re PR target/64513 (ICE: in maybe_record_trace_start, at dwarf2cfi.c:2231 with -mstac...
authorJakub Jelinek <jakub@redhat.com>
Mon, 12 Jan 2015 20:45:38 +0000 (21:45 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 12 Jan 2015 20:45:38 +0000 (21:45 +0100)
PR target/64513
* config/i386/i386.c (ix86_expand_prologue): Add
REG_FRAME_RELATED_EXPR to %rax and %r10 pushes.

* gcc.target/i386/pr64513.c: New test.

From-SVN: r219492

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr64513.c [new file with mode: 0644]

index b9d47cf84dc33f03e140fb8bc18816f57b1ff930..4a21711b41ab393d662b5ec8e642c48b2e23c1ee 100644 (file)
@@ -1,5 +1,9 @@
 2015-01-12  Jakub Jelinek  <jakub@redhat.com>
 
+       PR target/64513
+       * config/i386/i386.c (ix86_expand_prologue): Add
+       REG_FRAME_RELATED_EXPR to %rax and %r10 pushes.
+
        PR tree-optimization/64454
        * tree-vrp.c (simplify_div_or_mod_using_ranges): Optimize
        op0 % op1 into op0 if op0 is in range [-op1 + 1, op1 - 1]
index 8724ea36cf411597e95d896518af823e7b8b442f..7a39f800d899df257ee56cd4f6fa6b5f7a361582 100644 (file)
@@ -11559,6 +11559,10 @@ ix86_expand_prologue (void)
              if (sp_is_cfa_reg)
                m->fs.cfa_offset += UNITS_PER_WORD;
              RTX_FRAME_RELATED_P (insn) = 1;
+             add_reg_note (insn, REG_FRAME_RELATED_EXPR,
+                           gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+                                        plus_constant (Pmode, stack_pointer_rtx,
+                                                       -UNITS_PER_WORD)));
            }
        }
 
@@ -11572,6 +11576,10 @@ ix86_expand_prologue (void)
              if (sp_is_cfa_reg)
                m->fs.cfa_offset += UNITS_PER_WORD;
              RTX_FRAME_RELATED_P (insn) = 1;
+             add_reg_note (insn, REG_FRAME_RELATED_EXPR,
+                           gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+                                        plus_constant (Pmode, stack_pointer_rtx,
+                                                       -UNITS_PER_WORD)));
            }
        }
 
index 9a07ada5235fc911e41ecfd57a0db3ff298e0ba3..1b441e492da1c46b2aad1f3dd84d3b080144a99e 100644 (file)
@@ -1,5 +1,8 @@
 2015-01-12  Jakub Jelinek  <jakub@redhat.com>
 
+       PR target/64513
+       * gcc.target/i386/pr64513.c: New test.
+
        PR tree-optimization/64454
        * gcc.dg/pr64454.c: New test.
 
diff --git a/gcc/testsuite/gcc.target/i386/pr64513.c b/gcc/testsuite/gcc.target/i386/pr64513.c
new file mode 100644 (file)
index 0000000..0236496
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR target/64513 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mstack-arg-probe" } */
+
+struct A {};
+struct B { struct A y; };
+int foo (struct A);
+
+int
+bar (int x)
+{
+  struct B b;
+  int c;
+  while (x--)
+    c = foo (b.y);
+  return c;
+}