This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/80932] UBSAN: false positive as a result of distribution: c1*(c2*v1-c3*v2)=>c1*c2*v1-c1*c3*v2


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;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]