This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Dead-code elimination can't remove string copy insns?
- From: law at redhat dot com
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: Zack Weinberg <zack at codesourcery dot com>, Michael Matz <matz at suse dot de>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 13 May 2003 11:38:47 -0600
- Subject: Re: Dead-code elimination can't remove string copy insns?
- Reply-to: law at redhat dot com
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