The following causes an ICE with latest gcc 4.5.0 (svn r157452):
============================================================
cat > file1.c << EOF
struct s1_s {
int v;
};
struct s1_s g1;
void __attribute__((externally_visible)) func1() {
struct s1_s *l1 = &g1;
l1->v = 0;
}
EOF
cat > file2.c << EOF
extern struct s1_s g1;
void func2() {
&g1;
}
EOF
cc -O -g -fwhole-program -combine -c file1.c file2.c
============================================================
This appears similar to pr41893.
$ ~/src/gcc/install/bin/gcc -O -g -fwhole-program -combine -c file1.c file2.c
file1.c: In function âfunc1â:
file1.c:5:42: internal compiler error: in simplify_subreg, at
simplify-rtx.c:5139
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ ~/src/gcc/install/bin/gcc --version
gcc (GCC) 4.5.0 20100315 (experimental)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--
Summary: ICE with -combine and -g
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kevin at koconnor dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43557