[Bug sanitizer/80800] New: UBSAN: yet another false positive

babokin at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed May 17 08:10:00 GMT 2017


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

            Bug ID: 80800
           Summary: UBSAN: yet another false positive
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: babokin at gmail dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

gcc rev248130, x86_64

> cat f.cpp
short var_29 = 26289;
unsigned short var_48 = 20359;
unsigned short var_80 = 21070;
int foo() {
  return 72 * (var_48 * 8531 * (var_80 / var_29));
}

int main () {
  foo();
  return 0;
}

> g++ -fsanitize=undefined f.cpp

> ./a.out
f.cpp:5:49: runtime error: signed integer overflow: 20359 * 614232 cannot be
represented in type 'int'


More information about the Gcc-bugs mailing list