]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/64513 (ICE: in maybe_record_trace_start, at dwarf2cfi.c:2231...
authorJakub Jelinek <jakub@redhat.com>
Sun, 1 Feb 2015 21:49:47 +0000 (22:49 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sun, 1 Feb 2015 21:49:47 +0000 (22:49 +0100)
Backported from mainline
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.

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

From-SVN: r220331

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

index 121358a1f2454f47c125a6cc2f6eac0d405356f5..2f71306db30c172e09011beac57aa41f0f429447 100644 (file)
@@ -1,3 +1,12 @@
+2015-02-01  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       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.
+
 2015-01-29  Ilya Tocar  <ilya.tocar@intel.com>
 
        * config/i386/avx2intrin.h (_mm256_bslli_epi128,
index 6872189a9efe33ba7f15bd899152580de54fee46..cb5b325183c84c0eaa358facaa780e5683734831 100644 (file)
@@ -10494,6 +10494,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)));
            }
        }
 
@@ -10507,6 +10511,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 919e6c05b0fe1e9bcab92f1f8042c193ccdc62ca..b855a38d8e6de450de245b2af936e77eba70e1d3 100644 (file)
@@ -1,3 +1,11 @@
+2015-02-01  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2015-01-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/64513
+       * gcc.target/i386/pr64513.c: New test.
+
 2015-01-29  Ilya Tocar  <ilya.tocar@intel.com>
 
        * gcc.target/i386/sse-14.c: Test new intrinsic.
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;
+}