[Bug target/49487] Internal compiler error in AVR code

2011-06-21 Thread eric.weddington at atmel dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49487

Eric Weddington  changed:

   What|Removed |Added

  Component|c   |target

--- Comment #1 from Eric Weddington  
2011-06-21 15:27:41 UTC ---
(In reply to comment #0)
> Compiling the following function triggers an internal compiler error in (at
> least) GCC versions 4.2, 4.3, 4.5 and the latest 4.7.0-20110620:

Could you be a bit more specific on the version numbers for 4.2, 4.3, and 4.5?

I've just tried building on 4.3.3 (WinAVR 20100110) and it compiled
successfully for -O[0123s].

 
> This was compiled using a cross-compiler on an x86_64 system as outlined 
> below:

Could you try using a 32-bit host?


[Bug target/49487] Internal compiler error in AVR code

2011-06-21 Thread j at uriah dot heep.sax.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49487

Joerg Wunsch  changed:

   What|Removed |Added

 CC||j at uriah dot heep.sax.de

--- Comment #2 from Joerg Wunsch  2011-06-21 
15:57:50 UTC ---
Confirmed for current SVN trunk (r175263).

I cannot reproduce it on GCC 4.3.4.


[Bug target/49487] Internal compiler error in AVR code

2011-06-21 Thread eric.weddington at atmel dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49487

Eric Weddington  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011.06.21 16:15:37
 Ever Confirmed|0   |1


[Bug target/49487] Internal compiler error in AVR code

2011-06-21 Thread gandalf at winds dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49487

--- Comment #3 from gandalf at winds dot org 2011-06-21 17:17:20 UTC ---
(In reply to comment #1)
> (In reply to comment #0)
> > Compiling the following function triggers an internal compiler error in (at
> > least) GCC versions 4.2, 4.3, 4.5 and the latest 4.7.0-20110620:
> 
> Could you be a bit more specific on the version numbers for 4.2, 4.3, and 4.5?
> 
> I've just tried building on 4.3.3 (WinAVR 20100110) and it compiled
> successfully for -O[0123s].
> 
>  
> > This was compiled using a cross-compiler on an x86_64 system as outlined 
> > below:
> 
> Could you try using a 32-bit host?

Sorry about being vague on the previous GCC versions--I didn't think it
mattered that much. I very well could have been using patches from Atmel back
then (it was a while ago). I cannot reproduce the problem today on vanilla GCC
4.3.5 and 4.4.6.

However I am able to reproduce the problem on 4.5.3 right now too (on a 64-bit
host).


[Bug target/49487] Internal compiler error in AVR code

2011-06-24 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49487

Georg-Johann Lay  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 CC||gjl at gcc dot gnu.org

--- Comment #4 from Georg-Johann Lay  2011-06-24 
20:11:20 UTC ---
I see this on 4.5.2

In 185r.asmcons we have insn 40:

(insn 40 38 41 4 foo.c:6 (parallel [
(set (reg:HI 94)
(rotate:HI (reg/v:HI 66 [ _x ])
(const_int 8 [0x8])))
(clobber (reg:QI 95))
]) 64 {*rotbhi} (expr_list:REG_DEAD (reg/v:HI 66 [ _x ])
(expr_list:REG_UNUSED (reg:QI 95)
(nil

and in 188r.ira it is:

(insn 40 38 41 4 foo.c:6 (parallel [
(set (reg:HI 20 r20 [94])
(rotate:HI (reg/v:HI 20 r20 [orig:66 _x ] [66])
(const_int 8 [0x8])))
(clobber (mem/c:QI (plus:HI (reg/f:HI 28 r28)
(const_int 1 [0x1])) [3 %sfp+1 S1 A8]))
]) 64 {*rotbhi} (nil))

At first sight I thought it is a reload bug, but it's not.
The bug goes like that:

operand3 gets constraint verbatim from rotx iterator, witch reads for HI
  (HI "X,X,X")
That was correct if reload would supply a scratch.  However, these rot patterns
don't request a scratch, the respective expander already supplies a pseudo.

So the "X" does not mean "don't need a scratch", instead it means "everything
is fine" so that reload need not generate reload insns to force "r" or whatever
constraint.

So either the constrint must be "=&r" or so if a pseudo is pre-generated (this
is waste because the reg is not needed and can even force a frame/frame
pointer) or this has to be rewritten as a proper scratch.


[Bug target/49487] Internal compiler error in AVR code (bytewise rotate)

2011-07-13 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49487

Georg-Johann Lay  changed:

   What|Removed |Added

   Target Milestone|--- |4.6.2


[Bug target/49487] Internal compiler error in AVR code (bytewise rotate)

2011-07-14 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49487

--- Comment #5 from Georg-Johann Lay  2011-07-14 
15:10:17 UTC ---
Author: gjl
Date: Thu Jul 14 15:10:12 2011
New Revision: 176276

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176276
Log:

PR target/49487
* config/avr/avr.md (rotl3): Generate SCRATCH instead
of REG.
(*rotw): Use const_int_operand for operand2.
Use match_scatch for operand3.
(*rotb): Ditto
* config/avr/avr.c (avr_rotate_bytes): Treat SCRATCH.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr.c
trunk/gcc/config/avr/avr.md


[Bug target/49487] Internal compiler error in AVR code (bytewise rotate)

2011-07-14 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49487

--- Comment #6 from Georg-Johann Lay  2011-07-14 
15:15:31 UTC ---
Author: gjl
Date: Thu Jul 14 15:15:28 2011
New Revision: 176277

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176277
Log:

PR target/49487
Backport from mainline r176276
2011-07-14  Georg-Johann Lay
* config/avr/avr.md (rotl3): Generate SCRATCH instead
of REG.
(*rotw): Use const_int_operand for operand2.
Use match_scatch for operand3.
(*rotb): Ditto
* config/avr/avr.c (avr_rotate_bytes): Treat SCRATCH.


Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/config/avr/avr.c
branches/gcc-4_6-branch/gcc/config/avr/avr.md


[Bug target/49487] Internal compiler error in AVR code (bytewise rotate)

2011-07-14 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49487

Georg-Johann Lay  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #7 from Georg-Johann Lay  2011-07-14 
15:18:04 UTC ---
Closed as FIXED for the Milestone.


[Bug target/49487] Internal compiler error in AVR code (bytewise rotate)

2011-07-25 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49487

Georg-Johann Lay  changed:

   What|Removed |Added

 CC||jh.gcc-bugzilla at plonk
   ||dot de

--- Comment #8 from Georg-Johann Lay  2011-07-25 
08:43:04 UTC ---
*** Bug 47509 has been marked as a duplicate of this bug. ***