Executing on host: /home/dave/gnu/gcc-4.4/objdir/gcc/xgcc -B/home/dave/gnu/gcc-4.4/objdir/gcc/ -O0 -w -fno-show-column -c -o 20010226-1.o /home/dave/gnu/gcc -4.4/gcc/gcc/testsuite/gcc.c-torture/compile/20010226-1.c (timeout = 300) /home/dave/gnu/gcc-4.4/gcc/gcc/testsuite/gcc.c-torture/compile/20010226-1.c: In function 'foo': /home/dave/gnu/gcc-4.4/gcc/gcc/testsuite/gcc.c-torture/compile/20010226-1.c:22: error: VOIDmode on an output (insn 30 29 31 2 /home/dave/gnu/gcc-4.4/gcc/gcc/testsuite/gcc.c-torture/compile/ 20010226-1.c:6 (parallel [ (const_int 1 [0x1]) (unspec_volatile [ (mem:BLK (scratch) [0 A8]) ] 1) (use (reg:SI 20 %r20 [108])) (use (reg:SI 19 %r19 [109])) (use (reg:SI 28 %r28 [110])) (clobber (scratch)) ]) 244 {dcacheflush} (nil))/home/dave/gnu/gcc-4.4/gcc/gcc/testsuite/gcc.c-torture/compile/20010226-1.c:22: internal compiler error: in do_output_reload, at reload1.c:7331 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. compiler exited with status 1 output is: /home/dave/gnu/gcc-4.4/gcc/gcc/testsuite/gcc.c-torture/compile/20010226-1.c: In function 'foo': /home/dave/gnu/gcc-4.4/gcc/gcc/testsuite/gcc.c-torture/compile/20010226-1.c:22: error: VOIDmode on an output (insn 30 29 31 2 /home/dave/gnu/gcc-4.4/gcc/gcc/testsuite/gcc.c-torture/compile/20010226-1.c:6 (parallel [ (const_int 1 [0x1]) (unspec_volatile [ (mem:BLK (scratch) [0 A8]) ] 1) (use (reg:SI 20 %r20 [108])) (use (reg:SI 19 %r19 [109])) (use (reg:SI 28 %r28 [110])) (clobber (scratch)) ]) 244 {dcacheflush} (nil)) /home/dave/gnu/gcc-4.4/gcc/gcc/testsuite/gcc.c-torture/compile/20010226-1.c:22: internal compiler error: in do_output_reload, at reload1.c:7331 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. FAIL: gcc.c-torture/compile/20010226-1.c -O0 (internal compiler error) FAIL: gcc.c-torture/compile/20010226-1.c -O0 (test for excess errors) Excess errors: /home/dave/gnu/gcc-4.4/gcc/gcc/testsuite/gcc.c-torture/compile/20010226-1.c:22: error: VOIDmode on an output (insn 30 29 31 2 /home/dave/gnu/gcc-4.4/gcc/gcc/testsuite/gcc.c-torture/compile/20010226-1.c:6 (parallel [ (const_int 1 [0x1]) (unspec_volatile [ (mem:BLK (scratch) [0 A8]) ] 1) (use (reg:SI 20 %r20 [108])) (use (reg:SI 19 %r19 [109])) (use (reg:SI 28 %r28 [110])) (clobber (scratch)) ]) 244 {dcacheflush} (nil)) /home/dave/gnu/gcc-4.4/gcc/gcc/testsuite/gcc.c-torture/compile/20010226-1.c:22: internal compiler error: in do_output_reload, at reload1.c:7331
(gdb) p debug_rtx (rl->out) (scratch)
Richard, does match_scratch now require a mode? The pattern causing the problem was written without a mode so that it could handle both SImode and DImode.
Subject: Re: gcc.c-torture/compile/20010226-1.c:22: ICE: in do_output_reload, at reload1.c:7331 This was introduced in revision 133531. Dave
Subject: Re: gcc.c-torture/compile/20010226-1.c:22: ICE: in do_output_reload, at reload1.c:7331 "danglin at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes: > Richard, does match_scratch now require a mode? The pattern causing > the problem was written without a mode so that it could handle both > SImode and DImode. Hmm. Well, the use of a modeless "match_scratch" in a matching context is OK. It's the use of a modeless "(scratch)" rtx (and thus a modeless "match_scratch" in an expander or named insn) that's the problem. It does seem odd for an output "(scratch)" to have no mode. From a quick check, it seems PA is the only port to use voidless "(scratch)" rtxes for output operands that really do need reloads. Other ports either add the mode to the "match_scratch" or get the associated expander to call "gen_rtx_SCRATCH (mode)". See s390.md for an example of the latter. I suppose the assumption in pa.md is that the scratch output reload should be in the same mode as the input operand. However, the point of my patch was that they needn't be: matched input-output operands can have different modes, and in every other case except the PA one, the mode of the output value determines the mode of the output reload register. If we want to continue to allow this, the fix is to change: if (rl->out && reg_rtx) into: if (rl->out && reg_rtx && !(GET_CODE (rl->out) == SCRATCH && GET_MODE (rl->out) == VOIDmode)) in reload1.c. What do you think? Should pa.md be changed (probably along the same lines as s390.md) or do you want to go with the reload change? Richard
Subject: Re: gcc.c-torture/compile/20010226-1.c:22: ICE: in do_output_reload, at reload1.c:7331 > I suppose the assumption in pa.md is that the scratch output reload > should be in the same mode as the input operand. I think the constraint should be changed from "=&0" to "+&0" to indicate that the operand is both read and written. Possibly, this will fix the problem. Dave
Subject: Re: gcc.c-torture/compile/20010226-1.c:22: ICE: in do_output_reload, at reload1.c:7331 "dave at hiauly1 dot hia dot nrc dot ca" <gcc-bugzilla@gcc.gnu.org> writes: >> I suppose the assumption in pa.md is that the scratch output reload >> should be in the same mode as the input operand. > > I think the constraint should be changed from "=&0" to "+&0" to indicate > that the operand is both read and written. Possibly, this will fix the > problem. Well, "=" is correct for matching operands; "+" isn't. As I say, the problem is simply that we have something that is logically an output value -- (scratch) -- but that does not have a mode. Changing "=" to "+" wouldn't solve that; the (scratch) would still be an output value. Richard
Testing backend fix.
Subject: Bug 35768 Author: danglin Date: Thu Apr 10 22:50:49 2008 New Revision: 134182 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134182 Log: PR target/35768 * pa.md: Define mode iterator P. Define mode attribute dwc. (dcacheflush): Update pattern to use iterator P and attribute dwc. (icacheflush): Likewise. * pa.h (INITIALIZE_TRAMPOLINE): Use dcacheflushsi/icacheflushsi if !TARGET_64BIT, and dcacheflushdi/icacheflushdi if TARGET_64BIT. Modified: trunk/gcc/ChangeLog trunk/gcc/config/pa/pa.h trunk/gcc/config/pa/pa.md
Fixed.