gcc: revert an upstream patch that is causing a regression on powerpc
[openwrt/svn-archive/archive.git] / toolchain / gcc / patches / 4.8-linaro / 001-revert_register_mode_search.patch
1 Revert of:
2
3 commit 275035b56823b26d5fb7e90fad945b998648edf2
4 Author: bergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>
5 Date: Thu Sep 5 14:09:07 2013 +0000
6
7 PR target/58139
8 * reginfo.c (choose_hard_reg_mode): Scan through all mode classes
9 looking for widest mode.
10
11
12 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4
13
14
15 --- a/gcc/reginfo.c
16 +++ b/gcc/reginfo.c
17 @@ -620,35 +620,40 @@ choose_hard_reg_mode (unsigned int regno
18 mode = GET_MODE_WIDER_MODE (mode))
19 if ((unsigned) hard_regno_nregs[regno][mode] == nregs
20 && HARD_REGNO_MODE_OK (regno, mode)
21 - && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
22 - && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
23 + && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
24 found_mode = mode;
25
26 + if (found_mode != VOIDmode)
27 + return found_mode;
28 +
29 for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT);
30 mode != VOIDmode;
31 mode = GET_MODE_WIDER_MODE (mode))
32 if ((unsigned) hard_regno_nregs[regno][mode] == nregs
33 && HARD_REGNO_MODE_OK (regno, mode)
34 - && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
35 - && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
36 + && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
37 found_mode = mode;
38
39 + if (found_mode != VOIDmode)
40 + return found_mode;
41 +
42 for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);
43 mode != VOIDmode;
44 mode = GET_MODE_WIDER_MODE (mode))
45 if ((unsigned) hard_regno_nregs[regno][mode] == nregs
46 && HARD_REGNO_MODE_OK (regno, mode)
47 - && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
48 - && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
49 + && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
50 found_mode = mode;
51
52 + if (found_mode != VOIDmode)
53 + return found_mode;
54 +
55 for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT);
56 mode != VOIDmode;
57 mode = GET_MODE_WIDER_MODE (mode))
58 if ((unsigned) hard_regno_nregs[regno][mode] == nregs
59 && HARD_REGNO_MODE_OK (regno, mode)
60 - && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
61 - && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
62 + && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
63 found_mode = mode;
64
65 if (found_mode != VOIDmode)