public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch,AVR]: FIX ICE in optabs due to bad rotate expander.
@ 2011-04-14 10:25 Georg-Johann Lay
  2011-04-14 16:21 ` Denis Chertykov
  0 siblings, 1 reply; 18+ messages in thread
From: Georg-Johann Lay @ 2011-04-14 10:25 UTC (permalink / raw)
  To: gcc-patches; +Cc: Anatoly Sokolov, Denis Chertykov, Eric Weddington

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

The "rotl<mode>3" expanders (mode \in {HI,SI,DI}) violates synopsis by
using 4 operands instead of 3. This runs in ICE in top of
optabs.c:maybe_gen_insn.

The right way to do this is to use match_dup, not match_operand. So
the fix is obvious.

Regenerated avr-gcc and run against avr testsuite:

gcc.target/avr/torture/pr41885.c generates these patterns

Johann

2011-04-14  Georg-Johann Lay  <avr@gjlay.de>

	* config/avr/avr.md ("rotlhi3", "rotlsi3", "rotldi3"): Fix
	expanders operand 3 from match_operand to match_dup.

	

[-- Attachment #2: rot-ice.diff --]
[-- Type: text/x-patch, Size: 484 bytes --]

Index: config/avr/avr.md
===================================================================
--- config/avr/avr.md	(Revision 172416)
+++ config/avr/avr.md	(Arbeitskopie)
@@ -1521,7 +1521,7 @@ (define_expand "rotl<mode>3"
   [(parallel [(set (match_operand:HIDI 0 "register_operand" "")
 		   (rotate:HIDI (match_operand:HIDI 1 "register_operand" "")
 				(match_operand:VOID 2 "const_int_operand" "")))
-		(clobber (match_operand 3 ""))])]
+		(clobber (match_dup 3))])]
   ""
   "
 {

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2011-04-20 17:24 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-14 10:25 [Patch,AVR]: FIX ICE in optabs due to bad rotate expander Georg-Johann Lay
2011-04-14 16:21 ` Denis Chertykov
2011-04-14 17:20   ` Georg-Johann Lay
2011-04-14 18:15     ` Denis Chertykov
2011-04-15 17:56       ` Georg-Johann Lay
2011-04-17 10:23         ` Denis Chertykov
2011-04-17 19:43           ` Denis Chertykov
2011-04-18 11:10             ` Georg-Johann Lay
2011-04-18 16:35               ` Denis Chertykov
2011-04-18 16:46                 ` Denis Chertykov
2011-04-19  9:46                 ` Georg-Johann Lay
2011-04-19 10:16                   ` Denis Chertykov
2011-04-19 10:36                     ` Georg-Johann Lay
2011-04-19 12:07                       ` Denis Chertykov
2011-04-19 13:15                         ` Richard Earnshaw
2011-04-20 17:44                     ` Richard Henderson
2011-04-20 11:25             ` Georg-Johann Lay
2011-04-20 12:56               ` Denis Chertykov

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).