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

            Bug ID: 67482
           Summary: dwarf2out.c sanitizer detects undefined behaviour
                    negation of -9223372036854775808
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeccav at gmail dot com
  Target Milestone: ---

/* must be compiled with -O2 -g */
/* sanitizer runtime error message
 * gcc-5.2.0/gcc/dwarf2out.c:1532:45: runtime error: negation of
-9223372036854775808 cannot be represented in type 'long int [3]'; cast to an
unsigned type to negate this value to itself */
/* offending statement "loc->dw_loc_next = int_loc_descriptor (-offset);" */
/*Target: x86_64-unknown-linux-gnu*/
/*COLLECT_GCC_OPTIONS='-O2' '-g' '-mtune=generic' '-march=x86-64'*/
int v;
__attribute__((noinline)) void
bar (void)
{
 v++;
}
__attribute__((noinline)) unsigned long long t134_2add (unsigned long long y)
{
 signed long long x = ((-0x7fffffffffffffffLL - 1));
 unsigned long long r;
 if (__builtin_add_overflow (x, y, &r)) bar ();
 return r;
}

Reply via email to