https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91381
Bug ID: 91381 Summary: ARM NEON register variable DWARF incorrect Product: gcc Version: 7.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: calum.west at analog dot com Target Milestone: --- When producing debug information for a 128-bit Q register variable using Q8 and above, the debug information produced incorrectly repeats the same D register twice as the operand of the DW_OP_piece operation. Example ( using 8.3-2019.03 found on arm.com ): /***main.c***/ #include <arm_neon.h> #include <stdint.h> int main() { register uint32x4_t neon_reg asm ("q8") = {1,2,3,4}; return 0; } /************/ $./arm-eabi-g++ -g -mcpu=cortex-a5 -mfloat-abi=hard --specs=nosys.specs main.c -o main.o $ ./arm-eabi-objdump.exe -g main.o ... <2><e6>: Abbrev Number: 8 (DW_TAG_variable) <e7> DW_AT_name : (indirect string, offset: 0x147): neon_reg <eb> DW_AT_decl_file : 1 <ec> DW_AT_decl_line : 11 <ed> DW_AT_decl_column : 24 <ee> DW_AT_type : <0xad> <f2> DW_AT_location : 10 byte block: 90 90 2 93 8 90 90 2 93 8 (DW_OP_regx: 272 (r272); DW_OP_piece: 8; DW_OP_regx: 272 (r272); DW_OP_piece: 8) ... This last attribute should be (DW_OP_regx: 272 (r272); DW_OP_piece: 8; DW_OP_regx: 273 (r273); DW_OP_piece: 8) and similar for other registers >Q8. Registers <Q8 appear to work correctly. I've briefly tested on different versions and with different variations of the g-dwarf($version) and g-strictdwarf switch and found the same results.