public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed, amdgcn] Fix conditional add LRA failure
@ 2020-01-31 16:59 Andrew Stubbs
  0 siblings, 0 replies; only message in thread
From: Andrew Stubbs @ 2020-01-31 16:59 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]

This patch fixes an ICE in testcase 
gfortran.dg/assumed_rank_bounds_3.f90. The ICE is "unable to generate 
reloads" and is caused by LRA wanting to use the same match constraint 
for two distinct operands.

It would be nice if LRA could choose not to do that (given that the 
alternative allows multiple possibilities for one of the operands), but 
the solution is to ensure that no alternative has more than one '0' 
constraint.

There are probably other patterns that can encounter the same issue, but 
I don't plan to fix them right now.

Andrew

[-- Attachment #2: 200131-addv64di3_exec-constraints.patch --]
[-- Type: text/x-patch, Size: 1288 bytes --]

Fix conditional add LRA failure

Fix ICE in testcase gfortran.dg/assumed_rank_bounds_3.f90.

2020-01-31  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* config/gcn/gcn-valu.md (addv64di3_exec): Allow one '0' in each
	alternative only.

diff --git a/gcc/config/gcn/gcn-valu.md b/gcc/config/gcn/gcn-valu.md
index 4aad835b2ef..ecdd60b8190 100644
--- a/gcc/config/gcn/gcn-valu.md
+++ b/gcc/config/gcn/gcn-valu.md
@@ -1200,13 +1200,14 @@
    (set_attr "length" "8")])
 
 (define_insn_and_split "addv64di3_exec"
-  [(set (match_operand:V64DI 0 "register_operand"		 "= &v,  &v")
+  [(set (match_operand:V64DI 0 "register_operand"	     "= &v,  &v, &v")
 	(vec_merge:V64DI
 	  (plus:V64DI
-	    (match_operand:V64DI 1 "register_operand"		 "%vDb,vDb0")
-	    (match_operand:V64DI 2 "gcn_alu_operand"		 "vDb0, vDb"))
-	  (match_operand:V64DI 3 "gcn_register_or_unspec_operand" " U0,  U0")
-	  (match_operand:DI 4 "gcn_exec_reg_operand"		 "   e,   e")))
+	    (match_operand:V64DI 1 "register_operand"	     "%vDb,vDb0,vDb")
+	    (match_operand:V64DI 2 "gcn_alu_operand"	     "vDb0, vDb,vDb"))
+	  (match_operand:V64DI 3 "gcn_register_or_unspec_operand"
+							     "   U,   U,  0")
+	  (match_operand:DI 4 "gcn_exec_reg_operand"	     "   e,   e,  e")))
    (clobber (reg:DI VCC_REG))]
   ""
   "#"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-31 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-31 16:59 [committed, amdgcn] Fix conditional add LRA failure Andrew Stubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).