------- Additional Comments From dberlin at gcc dot gnu dot org  2004-11-23 
02:53 -------
(In reply to comment #8)
> yes, but if GVNPRE hoists the operation, we end up with:
> 
> int f(int i, int b, int *c)
> {
>   int ii;
>   ii = i+1;
>   if (b)
>     ;
>   else
>     *c = ii;
>   return ii;
> }
> 
> that can be later simplified to:
> 
> int f(int i, int b, int *c)
> {
>   int ii;
>   ii = i+1;
>   if (!b)
>     *c = ii;
>   return ii;
> }
> 

This is still not faster code, only smaller code.
And you'll note that with -Os, this is what we do.


In any case, i have no plan sto make GVN-PRE do this type of hoisting, as i'm
not so interested in code size.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|dberlin at gcc dot gnu dot  |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15559

Reply via email to