diff options
6 files changed, 760 insertions, 336 deletions
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5.inc b/meta-oe/recipes-devtools/gcc/gcc-4.5.inc index 579280ff1c..a0c2a7b289 100644 --- a/meta-oe/recipes-devtools/gcc/gcc-4.5.inc +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5.inc | |||
@@ -14,7 +14,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \ | |||
14 | 14 | ||
15 | 15 | ||
16 | PV = "4.5" | 16 | PV = "4.5" |
17 | PR = "r43" | 17 | PR = "r44" |
18 | 18 | ||
19 | # BINV should be incremented after updating to a revision | 19 | # BINV should be incremented after updating to a revision |
20 | # after a minor gcc release (e.g. 4.5.1 or 4.5.2) has been made | 20 | # after a minor gcc release (e.g. 4.5.1 or 4.5.2) has been made |
@@ -23,8 +23,7 @@ PR = "r43" | |||
23 | # which will be next minor release and so on. | 23 | # which will be next minor release and so on. |
24 | 24 | ||
25 | BINV = "${PV}.4" | 25 | BINV = "${PV}.4" |
26 | 26 | SRCREV = 181733 | |
27 | SRCREV = 178923 | ||
28 | BRANCH = "gcc-4_5-branch" | 27 | BRANCH = "gcc-4_5-branch" |
29 | PR_append = "+svnr${SRCPV}" | 28 | PR_append = "+svnr${SRCPV}" |
30 | 29 | ||
@@ -179,7 +178,6 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \ | |||
179 | file://linaro/gcc-4.5-linaro-r99483.patch \ | 178 | file://linaro/gcc-4.5-linaro-r99483.patch \ |
180 | file://linaro/gcc-4.5-linaro-r99488.patch \ | 179 | file://linaro/gcc-4.5-linaro-r99488.patch \ |
181 | file://linaro/gcc-4.5-linaro-r99489.patch \ | 180 | file://linaro/gcc-4.5-linaro-r99489.patch \ |
182 | file://linaro/gcc-4.5-linaro-r99491.patch \ | ||
183 | file://linaro/gcc-4.5-linaro-r99494.patch \ | 181 | file://linaro/gcc-4.5-linaro-r99494.patch \ |
184 | file://linaro/gcc-4.5-linaro-r99495.patch \ | 182 | file://linaro/gcc-4.5-linaro-r99495.patch \ |
185 | file://linaro/gcc-4.5-linaro-r99498.patch \ | 183 | file://linaro/gcc-4.5-linaro-r99498.patch \ |
@@ -208,7 +206,8 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \ | |||
208 | file://linaro/gcc-4.5-linaro-r99536.patch \ | 206 | file://linaro/gcc-4.5-linaro-r99536.patch \ |
209 | file://linaro/gcc-4.5-linaro-r99537.patch \ | 207 | file://linaro/gcc-4.5-linaro-r99537.patch \ |
210 | file://linaro/gcc-4.5-linaro-r99540.patch \ | 208 | file://linaro/gcc-4.5-linaro-r99540.patch \ |
211 | file://linaro/gcc-4.5-linaro-r99541.patch \ | 209 | file://linaro/gcc-4.5-linaro-r99548.patch \ |
210 | file://linaro/gcc-4.5-linaro-r99549.patch \ | ||
212 | \ | 211 | \ |
213 | file://more-epilogues.patch \ | 212 | file://more-epilogues.patch \ |
214 | file://gcc-scalar-widening-pr45847.patch \ | 213 | file://gcc-scalar-widening-pr45847.patch \ |
@@ -233,6 +232,7 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \ | |||
233 | file://gcc-poison-parameters.patch \ | 232 | file://gcc-poison-parameters.patch \ |
234 | file://gcc-ppc-config-fix.patch \ | 233 | file://gcc-ppc-config-fix.patch \ |
235 | file://use-defaults.h-and-t-oe-in-B.patch \ | 234 | file://use-defaults.h-and-t-oe-in-B.patch \ |
235 | file://gcc-with-linker-hash-style.patch \ | ||
236 | " | 236 | " |
237 | 237 | ||
238 | # Language Overrides | 238 | # Language Overrides |
@@ -252,6 +252,9 @@ EXTRA_OECONF_BASE = "--enable-lto \ | |||
252 | --disable-bootstrap \ | 252 | --disable-bootstrap \ |
253 | --disable-libgomp \ | 253 | --disable-libgomp \ |
254 | --disable-libmudflap \ | 254 | --disable-libmudflap \ |
255 | --with-linker-hash-style=${LINKER_HASH_STYLE} \ | ||
256 | --with-ppl=no \ | ||
257 | --with-cloog=no \ | ||
255 | --enable-cheaders=c_global " | 258 | --enable-cheaders=c_global " |
256 | 259 | ||
257 | EXTRA_OECONF_INITIAL = "--disable-libmudflap \ | 260 | EXTRA_OECONF_INITIAL = "--disable-libmudflap \ |
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/gcc-with-linker-hash-style.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/gcc-with-linker-hash-style.patch new file mode 100644 index 0000000000..ac4281ac28 --- /dev/null +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/gcc-with-linker-hash-style.patch | |||
@@ -0,0 +1,212 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
3 | |||
4 | commit 3cb9bbfa927aa187048534f9069202c017a78e38 | ||
5 | Author: ppluzhnikov <ppluzhnikov@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
6 | Date: Wed May 11 18:28:14 2011 +0000 | ||
7 | |||
8 | 2011-05-11 Satoru Takabayashi <satorux@google.com> | ||
9 | Paul Pluzhnikov <ppluzhnikov@google.com> | ||
10 | |||
11 | * gcc/doc/install.texi (Configuration): Document | ||
12 | --with-linker-hash-style. | ||
13 | * gcc/gcc.c (init_spec): Handle LINKER_HASH_STYLE. | ||
14 | * gcc/config.in: Add LINKER_HASH_STYLE. | ||
15 | * gcc/configure.ac: Add --with-linker-hash-style. | ||
16 | * gcc/configure: Regenerate. | ||
17 | |||
18 | |||
19 | |||
20 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173668 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
21 | |||
22 | Index: gcc-4_5-branch/gcc/config.in | ||
23 | =================================================================== | ||
24 | --- gcc-4_5-branch.orig/gcc/config.in 2011-12-03 13:41:00.000000000 -0800 | ||
25 | +++ gcc-4_5-branch/gcc/config.in 2011-12-03 13:44:46.287530329 -0800 | ||
26 | @@ -113,6 +113,12 @@ | ||
27 | #endif | ||
28 | |||
29 | |||
30 | +/* The linker hash style */ | ||
31 | +#ifndef USED_FOR_TARGET | ||
32 | +#undef LINKER_HASH_STYLE | ||
33 | +#endif | ||
34 | + | ||
35 | + | ||
36 | /* Define to enable LTO support. */ | ||
37 | #ifndef USED_FOR_TARGET | ||
38 | #undef ENABLE_LTO | ||
39 | Index: gcc-4_5-branch/gcc/configure | ||
40 | =================================================================== | ||
41 | --- gcc-4_5-branch.orig/gcc/configure 2011-12-03 13:41:00.000000000 -0800 | ||
42 | +++ gcc-4_5-branch/gcc/configure 2011-12-03 13:46:12.747530321 -0800 | ||
43 | @@ -600,6 +600,7 @@ | ||
44 | |||
45 | ac_subst_vars='LTLIBOBJS | ||
46 | LIBOBJS | ||
47 | +enable_target_optspace | ||
48 | enable_plugin | ||
49 | pluginlibs | ||
50 | LIBELFINC | ||
51 | @@ -915,7 +916,7 @@ | ||
52 | with_slibdir | ||
53 | enable_poison_system_directories | ||
54 | enable_plugin | ||
55 | -enable_target_optspace | ||
56 | +with_linker_hash_style | ||
57 | ' | ||
58 | ac_precious_vars='build_alias | ||
59 | host_alias | ||
60 | @@ -1663,6 +1664,8 @@ | ||
61 | with the compiler | ||
62 | --with-system-zlib use installed libz | ||
63 | --with-slibdir=DIR shared libraries in DIR [LIBDIR] | ||
64 | + --with-linker-hash-style={sysv,gnu,both} | ||
65 | + specify the linker hash style | ||
66 | |||
67 | Some influential environment variables: | ||
68 | CC C compiler command | ||
69 | @@ -17115,7 +17118,7 @@ | ||
70 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
71 | lt_status=$lt_dlunknown | ||
72 | cat > conftest.$ac_ext <<_LT_EOF | ||
73 | -#line 17114 "configure" | ||
74 | +#line 17121 "configure" | ||
75 | #include "confdefs.h" | ||
76 | |||
77 | #if HAVE_DLFCN_H | ||
78 | @@ -17221,7 +17224,7 @@ | ||
79 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
80 | lt_status=$lt_dlunknown | ||
81 | cat > conftest.$ac_ext <<_LT_EOF | ||
82 | -#line 17220 "configure" | ||
83 | +#line 17227 "configure" | ||
84 | #include "confdefs.h" | ||
85 | |||
86 | #if HAVE_DLFCN_H | ||
87 | @@ -25659,12 +25662,42 @@ | ||
88 | |||
89 | fi | ||
90 | |||
91 | -if test x"$enable_target_optspace" != x; then : | ||
92 | + | ||
93 | +if test x"$enable_target_optspace" != x; then | ||
94 | |||
95 | $as_echo "#define ENABLE_TARGET_OPTSPACE 1" >>confdefs.h | ||
96 | |||
97 | fi | ||
98 | |||
99 | +# Specify what hash style to use by default. | ||
100 | + | ||
101 | +# Check whether --with-linker-hash-style was given. | ||
102 | +if test "${with_linker_hash_style+set}" = set; then : | ||
103 | + withval=$with_linker_hash_style; case x"$withval" in | ||
104 | + xsysv) | ||
105 | + LINKER_HASH_STYLE=sysv | ||
106 | + ;; | ||
107 | + xgnu) | ||
108 | + LINKER_HASH_STYLE=gnu | ||
109 | + ;; | ||
110 | + xboth) | ||
111 | + LINKER_HASH_STYLE=both | ||
112 | + ;; | ||
113 | + *) | ||
114 | + as_fn_error "$withval is an invalid option to --with-linker-hash-style" "$LINENO" 5 | ||
115 | + ;; | ||
116 | + esac | ||
117 | +else | ||
118 | + LINKER_HASH_STYLE='' | ||
119 | +fi | ||
120 | + | ||
121 | +if test x"${LINKER_HASH_STYLE}" != x; then | ||
122 | + | ||
123 | +cat >>confdefs.h <<_ACEOF | ||
124 | +#define LINKER_HASH_STYLE "$LINKER_HASH_STYLE" | ||
125 | +_ACEOF | ||
126 | + | ||
127 | +fi | ||
128 | |||
129 | # Configure the subdirectories | ||
130 | # AC_CONFIG_SUBDIRS($subdirs) | ||
131 | Index: gcc-4_5-branch/gcc/configure.ac | ||
132 | =================================================================== | ||
133 | --- gcc-4_5-branch.orig/gcc/configure.ac 2011-12-03 13:41:00.000000000 -0800 | ||
134 | +++ gcc-4_5-branch/gcc/configure.ac 2011-12-03 13:41:04.499530358 -0800 | ||
135 | @@ -4664,6 +4664,30 @@ | ||
136 | AC_DEFINE(ENABLE_TARGET_OPTSPACE, 1, [Define to enable target optspace support.]) | ||
137 | fi | ||
138 | |||
139 | +# Specify what hash style to use by default. | ||
140 | +AC_ARG_WITH([linker-hash-style], | ||
141 | +[AC_HELP_STRING([--with-linker-hash-style={sysv,gnu,both}], | ||
142 | + [specify the linker hash style])], | ||
143 | +[case x"$withval" in | ||
144 | + xsysv) | ||
145 | + LINKER_HASH_STYLE=sysv | ||
146 | + ;; | ||
147 | + xgnu) | ||
148 | + LINKER_HASH_STYLE=gnu | ||
149 | + ;; | ||
150 | + xboth) | ||
151 | + LINKER_HASH_STYLE=both | ||
152 | + ;; | ||
153 | + *) | ||
154 | + AC_MSG_ERROR([$withval is an invalid option to --with-linker-hash-style]) | ||
155 | + ;; | ||
156 | + esac], | ||
157 | +[LINKER_HASH_STYLE='']) | ||
158 | +if test x"${LINKER_HASH_STYLE}" != x; then | ||
159 | + AC_DEFINE_UNQUOTED(LINKER_HASH_STYLE, "$LINKER_HASH_STYLE", | ||
160 | + [The linker hash style]) | ||
161 | +fi | ||
162 | + | ||
163 | # Configure the subdirectories | ||
164 | # AC_CONFIG_SUBDIRS($subdirs) | ||
165 | |||
166 | Index: gcc-4_5-branch/gcc/doc/install.texi | ||
167 | =================================================================== | ||
168 | --- gcc-4_5-branch.orig/gcc/doc/install.texi 2011-12-03 13:15:09.000000000 -0800 | ||
169 | +++ gcc-4_5-branch/gcc/doc/install.texi 2011-12-03 13:41:04.499530358 -0800 | ||
170 | @@ -1630,6 +1630,11 @@ | ||
171 | support @option{--build-id} option, a warning is issued and the | ||
172 | @option{--enable-linker-build-id} option is ignored. The default is off. | ||
173 | |||
174 | +@item --with-linker-hash-style=@var{choice} | ||
175 | +Tells GCC to pass @option{--hash-style=@var{choice}} option to the | ||
176 | +linker for all final links. @var{choice} can be one of | ||
177 | +@samp{sysv}, @samp{gnu}, and @samp{both} where @samp{sysv} is the default. | ||
178 | + | ||
179 | @item --enable-gnu-unique-object | ||
180 | @itemx --disable-gnu-unique-object | ||
181 | Tells GCC to use the gnu_unique_object relocation for C++ template | ||
182 | Index: gcc-4_5-branch/gcc/gcc.c | ||
183 | =================================================================== | ||
184 | --- gcc-4_5-branch.orig/gcc/gcc.c 2011-12-03 13:41:00.000000000 -0800 | ||
185 | +++ gcc-4_5-branch/gcc/gcc.c 2011-12-03 13:41:04.499530358 -0800 | ||
186 | @@ -1917,7 +1917,8 @@ | ||
187 | } | ||
188 | #endif | ||
189 | |||
190 | -#if defined LINK_EH_SPEC || defined LINK_BUILDID_SPEC | ||
191 | +#if defined LINK_EH_SPEC || defined LINK_BUILDID_SPEC || \ | ||
192 | + defined LINKER_HASH_STYLE | ||
193 | # ifdef LINK_BUILDID_SPEC | ||
194 | /* Prepend LINK_BUILDID_SPEC to whatever link_spec we had before. */ | ||
195 | obstack_grow (&obstack, LINK_BUILDID_SPEC, sizeof(LINK_BUILDID_SPEC) - 1); | ||
196 | @@ -1926,6 +1927,16 @@ | ||
197 | /* Prepend LINK_EH_SPEC to whatever link_spec we had before. */ | ||
198 | obstack_grow (&obstack, LINK_EH_SPEC, sizeof(LINK_EH_SPEC) - 1); | ||
199 | # endif | ||
200 | +# ifdef LINKER_HASH_STYLE | ||
201 | + /* Prepend --hash-style=LINKER_HASH_STYLE to whatever link_spec we had | ||
202 | + before. */ | ||
203 | + { | ||
204 | + static const char hash_style[] = "--hash-style="; | ||
205 | + obstack_grow (&obstack, hash_style, sizeof(hash_style) - 1); | ||
206 | + obstack_grow (&obstack, LINKER_HASH_STYLE, sizeof(LINKER_HASH_STYLE) - 1); | ||
207 | + obstack_1grow (&obstack, ' '); | ||
208 | + } | ||
209 | +# endif | ||
210 | obstack_grow0 (&obstack, link_spec, strlen (link_spec)); | ||
211 | link_spec = XOBFINISH (&obstack, const char *); | ||
212 | #endif | ||
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99491.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99491.patch deleted file mode 100644 index a2d6c6a69a..0000000000 --- a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99491.patch +++ /dev/null | |||
@@ -1,309 +0,0 @@ | |||
1 | 2011-04-08 Richard Sandiford <richard.sandiford@linaro.org> | ||
2 | |||
3 | Backport from mainline: | ||
4 | gcc/ | ||
5 | * dwarf2out.c (dw_loc_list_node): Add resolved_addr and replaced. | ||
6 | (cached_dw_loc_list_def): New structure. | ||
7 | (cached_dw_loc_list): New typedef. | ||
8 | (cached_dw_loc_list_table): New variable. | ||
9 | (cached_dw_loc_list_table_hash): New function. | ||
10 | (cached_dw_loc_list_table_eq): Likewise. | ||
11 | (add_location_or_const_value_attribute): Take a bool cache_p. | ||
12 | Cache the list when the parameter is true. | ||
13 | (gen_formal_parameter_die): Update caller. | ||
14 | (gen_variable_die): Likewise. | ||
15 | (dwarf2out_finish): Likewise. | ||
16 | (dwarf2out_abstract_function): Nullify cached_dw_loc_list_table | ||
17 | while generating debug info for the decl. | ||
18 | (dwarf2out_function_decl): Clear cached_dw_loc_list_table. | ||
19 | (dwarf2out_init): Initialize cached_dw_loc_list_table. | ||
20 | (resolve_addr): Cache the result of resolving a chain of | ||
21 | location lists. | ||
22 | |||
23 | From: 2010-10-12 Jakub Jelinek <jakub@redhat.com> | ||
24 | * dwarf2out.c (dw_loc_list_node): Add emitted field. | ||
25 | (output_loc_list): Return immediately if emitted is set, set it. | ||
26 | |||
27 | === modified file 'gcc/dwarf2out.c' | ||
28 | --- old/gcc/dwarf2out.c 2011-03-10 14:55:10 +0000 | ||
29 | +++ new/gcc/dwarf2out.c 2011-03-28 09:43:50 +0000 | ||
30 | @@ -4256,6 +4256,12 @@ | ||
31 | Only on head of list */ | ||
32 | const char *section; /* Section this loclist is relative to */ | ||
33 | dw_loc_descr_ref expr; | ||
34 | + /* True if all addresses in this and subsequent lists are known to be | ||
35 | + resolved. */ | ||
36 | + bool resolved_addr; | ||
37 | + /* True if this list has been replaced by dw_loc_next. */ | ||
38 | + bool replaced; | ||
39 | + bool emitted; | ||
40 | } dw_loc_list_node; | ||
41 | |||
42 | #if defined (DWARF2_DEBUGGING_INFO) || defined (DWARF2_UNWIND_INFO) | ||
43 | @@ -5759,6 +5765,19 @@ | ||
44 | /* Table of decl location linked lists. */ | ||
45 | static GTY ((param_is (var_loc_list))) htab_t decl_loc_table; | ||
46 | |||
47 | +/* A cached location list. */ | ||
48 | +struct GTY (()) cached_dw_loc_list_def { | ||
49 | + /* The DECL_UID of the decl that this entry describes. */ | ||
50 | + unsigned int decl_id; | ||
51 | + | ||
52 | + /* The cached location list. */ | ||
53 | + dw_loc_list_ref loc_list; | ||
54 | +}; | ||
55 | +typedef struct cached_dw_loc_list_def cached_dw_loc_list; | ||
56 | + | ||
57 | +/* Table of cached location lists. */ | ||
58 | +static GTY ((param_is (cached_dw_loc_list))) htab_t cached_dw_loc_list_table; | ||
59 | + | ||
60 | /* A pointer to the base of a list of references to DIE's that | ||
61 | are uniquely identified by their tag, presence/absence of | ||
62 | children DIE's, and list of attribute/value pairs. */ | ||
63 | @@ -6112,7 +6131,7 @@ | ||
64 | static void insert_int (HOST_WIDE_INT, unsigned, unsigned char *); | ||
65 | static void insert_float (const_rtx, unsigned char *); | ||
66 | static rtx rtl_for_decl_location (tree); | ||
67 | -static bool add_location_or_const_value_attribute (dw_die_ref, tree, | ||
68 | +static bool add_location_or_const_value_attribute (dw_die_ref, tree, bool, | ||
69 | enum dwarf_attribute); | ||
70 | static bool tree_add_const_value_attribute (dw_die_ref, tree); | ||
71 | static bool tree_add_const_value_attribute_for_decl (dw_die_ref, tree); | ||
72 | @@ -7731,6 +7750,24 @@ | ||
73 | htab_find_with_hash (decl_loc_table, decl, DECL_UID (decl)); | ||
74 | } | ||
75 | |||
76 | +/* Returns a hash value for X (which really is a cached_dw_loc_list_list). */ | ||
77 | + | ||
78 | +static hashval_t | ||
79 | +cached_dw_loc_list_table_hash (const void *x) | ||
80 | +{ | ||
81 | + return (hashval_t) ((const cached_dw_loc_list *) x)->decl_id; | ||
82 | +} | ||
83 | + | ||
84 | +/* Return nonzero if decl_id of cached_dw_loc_list X is the same as | ||
85 | + UID of decl *Y. */ | ||
86 | + | ||
87 | +static int | ||
88 | +cached_dw_loc_list_table_eq (const void *x, const void *y) | ||
89 | +{ | ||
90 | + return (((const cached_dw_loc_list *) x)->decl_id | ||
91 | + == DECL_UID ((const_tree) y)); | ||
92 | +} | ||
93 | + | ||
94 | /* Equate a DIE to a particular declaration. */ | ||
95 | |||
96 | static void | ||
97 | @@ -10355,6 +10392,10 @@ | ||
98 | { | ||
99 | dw_loc_list_ref curr = list_head; | ||
100 | |||
101 | + if (list_head->emitted) | ||
102 | + return; | ||
103 | + list_head->emitted = true; | ||
104 | + | ||
105 | ASM_OUTPUT_LABEL (asm_out_file, list_head->ll_symbol); | ||
106 | |||
107 | /* Walk the location list, and output each range + expression. */ | ||
108 | @@ -15920,15 +15961,22 @@ | ||
109 | these things can crop up in other ways also.) Note that one type of | ||
110 | constant value which can be passed into an inlined function is a constant | ||
111 | pointer. This can happen for example if an actual argument in an inlined | ||
112 | - function call evaluates to a compile-time constant address. */ | ||
113 | + function call evaluates to a compile-time constant address. | ||
114 | + | ||
115 | + CACHE_P is true if it is worth caching the location list for DECL, | ||
116 | + so that future calls can reuse it rather than regenerate it from scratch. | ||
117 | + This is true for BLOCK_NONLOCALIZED_VARS in inlined subroutines, | ||
118 | + since we will need to refer to them each time the function is inlined. */ | ||
119 | |||
120 | static bool | ||
121 | -add_location_or_const_value_attribute (dw_die_ref die, tree decl, | ||
122 | +add_location_or_const_value_attribute (dw_die_ref die, tree decl, bool cache_p, | ||
123 | enum dwarf_attribute attr) | ||
124 | { | ||
125 | rtx rtl; | ||
126 | dw_loc_list_ref list; | ||
127 | var_loc_list *loc_list; | ||
128 | + cached_dw_loc_list *cache; | ||
129 | + void **slot; | ||
130 | |||
131 | if (TREE_CODE (decl) == ERROR_MARK) | ||
132 | return false; | ||
133 | @@ -15964,7 +16012,34 @@ | ||
134 | && add_const_value_attribute (die, rtl)) | ||
135 | return true; | ||
136 | } | ||
137 | - list = loc_list_from_tree (decl, decl_by_reference_p (decl) ? 0 : 2); | ||
138 | + /* If this decl is from BLOCK_NONLOCALIZED_VARS, we might need its | ||
139 | + list several times. See if we've already cached the contents. */ | ||
140 | + list = NULL; | ||
141 | + if (loc_list == NULL || cached_dw_loc_list_table == NULL) | ||
142 | + cache_p = false; | ||
143 | + if (cache_p) | ||
144 | + { | ||
145 | + cache = (cached_dw_loc_list *) | ||
146 | + htab_find_with_hash (cached_dw_loc_list_table, decl, DECL_UID (decl)); | ||
147 | + if (cache) | ||
148 | + list = cache->loc_list; | ||
149 | + } | ||
150 | + if (list == NULL) | ||
151 | + { | ||
152 | + list = loc_list_from_tree (decl, decl_by_reference_p (decl) ? 0 : 2); | ||
153 | + /* It is usually worth caching this result if the decl is from | ||
154 | + BLOCK_NONLOCALIZED_VARS and if the list has at least two elements. */ | ||
155 | + if (cache_p && list && list->dw_loc_next) | ||
156 | + { | ||
157 | + slot = htab_find_slot_with_hash (cached_dw_loc_list_table, decl, | ||
158 | + DECL_UID (decl), INSERT); | ||
159 | + cache = (cached_dw_loc_list *) | ||
160 | + ggc_alloc_cleared (sizeof (cached_dw_loc_list)); | ||
161 | + cache->decl_id = DECL_UID (decl); | ||
162 | + cache->loc_list = list; | ||
163 | + *slot = cache; | ||
164 | + } | ||
165 | + } | ||
166 | if (list) | ||
167 | { | ||
168 | add_AT_location_description (die, attr, list); | ||
169 | @@ -17532,7 +17607,7 @@ | ||
170 | equate_decl_number_to_die (node, parm_die); | ||
171 | if (! DECL_ABSTRACT (node_or_origin)) | ||
172 | add_location_or_const_value_attribute (parm_die, node_or_origin, | ||
173 | - DW_AT_location); | ||
174 | + node == NULL, DW_AT_location); | ||
175 | |||
176 | break; | ||
177 | |||
178 | @@ -17712,6 +17787,7 @@ | ||
179 | tree context; | ||
180 | int was_abstract; | ||
181 | htab_t old_decl_loc_table; | ||
182 | + htab_t old_cached_dw_loc_list_table; | ||
183 | |||
184 | /* Make sure we have the actual abstract inline, not a clone. */ | ||
185 | decl = DECL_ORIGIN (decl); | ||
186 | @@ -17725,7 +17801,9 @@ | ||
187 | DIE. Be sure to not clobber the outer location table nor use it or we would | ||
188 | get locations in abstract instantces. */ | ||
189 | old_decl_loc_table = decl_loc_table; | ||
190 | + old_cached_dw_loc_list_table = cached_dw_loc_list_table; | ||
191 | decl_loc_table = NULL; | ||
192 | + cached_dw_loc_list_table = NULL; | ||
193 | |||
194 | /* Be sure we've emitted the in-class declaration DIE (if any) first, so | ||
195 | we don't get confused by DECL_ABSTRACT. */ | ||
196 | @@ -17750,6 +17828,7 @@ | ||
197 | |||
198 | current_function_decl = save_fn; | ||
199 | decl_loc_table = old_decl_loc_table; | ||
200 | + cached_dw_loc_list_table = old_cached_dw_loc_list_table; | ||
201 | pop_cfun (); | ||
202 | } | ||
203 | |||
204 | @@ -18431,9 +18510,8 @@ | ||
205 | && !TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl_or_origin))) | ||
206 | defer_location (decl_or_origin, var_die); | ||
207 | else | ||
208 | - add_location_or_const_value_attribute (var_die, | ||
209 | - decl_or_origin, | ||
210 | - DW_AT_location); | ||
211 | + add_location_or_const_value_attribute (var_die, decl_or_origin, | ||
212 | + decl == NULL, DW_AT_location); | ||
213 | add_pubname (decl_or_origin, var_die); | ||
214 | } | ||
215 | else | ||
216 | @@ -20049,6 +20127,7 @@ | ||
217 | dwarf2out_decl (decl); | ||
218 | |||
219 | htab_empty (decl_loc_table); | ||
220 | + htab_empty (cached_dw_loc_list_table); | ||
221 | } | ||
222 | |||
223 | /* Output a marker (i.e. a label) for the beginning of the generated code for | ||
224 | @@ -20649,6 +20728,11 @@ | ||
225 | decl_loc_table = htab_create_ggc (10, decl_loc_table_hash, | ||
226 | decl_loc_table_eq, NULL); | ||
227 | |||
228 | + /* Allocate the cached_dw_loc_list_table. */ | ||
229 | + cached_dw_loc_list_table | ||
230 | + = htab_create_ggc (10, cached_dw_loc_list_table_hash, | ||
231 | + cached_dw_loc_list_table_eq, NULL); | ||
232 | + | ||
233 | /* Allocate the initial hunk of the decl_scope_table. */ | ||
234 | decl_scope_table = VEC_alloc (tree, gc, 256); | ||
235 | |||
236 | @@ -21278,30 +21362,53 @@ | ||
237 | { | ||
238 | dw_die_ref c; | ||
239 | dw_attr_ref a; | ||
240 | - dw_loc_list_ref *curr; | ||
241 | + dw_loc_list_ref *curr, *start, loc; | ||
242 | unsigned ix; | ||
243 | |||
244 | for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++) | ||
245 | switch (AT_class (a)) | ||
246 | { | ||
247 | case dw_val_class_loc_list: | ||
248 | - curr = AT_loc_list_ptr (a); | ||
249 | - while (*curr) | ||
250 | + start = curr = AT_loc_list_ptr (a); | ||
251 | + loc = *curr; | ||
252 | + gcc_assert (loc); | ||
253 | + /* The same list can be referenced more than once. See if we have | ||
254 | + already recorded the result from a previous pass. */ | ||
255 | + if (loc->replaced) | ||
256 | + *curr = loc->dw_loc_next; | ||
257 | + else if (!loc->resolved_addr) | ||
258 | { | ||
259 | - if (!resolve_addr_in_expr ((*curr)->expr)) | ||
260 | + /* As things stand, we do not expect or allow one die to | ||
261 | + reference a suffix of another die's location list chain. | ||
262 | + References must be identical or completely separate. | ||
263 | + There is therefore no need to cache the result of this | ||
264 | + pass on any list other than the first; doing so | ||
265 | + would lead to unnecessary writes. */ | ||
266 | + while (*curr) | ||
267 | { | ||
268 | - dw_loc_list_ref next = (*curr)->dw_loc_next; | ||
269 | - if (next && (*curr)->ll_symbol) | ||
270 | + gcc_assert (!(*curr)->replaced && !(*curr)->resolved_addr); | ||
271 | + if (!resolve_addr_in_expr ((*curr)->expr)) | ||
272 | { | ||
273 | - gcc_assert (!next->ll_symbol); | ||
274 | - next->ll_symbol = (*curr)->ll_symbol; | ||
275 | + dw_loc_list_ref next = (*curr)->dw_loc_next; | ||
276 | + if (next && (*curr)->ll_symbol) | ||
277 | + { | ||
278 | + gcc_assert (!next->ll_symbol); | ||
279 | + next->ll_symbol = (*curr)->ll_symbol; | ||
280 | + } | ||
281 | + *curr = next; | ||
282 | } | ||
283 | - *curr = next; | ||
284 | + else | ||
285 | + curr = &(*curr)->dw_loc_next; | ||
286 | } | ||
287 | + if (loc == *start) | ||
288 | + loc->resolved_addr = 1; | ||
289 | else | ||
290 | - curr = &(*curr)->dw_loc_next; | ||
291 | + { | ||
292 | + loc->replaced = 1; | ||
293 | + loc->dw_loc_next = *start; | ||
294 | + } | ||
295 | } | ||
296 | - if (!AT_loc_list (a)) | ||
297 | + if (!*start) | ||
298 | { | ||
299 | remove_AT (die, a->dw_attr); | ||
300 | ix--; | ||
301 | @@ -21361,6 +21468,7 @@ | ||
302 | add_location_or_const_value_attribute ( | ||
303 | VEC_index (deferred_locations, deferred_locations_list, i)->die, | ||
304 | VEC_index (deferred_locations, deferred_locations_list, i)->variable, | ||
305 | + false, | ||
306 | DW_AT_location); | ||
307 | } | ||
308 | |||
309 | |||
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99541.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99541.patch deleted file mode 100644 index ae0e4bcd35..0000000000 --- a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99541.patch +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | 2011-09-12 Richard Sandiford <richard.sandiford@linaro.org> | ||
2 | |||
3 | gcc/ | ||
4 | Backport from mainline: | ||
5 | |||
6 | 2010-12-06 Jakub Jelinek <jakub@redhat.com> | ||
7 | |||
8 | PR debug/46771 | ||
9 | * reginfo.c (init_subregs_of_mode): Don't call find_subregs_of_mode | ||
10 | on DEBUG_INSNs. | ||
11 | |||
12 | === modified file 'gcc/reginfo.c' | ||
13 | --- old/gcc/reginfo.c 2010-10-04 00:50:43 +0000 | ||
14 | +++ new/gcc/reginfo.c 2011-09-12 10:54:51 +0000 | ||
15 | @@ -1350,7 +1350,7 @@ | ||
16 | |||
17 | FOR_EACH_BB (bb) | ||
18 | FOR_BB_INSNS (bb, insn) | ||
19 | - if (INSN_P (insn)) | ||
20 | + if (NONDEBUG_INSN_P (insn)) | ||
21 | find_subregs_of_mode (PATTERN (insn)); | ||
22 | } | ||
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99548.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99548.patch new file mode 100644 index 0000000000..b78319e8fa --- /dev/null +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99548.patch | |||
@@ -0,0 +1,80 @@ | |||
1 | 2011-09-22 Revital Eres <revital.eres@linaro.org> | ||
2 | |||
3 | gcc/ | ||
4 | Backport from trunk -r178804: | ||
5 | modulo-sched.c (remove_node_from_ps): Return void | ||
6 | instead of bool. | ||
7 | (optimize_sc): Adjust call to remove_node_from_ps. | ||
8 | (sms_schedule): Add print info. | ||
9 | |||
10 | === modified file 'gcc/modulo-sched.c' | ||
11 | --- old/gcc/modulo-sched.c 2011-08-09 04:31:10 +0000 | ||
12 | +++ new/gcc/modulo-sched.c 2011-09-22 13:58:43 +0000 | ||
13 | @@ -211,7 +211,7 @@ | ||
14 | static bool try_scheduling_node_in_cycle (partial_schedule_ptr, ddg_node_ptr, | ||
15 | int, int, sbitmap, int *, sbitmap, | ||
16 | sbitmap); | ||
17 | -static bool remove_node_from_ps (partial_schedule_ptr, ps_insn_ptr); | ||
18 | +static void remove_node_from_ps (partial_schedule_ptr, ps_insn_ptr); | ||
19 | |||
20 | #define SCHED_ASAP(x) (((node_sched_params_ptr)(x)->aux.info)->asap) | ||
21 | #define SCHED_TIME(x) (((node_sched_params_ptr)(x)->aux.info)->time) | ||
22 | @@ -834,8 +834,7 @@ | ||
23 | if (next_ps_i->node->cuid == g->closing_branch->cuid) | ||
24 | break; | ||
25 | |||
26 | - gcc_assert (next_ps_i); | ||
27 | - gcc_assert (remove_node_from_ps (ps, next_ps_i)); | ||
28 | + remove_node_from_ps (ps, next_ps_i); | ||
29 | success = | ||
30 | try_scheduling_node_in_cycle (ps, g->closing_branch, | ||
31 | g->closing_branch->cuid, c, | ||
32 | @@ -1485,8 +1484,8 @@ | ||
33 | if (dump_file) | ||
34 | { | ||
35 | fprintf (dump_file, | ||
36 | - "SMS succeeded %d %d (with ii, sc)\n", ps->ii, | ||
37 | - stage_count); | ||
38 | + "%s:%d SMS succeeded %d %d (with ii, sc)\n", | ||
39 | + insn_file (tail), insn_line (tail), ps->ii, stage_count); | ||
40 | print_partial_schedule (ps, dump_file); | ||
41 | } | ||
42 | |||
43 | @@ -2810,22 +2809,18 @@ | ||
44 | } | ||
45 | |||
46 | |||
47 | -/* Removes the given PS_INSN from the partial schedule. Returns false if the | ||
48 | - node is not found in the partial schedule, else returns true. */ | ||
49 | -static bool | ||
50 | +/* Removes the given PS_INSN from the partial schedule. */ | ||
51 | +static void | ||
52 | remove_node_from_ps (partial_schedule_ptr ps, ps_insn_ptr ps_i) | ||
53 | { | ||
54 | int row; | ||
55 | |||
56 | - if (!ps || !ps_i) | ||
57 | - return false; | ||
58 | - | ||
59 | + gcc_assert (ps && ps_i); | ||
60 | + | ||
61 | row = SMODULO (ps_i->cycle, ps->ii); | ||
62 | if (! ps_i->prev_in_row) | ||
63 | { | ||
64 | - if (ps_i != ps->rows[row]) | ||
65 | - return false; | ||
66 | - | ||
67 | + gcc_assert (ps_i == ps->rows[row]); | ||
68 | ps->rows[row] = ps_i->next_in_row; | ||
69 | if (ps->rows[row]) | ||
70 | ps->rows[row]->prev_in_row = NULL; | ||
71 | @@ -2839,7 +2834,7 @@ | ||
72 | |||
73 | ps->rows_length[row] -= 1; | ||
74 | free (ps_i); | ||
75 | - return true; | ||
76 | + return; | ||
77 | } | ||
78 | |||
79 | /* Unlike what literature describes for modulo scheduling (which focuses | ||
80 | |||
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99549.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99549.patch new file mode 100644 index 0000000000..43617024a1 --- /dev/null +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99549.patch | |||
@@ -0,0 +1,460 @@ | |||
1 | 2011-10-03 Richard Sandiford <richard.sandiford@linaro.org> | ||
2 | |||
3 | gcc/ | ||
4 | Backport from mainline: | ||
5 | |||
6 | 2010-12-06 Jakub Jelinek <jakub@redhat.com> | ||
7 | |||
8 | PR debug/46771 | ||
9 | * reginfo.c (init_subregs_of_mode): Don't call find_subregs_of_mode | ||
10 | on DEBUG_INSNs. | ||
11 | |||
12 | 2011-10-03 Richard Sandiford <richard.sandiford@linaro.org> | ||
13 | |||
14 | gcc/ | ||
15 | Backport from mainline: | ||
16 | |||
17 | 2011-09-22 Richard Sandiford <richard.sandiford@linaro.org> | ||
18 | |||
19 | * config/arm/predicates.md (expandable_comparison_operator): New | ||
20 | predicate, extracted from... | ||
21 | (arm_comparison_operator): ...here. | ||
22 | * config/arm/arm.md (cbranchsi4, cbranchsf4, cbranchdf4, cbranchdi4) | ||
23 | (cstoresi4, cstoresf4, cstoredf4, cstoredi4, movsicc, movsfcc) | ||
24 | (movdfcc): Use expandable_comparison_operator. | ||
25 | |||
26 | gcc/testsuite/ | ||
27 | Backport from mainline: | ||
28 | |||
29 | 2011-09-22 Richard Sandiford <richard.sandiford@linaro.org> | ||
30 | |||
31 | * gcc.target/arm/cmp-1.c: New test. | ||
32 | * gcc.target/arm/cmp-2.c: Likewise. | ||
33 | |||
34 | 2011-10-03 Richard Sandiford <richard.sandiford@linaro.org> | ||
35 | |||
36 | gcc/ | ||
37 | Backport from mainline: | ||
38 | |||
39 | 2011-09-07 Richard Sandiford <richard.sandiford@linaro.org> | ||
40 | |||
41 | PR target/49030 | ||
42 | * config/arm/arm-protos.h (maybe_get_arm_condition_code): Declare. | ||
43 | * config/arm/arm.c (maybe_get_arm_condition_code): New function, | ||
44 | reusing the old code from get_arm_condition_code. Return ARM_NV | ||
45 | for invalid comparison codes. | ||
46 | (get_arm_condition_code): Redefine in terms of | ||
47 | maybe_get_arm_condition_code. | ||
48 | * config/arm/predicates.md (arm_comparison_operator): Use | ||
49 | maybe_get_arm_condition_code. | ||
50 | |||
51 | gcc/testsuite/ | ||
52 | Backport from mainline: | ||
53 | |||
54 | 2011-09-07 Richard Sandiford <richard.sandiford@linaro.org> | ||
55 | |||
56 | PR target/49030 | ||
57 | * gcc.dg/torture/pr49030.c: New test. | ||
58 | |||
59 | === modified file 'gcc/config/arm/arm-protos.h' | ||
60 | --- old/gcc/config/arm/arm-protos.h 2011-09-15 10:06:35 +0000 | ||
61 | +++ new/gcc/config/arm/arm-protos.h 2011-10-03 10:09:06 +0000 | ||
62 | @@ -182,6 +182,7 @@ | ||
63 | #endif | ||
64 | extern int thumb_shiftable_const (unsigned HOST_WIDE_INT); | ||
65 | #ifdef RTX_CODE | ||
66 | +extern enum arm_cond_code maybe_get_arm_condition_code (rtx); | ||
67 | extern void thumb1_final_prescan_insn (rtx); | ||
68 | extern void thumb2_final_prescan_insn (rtx); | ||
69 | extern const char *thumb_load_double_from_address (rtx *); | ||
70 | |||
71 | === modified file 'gcc/config/arm/arm.c' | ||
72 | --- old/gcc/config/arm/arm.c 2011-09-15 10:06:35 +0000 | ||
73 | +++ new/gcc/config/arm/arm.c 2011-10-03 10:09:06 +0000 | ||
74 | @@ -17196,10 +17196,10 @@ | ||
75 | decremented/zeroed by arm_asm_output_opcode as the insns are output. */ | ||
76 | |||
77 | /* Returns the index of the ARM condition code string in | ||
78 | - `arm_condition_codes'. COMPARISON should be an rtx like | ||
79 | - `(eq (...) (...))'. */ | ||
80 | -static enum arm_cond_code | ||
81 | -get_arm_condition_code (rtx comparison) | ||
82 | + `arm_condition_codes', or ARM_NV if the comparison is invalid. | ||
83 | + COMPARISON should be an rtx like `(eq (...) (...))'. */ | ||
84 | +enum arm_cond_code | ||
85 | +maybe_get_arm_condition_code (rtx comparison) | ||
86 | { | ||
87 | enum machine_mode mode = GET_MODE (XEXP (comparison, 0)); | ||
88 | enum arm_cond_code code; | ||
89 | @@ -17223,11 +17223,11 @@ | ||
90 | case CC_DLTUmode: code = ARM_CC; | ||
91 | |||
92 | dominance: | ||
93 | - gcc_assert (comp_code == EQ || comp_code == NE); | ||
94 | - | ||
95 | if (comp_code == EQ) | ||
96 | return ARM_INVERSE_CONDITION_CODE (code); | ||
97 | - return code; | ||
98 | + if (comp_code == NE) | ||
99 | + return code; | ||
100 | + return ARM_NV; | ||
101 | |||
102 | case CC_NOOVmode: | ||
103 | switch (comp_code) | ||
104 | @@ -17236,7 +17236,7 @@ | ||
105 | case EQ: return ARM_EQ; | ||
106 | case GE: return ARM_PL; | ||
107 | case LT: return ARM_MI; | ||
108 | - default: gcc_unreachable (); | ||
109 | + default: return ARM_NV; | ||
110 | } | ||
111 | |||
112 | case CC_Zmode: | ||
113 | @@ -17244,7 +17244,7 @@ | ||
114 | { | ||
115 | case NE: return ARM_NE; | ||
116 | case EQ: return ARM_EQ; | ||
117 | - default: gcc_unreachable (); | ||
118 | + default: return ARM_NV; | ||
119 | } | ||
120 | |||
121 | case CC_Nmode: | ||
122 | @@ -17252,7 +17252,7 @@ | ||
123 | { | ||
124 | case NE: return ARM_MI; | ||
125 | case EQ: return ARM_PL; | ||
126 | - default: gcc_unreachable (); | ||
127 | + default: return ARM_NV; | ||
128 | } | ||
129 | |||
130 | case CCFPEmode: | ||
131 | @@ -17277,7 +17277,7 @@ | ||
132 | /* UNEQ and LTGT do not have a representation. */ | ||
133 | case UNEQ: /* Fall through. */ | ||
134 | case LTGT: /* Fall through. */ | ||
135 | - default: gcc_unreachable (); | ||
136 | + default: return ARM_NV; | ||
137 | } | ||
138 | |||
139 | case CC_SWPmode: | ||
140 | @@ -17293,7 +17293,7 @@ | ||
141 | case GTU: return ARM_CC; | ||
142 | case LEU: return ARM_CS; | ||
143 | case LTU: return ARM_HI; | ||
144 | - default: gcc_unreachable (); | ||
145 | + default: return ARM_NV; | ||
146 | } | ||
147 | |||
148 | case CC_Cmode: | ||
149 | @@ -17301,7 +17301,7 @@ | ||
150 | { | ||
151 | case LTU: return ARM_CS; | ||
152 | case GEU: return ARM_CC; | ||
153 | - default: gcc_unreachable (); | ||
154 | + default: return ARM_NV; | ||
155 | } | ||
156 | |||
157 | case CC_CZmode: | ||
158 | @@ -17313,7 +17313,7 @@ | ||
159 | case GTU: return ARM_HI; | ||
160 | case LEU: return ARM_LS; | ||
161 | case LTU: return ARM_CC; | ||
162 | - default: gcc_unreachable (); | ||
163 | + default: return ARM_NV; | ||
164 | } | ||
165 | |||
166 | case CC_NCVmode: | ||
167 | @@ -17323,7 +17323,7 @@ | ||
168 | case LT: return ARM_LT; | ||
169 | case GEU: return ARM_CS; | ||
170 | case LTU: return ARM_CC; | ||
171 | - default: gcc_unreachable (); | ||
172 | + default: return ARM_NV; | ||
173 | } | ||
174 | |||
175 | case CCmode: | ||
176 | @@ -17339,13 +17339,22 @@ | ||
177 | case GTU: return ARM_HI; | ||
178 | case LEU: return ARM_LS; | ||
179 | case LTU: return ARM_CC; | ||
180 | - default: gcc_unreachable (); | ||
181 | + default: return ARM_NV; | ||
182 | } | ||
183 | |||
184 | default: gcc_unreachable (); | ||
185 | } | ||
186 | } | ||
187 | |||
188 | +/* Like maybe_get_arm_condition_code, but never return ARM_NV. */ | ||
189 | +static enum arm_cond_code | ||
190 | +get_arm_condition_code (rtx comparison) | ||
191 | +{ | ||
192 | + enum arm_cond_code code = maybe_get_arm_condition_code (comparison); | ||
193 | + gcc_assert (code != ARM_NV); | ||
194 | + return code; | ||
195 | +} | ||
196 | + | ||
197 | /* Tell arm_asm_output_opcode to output IT blocks for conditionally executed | ||
198 | instructions. */ | ||
199 | void | ||
200 | |||
201 | === modified file 'gcc/config/arm/arm.md' | ||
202 | --- old/gcc/config/arm/arm.md 2011-07-12 16:35:20 +0000 | ||
203 | +++ new/gcc/config/arm/arm.md 2011-10-03 10:09:55 +0000 | ||
204 | @@ -6428,7 +6428,7 @@ | ||
205 | |||
206 | (define_expand "cbranchsi4" | ||
207 | [(set (pc) (if_then_else | ||
208 | - (match_operator 0 "arm_comparison_operator" | ||
209 | + (match_operator 0 "expandable_comparison_operator" | ||
210 | [(match_operand:SI 1 "s_register_operand" "") | ||
211 | (match_operand:SI 2 "nonmemory_operand" "")]) | ||
212 | (label_ref (match_operand 3 "" "")) | ||
213 | @@ -6479,7 +6479,7 @@ | ||
214 | |||
215 | (define_expand "cbranchsf4" | ||
216 | [(set (pc) (if_then_else | ||
217 | - (match_operator 0 "arm_comparison_operator" | ||
218 | + (match_operator 0 "expandable_comparison_operator" | ||
219 | [(match_operand:SF 1 "s_register_operand" "") | ||
220 | (match_operand:SF 2 "arm_float_compare_operand" "")]) | ||
221 | (label_ref (match_operand 3 "" "")) | ||
222 | @@ -6491,7 +6491,7 @@ | ||
223 | |||
224 | (define_expand "cbranchdf4" | ||
225 | [(set (pc) (if_then_else | ||
226 | - (match_operator 0 "arm_comparison_operator" | ||
227 | + (match_operator 0 "expandable_comparison_operator" | ||
228 | [(match_operand:DF 1 "s_register_operand" "") | ||
229 | (match_operand:DF 2 "arm_float_compare_operand" "")]) | ||
230 | (label_ref (match_operand 3 "" "")) | ||
231 | @@ -6503,7 +6503,7 @@ | ||
232 | |||
233 | (define_expand "cbranchdi4" | ||
234 | [(set (pc) (if_then_else | ||
235 | - (match_operator 0 "arm_comparison_operator" | ||
236 | + (match_operator 0 "expandable_comparison_operator" | ||
237 | [(match_operand:DI 1 "cmpdi_operand" "") | ||
238 | (match_operand:DI 2 "cmpdi_operand" "")]) | ||
239 | (label_ref (match_operand 3 "" "")) | ||
240 | @@ -7898,7 +7898,7 @@ | ||
241 | |||
242 | (define_expand "cstoresi4" | ||
243 | [(set (match_operand:SI 0 "s_register_operand" "") | ||
244 | - (match_operator:SI 1 "arm_comparison_operator" | ||
245 | + (match_operator:SI 1 "expandable_comparison_operator" | ||
246 | [(match_operand:SI 2 "s_register_operand" "") | ||
247 | (match_operand:SI 3 "reg_or_int_operand" "")]))] | ||
248 | "TARGET_32BIT || TARGET_THUMB1" | ||
249 | @@ -8034,7 +8034,7 @@ | ||
250 | |||
251 | (define_expand "cstoresf4" | ||
252 | [(set (match_operand:SI 0 "s_register_operand" "") | ||
253 | - (match_operator:SI 1 "arm_comparison_operator" | ||
254 | + (match_operator:SI 1 "expandable_comparison_operator" | ||
255 | [(match_operand:SF 2 "s_register_operand" "") | ||
256 | (match_operand:SF 3 "arm_float_compare_operand" "")]))] | ||
257 | "TARGET_32BIT && TARGET_HARD_FLOAT" | ||
258 | @@ -8044,7 +8044,7 @@ | ||
259 | |||
260 | (define_expand "cstoredf4" | ||
261 | [(set (match_operand:SI 0 "s_register_operand" "") | ||
262 | - (match_operator:SI 1 "arm_comparison_operator" | ||
263 | + (match_operator:SI 1 "expandable_comparison_operator" | ||
264 | [(match_operand:DF 2 "s_register_operand" "") | ||
265 | (match_operand:DF 3 "arm_float_compare_operand" "")]))] | ||
266 | "TARGET_32BIT && TARGET_HARD_FLOAT && !TARGET_VFP_SINGLE" | ||
267 | @@ -8054,7 +8054,7 @@ | ||
268 | |||
269 | (define_expand "cstoredi4" | ||
270 | [(set (match_operand:SI 0 "s_register_operand" "") | ||
271 | - (match_operator:SI 1 "arm_comparison_operator" | ||
272 | + (match_operator:SI 1 "expandable_comparison_operator" | ||
273 | [(match_operand:DI 2 "cmpdi_operand" "") | ||
274 | (match_operand:DI 3 "cmpdi_operand" "")]))] | ||
275 | "TARGET_32BIT" | ||
276 | @@ -8174,7 +8174,7 @@ | ||
277 | |||
278 | (define_expand "movsicc" | ||
279 | [(set (match_operand:SI 0 "s_register_operand" "") | ||
280 | - (if_then_else:SI (match_operand 1 "arm_comparison_operator" "") | ||
281 | + (if_then_else:SI (match_operand 1 "expandable_comparison_operator" "") | ||
282 | (match_operand:SI 2 "arm_not_operand" "") | ||
283 | (match_operand:SI 3 "arm_not_operand" "")))] | ||
284 | "TARGET_32BIT" | ||
285 | @@ -8194,7 +8194,7 @@ | ||
286 | |||
287 | (define_expand "movsfcc" | ||
288 | [(set (match_operand:SF 0 "s_register_operand" "") | ||
289 | - (if_then_else:SF (match_operand 1 "arm_comparison_operator" "") | ||
290 | + (if_then_else:SF (match_operand 1 "expandable_comparison_operator" "") | ||
291 | (match_operand:SF 2 "s_register_operand" "") | ||
292 | (match_operand:SF 3 "nonmemory_operand" "")))] | ||
293 | "TARGET_32BIT && TARGET_HARD_FLOAT" | ||
294 | @@ -8220,7 +8220,7 @@ | ||
295 | |||
296 | (define_expand "movdfcc" | ||
297 | [(set (match_operand:DF 0 "s_register_operand" "") | ||
298 | - (if_then_else:DF (match_operand 1 "arm_comparison_operator" "") | ||
299 | + (if_then_else:DF (match_operand 1 "expandable_comparison_operator" "") | ||
300 | (match_operand:DF 2 "s_register_operand" "") | ||
301 | (match_operand:DF 3 "arm_float_add_operand" "")))] | ||
302 | "TARGET_32BIT && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP_DOUBLE)" | ||
303 | |||
304 | === modified file 'gcc/config/arm/predicates.md' | ||
305 | --- old/gcc/config/arm/predicates.md 2011-09-15 10:06:35 +0000 | ||
306 | +++ new/gcc/config/arm/predicates.md 2011-10-03 10:09:55 +0000 | ||
307 | @@ -236,11 +236,15 @@ | ||
308 | |||
309 | ;; True for integer comparisons and, if FP is active, for comparisons | ||
310 | ;; other than LTGT or UNEQ. | ||
311 | +(define_special_predicate "expandable_comparison_operator" | ||
312 | + (match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltu, | ||
313 | + unordered,ordered,unlt,unle,unge,ungt")) | ||
314 | + | ||
315 | +;; Likewise, but only accept comparisons that are directly supported | ||
316 | +;; by ARM condition codes. | ||
317 | (define_special_predicate "arm_comparison_operator" | ||
318 | - (ior (match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltu") | ||
319 | - (and (match_test "TARGET_32BIT && TARGET_HARD_FLOAT | ||
320 | - && (TARGET_FPA || TARGET_VFP)") | ||
321 | - (match_code "unordered,ordered,unlt,unle,unge,ungt")))) | ||
322 | + (and (match_operand 0 "expandable_comparison_operator") | ||
323 | + (match_test "maybe_get_arm_condition_code (op) != ARM_NV"))) | ||
324 | |||
325 | (define_special_predicate "lt_ge_comparison_operator" | ||
326 | (match_code "lt,ge")) | ||
327 | |||
328 | === modified file 'gcc/reginfo.c' | ||
329 | --- old/gcc/reginfo.c 2011-09-15 10:06:35 +0000 | ||
330 | +++ new/gcc/reginfo.c 2011-10-03 10:10:17 +0000 | ||
331 | @@ -1350,7 +1350,7 @@ | ||
332 | |||
333 | FOR_EACH_BB (bb) | ||
334 | FOR_BB_INSNS (bb, insn) | ||
335 | - if (INSN_P (insn)) | ||
336 | + if (NONDEBUG_INSN_P (insn)) | ||
337 | find_subregs_of_mode (PATTERN (insn)); | ||
338 | } | ||
339 | |||
340 | |||
341 | === added file 'gcc/testsuite/gcc.dg/torture/pr49030.c' | ||
342 | --- old/gcc/testsuite/gcc.dg/torture/pr49030.c 1970-01-01 00:00:00 +0000 | ||
343 | +++ new/gcc/testsuite/gcc.dg/torture/pr49030.c 2011-10-03 10:09:06 +0000 | ||
344 | @@ -0,0 +1,19 @@ | ||
345 | +void | ||
346 | +sample_move_d32u24_sS (char *dst, float *src, unsigned long nsamples, | ||
347 | + unsigned long dst_skip) | ||
348 | +{ | ||
349 | + long long y; | ||
350 | + while (nsamples--) | ||
351 | + { | ||
352 | + y = (long long) (*src * 8388608.0f) << 8; | ||
353 | + if (y > 2147483647) { | ||
354 | + *(int *) dst = 2147483647; | ||
355 | + } else if (y < -2147483647 - 1) { | ||
356 | + *(int *) dst = -2147483647 - 1; | ||
357 | + } else { | ||
358 | + *(int *) dst = (int) y; | ||
359 | + } | ||
360 | + dst += dst_skip; | ||
361 | + src++; | ||
362 | + } | ||
363 | +} | ||
364 | |||
365 | === added file 'gcc/testsuite/gcc.target/arm/cmp-1.c' | ||
366 | --- old/gcc/testsuite/gcc.target/arm/cmp-1.c 1970-01-01 00:00:00 +0000 | ||
367 | +++ new/gcc/testsuite/gcc.target/arm/cmp-1.c 2011-10-03 10:09:55 +0000 | ||
368 | @@ -0,0 +1,37 @@ | ||
369 | +/* { dg-do compile } */ | ||
370 | +/* { dg-options "-O" } */ | ||
371 | +/* { dg-final { scan-assembler-not "\tbl\t" } } */ | ||
372 | +/* { dg-final { scan-assembler-not "__aeabi" } } */ | ||
373 | +int x, y; | ||
374 | + | ||
375 | +#define TEST_EXPR(NAME, ARGS, EXPR) \ | ||
376 | + int NAME##1 ARGS { return (EXPR); } \ | ||
377 | + int NAME##2 ARGS { return !(EXPR); } \ | ||
378 | + int NAME##3 ARGS { return (EXPR) ? x : y; } \ | ||
379 | + void NAME##4 ARGS { if (EXPR) x++; } \ | ||
380 | + void NAME##5 ARGS { if (!(EXPR)) x++; } | ||
381 | + | ||
382 | +#define TEST(NAME, TYPE, OPERATOR) \ | ||
383 | + TEST_EXPR (NAME##_rr, (TYPE a1, TYPE a2), a1 OPERATOR a2) \ | ||
384 | + TEST_EXPR (NAME##_rm, (TYPE a1, TYPE *a2), a1 OPERATOR *a2) \ | ||
385 | + TEST_EXPR (NAME##_mr, (TYPE *a1, TYPE a2), *a1 OPERATOR a2) \ | ||
386 | + TEST_EXPR (NAME##_mm, (TYPE *a1, TYPE *a2), *a1 OPERATOR *a2) \ | ||
387 | + TEST_EXPR (NAME##_rc, (TYPE a1), a1 OPERATOR 100) \ | ||
388 | + TEST_EXPR (NAME##_cr, (TYPE a1), 100 OPERATOR a1) | ||
389 | + | ||
390 | +#define TEST_OP(NAME, OPERATOR) \ | ||
391 | + TEST (sc_##NAME, signed char, OPERATOR) \ | ||
392 | + TEST (uc_##NAME, unsigned char, OPERATOR) \ | ||
393 | + TEST (ss_##NAME, short, OPERATOR) \ | ||
394 | + TEST (us_##NAME, unsigned short, OPERATOR) \ | ||
395 | + TEST (si_##NAME, int, OPERATOR) \ | ||
396 | + TEST (ui_##NAME, unsigned int, OPERATOR) \ | ||
397 | + TEST (sll_##NAME, long long, OPERATOR) \ | ||
398 | + TEST (ull_##NAME, unsigned long long, OPERATOR) | ||
399 | + | ||
400 | +TEST_OP (eq, ==) | ||
401 | +TEST_OP (ne, !=) | ||
402 | +TEST_OP (lt, <) | ||
403 | +TEST_OP (gt, >) | ||
404 | +TEST_OP (le, <=) | ||
405 | +TEST_OP (ge, >=) | ||
406 | |||
407 | === added file 'gcc/testsuite/gcc.target/arm/cmp-2.c' | ||
408 | --- old/gcc/testsuite/gcc.target/arm/cmp-2.c 1970-01-01 00:00:00 +0000 | ||
409 | +++ new/gcc/testsuite/gcc.target/arm/cmp-2.c 2011-10-03 10:09:55 +0000 | ||
410 | @@ -0,0 +1,49 @@ | ||
411 | +/* { dg-do compile } */ | ||
412 | +/* { dg-require-effective-target arm_vfp_ok } */ | ||
413 | +/* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */ | ||
414 | +/* { dg-options "-O -mfpu=vfp -mfloat-abi=softfp" } */ | ||
415 | +/* { dg-final { scan-assembler-not "\tbl\t" } } */ | ||
416 | +/* { dg-final { scan-assembler-not "__aeabi" } } */ | ||
417 | +int x, y; | ||
418 | + | ||
419 | +#define EQ(X, Y) ((X) == (Y)) | ||
420 | +#define NE(X, Y) ((X) != (Y)) | ||
421 | +#define LT(X, Y) ((X) < (Y)) | ||
422 | +#define GT(X, Y) ((X) > (Y)) | ||
423 | +#define LE(X, Y) ((X) <= (Y)) | ||
424 | +#define GE(X, Y) ((X) >= (Y)) | ||
425 | + | ||
426 | +#define TEST_EXPR(NAME, ARGS, EXPR) \ | ||
427 | + int NAME##1 ARGS { return (EXPR); } \ | ||
428 | + int NAME##2 ARGS { return !(EXPR); } \ | ||
429 | + int NAME##3 ARGS { return (EXPR) ? x : y; } \ | ||
430 | + void NAME##4 ARGS { if (EXPR) x++; } \ | ||
431 | + void NAME##5 ARGS { if (!(EXPR)) x++; } | ||
432 | + | ||
433 | +#define TEST(NAME, TYPE, OPERATOR) \ | ||
434 | + TEST_EXPR (NAME##_rr, (TYPE a1, TYPE a2), OPERATOR (a1, a2)) \ | ||
435 | + TEST_EXPR (NAME##_rm, (TYPE a1, TYPE *a2), OPERATOR (a1, *a2)) \ | ||
436 | + TEST_EXPR (NAME##_mr, (TYPE *a1, TYPE a2), OPERATOR (*a1, a2)) \ | ||
437 | + TEST_EXPR (NAME##_mm, (TYPE *a1, TYPE *a2), OPERATOR (*a1, *a2)) \ | ||
438 | + TEST_EXPR (NAME##_rc, (TYPE a1), OPERATOR (a1, 100)) \ | ||
439 | + TEST_EXPR (NAME##_cr, (TYPE a1), OPERATOR (100, a1)) | ||
440 | + | ||
441 | +#define TEST_OP(NAME, OPERATOR) \ | ||
442 | + TEST (f_##NAME, float, OPERATOR) \ | ||
443 | + TEST (d_##NAME, double, OPERATOR) \ | ||
444 | + TEST (ld_##NAME, long double, OPERATOR) | ||
445 | + | ||
446 | +TEST_OP (eq, EQ) | ||
447 | +TEST_OP (ne, NE) | ||
448 | +TEST_OP (lt, LT) | ||
449 | +TEST_OP (gt, GT) | ||
450 | +TEST_OP (le, LE) | ||
451 | +TEST_OP (ge, GE) | ||
452 | +TEST_OP (blt, __builtin_isless) | ||
453 | +TEST_OP (bgt, __builtin_isgreater) | ||
454 | +TEST_OP (ble, __builtin_islessequal) | ||
455 | +TEST_OP (bge, __builtin_isgreaterequal) | ||
456 | +/* This one should be expanded into separate ordered and equality | ||
457 | + comparisons. */ | ||
458 | +TEST_OP (blg, __builtin_islessgreater) | ||
459 | +TEST_OP (bun, __builtin_isunordered) | ||
460 | |||