[PATCH] Avoid introducing TREE_OVERFLOWs in (T)(x&cst) -> (T)x & (T)cst optimization (PR middle-end/19857)

Eric Botcazou ebotcazou@libertysurf.fr
Tue Feb 15 21:05:00 GMT 2005


> However, I believe that all of these problems will go away in
> the near future, once the middle-end stops setting TREE_OVERFLOW
> and TREE_CONSTANT_OVERFLOW in fold_const.  I've already posted a
> patch at http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00030.html
> The only thing blocking that patch was that a C front-end maintainer
> wanted me to write an extensive set of C test cases to check that
> the C front-end would generate all the required diagnostics.

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 any cases, if you don't mind, I think you should seek some form of buy-in 
from Richard Kenner.

-- 
Eric Botcazou



More information about the Gcc-patches mailing list