This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Type conversion and addition
On Fri, 24 Mar 2006, Eric Botcazou wrote:
> > This is of course a definition of C semantics rather than tree semantics,
> > but I believe our trees follow the C semantics here.
>
> Not quite, TREE_OVERFLOW is set on the result. And the C front-end has
> explicit code to unset it:
Setting TREE_OVERFLOW here sounds like the bug. Or, if some front ends
require it for some test cases then it should be made language-specific
whether conversions of constants set TREE_OVERFLOW in this case. (For C,
gcc.dg/overflow-warn-*.c should adequately cover the diagnostics in this
area.) In the long run, TREE_OVERFLOW should go away and fold should
provide front ends with information about the sorts of overflow happening
so front ends can track their own information about what counts as
overflow in each language.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
joseph@codesourcery.com (CodeSourcery mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)