This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][ARM] pr50193: ICE on a | (b << negative-constant)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Andrew Stubbs <ams at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, patches at linaro dot org
- Date: Thu, 1 Sep 2011 13:21:38 +0000 (UTC)
- Subject: Re: [PATCH][ARM] pr50193: ICE on a | (b << negative-constant)
- References: <4E5F6B5F.email@example.com>
On Thu, 1 Sep 2011, Andrew Stubbs wrote:
> This patch fixes the problem by merely checking that the constant is positive.
> I've confirmed that values larger than the mode-size are not a problem because
> the compiler optimizes those away earlier, even at -O0.
Do you mean that you have observed for some testcases that they get
optimized away - or do you have reasons (if so, please state them) to
believe that any possible path through the compiler that would result in a
larger constant here (possibly as a result of constant propagation and
other optimizations) will always result in it being optimized away as
well? If it's just observation it would be better to put the complete
check in here.
Quite of few of the Csmith-generated bug reports from John Regehr have
involved constants appearing in unexpected places as a result of
transformations in the compiler. It would probably be a good idea for
someone to try using Csmith to find ARM compiler bugs (both ICEs and
wrong-code); pretty much all the bugs reported have been testing on x86
and x86_64, so it's likely there are quite a few bugs in the ARM back end
that could be found that way.
Joseph S. Myers