The nvptx backend is somewhat unusual in that call insns set a pseudo. The combiner is surprised by this and allows combining them into other insns, which remain as INSN rather than CALL_INSN. Aborts ensue.

Bootstrapped and tested on x86_64-linux, together with the other patches. Ok?


Bernd
    	* combine.c (try_combine): Don't allow a call as one of the source
    	insns.

diff --git a/gcc/combine.c b/gcc/combine.c
index 0ec7f85..fe95b41 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2543,7 +2543,10 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
 
   /* Exit early if one of the insns involved can't be used for
      combinations.  */
-  if (cant_combine_insn_p (i3)
+  if (CALL_P (i2)
+      || (i1 && CALL_P (i1))
+      || (i0 && CALL_P (i0))
+      || cant_combine_insn_p (i3)
       || cant_combine_insn_p (i2)
       || (i1 && cant_combine_insn_p (i1))
       || (i0 && cant_combine_insn_p (i0))

Reply via email to