Bug 43234 - ICE with per-function -ftree-loop-distribution (via attribute optimize or pragma)
Summary: ICE with per-function -ftree-loop-distribution (via attribute optimize or pra...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-02 19:30 UTC by Zdenek Sojka
Modified: 2012-12-05 09:49 UTC (History)
5 users (show)

See Also:
Host: x86(_64)-pc-linux-gnu
Target: x86(_64)-pc-linux-gnu
Build:
Known to work:
Known to fail: 4.4.4, 4.5.0
Last reconfirmed:


Attachments
reduced testcase (127 bytes, text/plain)
2010-03-02 19:32 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2010-03-02 19:30:47 UTC
Command line:
gcc -O1 -c testcase.c

Tested revisions:
trunk r157161 x86_64 - segfault
trunk r156472 i686   - segfault
trunk r153685 x86_64 - segfault
4.4 r157120 x86_64 - assert at tree-nrv.c:143
4.4 r156591 i686   - OK
4.4 r149995 x86_64 - assert at tree-nrv.c:143
(all with checking=yes)

Output - trunk:
$ valgrind --trace-children=yes /mnt/svn/gcc-trunk/binary-157161/bin/gcc -O1 -c testcase.c
...
==22758==
==22758== Invalid read of size 2
==22758==    at 0x6E51B6: mark_jump_label_1 (jump.c:1027)
==22758==    by 0x6E531F: mark_jump_label_1 (jump.c:1141)
==22758==    by 0x6E531F: mark_jump_label_1 (jump.c:1141)
==22758==    by 0x6E531F: mark_jump_label_1 (jump.c:1141)
==22758==    by 0x6E563E: rebuild_jump_labels (jump.c:199)
==22758==    by 0x5711EC: gimple_expand_cfg (cfgexpand.c:3773)
==22758==    by 0x72531A: execute_one_pass (passes.c:1567)
==22758==    by 0x7255A4: execute_pass_list (passes.c:1622)
==22758==    by 0x81B594: tree_rest_of_compilation (tree-optimize.c:413)
==22758==    by 0x99DBB0: cgraph_expand_function (cgraphunit.c:1545)
==22758==    by 0x9A0584: cgraph_optimize (cgraphunit.c:1624)
==22758==    by 0x9A0AE4: cgraph_finalize_compilation_unit (cgraphunit.c:1093)
==22758==  Address 0xffffffff00000020 is not stack'd, malloc'd or (recently) free'd
==22758==
testcase.c: In function 'foo':
testcase.c:15:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Output - 4.4 x86_64:
$ /mnt/svn/gcc-4_4/binary-157120-enable-checking/bin/gcc -O1 -c testcase.c
testcase.c: In function &#8216;bar&#8217;:
testcase.c:5: internal compiler error: in tree_nrv, at tree-nrv.c:143
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Zdenek Sojka 2010-03-02 19:32:50 UTC
Created attachment 20004 [details]
reduced testcase

Crashes with both
__attribute__((optimize("-ftree-loop-distribution")))
and
__attribute__((optimize("-fno-tree-loop-distribution")))

at all -O[123] levels
Comment 2 Jie Zhang 2010-03-29 13:43:26 UTC

*** This bug has been marked as a duplicate of 43564 ***
Comment 3 Jie Zhang 2010-03-29 16:08:27 UTC
The ICE on trunk is a duplicate of PR 43564. But ICE on 4.4 apparently not the same bug. Reopen it.
Comment 4 Richard Biener 2012-12-05 09:49:09 UTC
Works with 4.5+.