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] Avoid introducing TREE_OVERFLOWs in (T)(x&cst) -> (T)x& (T)cst optimization (PR middle-end/19857)


On Tue, 15 Feb 2005, Eric Botcazou wrote:
> Sorry if this has already been mentioned, but I think your patch might be
> harmful to the Ada compiler, at least without specific counter-measures.  My
> understanding is that gigi relies on TREE_OVERFLOW being set by fold to issue
> warnings and detect CONSTRAINT_ERRORs at compile-time.  And, in some cases,
> that's vital (from Ada's viewpoint) because things would wrap around in the
> target's arithmetics, hence would go unnoticed at run-time.

In theory, this shouldn't be an issue as we have two semantically
different conversion functions, "convert" which is used directly by
the front-ends that is free to issue diagnostics, set overflow bits
etc..., and "fold_convert" which is used by the middle-end for its
own constant folding purposes, and is similar to simplify_unary_operation
at the RTL-level in that it doesn't/shouldn't care about overflow.

Provided that all of Ada's reliance on overflow bits is through its
use of its own "convert" function there shouldn't be an problem?  I
agree that any Ada issues will need to be resolved before such a
change is made.

Roger
--


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