public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/51642] New: Weak variable reference triggers ICE with -flto option
@ 2011-12-20 17:44 sipych at gmail dot com
  2011-12-21 10:10 ` [Bug lto/51642] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: sipych at gmail dot com @ 2011-12-20 17:44 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51642
           Summary: Weak variable reference triggers ICE with -flto option
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: sipych@gmail.com


The following program triggers ICE when compiled with -flto switch.
Tested on:
- GCC 4.6.2 and 4.6.1 on ARM target;
- GCC 4.6.2 x86 target (Fedora-16, x86_64)

NOTE: trying to add/remove -fnodefaultlibs option,
trying to add __attribute__(used) to "config_np" -
just the same ICE.

<<<<
extern const int config_board;
const int config_np = 1;
#pragma weak config_board = config_np
int main(void)
{
  return config_board;
}
>>>>

Logs:
## Case 1: cross-gcc for ARM
$ /opt/arm/gnuarm-4.6.2/bin/arm-eabi-gcc -o test.ax t00x0.c -O3 -nodefaultlibs
-flto

lto1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: /opt/arm/gnuarm-4.6.2/bin/arm-eabi-gcc returned 1 exit status
/opt/arm/gnuarm-4.6.2/lib/gcc/arm-eabi/4.6.2/../../../../arm-eabi/bin/ld:
lto-wrapper failed
collect2: ld returned 1 exit status

$ /opt/arm/gnuarm-4.6.2/bin/arm-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=/opt/arm/gnuarm-4.6.2/bin/arm-eabi-gcc
COLLECT_LTO_WRAPPER=/opt/arm/gnuarm-4.6.2/libexec/gcc/arm-eabi/4.6.2/lto-wrapper
Target: arm-eabi
Configured with: ../../src/gcc-4.6.2/configure --target=arm-eabi
--prefix=/opt/arm/gnuarm-4.6.2 --enable-multilib --enable-interwork
--enable-biendian --enable-fpu --with-newlib --with-gnu-ld --with-gnu-as
--disable-nls --disable-shared --with-arch=armv5te --with-fpu=vfp
--with-float=softfp --with-abi=aapcs-linux --enable-lto
--enable-languages=c,c++ --disable-threads --enable-ppl --enable-cloog
--enable-gmp --enable-mpfr --enable-lto
-with-headers=/opt/arm/gnuarm-4.6.2/arm-eabi/include
Thread model: single
gcc version 4.6.2 (GCC)

## Case 2: Native gcc, Fedora-16
$ gcc -o test.ax t00x0.c -O3 -nodefaultlibs -flto
lto1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
lto-wrapper: /usr/bin/gcc returned 1 exit status
/usr/bin/ld: lto-wrapper failed
collect2: ld returned 1 exit status

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.6.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin
--enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-ppl --with-cloog --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.6.2 20111027 (Red Hat 4.6.2-1) (GCC)


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

end of thread, other threads:[~2014-11-19 15:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-20 17:44 [Bug lto/51642] New: Weak variable reference triggers ICE with -flto option sipych at gmail dot com
2011-12-21 10:10 ` [Bug lto/51642] " rguenth at gcc dot gnu.org
2011-12-21 20:50 ` sipych at gmail dot com
2012-01-23 12:30 ` ramana at gcc dot gnu.org
2012-01-23 13:44 ` rguenth at gcc dot gnu.org
2014-11-19 15:27 ` tbsaunde 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).