re PR target/70110 (ICE at -O3 in the 32-bit mode in set_last_insn, at emit-rtl.h...
authorJakub Jelinek <jakub@redhat.com>
Tue, 8 Mar 2016 08:05:26 +0000 (09:05 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 8 Mar 2016 08:05:26 +0000 (09:05 +0100)
PR target/70110
* config/i386/i386.c (scalar_chain::make_vector_copies,
scalar_chain::convert_reg): Call end_sequence in between
get_insns and emit_conversion_insns rather than after both
calls.

* gcc.dg/pr70110.c: New test.

From-SVN: r234057

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

index 38c47b6..3bfd5f4 100644 (file)
@@ -1,3 +1,11 @@
+2016-03-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/70110
+       * config/i386/i386.c (scalar_chain::make_vector_copies,
+       scalar_chain::convert_reg): Call end_sequence in between
+       get_insns and emit_conversion_insns rather than after both
+       calls.
+
 2016-03-07  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/70064
index 5155a00..25a6467 100644 (file)
@@ -3272,8 +3272,9 @@ scalar_chain::make_vector_copies (unsigned regno)
                            gen_rtx_SUBREG (SImode, reg, 4));
            emit_move_insn (vreg, tmp);
          }
-       emit_conversion_insns (get_insns (), insn);
+       rtx_insn *seq = get_insns ();
        end_sequence ();
+       emit_conversion_insns (seq, insn);
 
        if (dump_file)
          fprintf (dump_file,
@@ -3348,8 +3349,9 @@ scalar_chain::convert_reg (unsigned regno)
              emit_move_insn (gen_rtx_SUBREG (SImode, scopy, 4),
                              adjust_address (tmp, SImode, 4));
            }
-         emit_conversion_insns (get_insns (), insn);
+         rtx_insn *seq = get_insns ();
          end_sequence ();
+         emit_conversion_insns (seq, insn);
 
          if (dump_file)
            fprintf (dump_file,
index 0dfe344..28229ee 100644 (file)
@@ -1,3 +1,8 @@
+2016-03-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/70110
+       * gcc.dg/pr70110.c: New test.
+
 2016-03-07  Martin Jambor  <mjambor@suse.cz>
 
        * c-c++-common/gomp/clauses-1.c: Remove dg-options.
diff --git a/gcc/testsuite/gcc.dg/pr70110.c b/gcc/testsuite/gcc.dg/pr70110.c
new file mode 100644 (file)
index 0000000..42bbe3a
--- /dev/null
@@ -0,0 +1,39 @@
+/* PR target/70110 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-additional-options "-msse2" { target i?86-*-* x86_64-*-* } } */
+
+int a, c, d, f, h;
+long long b;
+
+static inline void
+foo (void)
+{
+  if (a) 
+    foo ();
+  b = c;
+}
+
+static inline void 
+bar (int p)
+{
+  if (p)
+    f = 0; 
+  b |= c; 
+} 
+
+void
+baz (int g, int i)
+{
+  for (b = d; (d = 1) != 0; )
+    {
+      if (a)
+       foo ();
+      b |= c;
+      bar (h); 
+      bar (g); 
+      bar (h); 
+      bar (i); 
+      bar (h);
+    }
+}