Bug 58767 - assemly output (labels order) depends on the sources location.
Summary: assemly output (labels order) depends on the sources location.
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.8.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-17 09:48 UTC by Pawel Sikora
Modified: 2021-12-06 04:57 UTC (History)
0 users

See Also:
Host: x86_64-gnu-linux
Target: x86_64-gnu-linux
Build: x86_64-gnu-linux
Known to work:
Known to fail: 4.8.2, 4.9.1
Last reconfirmed:


Attachments
testcase (25.30 KB, application/x-gzip)
2013-10-17 09:48 UTC, Pawel Sikora
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Sikora 2013-10-17 09:48:54 UTC
Created attachment 31025 [details]
testcase

hi,

on the attached testcase you can see that location
of LASF{10,12,28} in the output assembly varies.
this prevents ccache from reuse objects.

LASF24 content change is not a problem and can be unified
in the other way.

$ ./bug.sh
+ rm -f t1.s t2.s
+ CXXFLAGS='-Wall -gno-record-gcc-switches -g2 -gdwarf-4 --save-temps' 
+ g++ -Wall -gno-record-gcc-switches -g2 -gdwarf-4 --save-temps repo/branch1/t.cpp -S
+ mv t.s t1.s
+ mv t.ii t1.ii
+ g++ -Wall -gno-record-gcc-switches -g2 -gdwarf-4 --save-temps repo/branch2/t.cpp -S
+ mv t.s t2.s
+ mv t.ii t2.ii
+ diff -u t1.s t2.s
--- t1.s        2013-10-17 11:38:03.084369344 +0200
+++ t2.s        2013-10-17 11:38:03.177702172 +0200
@@ -407,6 +407,8 @@
        .string "nothrow_t"
 .LASF22:
        .string "bool"
+.LASF12:
+       .string "signed char"
 .LASF18:
        .string "float"
 .LASF5:
@@ -423,16 +425,14 @@
        .string "__gnu_debug"
 .LASF2:
        .string "__gnu_cxx"
-.LASF12:
-       .string "signed char"
+.LASF24:
+       .string "repo/branch2/t.cpp"
 .LASF11:
        .string "long long unsigned int"
 .LASF9:
        .string "unsigned int"
 .LASF32:
        .string "_ZN9__gnu_cxx24__numeric_traits_integerIlE5__maxE"
-.LASF10:
-       .string "long unsigned int"
 .LASF8:
        .string "short unsigned int"
 .LASF21:
@@ -445,8 +445,8 @@
        .string "GNU C++ 4.8.1 20130531 (release)"
 .LASF4:
        .string "__max"
-.LASF28:
-       .string "nothrow"
+.LASF10:
+       .string "long unsigned int"
 .LASF17:
        .string "double"
 .LASF3:
@@ -457,7 +457,7 @@
        .string "__debug"
 .LASF6:
        .string "__digits"
-.LASF24:
-       .string "repo/branch1/t.cpp"
+.LASF28:
+       .string "nothrow"
        .ident  "GCC: (PLD-Linux) 4.8.1 20130531 (release)"
        .section        .note.GNU-stack,"",@progbits
Comment 1 Andrew Pinski 2021-12-06 04:57:46 UTC
The output of the strings is based on the the traverse of the hashtable. this might mean the output of the strings in the hashtable be outputted at a different location based on the hash of the strings.

In this case it is because "repo/branch2/t.cpp" and "repo/branch1/t.cpp" are going to be different hashes which is causing the difference in the hash table traversal.