OSDN Git Service

PR target/51354
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Dec 2011 17:15:11 +0000 (17:15 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Dec 2011 17:15:11 +0000 (17:15 +0000)
* config/i386/i386.c (ix86_emit_leave): Call ix86_add_cfa_restore_note
unconditionally.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182056 138bc75d-0d04-0410-961f-82ee72b054a4

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

index c74afa9..9a22496 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 1b871be..1638799 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 ac537cf..0472974 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;
+}