GCC g++ ICE on i586

Bug #721023 reported by Khem Raj on 2011-02-17
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linaro GCC
Fix Released
Low
Andrew Stubbs
Linaro GCC Tracking
In Progress
Undecided
Unassigned

Bug Description

Attached testcase causes GCC to ICE when cross compiled for i586 to reproduce compile the attached file with

g++ -Os -march=pentium libc-tls.c

ios_init.c: In destructor 'std::ios_base::Init::~Init()':
ios_init.c:15899:3: internal compiler error: in
dwarf2out_begin_epilogue, at dwarf2out.c:2859
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Related branches

Khem Raj (khem-raj) wrote :
Khem Raj (khem-raj) wrote :

hmm I forgot to mention that if I revert r99474 then the ICE goes away. I can not reproduce this issue with upstream gcc trunk

Michael Hope (michaelh1) wrote :

Confirmed in gcc-linaro-4.5+bzr99476. Appears at -Os on 32 bit only - x86_64 is fine, -O1 is fine, -O2 is fine.

Changed in gcc-linaro:
status: New → Triaged
importance: Undecided → Low
Michael Hope (michaelh1) wrote :

Hits an assertion at the end of dwarf2out_begin_epilogue:

  /* And emulate the state save. */
  gcc_assert (!cfa_remember.in_use);
  cfa_remember = cfa;
  cfa_remember.in_use = 1;
}

Set to low priority as it's size only in a non-code generation area.

Download full text (3.1 KiB)

This bug is still present in the 2011.03-0 milestone build. It breaks the build of eglibc's libstdc++ (and therefore the construction of a cross toolchain) at -mcpu=pentium-m -Os, which is the tuning we've been using for our embedded device.

Adding -fomit-frame-pointer makes the ICE disappear:

build@ctbu-bld5:~$ /home/build/x-tools-x86/targets/i686-cm-linux-gnu/build/build-cc/./gcc/xgcc -shared-libgcc -B/home/build/x-tools-x86/targets/i686-cm-linux-gnu/build/build-cc/./gcc -nostdinc++ -L/home/build/x-tools-x86/targets/i686-cm-linux-gnu/build/build-cc/i686-cm-linux-gnu/libstdc++-v3/src -L/home/build/x-tools-x86/targets/i686-cm-linux-gnu/build/build-cc/i686-cm-linux-gnu/libstdc++-v3/src/.libs -B/opt/x-tools/i686-cm-linux-gnu/i686-cm-linux-gnu/bin/ -B/opt/x-tools/i686-cm-linux-gnu/i686-cm-linux-gnu/lib/ -isystem /opt/x-tools/i686-cm-linux-gnu/i686-cm-linux-gnu/include -isystem /opt/x-tools/i686-cm-linux-gnu/i686-cm-linux-gnu/sys-include -I/home/build/x-tools-x86/targets/i686-cm-linux-gnu/build/build-cc/i686-cm-linux-gnu/libstdc++-v3/include/i686-cm-linux-gnu -I/home/build/x-tools-x86/targets/i686-cm-linux-gnu/build/build-cc/i686-cm-linux-gnu/libstdc++-v3/include -I/home/build/x-tools-x86/targets/src/gcc-linaro-4.5-2011.03-0/libstdc++-v3/libsupc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -g -Os -c /home/build/x-tools-x86/targets/src/gcc-linaro-4.5-2011.03-0/libstdc++-v3/src/ios_init.cc -o ios_init.o -fomit-frame-pointer

build@ctbu-bld5:~$ /home/build/x-tools-x86/targets/i686-cm-linux-gnu/build/build-cc/./gcc/xgcc -shared-libgcc -B/home/build/x-tools-x86/targets/i686-cm-linux-gnu/build/build-cc/./gcc -nostdinc++ -L/home/build/x-tools-x86/targets/i686-cm-linux-gnu/build/build-cc/i686-cm-linux-gnu/libstdc++-v3/src -L/home/build/x-tools-x86/targets/i686-cm-linux-gnu/build/build-cc/i686-cm-linux-gnu/libstdc++-v3/src/.libs -B/opt/x-tools/i686-cm-linux-gnu/i686-cm-linux-gnu/bin/ -B/opt/x-tools/i686-cm-linux-gnu/i686-cm-linux-gnu/lib/ -isystem /opt/x-tools/i686-cm-linux-gnu/i686-cm-linux-gnu/include -isystem /opt/x-tools/i686-cm-linux-gnu/i686-cm-linux-gnu/sys-include -I/home/build/x-tools-x86/targets/i686-cm-linux-gnu/build/build-cc/i686-cm-linux-gnu/libstdc++-v3/include/i686-cm-linux-gnu -I/home/build/x-tools-x86/targets/i686-cm-linux-gnu/build/build-cc/i686-cm-linux-gnu/libstdc++-v3/include -I/home/build/x-tools-x86/targets/src/gcc-linaro-4.5-2011.03-0/libstdc++-v3/libsupc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -g -Os -c /home/build/x-tools-x86/targets/src/gcc-linaro-4.5-2011.03-0/libstdc++-v3/src/ios_init.cc -o ios_init.o -fno-omit-frame-pointer
/home/build/x-tools-x86/targets/src/gcc-linaro-4.5-2011.03-0/libstdc++-v3/src/ios_init.cc: In destructor 'std::ios_base::Init::~Init()':
/home/build/x-tools-x86/targets/src/gcc-linaro-4.5-2011.03-0/libstdc++-v3/src/ios_init.cc:144:3: internal compiler error: in dwarf2out_begin_epilogue, at dwarf2out.c:2859
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for...

Read more...

I of course did not mean eglibc's libsdc++; I mean Linaro gcc's. (I was *very* tired when I wrote that.) In case it matters, the failure occurred during the "final" compiler phase (after libc installation) of a toolchain build done with crosstool-ng, using an eglibc patched similarly to current Natty.

Michael Hope (michaelh1) wrote :

Note that adding '-fno-shrink-wrap' works around the problem.

Michael Hope (michaelh1) wrote :

LP: #730860 is related.

The patch attached to https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/730860 fixed the FTBFS. I'll test the resulting system image and report back.

I've just committed a patch from Bernd Schmidt. This issue should now be fixed.

Related: lp:gcc-linaro/4.5,revno=99486

Changed in gcc-linaro:
assignee: nobody → Andrew Stubbs (ams-codesourcery)
milestone: none → 4.5-2011.04-0
status: Triaged → Fix Committed
Changed in gcc-linaro-tracking:
milestone: none → 4.7.0
Michael Hope (michaelh1) on 2011-03-20
tags: added: shrinkwrap

Bernd has now posted this upstream:

http://<email address hidden>/msg01345.html

Changed in gcc-linaro-tracking:
status: New → In Progress
Michael Hope (michaelh1) wrote :

This is fixed in more recent builds. Tested using:

michaelh@crucis:/mnt/michaelh/linaro/bugs/shrinkwrap$ ~/linaro/toolchains/gcc-linaro-4.5+bzr99502~ams-codesourcery~cs-merge-20110413-x86_64-maverick-cbuild109-crucis-x86_64r1/bin/g++ -m32 -Os -march=pentium -c ios_init.i

on x86_64.

Michael Hope (michaelh1) on 2011-04-21
Changed in gcc-linaro:
status: Fix Committed → Fix Released
tags: added: 46merge
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments