This is the mail archive of the
mailing list for the GCC project.
Re: Improve tree-ssa-forwprop
- From: law at redhat dot com
- To: kaih at khms dot westfalen dot de (Kai Henningsen)
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 14 May 2004 08:31:12 -0600
- Subject: Re: Improve tree-ssa-forwprop
- Reply-to: law at redhat dot com
In message <98q2MeDXw-B@khms.westfalen.de>, Kai Henningsen writes:
>firstname.lastname@example.org wrote on 13.05.04 in <200405132052.i4DKqX1H019492@speedy.slc.
>> + bb0:
>> + x = (typecast) a
>> + if (x) goto ... else goto ...
>> + Will be transformed into:
>> + bb0:
>> + if (a != 0) goto ... else goto ...
>> + (Assuming a is an integral type and x is a boolean or x is an
>> + integral and a is a boolean.)
>What about stuff like
> long x, a = 0xff8800;
> /* obviously in reality this wouldn't be a constant */
> x = (unsigned char) a;
> if (x) ...
In that case the folder should transform the first assignment into
x = 0;
After that the value should be propagated into the conditional and
the conditional optimized appropriately.