[PATCH] CSE some calls to compare_values

Richard Guenther richard.guenther@gmail.com
Sun Jan 7 17:11:00 GMT 2007


On 1/7/07, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> On Sun, 7 Jan 2007, Richard Guenther wrote:
>
> > Bootstrapped and tested on x86_64-unknown-linux-gnu.
> >
> > Applied to mainline.
> > Richard.
> >
> > 2007-01-07  Richard Guenther  <rguenther@suse.de>
> >
> >         * tree-vrp.c (extract_range_from_assert): CSE calls to
> >         compare_values where possible.
> >         (extract_range_from_unary_expr): Likewise.
>
>
> Wouldn't it be more natural to apply atttribute const or pure to
> compare_values() and let the optimizer to this for you (everywhere)?

Well, we'd lie to the compiler as compare_values has side-effects.  It
shouldn't break anything but I remember we concluded not to like it.
(We could also "safely" mark build_int_cst pure for example)

Richard.



More information about the Gcc-patches mailing list