librecmc : Bump to v1.5.15
[librecmc/librecmc.git] / toolchain / gcc / patches / 7.5.0 / 001-revert_register_mode_search.patch
1 commit 31285a20390a5e53a74a2a71d1b5c82f366ddd5a
2 Author: Felix Fietkau <nbd@openwrt.org>
3 Date:   Tue May 6 11:49:05 2014 +0000
4
5     gcc: revert an upstream patch that is causing a regression on powerpc
6     
7     https://forum.openwrt.org/viewtopic.php?pid=232494#p232494
8     
9     Signed-off-by: Felix Fietkau <nbd@openwrt.org>
10     
11     SVN-Revision: 40709
12
13 Revert of:
14
15 commit 275035b56823b26d5fb7e90fad945b998648edf2
16 Author: bergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>
17 Date:   Thu Sep 5 14:09:07 2013 +0000
18
19         PR target/58139
20         * reginfo.c (choose_hard_reg_mode): Scan through all mode classes
21         looking for widest mode.
22
23
24     git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4
25
26
27 --- a/gcc/reginfo.c
28 +++ b/gcc/reginfo.c
29 @@ -637,35 +637,40 @@ choose_hard_reg_mode (unsigned int regno
30         mode = GET_MODE_WIDER_MODE (mode))
31      if ((unsigned) hard_regno_nregs[regno][mode] == nregs
32         && HARD_REGNO_MODE_OK (regno, mode)
33 -       && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
34 -       && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
35 +       && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
36        found_mode = mode;
37  
38 +  if (found_mode != VOIDmode)
39 +    return found_mode;
40 +
41    for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT);
42         mode != VOIDmode;
43         mode = GET_MODE_WIDER_MODE (mode))
44      if ((unsigned) hard_regno_nregs[regno][mode] == nregs
45         && HARD_REGNO_MODE_OK (regno, mode)
46 -       && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
47 -       && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
48 +       && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
49        found_mode = mode;
50  
51 +  if (found_mode != VOIDmode)
52 +    return found_mode;
53 +
54    for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);
55         mode != VOIDmode;
56         mode = GET_MODE_WIDER_MODE (mode))
57      if ((unsigned) hard_regno_nregs[regno][mode] == nregs
58         && HARD_REGNO_MODE_OK (regno, mode)
59 -       && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
60 -       && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
61 +       && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
62        found_mode = mode;
63  
64 +  if (found_mode != VOIDmode)
65 +    return found_mode;
66 +
67    for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT);
68         mode != VOIDmode;
69         mode = GET_MODE_WIDER_MODE (mode))
70      if ((unsigned) hard_regno_nregs[regno][mode] == nregs
71         && HARD_REGNO_MODE_OK (regno, mode)
72 -       && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
73 -       && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
74 +       && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
75        found_mode = mode;
76  
77    if (found_mode != VOIDmode)