https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121747

            Bug ID: 121747
           Summary: Bus error with -flto on sun4v
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

int main (void)
{
  return 0;
}

Produces the bus error below on cfarm216 build=host=sparc-sun-solaris2.11

$ avr-ld --version
GNU ld (GNU Binutils) 2.45

Apart from -flto, the compiler seems to work ok.

## --------- ##
## Platform. ##
## --------- ##

hostname = s11-sparc.cfarm
uname -m = sun4v
uname -r = 5.11
uname -s = SunOS
uname -v = 11.4.84.201.1

/usr/bin/uname -p = sparc
/bin/uname -X     = System = SunOS
Node = s11-sparc.cfarm
Release = 5.11
KernelID = 11.4.84.201.1
Machine = sun4v
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 128

/bin/arch              = sun4
/usr/bin/arch -k       = sun4v

$ avr-gcc main.c -flto -freport-bug -v

Using built-in specs.
Reading specs from
/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/device-specs/specs-avr2
COLLECT_GCC=avr-gcc
COLLECT_LTO_WRAPPER=/home/gjl/gnu/install/gcc-15-avr/bin/../libexec/gcc/avr/15.2.0/lto-wrapper
Target: avr
Configured with: ../src-gcc/configure --with-long-double=64 --target=avr
--enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-dwarf2
--disable-nls --disable-libcc1 --disable-libssp --enable-checking=release
--prefix=/home/gjl/atest/make-avr-gcc/install-native
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 15.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-flto' '-freport-bug' '-v' '-mdouble=32'
'-mlong-double=64' '-specs=device-specs/specs-avr2' '-dumpdir' 'a-'
 /home/gjl/gnu/install/gcc-15-avr/bin/../libexec/gcc/avr/15.2.0/cc1 -quiet -v
-iprefix /home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/ main.c
-mn-flash=6 -mskip-bug -quiet -dumpdir a- -dumpbase main.c -dumpbase-ext .c
-mdouble=32 -mlong-double=64 -version -flto -freport-bug -o
/var/tmp//ccCaRoLb.s
GNU C23 (GCC) version 15.2.0 (avr)
        compiled by GNU C version 14.2.0, GMP version 6.2.1, MPFR version
4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/../../../../avr/sys-include"
ignoring duplicate directory
"/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/../../lib/gcc/avr/15.2.0/include"
ignoring duplicate directory
"/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/../../lib/gcc/avr/15.2.0/include-fixed"
ignoring nonexistent directory
"/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/../../lib/gcc/avr/15.2.0/../../../../avr/sys-include"
ignoring duplicate directory
"/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/../../lib/gcc/avr/15.2.0/../../../../avr/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/include
 /home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/include-fixed

/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/../../../../avr/include
End of search list.
Compiler executable checksum: 6074904fe33659e5c4c65e80b268a7e2
COLLECT_GCC_OPTIONS='-flto' '-freport-bug' '-v' '-mdouble=32'
'-mlong-double=64' '-specs=device-specs/specs-avr2' '-dumpdir' 'a-'

/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/../../../../avr/bin/as
-v -mmcu=avr2 -mgcc-isr -o /var/tmp//ccmF8Tqa.o /var/tmp//ccCaRoLb.s
GNU assembler version 2.45 (avr) using BFD version (GNU Binutils) 2.45
COMPILER_PATH=/home/gjl/gnu/install/gcc-15-avr/bin/../libexec/gcc/avr/15.2.0/:/home/gjl/gnu/install/gcc-15-avr/bin/../libexec/gcc/:/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/../../../../avr/bin/
LIBRARY_PATH=/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/:/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/:/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/../../../../avr/lib/
COLLECT_GCC_OPTIONS='-flto' '-freport-bug' '-v' '-mdouble=32'
'-mlong-double=64' '-specs=device-specs/specs-avr2' '-dumpdir' 'a.'
 /home/gjl/gnu/install/gcc-15-avr/bin/../libexec/gcc/avr/15.2.0/collect2
-plugin
/home/gjl/gnu/install/gcc-15-avr/bin/../libexec/gcc/avr/15.2.0/liblto_plugin.so
-plugin-opt=/home/gjl/gnu/install/gcc-15-avr/bin/../libexec/gcc/avr/15.2.0/lto-wrapper
-plugin-opt=-fresolution=/var/tmp//ccEakpEa.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lc -flto
-L/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0
-L/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc
-L/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/../../../../avr/lib
/var/tmp//ccmF8Tqa.o --start-group -lgcc -lm -lc --end-group
/home/gjl/gnu/install/gcc-15-avr/bin/../libexec/gcc/avr/15.2.0/lto-wrapper
-fresolution=/var/tmp//ccEakpEa.res -flinker-output=exec /var/tmp//ccmF8Tqa.o 
/home/gjl/gnu/install/gcc-15-avr/bin/../libexec/gcc/avr/15.2.0/lto-wrapper
-fresolution=/var/tmp//ccEakpEa.res -flinker-output=exec /var/tmp//ccmF8Tqa.o 
avr-gcc @/var/tmp//ccN9rIKb
Using built-in specs.
Reading specs from
/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/device-specs/specs-avr2
Reading specs from
/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/device-specs/specs-avr2
COLLECT_GCC=avr-gcc
Target: avr
Configured with: ../src-gcc/configure --with-long-double=64 --target=avr
--enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-dwarf2
--disable-nls --disable-libcc1 --disable-libssp --enable-checking=release
--prefix=/home/gjl/atest/make-avr-gcc/install-native
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 15.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-fno-pie'
'-fcf-protection=none' '-mn-flash=6' '-mskip-bug'   '-freport-bug' '-v'  
'-specs=device-specs/specs-avr2'  
'-fltrans-output-list=/var/tmp//ccpqNC0d.ltrans.out' '-fwpa'
'-fresolution=/var/tmp//ccEakpEa.res' '-flinker-output=exec' '-mdouble=32'
'-mlong-double=64' '-specs=device-specs/specs-avr2'

/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/../../libexec/gcc/avr/15.2.0/lto1
-mskip-bug -quiet -dumpbase ./a.wpa -mn-flash=6 -mskip-bug -mdouble=32
-mlong-double=64 -version -fno-openmp -fno-openacc -fno-pie
-fcf-protection=none -freport-bug
-fltrans-output-list=/var/tmp//ccpqNC0d.ltrans.out -fwpa
-fresolution=/var/tmp//ccEakpEa.res -flinker-output=exec @/var/tmp//cc7QmCfd
GNU GIMPLE (GCC) version 15.2.0 (avr)
        compiled by GNU C version 14.2.0, GMP version 6.2.1, MPFR version
4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COMPILER_PATH=/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/../../libexec/gcc/avr/15.2.0/:/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/../../libexec/gcc/:/home/gjl/gnu/install/gcc-15-avr/bin/../libexec/gcc/avr/15.2.0/:/home/gjl/gnu/install/gcc-15-avr/bin/../libexec/gcc/avr/15.2.0/:/home/gjl/gnu/install/gcc-15-avr/bin/../libexec/gcc/:/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/../../../../avr/bin/:/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/../../../../avr/bin/
LIBRARY_PATH=/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/:/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/:/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/../../../../avr/lib/
COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-fno-pie'
'-fcf-protection=none' '-mn-flash=6' '-mskip-bug'   '-freport-bug' '-v'  
'-specs=device-specs/specs-avr2'  
'-fltrans-output-list=/var/tmp//ccpqNC0d.ltrans.out' '-fwpa'
'-fresolution=/var/tmp//ccEakpEa.res' '-flinker-output=exec' '-mdouble=32'
'-mlong-double=64' '-specs=device-specs/specs-avr2' '-dumpdir' './a.wpa.'
avr-gcc @/var/tmp//ccDg1Iac
Using built-in specs.
Reading specs from
/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/device-specs/specs-avr2
Reading specs from
/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/device-specs/specs-avr2
COLLECT_GCC=avr-gcc
Target: avr
Configured with: ../src-gcc/configure --with-long-double=64 --target=avr
--enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-dwarf2
--disable-nls --disable-libcc1 --disable-libssp --enable-checking=release
--prefix=/home/gjl/atest/make-avr-gcc/install-native
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 15.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-fno-pie'
'-fcf-protection=none' '-mn-flash=6' '-mskip-bug'   '-freport-bug' '-v'  
'-specs=device-specs/specs-avr2'   '-fltrans' '-o'
'/var/tmp//ccpqNC0d.ltrans0.ltrans.o' '-mdouble=32' '-mlong-double=64'
'-specs=device-specs/specs-avr2'

/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/../../libexec/gcc/avr/15.2.0/lto1
-mskip-bug -quiet -dumpbase ./a.ltrans0.ltrans -mn-flash=6 -mskip-bug
-mdouble=32 -mlong-double=64 -version -fno-openmp -fno-openacc -fno-pie
-fcf-protection=none -freport-bug -fltrans @/var/tmp//ccsR20sa -o
/var/tmp//ccV.9_Pc.s
GNU GIMPLE (GCC) version 15.2.0 (avr)
        compiled by GNU C version 14.2.0, GMP version 6.2.1, MPFR version
4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
lto1: internal compiler error: Bus Error
0x101a037a7 internal_error(char const*, ...)
        ../../src-gcc/gcc/diagnostic-global-context.cc:517
0x100c56fbf crash_signal
        ../../src-gcc/gcc/toplev.cc:322
0x100ab9ac8 lto_create_simple_input_block(lto_file_decl_data*,
lto_section_type, char const**, unsigned long*)
        ../../src-gcc/gcc/lto-section-in.cc:265
0x100aa0323 input_symtab()
        ../../src-gcc/gcc/lto-cgraph.cc:1774
0x1006a7ea7 read_cgraph_and_symbols(unsigned int, char const**)
        ../../src-gcc/gcc/lto/lto-common.cc:2881
0x10068be47 lto_main()
        ../../src-gcc/gcc/lto/lto.cc:662
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper: fatal error: avr-gcc returned 1 exit status
compilation terminated.
/home/gjl/gnu/install/gcc-15-avr/bin/../lib/gcc/avr/15.2.0/../../../../avr/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Reply via email to