public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53065] New: ICE replace_reg_with_saved_mem, at caller-save.c:1125
@ 2012-04-21 15:18 webbot at webbot dot org.uk
  2012-04-22 23:36 ` [Bug other/53065] " gjl at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: webbot at webbot dot org.uk @ 2012-04-21 15:18 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53065
           Summary: ICE replace_reg_with_saved_mem, at caller-save.c:1125
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: webbot@webbot.org.uk


Created attachment 27213
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27213
Pre-processor output

Environment: Windows 7 (64 bit). Compiler source v4.7.0 compiled under CygWin
for "avr" target.

avr-g++ -v -save-temps  -g -Wall -Wextra -DF_CPU=8000000 -mmcu=atmega328p
-gdwarf-2 -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields
-fno-threadsafe-statics -fno-strict-aliasing -fwrapv  -I"../../.." -Os -c -o
AHRS.o AHRS.cpp

outputs

Using built-in specs.
COLLECT_GCC=avr-g++
Target: avr
Configured with: ../configure --target=avr --prefix=/cygdrive/c/avrgcc
--with-gm
p-lib=/usr/local/lib --with-mpfr-lib=/usr/local/lib
--with-mpc-lib=/usr/local/li
b --with-dwarf2 --enable-languages=c,c++ --disable-libssp --disable-nls
Thread model: single
gcc version 4.7.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-g' '-Wall' '-Wextra' '-D'
'F_CPU=800000
0' '-mmcu=atmega328p' '-gdwarf-2' '-fpack-struct' '-fshort-enums'
'-funsigned-ch
ar' '-funsigned-bitfields' '-fno-threadsafe-statics' '-fno-strict-aliasing'
'-fw
rapv' '-I' '../../..' '-Os' '-c' '-o' 'AHRS.o'
 /cygdrive/c/avrgcc/libexec/gcc/avr/4.7.0/cc1plus.exe -E -quiet -v -I ../../..
-
imultilib avr5 -D F_CPU=8000000 AHRS.cpp -mmcu=atmega328p -Wall -Wextra
-fpack-s
truct -fshort-enums -funsigned-char -funsigned-bitfields
-fno-threadsafe-statics
 -fno-strict-aliasing -fwrapv -g -gdwarf-2 -fworking-directory -Os
-fpch-preproc
ess -fno-rtti -fno-enforce-eh-specs -fno-exceptions -o AHRS.ii
ignoring nonexistent directory
"/cygdrive/c/avrgcc/lib/gcc/avr/4.7.0/../../../..
/avr/include/c++/4.7.0"
ignoring nonexistent directory
"/cygdrive/c/avrgcc/lib/gcc/avr/4.7.0/../../../..
/avr/include/c++/4.7.0/avr/avr5"
ignoring nonexistent directory
"/cygdrive/c/avrgcc/lib/gcc/avr/4.7.0/../../../..
/avr/include/c++/4.7.0/backward"
ignoring nonexistent directory
"/cygdrive/c/avrgcc/lib/gcc/avr/4.7.0/../../../..
/avr/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 ../../..
 /cygdrive/c/avrgcc/lib/gcc/avr/4.7.0/include
 /cygdrive/c/avrgcc/lib/gcc/avr/4.7.0/include-fixed
 /cygdrive/c/avrgcc/lib/gcc/avr/4.7.0/../../../../avr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-g' '-Wall' '-Wextra' '-D'
'F_CPU=800000
0' '-mmcu=atmega328p' '-gdwarf-2' '-fpack-struct' '-fshort-enums'
'-funsigned-ch
ar' '-funsigned-bitfields' '-fno-threadsafe-statics' '-fno-strict-aliasing'
'-fw
rapv' '-I' '../../..' '-Os' '-c' '-o' 'AHRS.o'
 /cygdrive/c/avrgcc/libexec/gcc/avr/4.7.0/cc1plus.exe -fpreprocessed AHRS.ii
-qu
iet -dumpbase AHRS.cpp -mmcu=atmega328p -auxbase-strip AHRS.o -g -gdwarf-2 -Os
-
Wall -Wextra -version -fpack-struct -fshort-enums -funsigned-char
-funsigned-bit
fields -fno-threadsafe-statics -fno-strict-aliasing -fwrapv -fno-rtti
-fno-enfor
ce-eh-specs -fno-exceptions -o AHRS.s
GNU C++ (GCC) version 4.7.0 (avr)
        compiled by GNU C version 4.5.3, GMP version 5.0.4, MPFR version 3.1.0,
MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.7.0 (avr)
        compiled by GNU C version 4.5.3, GMP version 5.0.4, MPFR version 3.1.0,
MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 318bd707d55fc0ebdb58cccdc81ea14b
AHRS.cpp:75:12: warning: unused parameter 'loopStart' [-Wunused-parameter]
AHRS.cpp:95:12: warning: unused parameter 'loopCount' [-Wunused-parameter]
AHRS.cpp:95:12: warning: unused parameter 'loopStart' [-Wunused-parameter]
AHRS.cpp: In function 'void readSensors()':
AHRS.cpp:297:1: internal compiler error: in replace_reg_with_saved_mem, at
calle
r-save.c:1125
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

I have attached the pre-processor output file AHRS.ii

It will compile ok if the optimiser is set to -O0 or -O1 .


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

* [Bug other/53065] ICE replace_reg_with_saved_mem, at caller-save.c:1125
  2012-04-21 15:18 [Bug c++/53065] New: ICE replace_reg_with_saved_mem, at caller-save.c:1125 webbot at webbot dot org.uk
@ 2012-04-22 23:36 ` gjl at gcc dot gnu.org
  2012-04-23  9:56 ` gjl at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-04-22 23:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-04-22
                 CC|                            |gjl at gcc dot gnu.org
          Component|c++                         |other
     Ever Confirmed|0                           |1

--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-04-22 23:35:49 UTC ---
Confirmed with mingw32 canadian cross for 4.7.0 and 4.7.1 (prerelease) from
2012-03-22.

The following line triggers the ICE:

$ avr-g++ -mmcu=atmega328p -gdwarf-2 -Os -c ahrs.cpp

whereas removing -gdwarf-2 works fine.

Is this a duplicate of PR52662?


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

* [Bug other/53065] ICE replace_reg_with_saved_mem, at caller-save.c:1125
  2012-04-21 15:18 [Bug c++/53065] New: ICE replace_reg_with_saved_mem, at caller-save.c:1125 webbot at webbot dot org.uk
  2012-04-22 23:36 ` [Bug other/53065] " gjl at gcc dot gnu.org
@ 2012-04-23  9:56 ` gjl at gcc dot gnu.org
  2012-04-24 11:50 ` [Bug target/53065] " gjl at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-04-23  9:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-04-23 09:56:24 UTC ---
Also confirmed with 4.8.0 from 2012-04-16 under i686-pc-linux-gnu.


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

* [Bug target/53065] ICE replace_reg_with_saved_mem, at caller-save.c:1125
  2012-04-21 15:18 [Bug c++/53065] New: ICE replace_reg_with_saved_mem, at caller-save.c:1125 webbot at webbot dot org.uk
  2012-04-22 23:36 ` [Bug other/53065] " gjl at gcc dot gnu.org
  2012-04-23  9:56 ` gjl at gcc dot gnu.org
@ 2012-04-24 11:50 ` gjl at gcc dot gnu.org
  2012-04-24 15:22 ` gjl at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-04-24 11:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu.org
              Build|4.7.0                       |

--- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-04-24 11:49:33 UTC ---
Would you please explain why this is a target issue?

The ICE occurs while caller-save.c:save_call_clobbered_regs:858 processes the
following:

(debug_insn 34 33 35 2 (var_location:SF y (concatn:SF [
            (reg:SI 16 r16)
            (reg:SI 17 r17)
            (mem/c:QI (plus:HI (reg/f:HI 32 __SP_L__)
                    (const_int 13 [0xd])) [29 S1 A8])
            (mem/c:QI (plus:HI (reg/f:HI 32 __SP_L__)
                    (const_int 14 [0xe])) [29 S1 A8])
        ])) AHRS.cpp:267 -1
     (nil))

save_mode[16] = SImode
save_mode[17] = VOIDmode

replace_reg_with_saved_mem then sees VOIDmode for R17

This looks wrong because R16 overlaps R17. All hard registers are 8 bits wide,
i.e. the next register after (reg:SI 16) is R20.

Obviously some pass generates a bad debug_insn and cannot process it.

The backend does not generate such insns.


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

* [Bug target/53065] ICE replace_reg_with_saved_mem, at caller-save.c:1125
  2012-04-21 15:18 [Bug c++/53065] New: ICE replace_reg_with_saved_mem, at caller-save.c:1125 webbot at webbot dot org.uk
                   ` (2 preceding siblings ...)
  2012-04-24 11:50 ` [Bug target/53065] " gjl at gcc dot gnu.org
@ 2012-04-24 15:22 ` gjl at gcc dot gnu.org
  2012-04-24 15:24 ` gjl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-04-24 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-04-24 15:21:36 UTC ---
Author: gjl
Date: Tue Apr 24 15:21:29 2012
New Revision: 186768

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186768
Log:
    PR target/53065
    * config/avr/avr.h (HARD_REGNO_CALL_PART_CLOBBERED): New hook define.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr.h


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

* [Bug target/53065] ICE replace_reg_with_saved_mem, at caller-save.c:1125
  2012-04-21 15:18 [Bug c++/53065] New: ICE replace_reg_with_saved_mem, at caller-save.c:1125 webbot at webbot dot org.uk
                   ` (3 preceding siblings ...)
  2012-04-24 15:22 ` gjl at gcc dot gnu.org
@ 2012-04-24 15:24 ` gjl at gcc dot gnu.org
  2012-04-24 15:27 ` gjl at gcc dot gnu.org
  2012-04-24 18:34 ` webbot at webbot dot org.uk
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-04-24 15:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-04-24 15:23:51 UTC ---
Author: gjl
Date: Tue Apr 24 15:23:46 2012
New Revision: 186770

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186770
Log:
    Backport from 2012-04-24 mainline r186768.
    PR target/53065
    * config/avr/avr.h (HARD_REGNO_CALL_PART_CLOBBERED): New hook define.


Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/config/avr/avr.h


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

* [Bug target/53065] ICE replace_reg_with_saved_mem, at caller-save.c:1125
  2012-04-21 15:18 [Bug c++/53065] New: ICE replace_reg_with_saved_mem, at caller-save.c:1125 webbot at webbot dot org.uk
                   ` (4 preceding siblings ...)
  2012-04-24 15:24 ` gjl at gcc dot gnu.org
@ 2012-04-24 15:27 ` gjl at gcc dot gnu.org
  2012-04-24 18:34 ` webbot at webbot dot org.uk
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-04-24 15:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.1

--- Comment #6 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-04-24 15:27:11 UTC ---
Fixed in 4.7.1


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

* [Bug target/53065] ICE replace_reg_with_saved_mem, at caller-save.c:1125
  2012-04-21 15:18 [Bug c++/53065] New: ICE replace_reg_with_saved_mem, at caller-save.c:1125 webbot at webbot dot org.uk
                   ` (5 preceding siblings ...)
  2012-04-24 15:27 ` gjl at gcc dot gnu.org
@ 2012-04-24 18:34 ` webbot at webbot dot org.uk
  6 siblings, 0 replies; 8+ messages in thread
From: webbot at webbot dot org.uk @ 2012-04-24 18:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from webbot at webbot dot org.uk 2012-04-24 18:34:41 UTC ---
Don't profess to understand the thread comments - but MANY THANKS for fixing in
4.7.1. Brilliant turnaround


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

end of thread, other threads:[~2012-04-24 18:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-21 15:18 [Bug c++/53065] New: ICE replace_reg_with_saved_mem, at caller-save.c:1125 webbot at webbot dot org.uk
2012-04-22 23:36 ` [Bug other/53065] " gjl at gcc dot gnu.org
2012-04-23  9:56 ` gjl at gcc dot gnu.org
2012-04-24 11:50 ` [Bug target/53065] " gjl at gcc dot gnu.org
2012-04-24 15:22 ` gjl at gcc dot gnu.org
2012-04-24 15:24 ` gjl at gcc dot gnu.org
2012-04-24 15:27 ` gjl at gcc dot gnu.org
2012-04-24 18:34 ` webbot at webbot dot org.uk

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