[PATCH] D135583: [LLVM] Use DWARFv4 bitfields when tuning for GDB

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 07:35:17 PDT 2022


DavidSpickett added a comment.

GCC 11 is where `DW_AT_data_bit_offset` is first used.

  $ ./bin/aarch64-none-linux-gnu-gcc --version
  aarch64-none-linux-gnu-gcc (fsf-10.343) 10.4.1 20220909
  <...>
  $ ./bin/aarch64-none-linux-gnu-gcc /tmp/test.c -o /tmp/test.o -c -g && llvm-dwarfdump-11 /tmp/test.o
  <...>
  0x00000026:     DW_TAG_member
  <...>
                    DW_AT_bit_size        (0x04)
                    DW_AT_bit_offset      (0x1c)
                    DW_AT_data_member_location    (0x00)



  $ ./bin/aarch64-none-linux-gnu-gcc --version
  aarch64-none-linux-gnu-gcc (fsf-11.284) 11.3.1 20221005
  <...>
  $ ./bin/aarch64-none-linux-gnu-gcc /tmp/test.c -o /tmp/test.o -c -g && llvm-dwarfdump-11 /tmp/
  <...>
  0x00000027:     DW_TAG_member
  <...>
                    DW_AT_bit_size        (0x04)
                    DW_AT_data_bit_offset (0x00)



> The question I'm roughly trying to answer is - has GCC shipped this feature? If so, we probably can too - because any system shipping older GCC versions is unlikely to be shipping a newer (as yet unreleased, in this case, but when it does release) clang.

With the feature being enabled in GCC 11, it seems to be ok for what will be clang 16 to enable it. For example the most recent Ubuntu LTS "Jammy", ships with GCC 11 and clang 14. So we're not going to see a gcc <=10 plus clang >=16 at least from them.

(hopefully I understood the question correctly)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135583/new/

https://reviews.llvm.org/D135583



More information about the llvm-commits mailing list