GCC 4.6.3 (cc1) crashes when compiling MPFR 3.1.0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Linaro GCC |
Fix Released
|
Medium
|
Ulrich Weigand | |
| 4.6 |
Fix Released
|
Medium
|
Ulrich Weigand | |
| 4.7 |
Fix Released
|
Medium
|
Ulrich Weigand | |
| gcc |
Fix Released
|
Medium
|
||
| gcc-4.6 (Ubuntu) |
Medium
|
Unassigned | ||
| Precise |
Medium
|
Unassigned |
Bug Description
...
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_
libtool: compile: gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_
../../mpfr-
../../mpfr-
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:/
Preprocessed source stored into /tmp/ccAHajJU.out file, please attach this to your bugreport.
make[2]: *** [set_f.lo] Fehler 1
make[2]: Verlasse Verzeichnis '/tmp/mpfr-
make[1]: *** [all] Fehler 2
make[1]: Verlasse Verzeichnis '/tmp/mpfr-
make: *** [all-recursive] Fehler 1
(The segfault is reproducible.)
CFLAGS taken from an MPIR (2.1.3) installation:
#define __GMP_CC "gcc"
#define __GMP_CFLAGS " -g -O3 -march=native -O3 -g -fno-strict-
Note that MPFR compiles just fine with GCC 4.6.3 on various systems, including e.g. Ubuntu 10.04.4 LTS x86_64.
Also, this didn't happen for someone else with a previous beta of Precise (although in a 32-bit VM IIRC).
I've attached the preprocessed source, FWIW. Going to experiment with compiler flags (especially "-march=...") ...
$ lsb_release -rd
Description: Ubuntu precise (development branch)
Release: 12.04
$ LANG=en_US gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu3)
$ head -25 /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz
stepping : 7
microcode : 0x1a
cpu MHz : 800.000
cache size : 3072 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 4789.25
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
ProblemType: Crash
DistroRelease: Ubuntu 12.04
Package: cpp-4.6 4.6.3-1ubuntu3
ProcVersionSign
Uname: Linux 3.2.0-20-generic x86_64
NonfreeKernelMo
ApportVersion: 1.95-0ubuntu1
Architecture: amd64
Date: Fri Mar 30 02:26:29 2012
EcryptfsInUse: Yes
ExecutablePath: /usr/lib/
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64 (20120301)
SourcePackage: gcc-4.6
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Linaro Toolchain Developers: Pending requested 2012-04-04
- Linaro Toolchain Developers: Pending requested 2012-04-04
Sleep Less (not-really) wrote : | #1 |
Sleep Less (not-really) wrote : | #2 |
summary: |
- GCC (cc1) crashes when compiling MPFR 3.1.0 + GCC 4.6.3 (cc1) crashes when compiling MPFR 3.1.0 |
Sleep Less (not-really) wrote : | #3 |
Similar for Singular (3-1-3-3): g++ / cc1plus crashes with "-O3", builds with "-O2" instead.
Hopefully Precise won't ship with a broken compiler... Haven't had such issues with GCC 4.6.3 installations I built myself.
Sleep Less (not-really) wrote : | #4 |
Just checked: It's really only that single file of MPFR (set_f.c) Ubuntu's current GCC / cc1 crashes on with '-O3'.
After 'make' failed in the first place, I just took the libtool command ("/bin/bash ../libtool --tag=CC --mode=compile gcc ..."), replaced the two occurrences of '-O3' by '-O2', executed that, then resumed the build by typing 'make' again.
That succeeded (compiling also all remaining files with '-O3'), as well as afterwards 'make check' did (which again involves building).
(This was a build outside of and completely unrelated to Sage, with GMP 5.0.4 built from scratch, but on the same machine.)
Sleep Less (not-really) wrote : | #5 |
FWIW, I've built a "vanilla" GCC 4.6.3 from scratch (along with GMP 5.0.4, MPFR 3.1.0-p8, MPC 0.9, PPL 0.12, CLooG 0.15.11 and libelf 0.8.13), installed it (as well as the libraries) under /usr/local, and don't get any crashes with that version. In particular, both MPFR and Singular build just fine with '-O3'.
The crash on Singular 3-1-3-3 (cc1plus) with '-O3' also happens with GCC 4.6.3-1ubuntu3 in a 32-bit virtual machine (Precise with all recent updates), as a friend just confirmed. (To trigger this, one has to [also] put '-O3' into CPPFLAGS, not just CXXFLAGS, since otherwise the setting gets overridden by a subsequent '-O2' in the compile command.)
Sleep Less (not-really) wrote : | #6 |
P.S.:
$ LANG=en_US gcc-4.6.3 -v
Using built-in specs.
COLLECT_
COLLECT_
Target: x86_64-linux-gnu
Configured with: ../gcc-
Thread model: posix
gcc version 4.6.3 (GCC)
Matthias Klose (doko) wrote : | #7 |
Program received signal SIGSEGV, Segmentation fault.
0x0000000000806eb8 in supportable_
(gdb) bt
#0 0x0000000000806eb8 in supportable_
#1 0x0000000000b2b164 in ?? ()
#2 0x0000000000b2bc12 in vect_pattern_recog ()
#3 0x0000000000821045 in vect_slp_analyze_bb ()
#4 0x0000000000821d1b in ?? ()
#5 0x000000000068eab9 in execute_one_pass ()
#6 0x000000000068ed75 in execute_pass_list ()
#7 0x000000000068ed87 in execute_pass_list ()
#8 0x000000000068ed87 in execute_pass_list ()
#9 0x000000000075bf51 in tree_rest_
#10 0x00000000008a074f in ?? ()
#11 0x00000000008a23fa in cgraph_optimize ()
#12 0x00000000008a27fa in cgraph_
#13 0x00000000004a3925 in c_write_
#14 0x00000000007207be in toplev_main ()
#15 0x00007ffff6f4576d in __libc_start_main () from /lib/x86_
#16 0x00000000004932b9 in _start ()
Changed in gcc-4.6 (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Confirmed |
status: | Confirmed → Triaged |
Matthias Klose (doko) wrote : | #8 |
not seen with the FSF branch, but with the Linaro 4.6 branch
Changed in gcc-4.6 (Ubuntu Precise): | |
milestone: | none → precise-updates |
Matthias Klose (doko) wrote : | #9 |
could you provide the preprocessed source for the singular ICE as well?
Sleep Less (not-really) wrote : | #10 |
Sure.
g++ -march=native -O3 -g -fno-strict-
sparsmat.cc: In function ‘long int smExpBound(ideal, int, int, int)’:
sparsmat.cc:216:3: warning: cast to pointer from integer of different size [-Wint-
sparsmat.cc:217:3: warning: cast to pointer from integer of different size [-Wint-
sparsmat.cc: In function ‘BOOLEAN smIsNegQuot(poly, poly, poly)’:
sparsmat.
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:/
Preprocessed source stored into /data/tmp/
Traceback (most recent call last):
File "/usr/share/
import apport, apport.fileutils
ImportError: No module named apport
make[2]: *** [sparsmat.o] Error 1
make[2]: Leaving directory `/mnt/linux-
make[1]: *** [install] Error 1
make[1]: Leaving directory `/mnt/linux-
make: *** [/mnt/linux-
:-)
Sleep Less (not-really) wrote : | #11 |
Matthias Klose (doko) wrote : | #12 |
the cc1plus is another issue. now tracked in bug 972648
Michael Hope (michaelh1) wrote : | #13 |
Thank you for the bug report. I've confirmed this with gcc-linaro-
michaelh@
../../mpfr-
../../mpfr-
The fault occurs in the SLP vectoriser. The work-around is to compile at -O3 -fno-tree-
I've set it to medium priority as it is a ftbfs, has a work around, and occurs at high optimisation levels. It seems similar to LP: #960283.
The backtrace is:
supportable_
vectype_
decl2=
multi_
at ../../.
5922 loop_vec_info loop_info = STMT_VINFO_
(gdb) back
#0 supportable_
vectype_
decl2=
multi_
at ../../.
#1 0x0000000000b31ef4 in vect_recog_
type_
#2 0x0000000000b329a2 in vect_pattern_
vect_
at ../../.
#3 vect_pattern_recog (loop_vinfo=
at ../../.
#4 0x00000000008260a5 in vect_slp_
at ../../.
#5 vect_slp_analyze_bb (bb=0x7ffff52606e8) at ../../.
#6 0x0000000000826d7b in execute_vect_slp () at ../../.
Changed in gcc-linaro: | |
status: | New → Triaged |
importance: | Undecided → Medium |
assignee: | nobody → Ulrich Weigand (uweigand) |
|
#18 |
Building the following testcase with -O -ftree-vectorize on x86_64:
long
test (int *x)
{
unsigned long sx, xprec;
sx = *x >= 0 ? *x : -*x;
xprec = sx * 64;
if (sx < 16384)
foo (sx);
return xprec;
}
results in an ICE:
crash1.c:5:1: internal compiler error: vector VEC(vec_
(When building with --disable-checking, we get a segmentation fault instead.)
|
#19 |
It seems the problem is that vect_recog_
I'm testing a fix.
Ulrich Weigand (uweigand) wrote : | #14 |
This affects current FSF mainline as well. I've opened a GCC bugzilla report:
http://
Changed in gcc-linaro: | |
status: | Triaged → In Progress |
Sleep Less (not-really) wrote : | #15 |
You mean current svn trunk?
I don't get this error with (released) GCC 4.6.3 nor 4.7.0, just with Ubuntu's 4.6.3-1ubuntu3.
Also your test case from bugzilla works for me with both of these.
Michael Hope (michaelh1) wrote : | #16 |
Yip, in trunk. The fault is in the SLP vectoriser that are in trunk, our 4.7, and our 4.6. They're not in the FSF 4.7.0 release.
Maarten Bezemer (veger) wrote : | #17 |
Thanks for taking the time to report this bug in the upstream bug tracking system this is a tremendous help. Launchpad has the ability to watch lots of upstream bug trackers and this can be done by following the procedure documented at https:/
Changed in gcc: | |
importance: | Unknown → Medium |
status: | Unknown → In Progress |
|
#20 |
Patch posted:
http://
|
#21 |
Author: uweigand
Date: Tue Apr 10 10:56:11 2012
New Revision: 186272
URL: http://
Log:
gcc/
PR tree-optimizati
* tree-vect-
presumed pattern statement is within the same loop or basic block.
gcc/testsuite/
PR tree-optimizati
* gcc.dg/
Added:
trunk/
Modified:
trunk/
trunk/
trunk/
Changed in gcc: | |
status: | In Progress → Fix Released |
Ulrich Weigand (uweigand) wrote : | #23 |
Committed backports to Linaro GCC 4.6 and 4.7.
|
#24 |
*** Bug 52639 has been marked as a duplicate of this bug. ***
Launchpad Janitor (janitor) wrote : | #25 |
This bug was fixed in the package gcc-4.6 - 4.6.3-4ubuntu1
---------------
gcc-4.6 (4.6.3-4ubuntu1) quantal; urgency=low
* Update to SVN 20120425 (r186817) from the gcc-4_6-branch.
- Fix PR middle-end/53084, PR lto/48246.
* Default to armv5t, soft float on armel.
gcc-4.6 (4.6.3-4) unstable; urgency=low
[ Matthias Klose ]
* Update to SVN 20120416 (r186492) from the gcc-4_6-branch.
- Fix PR middle-end/52894, PR target/52717, PR target/52775,
PR target/52775.
* Update the Linaro support to the 4.6-2012.04 release.
* Fix PR middle-end/52870, taken from the trunk (Ulrich Weigand).
Linaro only. LP: #968766.
* Fix ICE (regression) in Linaro gcc-4.6 (Ulrich Weigand).
LP: #972648.
* Don't build ARM biarch runtime libraries, now built from the
gcc-4.7 sources.
* Set the ARM hard-float linker path according to the consensus:
http://
[ Samuel Thibault ]
* ada-s-osinte-
ada-
Add ada support for GNU/Hurd, thanks Svante Signell for the patches
and bootstrap! (Closes: #668425).
-- Matthias Klose <email address hidden> Wed, 25 Apr 2012 16:26:46 +0200
Changed in gcc-4.6 (Ubuntu): | |
status: | Triaged → Fix Released |
|
#26 |
Author: uweigand
Date: Fri May 4 14:56:48 2012
New Revision: 187162
URL: http://
Log:
2012-05-04 Ulrich Weigand <email address hidden>
Backport from mainline:
2012-05-04 Ulrich Weigand <email address hidden>
PR tree-optimizati
* tree-vect-
vect_
(vect_
already detected as over-widening pattern. Remove special handling
of "unsigned" cases. Instead, support general case of conversion
of the shift result to another type.
2012-05-04 Ulrich Weigand <email address hidden>
* tree-vect-
(vect_
(vect_
(vect_
2012-04-10 Ulrich Weigand <email address hidden>
PR tree-optimizati
* tree-vect-
presumed pattern statement is within the same loop or basic block.
2012-05-04 Ulrich Weigand <email address hidden>
Backport from mainline:
2012-05-04 Ulrich Weigand <email address hidden>
PR tree-optimizati
* gcc.dg/
recognized as widening shifts instead of over-widening.
* gcc.dg/
* gcc.dg/
* gcc.dg/
* gcc.target/
2012-04-10 Ulrich Weigand <email address hidden>
PR tree-optimizati
* gcc.dg/
Added:
branches/
branches/
Modified:
branches/
branches/
branches/
branches/
branches/
branches/
branches/
Bruno Medeiros (brunojcm) wrote : | #27 |
Any hope waiting a release of this fix to precise-backports?
I'm really disappointed with my situation, I'm trying hard to compile something that needs gcc-4.7. The only way to achieve that without compiling it myself is installing a test ppa, https:/
An then... I found this bug trying to compile mpfr. Really sad...
Sleep Less (not-really) wrote : | #28 |
Yes, it's sad Precise's gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) is still broken.
If you want to (re)build MPFR with that, use (just) '-O2', or '-O3 -fno-tree-
Or (build and) use any of FSF's / vanilla GCC 4.7.{0,1,2,3} or 4.8.0 ... :-)
Jan Groenewald (jan-aims) wrote : | #29 |
This says status: fix released and milestone: precise-updates since 2012-05.
Is the bug forgotten or expired?
It doesn't crash with "-O3" replaced by "-O2" (still with "-march=native"); also MPFR passes its test suite ('make check') with these settings / that build.