This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix LRA ICE (PR middle-end/70219)


Hi!

The newly added assert in delete_move_and_clobber requires dregno > 0,
but dregno == 0 is also normal (e.g. in the testcase below we get dregno ==
0, because it uses %rax).  Only dregno < 0 is special and we shouldn't see
it here.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2016-03-14  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/70219
	* lra-constraints.c (delete_move_and_clobber): Change assertion
	to also allow dregno == 0.

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

--- gcc/lra-constraints.c.jj	2016-03-13 21:39:24.000000000 +0100
+++ gcc/lra-constraints.c	2016-03-14 09:16:39.849241403 +0100
@@ -5861,7 +5861,7 @@ delete_move_and_clobber (rtx_insn *insn,
   rtx_insn *prev_insn = PREV_INSN (insn);
 
   lra_set_insn_deleted (insn);
-  lra_assert (dregno > 0);
+  lra_assert (dregno >= 0);
   if (prev_insn != NULL && NONDEBUG_INSN_P (prev_insn)
       && GET_CODE (PATTERN (prev_insn)) == CLOBBER
       && dregno == get_regno (XEXP (PATTERN (prev_insn), 0)))
--- gcc/testsuite/gcc.dg/pr70219.c.jj	2016-03-14 09:15:48.887941755 +0100
+++ gcc/testsuite/gcc.dg/pr70219.c	2016-03-14 09:13:58.000000000 +0100
@@ -0,0 +1,18 @@
+/* PR middle-end/70219 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O1 -w -Wno-psabi" } */
+
+typedef int B __attribute__ ((vector_size (32)));
+typedef int D __attribute__ ((vector_size (32)));
+typedef long E __attribute__ ((vector_size (32)));
+typedef __int128 F;
+typedef __int128 G __attribute__ ((vector_size (32)));
+
+F
+foo (int a, unsigned b, F c, B d, G e, B f, D g, E h, G i)
+{
+  b /= c;
+  e /= (G) ~d;
+  h -= (E){ g[4], e[1], 64, ~f[1] };
+  return b + e[1] + h[0] + h[1] + i[1];
+}

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]