This is the mail archive of the
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.firstname.lastname@example.org>
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
> 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
So I guess for now this will have to do :-/ At least your approach
Thanks for looking into this,