https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81110

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Ada Liu from comment #5) 
> But (65536*d[1]+d[0]) is convered to (unsigned long), should not be treated
> as unsigned?

NO.  Both C and C++ language is clear here about the expression "65536*d[1]" is
done in signed int.

> On gcc4.7.2 I can get expected result.

Yes but newer gcc optimizes more and uses the fact that signed integer overflow
is undefined behavior more.

Reply via email to