aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.cc
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2024-08-19 07:11:18 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2024-08-22 12:40:07 +0200
commit76c29548b3de8bd06c3eef6084c19696019a7a2f (patch)
tree87bd4645b10dde2a819efc899873fdaa3217be92 /gcc/fold-const.cc
parentbcb33b1237042e9540a905d9de19219f876e26c0 (diff)
downloadgcc-76c29548b3de8bd06c3eef6084c19696019a7a2f.zip
gcc-76c29548b3de8bd06c3eef6084c19696019a7a2f.tar.gz
gcc-76c29548b3de8bd06c3eef6084c19696019a7a2f.tar.bz2
RISC-V: Enable -gvariable-location-views by default
This affects only the RISC-V targets, where the compiler options -gvariable-location-views and consequently also -ginline-points are disabled by default, which is unexpected and disables some useful features of the generated debug info. Due to a bug in the gas assembler the .loc statement is not usable to generate location view debug info. That is detected by configure: configure:31500: checking assembler for dwarf2 debug_view support configure:31509: .../riscv-unknown-elf/bin/as -o conftest.o conftest.s >&5 conftest.s: Assembler messages: conftest.s:5: Error: .uleb128 only supports constant or subtract expressions conftest.s:6: Error: .uleb128 only supports constant or subtract expressions configure:31512: $? = 1 configure: failed program was .file 1 "conftest.s" .loc 1 3 0 view .LVU1 nop .data .uleb128 .LVU1 .uleb128 .LVU1 configure:31523: result: no This results in dwarf2out_as_locview_support being set to false, and that creates a sequence of events, with the end result that most inlined functions either have no DW_AT_entry_pc, or one with a wrong entry pc value. But the location views can also be generated without using any .loc statements, therefore we should enable the option -gvariable-location-views by default, regardless of the status of -gas-locview-support. Note however, that the combination of the following compiler options -g -O2 -gvariable-location-views -gno-as-loc-support turned out to create invalid assembler intermediate files, with lots of assembler errors like: Error: leb128 operand is an undefined symbol: .LVU3 This affects all targets, except RISC-V of course ;-) and is fixed by the changes in dwarf2out.cc Finally the .debug_loclists created without assembler locview support did contain location view pairs like v0000000ffffffff v000000000000000 which is the value from FORCE_RESET_NEXT_VIEW, but that is most likely not as expected either, so change that as well. gcc/ChangeLog: * dwarf2out.cc (dwarf2out_maybe_output_loclist_view_pair, output_loc_list): Correct handling of -gno-as-loc-support, use ZERO_VIEW_P to output view number as zero value. * toplev.cc (process_options): Do not automatically disable -gvariable-location-views when -gno-as-loc-support or -gno-as-locview-support is used, instead do automatically disable -gas-locview-support if -gno-as-loc-support is used. gcc/testsuite/ChangeLog: * gcc.dg/debug/dwarf2/inline2.c: Add checks for inline entry_pc. * gcc.dg/debug/dwarf2/inline6.c: Add -gno-as-loc-support and check the resulting location views.
Diffstat (limited to 'gcc/fold-const.cc')
0 files changed, 0 insertions, 0 deletions