]> gcc.gnu.org Git - gcc.git/commitdiff
re PR debug/44223 (segmentation fault with -g -fsched-pressure)
authorJakub Jelinek <jakub@redhat.com>
Fri, 21 May 2010 18:45:29 +0000 (20:45 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 21 May 2010 18:45:29 +0000 (20:45 +0200)
PR debug/44223
* haifa-sched.c (schedule_insn): When freeing INSN_REG_USE_LIST,
unchain each use from the cyclic next_regno_use chain first.

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

From-SVN: r159680

gcc/ChangeLog
gcc/haifa-sched.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr44223.c [new file with mode: 0644]

index ee78f2340d8228c3b166ca638a7950e439a47ac2..dcfff779fc16c34c7cad3c0e0000a5a794018a66 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/44223
+       * haifa-sched.c (schedule_insn): When freeing INSN_REG_USE_LIST,
+       unchain each use from the cyclic next_regno_use chain first.
+
 2010-05-21  Steven Bosscher  <steven@gcc.gnu.org>
 
        * real: Do not include gmp.h, mpfr.h, and mpc.h.
index f7c087fef79c8b291584f7608d3fb9fa40418d68..b15fe63f34a299b9312ecab9adfc9d1499f78954 100644 (file)
@@ -1721,6 +1721,12 @@ schedule_insn (rtx insn)
        /* Unknown location doesn't use any registers.  */
        for (use = INSN_REG_USE_LIST (dbg); use != NULL; use = next)
          {
+           struct reg_use_data *prev = use;
+
+           /* Remove use from the cyclic next_regno_use chain first.  */
+           while (prev->next_regno_use != use)
+             prev = prev->next_regno_use;
+           prev->next_regno_use = use->next_regno_use;
            next = use->next_insn_use;
            free (use);
          }
index 259ee77b691475d33b116a92da9c14e071e66b47..d40fc045d2dba0d97ee29f27290ebdc429996f66 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/44223
+       * gcc.target/i386/pr44223.c: New test.
+
 2010-05-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * gcc.target/i386/pr25993.c: Use @function as type specifier.
diff --git a/gcc/testsuite/gcc.target/i386/pr44223.c b/gcc/testsuite/gcc.target/i386/pr44223.c
new file mode 100644 (file)
index 0000000..3b8030c
--- /dev/null
@@ -0,0 +1,36 @@
+/* PR debug/44223 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fsched-pressure -fschedule-insns -fpic -march=core2 -g" { target fpic } } */
+
+struct S { unsigned int s1; int s2; };
+struct T { int t; };
+
+extern void extfn (struct S *);
+
+static inline void
+foo (struct S *s, unsigned char *x, int y)
+{
+  s->s2 = 32;
+}
+
+static inline void
+bar (struct S *s, int n, unsigned int x)
+{
+  unsigned int s1;
+  int s2;
+  s1 = s->s1;
+  s2 = s->s2;
+  if (n < s2)
+    s1 = (s1 << n) | x;
+  s->s1 = s1;
+}
+
+int
+baz (struct T *u, unsigned char *v, int w)
+{
+  struct S y;
+  foo (&y, v, 7);
+  bar (&y, 12, 0xfff);
+  bar (&y, 2, u->t);
+  extfn (&y);
+}
This page took 0.099913 seconds and 5 git commands to generate.