This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/41577] Broken code with -O -ftree-vrp
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Oct 2009 12:02:21 -0000
- Subject: [Bug tree-optimization/41577] Broken code with -O -ftree-vrp
- References: <bug-41577-16469@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from rguenth at gcc dot gnu dot org 2009-10-05 12:02 -------
Actually the testcase is invalid.
uint32 res = ((uint16)(cpu->gprs[12] >> 16) * (uint16)(cpu->gprs[16]
>> 16));
performs a signed multiplication which invokes undefined behavior if it
overflows. Thus the compiler rightfully can assume that the result can
be converted to a positive signed value.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41577