re PR target/51354 (ICE in maybe_record_trace_start)
authorJakub Jelinek <jakub@redhat.com>
Tue, 6 Dec 2011 17:15:11 +0000 (18:15 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 6 Dec 2011 17:15:11 +0000 (18:15 +0100)
PR target/51354
* config/i386/i386.c (ix86_emit_leave): Call ix86_add_cfa_restore_note
unconditionally.

* gcc.c-torture/compile/pr51354.c: New test.

From-SVN: r182056

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr51354.c [new file with mode: 0644]

index c74afa9274054fa4061974c9098db1631d037b4c..9a2249629b2ab33aad878c74c94698a20969c4cc 100644 (file)
@@ -1,3 +1,9 @@
+2011-12-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/51354
+       * config/i386/i386.c (ix86_emit_leave): Call ix86_add_cfa_restore_note
+       unconditionally.
+
 2011-12-06  Georg-Johann Lay  <avr@gjlay.de>
 
        Forward-port from gcc-4_6-branch r181936 2011-12-02.
index 1b871be84802683703497773c61d8c8e79239366..16387991705aaf5217918b94bd0348ae52f27536 100644 (file)
@@ -10545,9 +10545,9 @@ ix86_emit_leave (void)
       add_reg_note (insn, REG_CFA_DEF_CFA,
                    plus_constant (stack_pointer_rtx, m->fs.sp_offset));
       RTX_FRAME_RELATED_P (insn) = 1;
-      ix86_add_cfa_restore_note (insn, hard_frame_pointer_rtx,
-                                m->fs.fp_offset);
     }
+  ix86_add_cfa_restore_note (insn, hard_frame_pointer_rtx,
+                            m->fs.fp_offset);
 }
 
 /* Emit code to restore saved registers using MOV insns.
index ac537cf44e879ba9352614bd9c9087c7ceedd043..04729740be91503599692a7e3320d47626a07939 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/51354
+       * gcc.c-torture/compile/pr51354.c: New test.
+
 2011-12-06  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/51431
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr51354.c b/gcc/testsuite/gcc.c-torture/compile/pr51354.c
new file mode 100644 (file)
index 0000000..5b2abb0
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR target/51354 */
+
+extern void abort (void);
+
+typedef int __attribute__ ((aligned (32))) ai;
+
+void foo (int *x, ai * y);
+
+int
+bar (int x)
+{
+  if (x == 12346)
+    return 24;
+  ai i;
+  foo (__builtin_alloca (x), &i);
+  return 128;
+}