Bug 48173 - [4.6 regression] bootstrap error on arm-linux-gnueabi (defaulting to armv4t)
Summary: [4.6 regression] bootstrap error on arm-linux-gnueabi (defaulting to armv4t)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.4
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-17 22:05 UTC by Matthias Klose
Modified: 2013-08-29 08:49 UTC (History)
2 users (show)

See Also:
Host:
Target: arm-linux-gnueabi
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-06-12 13:03:21


Attachments
Preprocessed source for segfault (158.90 KB, application/x-gzip)
2011-03-22 00:53 UTC, Hector Oron
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2011-03-17 22:05:45 UTC
according to
https://buildd.debian.org/fetch.cgi?pkg=gcc-4.6&arch=armel&ver=4.6.0~rc1-1&stamp=1300253746&file=log&as=raw

the bootstrap build fails with:

/build/buildd-gcc-4.6_4.6.0~rc1-1-armel-5jpjEr/gcc-4.6-4.6.0~rc1/build/./prev-gcc/xgcc -B/build/buildd-gcc-4.6_4.6.0~rc1-1-armel-5jpjEr/gcc-4.6-4.6.0~rc1/build/./prev-gcc/ -B/usr/arm-linux-gnueabi/bin/ -B/usr/arm-linux-gnueabi/bin/ -B/usr/arm-linux-gnueabi/lib/ -isystem /usr/arm-linux-gnueabi/include -isystem /usr/arm-linux-gnueabi/sys-include    -c   -g -O2 -gtoggle -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat  -Wno-error -DHAVE_CONFIG_H -I. -I. -I../../src/gcc -I../../src/gcc/. -I../../src/gcc/../include -I../../src/gcc/../libcpp/include  -I../../src/gcc/../libdecnumber -I../../src/gcc/../libdecnumber/dpd -I../libdecnumber    ../../src/gcc/expmed.c -o expmed.o
../../src/gcc/expmed.c: In function 'init_expmed':
../../src/gcc/expmed.c:134:3: warning: array subscript is above array bounds [-Warray-bounds]
xgcc: internal compiler error: Segmentation fault (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
make[5]: *** [expmed.o] Error 4
make[5]: Leaving directory `/build/buildd-gcc-4.6_4.6.0~rc1-1-armel-5jpjEr/gcc-4.6-4.6.0~rc1/build/gcc'
make[4]: *** [all-stage2-gcc] Error 2
make[4]: Leaving directory `/build/buildd-gcc-4.6_4.6.0~rc1-1-armel-5jpjEr/gcc-4.6-4.6.0~rc1/build'
make[3]: *** [stage2-bubble] Error 2
make[3]: Leaving directory `/build/buildd-gcc-4.6_4.6.0~rc1-1-armel-5jpjEr/gcc-4.6-4.6.0~rc1/build'
make[2]: *** [bootstrap-lean] Error 2
make[2]: Leaving directory `/build/buildd-gcc-4.6_4.6.0~rc1-1-armel-5jpjEr/gcc-4.6-4.6.0~rc1/build'
s=`cat status`; rm -f status; test $s -eq 0
make[1]: *** [stamps/05-build-stamp] Error 1


configured as:
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib  --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --disable-sjlj-exceptions --enable-checking=release --build=arm-linux-gnueabi --host=arm-linux-gnueabi --target=arm-linux-gnueabi

and the patch:
--- a/src/gcc/config/arm/linux-eabi.h
+++ b/src/gcc/config/arm/linux-eabi.h
@@ -44,7 +44,7 @@
    The ARM10TDMI core is the default for armv5t, so set
    SUBTARGET_CPU_DEFAULT to achieve this.  */
 #undef  SUBTARGET_CPU_DEFAULT
-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
 
 /* TARGET_BIG_ENDIAN_DEFAULT is set in
    config.gcc for big endian configurations.  */
Comment 1 Jakub Jelinek 2011-03-17 22:19:02 UTC
Would be nice if you could provide more details, like preprocessed source, backtrace on the segfault, ...
Comment 2 Hector Oron 2011-03-22 00:53:52 UTC
Created attachment 23746 [details]
Preprocessed source for segfault

I was also able to reproduce the bug. Find attached the preprocessed source.
Comment 3 Matthias Klose 2011-03-22 13:13:57 UTC
had to reproduce it with a local build ...

the ice is triggered with any warning, -Warray-bounds as in the example, or faster with -Wlong-long, e.g.:

  -g -O2 -Warray-bounds -Wlong-long

Program received signal SIGSEGV, Segmentation fault.
pp_base_format (pp=0x7833fc, text=0xbeee47bc) at ../../src/gcc/pretty-print.c:217
217       new_chunk_array = XOBNEW (&buffer->chunk_obstack, struct chunk_info);
(gdb) bt
#0  pp_base_format (pp=0x7833fc, text=0xbeee47bc) at ../../src/gcc/pretty-print.c:217
#1  0x00166d54 in diagnostic_report_diagnostic (context=0x937a14, diagnostic=0xbeee47bc)
    at ../../src/gcc/diagnostic.c:541
#2  0x00086fc4 in pedwarn_c90 (location=<value optimized out>, opt=250, 
    gmsgid=0x7833fc "ISO C90 does not support %<long long%>") at ../../src/gcc/c-errors.c:62
#3  0x00095930 in declspecs_add_type (loc=572947, specs=0xa95758, spec=...)
    at ../../src/gcc/c-decl.c:8780
#4  0x000b8d24 in c_parser_declspecs (parser=0x40824b60, specs=0xa95758, 
    scspec_ok=<value optimized out>, typespec_ok=<value optimized out>, start_attr_ok=1 '\001', 
    la=cla_nonabstract_decl) at ../../src/gcc/c-parser.c:2090
#5  0x000b9c80 in c_parser_parameter_declaration (parser=0x40824b60, attrs=<value optimized out>)
    at ../../src/gcc/c-parser.c:3230
#6  0x000b9f84 in c_parser_parms_list_declarator (parser=0x40824b60, id_list_ok=<value optimized out>, 
    attrs=<value optimized out>) at ../../src/gcc/c-parser.c:3137
#7  c_parser_parms_declarator (parser=0x40824b60, id_list_ok=<value optimized out>, 
    attrs=<value optimized out>) at ../../src/gcc/c-parser.c:3085
#8  0x000ba51c in c_parser_direct_declarator_inner (parser=0x40824b60, 
    id_present=<value optimized out>, inner=0xa95738) at ../../src/gcc/c-parser.c:3015
#9  0x000b13b0 in c_parser_declaration_or_fndef (parser=0x40824b60, fndef_ok=1 '\001', 
    static_assert_ok=<value optimized out>, empty_ok=<value optimized out>, nested=0 '\000', 
    start_attr_ok=1 '\001', objc_foreach_object_declaration=0x0) at ../../src/gcc/c-parser.c:1576
#10 0x000bd2d4 in c_parser_external_declaration (parser=0x40824b60) at ../../src/gcc/c-parser.c:1332
#11 0x000bdfdc in c_parser_translation_unit () at ../../src/gcc/c-parser.c:1220
#12 c_parse_file () at ../../src/gcc/c-parser.c:9950
#13 0x000eb36c in c_common_parse_file () at ../../src/gcc/c-family/c-opts.c:1077
#14 0x00333650 in compile_file (argc=11085600, argv=0x40024de0) at ../../src/gcc/toplev.c:579
#15 do_compile (argc=11085600, argv=0x40024de0) at ../../src/gcc/toplev.c:1900
#16 toplev_main (argc=11085600, argv=0x40024de0) at ../../src/gcc/toplev.c:1963
#17 0x000f94e0 in main (argc=<value optimized out>, argv=<value optimized out>)
    at ../../src/gcc/main.c:36
(gdb) p buffer
$1 = (output_buffer *) 0x204f5349
(gdb) p buffer->chunk_obstack
Cannot access memory at address 0x204f5375
Comment 4 Hector Oron 2011-03-22 14:25:00 UTC
Hello,

  I also attempted a backtrace, but I am not sure if it is done properly.

(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/zumbi/gcc-4.6-4.6.0~rc1/build/prev-gcc/xgcc -B/home/zumbi/gcc-4.6-4.6.0\~rc1/build/./prev-gcc/ -B/usr/arm-linux-gnueabi/bin/ -B/usr/arm-linux-gnueabi/bin/ -B/usr/arm-linux-gnueabi/lib/ -isystem /usr/arm-linux-gnueabi/include -isystem /usr/arm-linux-gnueabi/sys-include -c -g -O2 -gtoggle -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -Wno-error -DHAVE_CONFIG_H -I. -I. -I../../src/gcc -I../../src/gcc/. -I../../src/gcc/../include -I../../src/gcc/../libcpp/include -I../../src/gcc/../libdecnumber -I../../src/gcc/../libdecnumber/dpd -I../libdecnumber ../../src/gcc/expmed.c -o expmed.o
../../src/gcc/expmed.c: In function 'init_expmed':
../../src/gcc/expmed.c:134:3: warning: array subscript is above array bounds [-Warray-bounds]

Breakpoint 2, internal_error (gmsgid=0x25d10 "%s (program %s)") at ../../src/gcc/diagnostic.c:838
838       diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_ICE);
(gdb) bt
#0  internal_error (gmsgid=0x25d10 "%s (program %s)") at ../../src/gcc/diagnostic.c:838
#1  0x0000ee98 in execute () at ../../src/gcc/gcc.c:2694
#2  0x0000f31c in do_spec_1 (spec=0x57890 "-o %|.s |\n as %(asm_options) %m.s %A", inswitch=<value optimized out>, soft_matched_part=0x0) at ../../src/gcc/gcc.c:4470
#3  0x00011874 in process_brace_body (p=<value optimized out>) at ../../src/gcc/gcc.c:5721
#4  handle_braces (p=<value optimized out>) at ../../src/gcc/gcc.c:5634
#5  0x0000fd78 in do_spec_1 (spec=0x57818 "   %{fcompare-debug=*|fdump-final-insns=*:%:compare-debug-dump-opt()}   %{!S:-o %|.s |\n as %(asm_options) %m.s %A }", inswitch=<value optimized out>, soft_matched_part=0x0) at ../../src/gcc/gcc.c:5107
#6  0x00011874 in process_brace_body (p=<value optimized out>) at ../../src/gcc/gcc.c:5721
#7  handle_braces (p=<value optimized out>) at ../../src/gcc/gcc.c:5634
#8  0x0000fd78 in do_spec_1 (spec=0x504f8 "%{!fwpa:   %{fcompare-debug=*|fdump-final-insns=*:%:compare-debug-dump-opt()}   %{!S:-o %|.s |\n as %(asm_options) %m.s %A }  }", inswitch=<value optimized out>, soft_matched_part=0x0) at ../../src/gcc/gcc.c:5107
#9  0x0000f5c4 in do_spec_1 (spec=0x57668 "%(invoke_as)", inswitch=<value optimized out>, soft_matched_part=0x0) at ../../src/gcc/gcc.c:5214
#10 0x00011874 in process_brace_body (p=<value optimized out>) at ../../src/gcc/gcc.c:5721
#11 handle_braces (p=<value optimized out>) at ../../src/gcc/gcc.c:5634
#12 0x0000fd78 in do_spec_1 (spec=0x571d8 "          %{traditional:%eGNU C no longer supports -traditional without -E}      %{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \t  %(cpp_options) -o %{save-temps*:%b.i} %{!save-te"..., inswitch=<value optimized out>, soft_matched_part=0x0) at ../../src/gcc/gcc.c:5107
#13 0x00011874 in process_brace_body (p=<value optimized out>) at ../../src/gcc/gcc.c:5721
#14 handle_braces (p=<value optimized out>) at ../../src/gcc/gcc.c:5634
#15 0x0000fd78 in do_spec_1 (spec=0x57010 "%{!MM:          %{traditional:%eGNU C no longer supports -traditional without -E}      %{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \t  %(cpp_options) -o %{save-temps*:%b.i} %{!s"..., inswitch=<value optimized out>, soft_matched_part=0x0) at ../../src/gcc/gcc.c:5107
#16 0x00011874 in process_brace_body (p=<value optimized out>) at ../../src/gcc/gcc.c:5721
#17 handle_braces (p=<value optimized out>) at ../../src/gcc/gcc.c:5634
#18 0x0000fd78 in do_spec_1 (spec=0x56e48 "%{!M:%{!MM:          %{traditional:%eGNU C no longer supports -traditional without -E}      %{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \t  %(cpp_options) -o %{save-temps*:%b.i}"..., inswitch=<value optimized out>, soft_matched_part=0x0) at ../../src/gcc/gcc.c:5107
#19 0x00011874 in process_brace_body (p=<value optimized out>) at ../../src/gcc/gcc.c:5721
#20 handle_braces (p=<value optimized out>) at ../../src/gcc/gcc.c:5634
#21 0x0000fd78 in do_spec_1 (spec=0x27b48 "%{E|M|MM:%(trad_capable_cpp) %(cpp_options) %(cpp_debug_options)}      %{!E:%{!M:%{!MM:          %{traditional:%eGNU C no longer supports -traditional without -E}      %{save-temps*|traditional-cpp|no"..., inswitch=<value optimized out>, soft_matched_part=0x0) at ../../src/gcc/gcc.c:5107
#22 0x00010d64 in do_spec_2 (spec=<value optimized out>) at ../../src/gcc/gcc.c:4172
#23 0x00011cb4 in do_spec (spec=<value optimized out>) at ../../src/gcc/gcc.c:4139
#24 0x00014454 in main (argc=41, argv=0xbe82f4f4) at ../../src/gcc/gcc.c:6723

23MB core file available at:
http://people.debian.org/~zumbi/tmp/core

Cheers
Comment 5 Richard Biener 2011-06-12 13:03:21 UTC
Can somebody re-confirm this bug?  Which version bootstrapped ok?
Comment 6 Jakub Jelinek 2011-06-27 12:33:13 UTC
GCC 4.6.1 is being released.
Comment 7 Jakub Jelinek 2011-10-26 17:14:03 UTC
GCC 4.6.2 is being released.
Comment 8 Jakub Jelinek 2012-03-01 14:39:24 UTC
GCC 4.6.3 is being released.
Comment 9 Jakub Jelinek 2013-04-12 15:47:07 UTC
Does this work with 4.7+?  The 4.6 branch is now closed.
Comment 10 Richard Biener 2013-08-29 08:49:58 UTC
Fixed in 4.7, 4.6 is out of maintainance.