re PR middle-end/67619 (ICE at -O1 and above on x86_64-linux-gnu in int_mode_for_mode...
authorUros Bizjak <uros@gcc.gnu.org>
Fri, 18 Sep 2015 16:27:51 +0000 (18:27 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 18 Sep 2015 16:27:51 +0000 (18:27 +0200)
PR middle-end/67619
* except.c (expand_builtin_eh_return): Use copy_addr_to_reg to copy
the address to a register.

testsuite/ChangeLog:

PR middle-end/67619
* gcc.dg/torture/pr67619.c: New test.

From-SVN: r227909

gcc/ChangeLog
gcc/except.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr67619.c [new file with mode: 0644]

index 469abad356fdaf1efcc9bf010d0627e2bc6f7aca..4f712e3fe7fae6c40fb72aec7b8ba99258d62b73 100644 (file)
@@ -1,4 +1,10 @@
-2015-09-16  Jeff Law  <law@redhat.com>
+2015-09-18  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR middle-end/67619
+       * except.c (expand_builtin_eh_return): Use copy_addr_to_reg to copy
+       the address to a register.
+
+2015-09-18  Jeff Law  <law@redhat.com>
 
        PR tree-optimization/47679
        * Makefile.in (OBJS): Add tree-ssa-phionlycprop.o
index 86ad6bc4446183ad51d78a24354f06f03f486cd6..f77a2fa6fb310b3beed2c7dbafeae65348fb34ba 100644 (file)
@@ -2219,7 +2219,7 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED,
                     VOIDmode, EXPAND_NORMAL);
   tmp = convert_memory_address (Pmode, tmp);
   if (!crtl->eh.ehr_stackadj)
-    crtl->eh.ehr_stackadj = copy_to_reg (tmp);
+    crtl->eh.ehr_stackadj = copy_addr_to_reg (tmp);
   else if (tmp != crtl->eh.ehr_stackadj)
     emit_move_insn (crtl->eh.ehr_stackadj, tmp);
 #endif
@@ -2228,7 +2228,7 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED,
                     VOIDmode, EXPAND_NORMAL);
   tmp = convert_memory_address (Pmode, tmp);
   if (!crtl->eh.ehr_handler)
-    crtl->eh.ehr_handler = copy_to_reg (tmp);
+    crtl->eh.ehr_handler = copy_addr_to_reg (tmp);
   else if (tmp != crtl->eh.ehr_handler)
     emit_move_insn (crtl->eh.ehr_handler, tmp);
 
index 08baed1ef3fb1f13a72a68ef69abc6cf8354ba51..f959a789f55ca53207737721885422e8f6d4407e 100644 (file)
@@ -1,3 +1,8 @@
+2015-09-18  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR middle-end/67619
+       * gcc.dg/torture/pr67619.c: New test.
+
 2015-09-18  Alan Lawrence  <alan.lawrence@arm.com>
 
        PR tree-optimization/67283
diff --git a/gcc/testsuite/gcc.dg/torture/pr67619.c b/gcc/testsuite/gcc.dg/torture/pr67619.c
new file mode 100644 (file)
index 0000000..e441ee9
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+void
+foo ()
+{
+  unsigned long l;
+  void *p = 0; 
+
+  __builtin_unwind_init ();
+  l = 0; 
+  __builtin_eh_return (l, p);
+}