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

            Bug ID: 108464
           Summary: [13 Regression] Broken -fdebug-prefix-map since
                    r13-3599
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

Starting with r13-3599-ge5c15eb183f17e806ad -fdebug-prefix-map stopped working
in some cases (breaks ccache testsuite among other things).

Reproducer:
mkdir -p foobar1/include foobar1/src
echo 'int test;' > foobar1/include/test.h
echo '#include <test.h>' > foobar1/src/test.c
ln -sf foobar1 foobar2
cd foobar2
gcc -S -I include/ -fdebug-prefix-map=`pwd`=XXXX -g -dA src/test.c -o test.s;
grep 'XXXX\|foobar' test.s

Before r13-3599, all the way back from r0-82686-gc8aea42ce2c691e4e8 when
-fdebug-prefix-map= has been introduced, this prints XXXX (once or multiple
times depending on exact version) and doesn't print any foobar strings.
Even r13-3598 prints
        .long   .LASF1  # DW_AT_comp_dir: "XXXX"
        .long   .LASF1  # Directory Entry: 0: "XXXX"
        .string "XXXX"
but starting with r13-3599 we print
        .long   .LASF1  # DW_AT_comp_dir: "/home/jakub/foobar2"
        .long   .LASF1  # Directory Entry: 0: "/home/jakub/foobar2"
        .string "/home/jakub/foobar2"
instead, which is wrong because user asked for remapping of /home/jakub/foobar2
and it wasn't done.

Reply via email to