public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/52113] New: [4.7 regression][avr] ICE: in extract_insn, at recog.c:2123
@ 2012-02-03 17:35 mhlavink at redhat dot com
  2012-02-03 18:47 ` [Bug rtl-optimization/52113] [4.7 regression][lower-subreg.c] " gjl at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: mhlavink at redhat dot com @ 2012-02-03 17:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52113

             Bug #: 52113
           Summary: [4.7 regression][avr] ICE: in extract_insn, at
                    recog.c:2123
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mhlavink@redhat.com


gcc 4.7 fails on code that was working in 4.6 without any problem

Version: 4.7.0-20120128
Target: avr

Problem happens only when optimization is used.

Pre-processed reproducer:
============= cut =================
typedef unsigned int uint8_t __attribute__((__mode__(__QI__)));
typedef unsigned int uint16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int uint32_t __attribute__ ((__mode__ (__SI__)));

extern uint32_t inacCounter;
uint8_t inactivityTimer;

int main()
{
    if(inacCounter>((uint32_t)inactivityTimer*1000)) inacCounter=0;
}
============= cut =================

$ avr-g++ -c -mmcu=atmega64 reproducer.cpp -O1
reproducer.cpp: In function 'int main()':
reproducer.cpp:11:1: error: unrecognizable insn:
(insn 26 6 27 2 (set (concatn:HI [
                (reg:QI 57)
                (reg:QI 58 [+1 ])
            ])
        (zero_extend:HI (reg:QI 48 [ inactivityTimer ]))) reproducer.cpp:10 -1
     (nil))
reproducer.cpp:11:1: internal compiler error: in extract_insn, at recog.c:2123
Please submit a full bug report,
with preprocessed source if appropriate.


Additional information:
$ avr-gcc -v
Using built-in specs.
COLLECT_GCC=avr-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/avr/4.7.0/lto-wrapper
Target: avr
Configured with: ../gcc-4.7-20120128/configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info --target=avr
--enable-languages=c,c++ --disable-nls --disable-libssp --with-system-zlib
--enable-version-specific-runtime-libs --with-pkgversion='Fedora 4.7-2.fc16'
--with-bugurl=https://bugzilla.redhat.com/
Thread model: single
gcc version 4.7.0 20120128 (experimental) (Fedora 4.7-2.fc16)


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

* [Bug rtl-optimization/52113] [4.7 regression][lower-subreg.c] ICE: in extract_insn, at recog.c:2123
  2012-02-03 17:35 [Bug target/52113] New: [4.7 regression][avr] ICE: in extract_insn, at recog.c:2123 mhlavink at redhat dot com
@ 2012-02-03 18:47 ` gjl at gcc dot gnu.org
  2012-02-04  0:10 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-02-03 18:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52113

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |avr
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.6.2
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2012-02-03
          Component|target                      |rtl-optimization
                 CC|                            |gjl at gcc dot gnu.org
     Ever Confirmed|0                           |1
            Summary|[4.7 regression][avr] ICE:  |[4.7
                   |in extract_insn, at         |regression][lower-subreg.c]
                   |recog.c:2123                |ICE: in extract_insn, at
                   |                            |recog.c:2123
   Target Milestone|---                         |4.7.0

--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-02-03 18:47:10 UTC ---
The ICE happens in .split2 and can be avoided by -fno-split-wide-types

The strange concatn insn 26 is generated in pass .subreg2 after .split1
generated the following sequence for the multiply:

(insn 26 6 27 2 (set (reg:HI 55)
        (zero_extend:HI (reg:QI 48 [ inactivityTimer ]))) pr52113.cpp:10 -1
     (nil))

(insn 27 26 29 2 (set (reg:HI 56)
        (const_int 1000 [0x3e8])) pr52113.cpp:10 -1
     (nil))

(insn 29 27 30 2 (set (reg:HI 18 r18)
        (reg:HI 55)) pr52113.cpp:10 -1
     (nil))

(insn 30 29 31 2 (set (reg:HI 26 r26)
        (reg:HI 56)) pr52113.cpp:10 -1
     (nil))

(insn 31 30 32 2 (set (reg:SI 22 r22)
        (mult:SI (zero_extend:SI (reg:HI 18 r18))
            (zero_extend:SI (reg:HI 26 r26)))) pr52113.cpp:10 -1
     (nil))

(insn 32 31 9 2 (set (reg:SI 49)
        (reg:SI 22 r22)) pr52113.cpp:10 -1
     (nil))

The sequence comes from .split1 that splitted the following pattern that was
sythesized by combine:

(insn 8 6 9 2 (parallel [
            (set (reg:SI 49)
                (mult:SI (zero_extend:SI (reg:QI 48 [ inactivityTimer ]))
                    (const_int 1000 [0x3e8])))
            (clobber (reg:HI 26 r26))
            (clobber (reg:DI 18 r18))
        ]) pr52113.cpp:10 111 {muluqisi3}


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

* [Bug rtl-optimization/52113] [4.7 regression][lower-subreg.c] ICE: in extract_insn, at recog.c:2123
  2012-02-03 17:35 [Bug target/52113] New: [4.7 regression][avr] ICE: in extract_insn, at recog.c:2123 mhlavink at redhat dot com
  2012-02-03 18:47 ` [Bug rtl-optimization/52113] [4.7 regression][lower-subreg.c] " gjl at gcc dot gnu.org
@ 2012-02-04  0:10 ` jakub at gcc dot gnu.org
  2012-02-04  1:15 ` gjl at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-04  0:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52113

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-04 00:10:04 UTC ---
Created attachment 26568
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26568
gcc47-pr52113.patch

Untested fix.  The problem is that lower-subreg relies on recog_memoized being
performed on all insns before changing decomposable regs into concatn, because
otherwise they might not be recognized.  They will be fixed up during the pass
later on, but if they weren't recognized first, extract_insn will already ICE.

Don't have time to test this for avr, will only include it in my next
x86_64/i686 bootstrap/regtest.


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

* [Bug rtl-optimization/52113] [4.7 regression][lower-subreg.c] ICE: in extract_insn, at recog.c:2123
  2012-02-03 17:35 [Bug target/52113] New: [4.7 regression][avr] ICE: in extract_insn, at recog.c:2123 mhlavink at redhat dot com
  2012-02-03 18:47 ` [Bug rtl-optimization/52113] [4.7 regression][lower-subreg.c] " gjl at gcc dot gnu.org
  2012-02-04  0:10 ` jakub at gcc dot gnu.org
@ 2012-02-04  1:15 ` gjl at gcc dot gnu.org
  2012-02-04  7:39 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-02-04  1:15 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52113

--- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-02-04 01:14:53 UTC ---
Thanks.

For the testcase, omit -mmcu=. That option is set by board.exp during
testsuite:

-/* { dg-options "-O1" } */
+/* { dg-options "-O1 -mmcu=atmega64" } */


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

* [Bug rtl-optimization/52113] [4.7 regression][lower-subreg.c] ICE: in extract_insn, at recog.c:2123
  2012-02-03 17:35 [Bug target/52113] New: [4.7 regression][avr] ICE: in extract_insn, at recog.c:2123 mhlavink at redhat dot com
                   ` (2 preceding siblings ...)
  2012-02-04  1:15 ` gjl at gcc dot gnu.org
@ 2012-02-04  7:39 ` jakub at gcc dot gnu.org
  2012-02-04 12:48 ` jakub at gcc dot gnu.org
  2012-02-04 12:59 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-04  7:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52113

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-04 07:39:14 UTC ---
Then it should be just a gcc.c-torture/compile/ test instead.


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

* [Bug rtl-optimization/52113] [4.7 regression][lower-subreg.c] ICE: in extract_insn, at recog.c:2123
  2012-02-03 17:35 [Bug target/52113] New: [4.7 regression][avr] ICE: in extract_insn, at recog.c:2123 mhlavink at redhat dot com
                   ` (3 preceding siblings ...)
  2012-02-04  7:39 ` jakub at gcc dot gnu.org
@ 2012-02-04 12:48 ` jakub at gcc dot gnu.org
  2012-02-04 12:59 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-04 12:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52113

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-04 12:47:58 UTC ---
Author: jakub
Date: Sat Feb  4 12:47:55 2012
New Revision: 183894

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183894
Log:
    PR rtl-optimization/52113
    * lower-subreg.c (decompose_multiword_subregs): Call recog_memoized
    even for decomposable shift/zext insns.

    * gcc.target/avr/pr52113.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr52113.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lower-subreg.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/52113] [4.7 regression][lower-subreg.c] ICE: in extract_insn, at recog.c:2123
  2012-02-03 17:35 [Bug target/52113] New: [4.7 regression][avr] ICE: in extract_insn, at recog.c:2123 mhlavink at redhat dot com
                   ` (4 preceding siblings ...)
  2012-02-04 12:48 ` jakub at gcc dot gnu.org
@ 2012-02-04 12:59 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-04 12:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52113

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-04 12:58:44 UTC ---
Fixed.


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

end of thread, other threads:[~2012-02-04 12:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-03 17:35 [Bug target/52113] New: [4.7 regression][avr] ICE: in extract_insn, at recog.c:2123 mhlavink at redhat dot com
2012-02-03 18:47 ` [Bug rtl-optimization/52113] [4.7 regression][lower-subreg.c] " gjl at gcc dot gnu.org
2012-02-04  0:10 ` jakub at gcc dot gnu.org
2012-02-04  1:15 ` gjl at gcc dot gnu.org
2012-02-04  7:39 ` jakub at gcc dot gnu.org
2012-02-04 12:48 ` jakub at gcc dot gnu.org
2012-02-04 12:59 ` jakub at gcc dot gnu.org

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