https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67379
Bug ID: 67379 Summary: libgcc2.c negation of -2147483648 cannot be represented in type 'int' Product: gcc Version: 5.2.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: libgcc Assignee: unassigned at gcc dot gnu.org Reporter: zeccav at gmail dot com Target Milestone: --- In libgcc2.c:1842 int m; unsigned int n = m < 0 ? -m : m; when m==-2147483648 I get the following message from the sanitizer /home/vitti/gcc-5.2.0/libgcc/libgcc2.c:1842:31: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself I suggest changing the line to the correct version unsigned int n = m < 0 ? - (unsigned int) m : m; to avoid undefinite behaviour This is running the gfortran testsuite file integer_exponentiation_1.f90