Bug 91381 - ARM NEON register variable DWARF incorrect
Summary: ARM NEON register variable DWARF incorrect
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 7.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-debug
Depends on:
Blocks:
 
Reported: 2019-08-06 17:24 UTC by CWest
Modified: 2019-08-07 08:00 UTC (History)
0 users

See Also:
Host:
Target: arm
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CWest 2019-08-06 17:24:46 UTC
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.