+++ 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.
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
I have a patch.
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
Fixed.