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: [PATCH] PR mid-end/17657: Truncate case ranges to index's type


On Monday 11 October 2004 01:12, Roger Sayle wrote:
> I'd argue that the ability of the middle-end to eliminate the unreachable
> cases above is a valid optimization, and shouldn't result in a diagnostic.
> Not that the middle-end should ever generate warnings, but the code above
> is valid.

Yup. I moved the cases where a warning was required to the front
end.

> Steven, are you happy with this solution?  I didn't want to approve my
> own patch without checking with you that you're OK with this approach,
> especially as this PR is currently assigned to you.

I'd prefer to do this before expand to expose as much information
as possible to the tree optimizers and to clean up switch expanding.
But for the moment I don't see how because we don't see on trees
that the index expression will be cast to a smaller type (and we
not yet have any bit propagation thing to catch the other examples
you give).
So I guess for now this will have to do :-/  At least your approach
is safe.

Thanks for looking into this,

Gr.
Steven



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