This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] tree-ssa-dom.c: Fix PR 14303.


> Well, the range bounds stuff is currently designed to only handle
> integers, not floats.    There's a lot of interesting issues when you
> start looking at handling floats -- NaNs come immediately to mind.
>
> The existing range should be considered a placeholder -- ultimately the
> range stuff should be largely done in the CCP engine since that engine
> can do a significantly better job at building range information (and
> probably do it more efficiently than we could in DOM).

As hinted in my mail, my interest in range bounds at the moment is
as an extremely local property.  We should in theory be able to
optimize "(x & 5) < 12" or "max (x, 6) < 4" during constant folding
without knowing anything about the range of values of actually held
in x.  As a first approximation, any unrecognized tree node can be
ascribed bounds TYPE_{MIN,MAX}_VALUE (TREE_TYPE (expr)).  Clearly
the more information that tree-ssa DOM or CCP can provide the more
accurate the approximation.  But this framework would generalize the
many "(unsigned int)x < 0" transformations currently special cased
in fold.

This could also be used, for example, to fix PR middle-end/11492 where
the middle-end is unable to determine "(int)((unsigned char)x * 1000)"
can't be negative.

Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]