Dead-code elimination can't remove string copy insns?
law@redhat.com
law@redhat.com
Tue May 13 17:38:00 GMT 2003
In message <20030513170722.GA7112@tornado.toronto.redhat.com>, Diego Novillo wr
ites:
>On Tue, May 13, 2003 at 09:40:33AM -0700, Zack Weinberg wrote:
>
>> gcc.dg/const-elim-1.c. On an x86, compile it with -march=i386 -O2;
>> rs6000-ibm-aix5 and arm-elf also show the problem.
>>
>Yup, tree-ssa handles it. The original program in GIMPLE form is
>on the left. The optimized version is on the right (we still
>don't linearize GOTO_EXPRs).
Does this look better? :-)
test1 ()
{
int retval.6;
int T.1;
char[37] * T.2;
char * T.3;
const char * T.4;
struct S <UVda10>;
struct S * T.5;
{
int <UVdee0>;
<ULde70>:;
};
return;
}
;; Function test2 (test2)
test2 ()
{
int retval.11;
char[40] * T.7;
char * T.8;
int T.9;
struct S * S.10;
const char * str;
struct S S;
const complex double cplx;
{
int <UVc230>;
<ULc1c0>:;
};
return;
}
;; Function returns_23 (returns_23)
returns_23 ()
{
return 23;
}
Note the GOTOs are gone :-)
The problem was the code didn't match the toplevel comments in regards
to when the pass should be repeated. Basically we want to repeat if
we eliminated a control structure as that can in turn expose more
GOTOs that we know how to eliminate.
Testing of the fix is in progress.
jeff
More information about the Gcc
mailing list