This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR optimization/11381
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Eric Botcazou <ebotcazou at libertysurf dot fr>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 02 Jul 2003 08:41:20 -0700
- Subject: Re: [PATCH] Fix PR optimization/11381
- References: <200307021004.01606.ebotcazou@libertysurf.fr>
On Wed, 2003-07-02 at 01:04, Eric Botcazou wrote:
> Hi,
>
> This is a regression from GCC 3.2.3, present on 3.3 branch and mainline.
>
> The optimizer (more precisely, the RTL simplifier) may discard volatile
> comparisons in some cases, because it forgets to check that the operands
> have no side-effects. The fix is then straightforward.
>
> Bootstrapped/regtested on i586-redhat-linux-gnu (3.3 branch except Ada). Ok
> for mainline and 3.3 branch?
Yes.
(It's interesting that -- even in the side-effects case -- we still know
the *answer*; it's just that we should still evaluate the two
expressions. That suggests that the interface to
simplify_relational_operation is suboptimal; it should give back some
code to evaluate and/or an answer. Oh, well.)
Thanks!
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com