------- Comment #14 from jakub at gcc dot gnu dot org  2006-04-19 13:45 -------
It is the TREE_OVERFLOW set on 0x8000.
That seems to be created by convert_to_integer.
type in that case is unsigned short and expr is (intD.0) xD.1878 & 32768.
As the expr was using signed type, convert_to_integer decides to use
short int as typex:
                      typex = lang_hooks.types.signed_type (typex);
                    return convert (type,
                                    fold_build2 (ex_form, typex,
                                                 convert (typex, arg0),
                                                 convert (typex, arg1)));
but convert (<short int>, <int 32768>) creates <short int overflow -32768>
and since that point forward we carry the overflow bit.
I'd say convert_to_integer should be more careful here, if it sees convert on
one or both of the args created overflow bit, it should either bail out or
use unsigned type instead.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26729

Reply via email to