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: Handling non-constant bounds in extract_range_from_cond


    Why not replace 'Valid by a function call, with the
    body unknown to the optimizer (unoptimizable/inlinable/whatever)?

    R := X'Valid
    =>
    R := Check_Valid(X,bound information)
    -- and make sure the compiler cannot know anything about Check_Valid
    -- at the point of the call and is forced to generate a call

    May be there's no way to say that about a function to the backend.

    Another possibility to add some backend representation
    of "don't assume anything about this value":

    R := (no_information(X))'Valid

Somehow I just don't like the idea of purposely generating something
for the sole purpose of not allowing an optimizer to see it.  It's
indeed possible, but it seems like overkill to me for an optimization
that's not likely to be all that useful.

And, as a programmer, what do you think about the "X in Foo" operation?
Would you expect that to be the same as X'Valid or would you be
comfortable viewing that as a bounded error?


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