aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2013-03-05 23:25:43 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2013-03-05 23:25:43 +0100
commit7ead14d420b671bbc3e3eff8976fa80b09a7766b (patch)
tree0859b99a62412f9160eef192b41558a061831d2d
parentee61ea3844e8deee83cee22e037b15339f823171 (diff)
downloadgcc-7ead14d420b671bbc3e3eff8976fa80b09a7766b.zip
gcc-7ead14d420b671bbc3e3eff8976fa80b09a7766b.tar.gz
gcc-7ead14d420b671bbc3e3eff8976fa80b09a7766b.tar.bz2
re PR rtl-optimization/56484 (ICE in assign_by_spills, at lra-assigns.c:1268)
PR rtl-optimization/56484 * ifcvt.c (noce_process_if_block): If else_bb is NULL, avoid extending lifetimes of hard registers on small register class machines. From-SVN: r196478
-rw-r--r--gcc/ifcvt.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr56484.c17
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index dd94100..f081ecd 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -2491,6 +2491,12 @@ noce_process_if_block (struct noce_if_info *if_info)
|| ! noce_operand_ok (SET_SRC (set_b))
|| reg_overlap_mentioned_p (x, SET_SRC (set_b))
|| modified_between_p (SET_SRC (set_b), insn_b, jump)
+ /* Avoid extending the lifetime of hard registers on small
+ register class machines. */
+ || (REG_P (SET_SRC (set_b))
+ && HARD_REGISTER_P (SET_SRC (set_b))
+ && targetm.small_register_classes_for_mode_p
+ (GET_MODE (SET_SRC (set_b))))
/* Likewise with X. In particular this can happen when
noce_get_condition looks farther back in the instruction
stream than one might expect. */
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr56484.c b/gcc/testsuite/gcc.c-torture/compile/pr56484.c
new file mode 100644
index 0000000..894862c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr56484.c
@@ -0,0 +1,17 @@
+/* PR rtl-optimization/56484 */
+
+unsigned char b[4096];
+int bar (void);
+
+int
+foo (void)
+{
+ int a = 0;
+ while (bar ())
+ {
+ int c = bar ();
+ a = a < 0 ? a : c;
+ __builtin_memset (b, 0, sizeof b);
+ }
+ return a;
+}