[tree-ssa] dom1 bug.
Andrew MacLeod
amacleod@redhat.com
Wed Dec 17 17:15:00 GMT 2003
Here's the first bit of fallout from using my operand freelist.
dom1 appears to lose VDEFs from time to time when it rewrites stmts. A
lot of the failures I am seeing are related to dropped VDEFS.
This illustrates the point: Compile with -O2 and look at the dom1
listing
Andrew
/* This is testcase 990130-1.c. Compile with -O2 */
int count = 0;
int dummy;
static int *
bar(void)
{
++count;
return &dummy;
}
static void
foo(void)
{
asm("" : "+r"(*bar()));
}
main()
{
foo();
if (count != 1)
abort();
exit(0);
}
/* The code coming into dom1 looks like:
<D1072>_5 = &dummy;
<L0>:;
retval.6_6 = <D1072>_5;
T.3_7 = retval.6_6;
# VUSE <count_4>;
# VUSE <dummy_8>;
T.4_9 = *T.3_7;
# count_10 = VDEF <count_4>;
# dummy_11 = VDEF <dummy_8>;
__asm__("":"=r" *T.3_7:"0" T.4_9);
# VUSE <count_10>;
count.5_12 = count;
Dom1 replaces *T.3_7 with 'dummy':
<D1072>_5 = &dummy;
<L0>:;
retval.6_6 = &dummy;
T.3_7 = &dummy;
# VUSE <dummy_8>;
T.4_9 = dummy;
# dummy_11 = VDEF <dummy_8>;
__asm__("":"=r" dummy:"0" T.4_9);
# VUSE <count_10>;
count.5_12 = count;
It removes the VDEF for count_10 from the ASM, so the VUSE of count_10
now has no definition.
*/
More information about the Gcc
mailing list