Bug 55997 - build of libstd3++ segfaults armv5tel.
Summary: build of libstd3++ segfaults armv5tel.
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-15 21:42 UTC by sean
Modified: 2015-01-16 14:42 UTC (History)
2 users (show)

See Also:
Host:
Target: arm
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sean 2013-01-15 21:42:57 UTC
Using:
[root@kirkwood-f18-v5tel gcc-4.8-20130113]# gcc -v
Using built-in specs.
COLLECT_GCC=/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/armv5tel-redhat-linux-gnueabi/4.7.2/lto-wrapper
Target: armv5tel-redhat-linux-gnueabi
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 --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,go,lto --enable-plugin --enable-initfini-array --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 --disable-sjlj-exceptions --build=armv5tel-redhat-linux-gnueabi
Thread model: posix
gcc version 4.7.2 20121109 (Red Hat 4.7.2-8) (GCC) 

---
building gcc-4.8.-20130113 with just ./configure 

/home/so/gcc-4.8-20130113/host-armv5tel-unknown-linux-gnueabi/gcc/xgcc -shared-libgcc -B/home/so/gcc-4.8-20130113/host-armv5tel-unknown-linux-gnueabi/gcc -nostdinc++ -L/home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3/src -L/home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3/src/.libs -B/usr/local/armv5tel-unknown-linux-gnueabi/bin/ -B/usr/local/armv5tel-unknown-linux-gnueabi/lib/ -isystem /usr/local/armv5tel-unknown-linux-gnueabi/include -isystem /usr/local/armv5tel-unknown-linux-gnueabi/sys-include    -x c++-header -nostdinc++ -g -O2 -D_GNU_SOURCE -I/home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3/include/armv5tel-unknown-linux-gnueabi -I/home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3/include -I/home/so/gcc-4.8-20130113/libstdc++-v3/libsupc++ -O2 -g -std=gnu++0x /home/so/gcc-4.8-20130113/libstdc++-v3/include/precompiled/stdc++.h \
-o armv5tel-unknown-linux-gnueabi/bits/stdc++.h.gch/O2ggnu++0x.gch
In file included from /home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3/include/random:52:0,
                 from /home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3/include/bits/stl_algo.h:67,
                 from /home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3/include/algorithm:63,
                 from /home/so/gcc-4.8-20130113/libstdc++-v3/include/precompiled/stdc++.h:65:
/home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3/include/bits/random.tcc: In function ‘_RealType std::generate_canonical(_UniformRandomNumberGenerator&)’:
/home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3/include/bits/random.tcc:3468:59:   in constexpr expansion of ‘std::log(2.0e+0l)’
/home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3/include/bits/random.tcc:3468:59: internal compiler error: Segmentation fault
       const size_t __log2r = std::log(__r) / std::log(2.0L);
                                                           ^
0x96e763 crash_signal
	../.././gcc/toplev.c:332
0x47bcd7 do_mpfr_arg1
	../.././gcc/builtins.c:13680
0x461d6b fold_builtin_logarithm
	../.././gcc/builtins.c:8255
0x472433 fold_builtin_1
	../.././gcc/builtins.c:10508
0x4741db fold_builtin_n
	../.././gcc/builtins.c:11054
0x474a07 fold_call_expr(unsigned int, tree_node*, bool)
	../.././gcc/builtins.c:11181
0x66e92f fold(tree_node*)
	../.././gcc/fold-const.c:14343
0x321613 cxx_eval_builtin_function_call
	../.././gcc/cp/semantics.c:6460
0x32219b cxx_eval_call_expression
	../.././gcc/cp/semantics.c:6603
0x327613 cxx_eval_constant_expression
	../.././gcc/cp/semantics.c:7691
0x327727 cxx_eval_constant_expression
	../.././gcc/cp/semantics.c:7712
0x32262b cxx_eval_call_expression
	../.././gcc/cp/semantics.c:6695
0x327613 cxx_eval_constant_expression
	../.././gcc/cp/semantics.c:7691
0x3283d3 cxx_eval_outermost_constant_expr
	../.././gcc/cp/semantics.c:7992
0x328c13 maybe_constant_value(tree_node*)
	../.././gcc/cp/semantics.c:8103
0x1f0d9f build_non_dependent_expr(tree_node*)
	../.././gcc/cp/pt.c:20207
0x2b7137 build_x_binary_op(unsigned int, tree_code, tree_node*, tree_code, tree_node*, tree_code, tree_node**, int)
	../.././gcc/cp/typeck.c:3670
0x26f697 cp_parser_binary_expression
	../.././gcc/cp/parser.c:7476
0x26fa3b cp_parser_assignment_expression
	../.././gcc/cp/parser.c:7584
0x26fecf cp_parser_constant_expression
	../.././gcc/cp/parser.c:7815
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[5]: *** [armv5tel-unknown-linux-gnueabi/bits/stdc++.h.gch/O2ggnu++0x.gch] Error 1
make[5]: Leaving directory `/home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3/include'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/so/gcc-4.8-20130113/armv5tel-unknown-linux-gnueabi/libstdc++-v3'
make[2]: *** [all-stage1-target-libstdc++-v3] Error 2
make[2]: Leaving directory `/home/so/gcc-4.8-20130113'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/so/gcc-4.8-20130113'
make: *** [all] Error 2
Comment 1 Richard Biener 2013-01-16 10:07:07 UTC
While generating a PCH ... ugh.
Comment 2 helo 2013-01-21 23:21:19 UTC
Hitting this bug on x86. gcc 4.7.2 (and 4.7.1).

Can't pinpoint why I haven't experienced it before today.
I haven't investigated yet, but I'm working around it with:

sed -i -e 's/std::log(2.0L)/0.693147/' libstdc++-v3/include/bits/random.tcc

0.693147 comes from mytest.cpp: cout << std::log(2.0L);

HTH
Comment 3 Ramana Radhakrishnan 2015-01-16 14:42:38 UTC
There is very little here to help reproduce this issue especially as I see others building 4.8.x based compilers on gcc-testresults even today.

I think I'm going to mark this as WONTFIX until we know more and let's reopen this if the problem still exists.