This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/80932] UBSAN: false positive as a result of distribution: c1*(c2*v1-c3*v2)=>c1*c2*v1-c1*c3*v2
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 05 Jun 2017 13:37:09 +0000
- Subject: [Bug sanitizer/80932] UBSAN: false positive as a result of distribution: c1*(c2*v1-c3*v2)=>c1*c2*v1-c1*c3*v2
- Auto-submitted: auto-generated
- References: <bug-80932-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80932
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Better testcase (C and C++):
int x = 1;
long int
foo (void)
{
return ((long) (13801962912760474560ULL * x) - (long)
(15334142073106273231ULL * x)) * -6;
}
int
main ()
{
foo ();
return 0;
}