ICE while nbench-2.2.3 compilation with -floop-parallelize-all

Bug #1227789 reported by Leo Yuriev on 2013-09-19
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Invalid
Medium
gcc-4.8 (Ubuntu)
Low
Unassigned
gcc-4.9 (Ubuntu)
Low
Unassigned
gcc-snapshot (Ubuntu)
Low
Unassigned

Bug Description

nbench source code: http://www.tux.org/~mayer/linux/bmark.html

CFLAGS = -s -static -Wall

CFLAGS += -Ofast -flto -fstrict-aliasing -fomit-frame-pointer -freciprocal-math -march=native -mrecip=all -freorder-blocks-and-partition

CFLAGS += -floop-nest-optimize -floop-parallelize-all -fgraphite-identity \
       -floop-interchange -funroll-loops

ProblemType: Crash
DistroRelease: Ubuntu 13.10
Package: cpp-4.8 4.8.1-10ubuntu3
ProcVersionSignature: Ubuntu 3.11.0-7.14-generic 3.11.1
Uname: Linux 3.11.0-7-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.12.2-0ubuntu1
Architecture: amd64
Date: Thu Sep 19 20:48:31 2013
ExecutablePath: /usr/lib/gcc/x86_64-linux-gnu/4.8/cc1
InstallationDate: Installed on 2013-06-08 (103 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
MarkForUpload: True
SourcePackage: gcc-4.8
UpgradeStatus: Upgraded to saucy on 2013-08-10 (40 days ago)

Leo Yuriev (leo-yuriev) wrote :
Leo Yuriev (leo-yuriev) on 2013-09-19
summary: - ICE while nbench-2.2.3 compilation with CLooG/Graphite enabled
+ ICE while nbench-2.2.3 compilation with -floop-parallelize-all

Created attachment 33305
Preprocessed source

gcc -O2 -floop-parallelize-all -ffast-math -c cvt.i

cvt.c: In function ‘Pobsopen’:
cvt.c:62:12: internal compiler error: Segmentation fault

Reproduced with both 4.8 and 4.9:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-unknown-linux-gnu/4.8.4/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.8-20140807/configure --prefix=/usr --enable-shared --disable-static --disable-dependency-tracking --enable-languages=c,c++ --disable-multilib --with-system-zlib --disable-bootstrap
Thread model: posix
gcc version 4.8.4 20140807 (prerelease) (GCC)

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-unknown-linux-gnu/4.9.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.9.1/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --disable-bootstrap --with-system-zlib --disable-static --disable-dependency-tracking
Thread model: posix
gcc version 4.9.1 (GCC)

Backtrace generated with gcc version 4.9.2 20140813 (prerelease)

# LANG=C gcc/cc1 -O2 -floop-parallelize-all -ffast-math /mnt/doc/cvt.i
 vprintf getchar fgetc_unlocked getc_unlocked getchar_unlocked putchar fputc_unlocked putc_unlocked putchar_unlocked feof_unlocked ferror_unlocked __signbitf __signbit __signbitl lgamma lgammaf lgammal gamma gammaf gammal tgamma tgammaf tgammal __bswap_32 __bswap_64 atoi atol atoll gnu_dev_major gnu_dev_minor gnu_dev_makedev bsearch atof mymalloc Pobsopen Pobsclose Pobspath Pobsbarriers addpt Bezier append_bezier
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data> <visibility> <early_local_cleanups> <*free_inline_summary> <whole-program> <profile_estimate> <devirt> <cp> <inline> <pure-const> <static-var>Assembling functions:
 Pobsopen
cvt.c: In function 'Pobsopen':
cvt.c:62:12: internal compiler error: Segmentation fault
0xb2a43e crash_signal
        ../../gcc-4.9-20140813/gcc/toplev.c:337
0x7f12fad2098f ???
        /usr/src/glibc/glibc-2.19/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x1201529 subtract_commutative_associative_deps
        ../../gcc-4.9-20140813/gcc/graphite-dependences.c:430
0x1201927 compute_deps(scop*, vec<poly_bb*, va_heap, vl_ptr>, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**)
        ../../gcc-4.9-20140813/gcc/graphite-dependences.c:502
0x1201b99 loop_level_carries_dependences
        ../../gcc-4.9-20140813/gcc/graphite-dependences.c:566
0x1201d07 loop_is_parallel_p(loop*, hash_table<bb_pbb_hasher, xcallocator>, int)
        ../../gcc-4.9-20140813/gcc/graphite-dependences.c:598
0x11fe45d translate_clast_for_loop
        ../../gcc-4.9-20140813/gcc/graphite-clast-to-gimple.c:1200
0x11fe512 translate_clast_for
        ../../gcc-4.9-20140813/gcc/graphite-clast-to-gimple.c:1224
0x11fe792 translate_clast
        ../../gcc-4.9-20140813/gcc/graphite-clast-to-gimple.c:1307
0x11fe886 translate_clast
        ../../gcc-4.9-20140813/gcc/graphite-clast-to-gimple.c:1327
0x11ff3b6 gloog(scop*, hash_table<bb_pbb_hasher, xcallocator>)
        ../../gcc-4.9-20140813/gcc/graphite-clast-to-gimple.c:1712
0x11fb371 graphite_transform_loops()
        ../../gcc-4.9-20140813/gcc/graphite.c:304
0x11fb406 graphite_transforms
        ../../gcc-4.9-20140813/gcc/graphite.c:332
0x11fb534 execute
        ../../gcc-4.9-20140813/gcc/graphite.c:416

Created attachment 33317
Reduced testcase

Confirmed, attaching reduced testcase

Confirmed on aarch64 4.9.1, trunk works, didn't try 4.8 though

In , Doko-v (doko-v) wrote :

this test case fails on the 4.8 and 4.9 branches, but succeeds with trunk 20140815.

$ cat tst.c
int a, b;
fn1() {
  for (; a; a++)
    b |= 1;
}

$ gcc -c -Ofast -floop-parallelize-all tst.c tst.c: In function 'fn1':
tst.c:2:1: internal compiler error: Segmentation fault
 fn1() {
 ^
Please submit a full bug report,
with preprocessed source if appropriate.

(gdb) bt
#0 0x0000000000cdf3ea in compute_deps(scop*, vec<poly_bb*, va_heap, vl_ptr>, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**, isl_union_map**) ()
#1 0x0000000000cdf913 in loop_is_parallel_p(loop*, hash_table<bb_pbb_hasher, xcallocator>, int)
    ()
#2 0x0000000000cdd9fd in ?? ()
#3 0x0000000000cddd72 in gloog(scop*, hash_table<bb_pbb_hasher, xcallocator>) ()
#4 0x0000000000cdac09 in graphite_transform_loops() ()
#5 0x0000000000cdb0f7 in ?? ()
#6 0x0000000000818b3b in execute_one_pass(opt_pass*) ()
#7 0x0000000000818dd6 in execute_pass_list(opt_pass*) ()
#8 0x0000000000818de8 in execute_pass_list(opt_pass*) ()
#9 0x0000000000818de8 in execute_pass_list(opt_pass*) ()
#10 0x0000000000818de8 in execute_pass_list(opt_pass*) ()
#11 0x000000000063f656 in ?? ()
#12 0x0000000000640f4d in compile() ()
#13 0x00000000006413a5 in finalize_compilation_unit() ()
#14 0x00000000005648ec in c_write_global_declarations() ()
#15 0x00000000008b353d in ?? ()
#16 0x00000000008b50d0 in toplev_main(int, char**) ()
#17 0x00007ffff66e7b45 in __libc_start_main (main=0x552750 <main>, argc=18,
    argv=0x7fffffffe588, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
    stack_end=0x7fffffffe578) at libc-start.c:287
#18 0x000000000055297f in _start ()

Matthias Klose (doko) wrote :

fixed with trunk 20140814

Changed in gcc-4.8 (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Changed in gcc-4.9 (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Changed in gcc-snapshot (Ubuntu):
importance: Undecided → Low
status: New → Fix Released
Changed in gcc:
importance: Unknown → Medium
status: Unknown → Confirmed

Backporting the commit r212122 from trunk fixes the error both in 4.8 and 4.9

In , Doko-v (doko-v) wrote :

this seems to be a duplicate of PR59586

*** This bug has been marked as a duplicate of bug 59586 ***

Changed in gcc:
status: Confirmed → Invalid
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.9 - 4.9.1-7ubuntu1

---------------
gcc-4.9 (4.9.1-7ubuntu1) utopic; urgency=medium

  * Update to SVN 20140817 (r214074) from the gcc-4_9-branch.
  * Fix PR middle-end/61294, -Wmemset-transposed-args, taken from the trunk.
    LP: #1352836.
  * Update the Linaro support to 4.9-2014.08.
  * Fix PR tree-optimization/59586, graphite segfault, taken from the trunk.
    LP: #1227789.

gcc-4.9 (4.9.1-7) unstable; urgency=medium

  * Build-depend on dpkg-dev (>= 1.17.11).
 -- Matthias Klose <email address hidden> Sun, 17 Aug 2014 21:30:42 +0200

Changed in gcc-4.9 (Ubuntu):
status: Confirmed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.8 - 4.8.3-9ubuntu1

---------------
gcc-4.8 (4.8.3-9ubuntu1) utopic; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from the upstream source.

gcc-4.8 (4.8.3-9) unstable; urgency=medium

  * Update to SVN 20140820 (r214213) from the gcc-4_8-branch.
  * Backport PR lto/62032.
  * Fix PR tree-optimization/59586, graphite segfault, taken from the trunk.
    LP: #1227789.
 -- Matthias Klose <email address hidden> Wed, 20 Aug 2014 12:15:53 +0200

Changed in gcc-4.8 (Ubuntu):
status: Confirmed → Fix Released

Hello Leo, or anyone else affected,

Accepted gcc-4.8 into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gcc-4.8/4.8.4-2ubuntu1~14.04 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Steve Langasek (vorlon) wrote :

Hello Leo, or anyone else affected,

Accepted gccgo-4.9 into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gccgo-4.9/4.9.3-0ubuntu4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Leo Yuriev (leo-yuriev) wrote :

Verified by gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04), no any problems.
Thank a lot.

tags: added: verification-done
removed: verification-needed
Leo Yuriev (leo-yuriev) wrote :

Also verified by:
 - gcc версия 4.7.4 (Ubuntu/Linaro 4.7.4-3ubuntu3) = Ok (without -floop-nest-optimize)
 - gcc version 4.8.5 (Ubuntu 4.8.5-1ubuntu1) = Ok
 - gcc version 4.9.3 (Ubuntu 4.9.3-5ubuntu1) = Ok
 - gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) = Ok

The verification of the Stable Release Update for gccgo-4.9 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.