This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/78587] dwarf2out.c:1517:45: runtime error: negation of -9223372036854775808 cannot be represented in type 'long int [4]'; cast to an unsigned type to negate this value to itself
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Nov 2016 18:45:51 +0000
- Subject: [Bug debug/78587] dwarf2out.c:1517:45: runtime error: negation of -9223372036854775808 cannot be represented in type 'long int [4]'; cast to an unsigned type to negate this value to itself
- Auto-submitted: auto-generated
- References: <bug-78587-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78587
--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
markus@x4 libgcc % cat bid64_add.i
extern void fn2();
void fn1(long p1) {
p1 ^= 9223372036854775808u;
fn2();
}
markus@x4 libgcc % /var/tmp/gcc_build_dir_/./gcc/xgcc
-B/var/tmp/gcc_build_dir_/./gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/lib/ -c -O2 -g bid64_add.i
../../gcc/gcc/dwarf2out.c:1517:45: runtime error: negation of
-9223372036854775808 cannot be represented in type 'long int [4]'; cast to an
unsigned type to negate this value to itself
======
markus@x4 libgcc % cat bid_binarydecimal.i
typedef struct { int w[4]; } UINT256;
UINT256 a[1];
UINT256 b;
void fn1() {
int e = fn1;
if (e <= -80)
e = 0;
b = a[e];
}
markus@x4 libgcc % /var/tmp/gcc_build_dir_/./gcc/xgcc
-B/var/tmp/gcc_build_dir_/./gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/lib/ -w -g -O2 -c bid_binarydecimal.i
../../gcc/gcc/dwarf2out.c:13855:54: runtime error: left shift of negative value
-80