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

--- Comment #1 from Wang Lei <MrEven132 at outlook dot com> ---
Also reproduced on x86_64-pc-linux-gnu with GCC 17.0.0 20261003 (experimental)
and GDB 17.2.

Using the same source, build commands and breakpoints as in the report, all six
-O1 values match the incorrect AArch64 results. At -O0, all six values are
correct.

For the corresponding division example at case.c:9 (-O1), RDI contains
0xfffffff9 and RSI contains 2, and GDB prints x = 2147483644 instead of -3. The
active DW_AT_location list entry for x is:

  DW_OP_breg5 (rdi): 0; DW_OP_breg4 (rsi): 0; DW_OP_div; DW_OP_stack_value

Reply via email to