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 creating TREE_OVERFLOW constants in convert_to_integer (PR middle-end/26729)


> convert_to_integer seems to optimize truncation (shouldn't that be solely
> fold's job?), but during that can create integer overflowed constants that
> mess optimizers later on.

Yes, see for example http://gcc.gnu.org/ml/gcc/2006-03/msg00719.html and 
http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01819.html.  This code is a 
mess.

> The following patch fixes that by doing the same that e.g. the C frontend
> does after calling convert - dropping the overflow bit if it was introduced 
> during the optimization.

Would this not modify the interface front-end/middle-end wrt TREE_OVERFLOW?

> Bootstrapped/regtested on x86_64-linux, ok for trunk/4.1?

Please do not put this on the 4.1 branch.  Kazu's patch has already introduced 
regressions for Ada there (which have not been fixed yet) and I think your 
patch could introduce more.

-- 
Eric Botcazou


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