Bug 43317 - [4.5 Regression] ICE: Segmentation fault with -fipa-struct-reorg -g
Summary: [4.5 Regression] ICE: Segmentation fault with -fipa-struct-reorg -g
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.5.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-10 00:00 UTC by Zdenek Sojka
Modified: 2010-03-15 13:17 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-03-15 13:01:49


Attachments
reduced testcase (originally comment #2 in pr43314) (140 bytes, text/plain)
2010-03-10 00:01 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-10 00:00:05 UTC
+++ This bug was initially created as a clone of Bug #43314 +++

Command line:
gcc -O1 -fipa-struct-reorg -fwhole-program -fipa-type-escape -g testcase.c

Tested revisions:
r157326 - crash
r157292 - crash
r156999 - crash
r156745 - OK
r153685 - OK
4.4 r157120 - OK

Output - trunk:
$ /mnt/svn/gcc-trunk/binary-157326-lto/bin/gcc -O1 -fipa-struct-reorg -fwhole-program -fipa-type-escape -g testcase.c 
testcase.c: In function 'main':
testcase.c:12:1: internal compiler error: Segmentation fault

Valgrind:
==25577== Invalid read of size 2
==25577==    at 0x8062DF: prepare_block_for_update (tree-into-ssa.c:2550)
==25577==    by 0x8063DA: prepare_block_for_update (tree-into-ssa.c:2568)
==25577==    by 0x80B4EA: update_ssa (tree-into-ssa.c:3317)
==25577==    by 0x9BA883: reorg_structs_drive (ipa-struct-reorg.c:3241)
==25577==    by 0x72596A: execute_one_pass (passes.c:1567)
==25577==    by 0x725DE9: execute_ipa_pass_list (passes.c:1801)
==25577==    by 0x9A181E: cgraph_optimize (cgraphunit.c:1795)
==25577==    by 0x9A1FE4: cgraph_finalize_compilation_unit (cgraphunit.c:1093)
==25577==    by 0x4B0572: c_write_global_declarations (c-decl.c:9510)
==25577==    by 0x7CAA9F: toplev_main (toplev.c:1065)
==25577==    by 0x658DBBC: (below main) (in /lib64/libc-2.11.so)
==25577==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

This could be related to pr43084.
Comment 1 Zdenek Sojka 2010-03-10 00:01:33 UTC
Created attachment 20069 [details]
reduced testcase (originally comment #2 in pr43314)

Command line:
gcc -O1 -fipa-struct-reorg -fwhole-program -fipa-type-escape -g pr43317.c
Comment 2 Richard Biener 2010-03-15 13:01:49 UTC
I have a patch.
Comment 3 Richard Biener 2010-03-15 13:05:22 UTC
Subject: Bug 43317

Author: rguenth
Date: Mon Mar 15 13:05:05 2010
New Revision: 157457

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157457
Log:
2010-03-15  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43317
	* ipa-struct-reorg.c (create_new_general_access): Update stmt.

	* gcc.dg/pr43317.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/pr43317.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-struct-reorg.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 Richard Biener 2010-03-15 13:17:04 UTC
Fixed.