This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/42614] [4.4 Regression] FRE optimizes away valid code after IPA inlining
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jan 2010 11:57:05 -0000
- Subject: [Bug tree-optimization/42614] [4.4 Regression] FRE optimizes away valid code after IPA inlining
- References: <bug-42614-17160@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from rguenth at gcc dot gnu dot org 2010-01-05 11:57 -------
Shorter testcase, fails at -O2 -fno-early-inlining:
extern void abort(void);
typedef struct SEntry
{
int num;
} TEntry;
typedef struct STable
{
TEntry data[2];
} TTable;
TTable * __attribute__((noinline))
init ()
{
static TTable t;
return &t;
}
static inline void
inlined_wrong (TEntry *entry_p)
{
unsigned char index;
entry_p->num = 0;
for (index = 0; index < 1; index++)
entry_p->num++;
if (!entry_p->num)
abort();
}
void __attribute__((noinline))
expect_func (unsigned char *b)
{
if (!b)
abort ();
}
int
main ()
{
unsigned char index = 0;
TTable *table_p;
expect_func (&index);
table_p = init();
inlined_wrong (&(table_p->data[1]));
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42614