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

            Bug ID: 67485
           Summary: expmed.c sanitizer detects overflow
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeccav at gmail dot com
  Target Milestone: ---

/* gcc sanitizer runtime error message*/
/* gcc/expmed.c:3026:42: runtime error: signed integer overflow:
-9223372036854775808 - 1 cannot be represented in type 'long int [3]*/
/* source line "val_so_far -= (HOST_WIDE_INT) 1 << log;" */
/* val_so_far == -9223372036854775808 */
/* log == 0 */
/* Target: x86_64-unknown-linux-gnu */
/* COLLECT_GCC_OPTIONS='-mtune=generic' '-march=x86-64' */
#define INTTYPE_SIGNED(t) (! ((t) 0 < (t) -1))
#define INTTYPE_MINIMUM(t) ((t) (INTTYPE_SIGNED (t) \
                             ? ~ (t) 0 << (sizeof (t) * 8 - 1) : (t) 0))
#define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
typedef long int int64_t;
int64_t
to_int ()
{
 int64_t sign;
 return sign * INTTYPE_MAXIMUM (int64_t);
}

Reply via email to