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

            Bug ID: 82951
           Summary: gcc.c-torture/execute/20040409-1.c undefined behavior
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org
  Target Milestone: ---

While testing a VRP patch, I had failures for
gcc.c-torture/execute/20040409-[1-3].c. If I run them with
-fsanitize=undefined, I get

20040409-1.c:27:12: runtime error: signed integer overflow: 0 - -2147483648
cannot be represented in type 'int'
20040409-1.c:17:12: runtime error: signed integer overflow: -2147483648 +
-2147483648 cannot be represented in type 'int'

20040409-2.c:47:13: runtime error: signed integer overflow: 0 - -2147483648
cannot be represented in type 'int'
20040409-2.c:57:23: runtime error: signed integer overflow: 4660 - -2147483648
cannot be represented in type 'int'
20040409-2.c:27:13: runtime error: signed integer overflow: -2147483648 +
-2147483648 cannot be represented in type 'int'
20040409-2.c:37:23: runtime error: signed integer overflow: -2147478988 +
-2147483648 cannot be represented in type 'int'
20040409-2.c:111:18: runtime error: signed integer overflow: -2147483648 +
-2147478988 cannot be represented in type 'int'

20040409-3.c:27:14: runtime error: signed integer overflow: 0 - -2147483648
cannot be represented in type 'int'
20040409-3.c:17:14: runtime error: signed integer overflow: -2147483648 +
-2147483648 cannot be represented in type 'int'

Unless someone volunteers to improve the tests, I'll likely remove the
offending cases (and probably more since this is a grid and I don't want to
look for every cell) from those 3 files.

Reply via email to