This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR mid-end/17657: Truncate case ranges to index's type
- From: Steven Bosscher <stevenb at suse dot de>
- To: Roger Sayle <roger at eyesopen dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 11 Oct 2004 08:52:41 +0200
- Subject: Re: [PATCH] PR mid-end/17657: Truncate case ranges to index's type
- Organization: SUSE Labs
- References: <Pine.LNX.4.44.0410101643590.24492-100000@www.eyesopen.com>
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