https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85608
Alex Coplan <acoplan at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
CC| |acoplan at gcc dot gnu.org
Ever confirmed|0 |1
Last reconfirmed| |2021-04-22
--- Comment #5 from Alex Coplan <acoplan at gcc dot gnu.org> ---
I'm seeing (likely) the same issue on AArch64 with GCC 11 RC. The following
testcase is reduced from gcc.dg/Warray-bounds-30.c:
$ cat test.c
void a() {
extern char b[];
char *c = b;
{
a(c[-0x7fffffffffffffffL]);
a(c[5535]);
}
a(&c[-0x7fffffffffffffffL - 1]);
}
$ gcc/xgcc -B gcc test.c -c -O
/home/alecop01/toolchain/src/gcc/gcc/config/aarch64/predicates.md:129:23:
runtime error: negation of -9223372036854775808 cannot be represented in type
'long int'; cast to an unsigned type to negate this value to itself
<see PR100200>
/home/alecop01/toolchain/src/gcc/gcc/cse.c:2204:34: runtime error: signed
integer overflow: -9223372036854775808 - 4096 cannot be represented in type
'long int'
#0 0x49676e0 in use_related_value
/home/alecop01/toolchain/src/gcc/gcc/cse.c:2204
#1 0x49676e0 in cse_insn /home/alecop01/toolchain/src/gcc/gcc/cse.c:4879
#2 0x496e198 in cse_extended_basic_block
/home/alecop01/toolchain/src/gcc/gcc/cse.c:6590
#3 0x496e198 in cse_main /home/alecop01/toolchain/src/gcc/gcc/cse.c:6769
#4 0x4972808 in rest_of_handle_cse
/home/alecop01/toolchain/src/gcc/gcc/cse.c:7599
#5 0x4972808 in execute /home/alecop01/toolchain/src/gcc/gcc/cse.c:7642
#6 0x1b5ec1c in execute_one_pass(opt_pass*)
/home/alecop01/toolchain/src/gcc/gcc/passes.c:2567
#7 0x1b623b8 in execute_pass_list_1
/home/alecop01/toolchain/src/gcc/gcc/passes.c:2656
#8 0x1b623f0 in execute_pass_list_1
/home/alecop01/toolchain/src/gcc/gcc/passes.c:2657
#9 0x1b624d4 in execute_pass_list(function*, opt_pass*)
/home/alecop01/toolchain/src/gcc/gcc/passes.c:2667
#10 0xc7b2a4 in cgraph_node::expand()
/home/alecop01/toolchain/src/gcc/gcc/cgraphunit.c:1830
#11 0xc7ff24 in expand_all_functions
/home/alecop01/toolchain/src/gcc/gcc/cgraphunit.c:1994
#12 0xc7ff24 in symbol_table::compile()
/home/alecop01/toolchain/src/gcc/gcc/cgraphunit.c:2358
#13 0xc8b81c in symbol_table::compile()
/home/alecop01/toolchain/src/gcc/gcc/cgraphunit.c:2271
#14 0xc8b81c in symbol_table::finalize_compilation_unit()
/home/alecop01/toolchain/src/gcc/gcc/cgraphunit.c:2539
#15 0x1f97478 in compile_file
/home/alecop01/toolchain/src/gcc/gcc/toplev.c:482
#16 0x68d9b0 in do_compile
/home/alecop01/toolchain/src/gcc/gcc/toplev.c:2201
#17 0x68d9b0 in toplev::main(int, char**)
/home/alecop01/toolchain/src/gcc/gcc/toplev.c:2340
#18 0x6910d0 in main /home/alecop01/toolchain/src/gcc/gcc/main.c:39
#19 0xffffb5f7b6dc in __libc_start_main
(/lib/aarch64-linux-gnu/libc.so.6+0x206dc)
#20 0x691b2c (/data/alecop01/builds/bstrap-ubsan/gcc/cc1+0x691b2c)