This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/68142] New: unsafe association of multiplication
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Oct 2015 09:14:40 +0000
- Subject: [Bug middle-end/68142] New: unsafe association of multiplication
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68142
Bug ID: 68142
Summary: unsafe association of multiplication
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
While working on PR66313 I noticed we fail for the following with
-fsanitize=undefined
int __attribute__((noinline,noclone))
i(int a)
{
return (2 * a) * (__INT_MAX__/2 + 1);
}
int main()
{
volatile tem = i(-1);
return 0;
}
this is because we simplify the above to
;; Function i (null)
;; enabled by -tree-original
{
return a * -2147483648(OVF);
}
which is of course invalid.