Bug 228769

Summary: spurious recompiling with -frepo and anonymous namespace
Product: [Fedora] Fedora Reporter: Serge Pavlovsky <pal666>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: aoliva, jason
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 4.1.2-4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-03-13 13:53:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Serge Pavlovsky 2007-02-14 21:09:32 UTC
Description of problem:


Version-Release number of selected component (if applicable):
4.1.1-51.fc6

How reproducible:
[pal@underdark repo]$ cat a.cpp
#include <vector>
namespace {
class A { };
}
int main ( ) {
        std :: vector < A > v;
        v.begin ( );
}
Steps to Reproduce:
1.
[pal@underdark repo]$ /usr/bin/g++ -c a.cpp -frepo -D_GLIBCXX_DEBUG && LC_ALL=C
/usr/bin/g++ a.o -o a
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
2.
[pal@underdark repo]$ cp a.rpo b.rpo
[pal@underdark repo]$ /usr/bin/g++ -c a.cpp -frepo -D_GLIBCXX_DEBUG && LC_ALL=C
/usr/bin/g++ a.o -o a
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
collect: recompiling a.cpp
collect: relinking
3.
[pal@underdark repo]$ diff -u b.rpo a.rpo
--- b.rpo       2007-02-14 23:03:22.000000000 +0200
+++ a.rpo       2007-02-14 23:03:30.000000000 +0200
@@ -1,16 +1,16 @@
 M a.cpp
 D /home/pal/tmp/repo
-A '-c' '-frepo' '-D_GLIBCXX_DEBUG' '-mtune=generic' '-frandom-seed=0xc210c8d9'
-C _ZTSN10__gnu_norm12_Vector_baseIN34_GLOBAL__N_a.cpp_00000000_982312C41AESaIS2_EEE
-C _ZTIN10__gnu_norm12_Vector_baseIN34_GLOBAL__N_a.cpp_00000000_982312C41AESaIS2_EEE
-C _ZTSN10__gnu_norm6vectorIN34_GLOBAL__N_a.cpp_00000000_982312C41AESaIS2_EEE
-C _ZTIN10__gnu_norm6vectorIN34_GLOBAL__N_a.cpp_00000000_982312C41AESaIS2_EEE
-C
_ZTSN11__gnu_debug14_Safe_sequenceIN15__gnu_debug_def6vectorIN34_GLOBAL__N_a.cpp_00000000_982312C41AESaIS4_EEEEE
-C
_ZTIN11__gnu_debug14_Safe_sequenceIN15__gnu_debug_def6vectorIN34_GLOBAL__N_a.cpp_00000000_982312C41AESaIS4_EEEEE
-C
_ZTSN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPN34_GLOBAL__N_a.cpp_00000000_982312C41AEN10__gnu_norm6vectorIS4_SaIS4_EEEEEN15__gnu_debug_def6vectorIS4_S8_EEEE
-C
_ZTIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPN34_GLOBAL__N_a.cpp_00000000_982312C41AEN10__gnu_norm6vectorIS4_SaIS4_EEEEEN15__gnu_debug_def6vectorIS4_S8_EEEE
-C _ZTSN15__gnu_debug_def6vectorIN34_GLOBAL__N_a.cpp_00000000_982312C41AESaIS2_EEE
-C _ZTIN15__gnu_debug_def6vectorIN34_GLOBAL__N_a.cpp_00000000_982312C41AESaIS2_EEE
+A '-c' '-frepo' '-D_GLIBCXX_DEBUG' '-mtune=generic' '-frandom-seed=0xc2110a5c'
+C _ZTSN10__gnu_norm12_Vector_baseIN34_GLOBAL__N_a.cpp_00000000_CF506A071AESaIS2_EEE
+C _ZTIN10__gnu_norm12_Vector_baseIN34_GLOBAL__N_a.cpp_00000000_CF506A071AESaIS2_EEE
+C _ZTSN10__gnu_norm6vectorIN34_GLOBAL__N_a.cpp_00000000_CF506A071AESaIS2_EEE
+C _ZTIN10__gnu_norm6vectorIN34_GLOBAL__N_a.cpp_00000000_CF506A071AESaIS2_EEE
+C
_ZTSN11__gnu_debug14_Safe_sequenceIN15__gnu_debug_def6vectorIN34_GLOBAL__N_a.cpp_00000000_CF506A071AESaIS4_EEEEE
+C
_ZTIN11__gnu_debug14_Safe_sequenceIN15__gnu_debug_def6vectorIN34_GLOBAL__N_a.cpp_00000000_CF506A071AESaIS4_EEEEE
+C
_ZTSN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPN34_GLOBAL__N_a.cpp_00000000_CF506A071AEN10__gnu_norm6vectorIS4_SaIS4_EEEEEN15__gnu_debug_def6vectorIS4_S8_EEEE
+C
_ZTIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPN34_GLOBAL__N_a.cpp_00000000_CF506A071AEN10__gnu_norm6vectorIS4_SaIS4_EEEEEN15__gnu_debug_def6vectorIS4_S8_EEEE
+C _ZTSN15__gnu_debug_def6vectorIN34_GLOBAL__N_a.cpp_00000000_CF506A071AESaIS2_EEE
+C _ZTIN15__gnu_debug_def6vectorIN34_GLOBAL__N_a.cpp_00000000_CF506A071AESaIS2_EEE
 O _ZN11__gnu_debug16__check_singularIcEEbPKT_
 O _ZN11__gnu_debug18__valid_range_aux2IPKcEEbRKT_S5_St26random_access_iterator_tag
 O _ZN11__gnu_debug16__check_singularIhEEbPKT_

Actual results:
several collect: recompiling a.cpp; collect: relinking during step2

Expected results:
no recomiling, since a.rpo from previous build is still present

Additional info:
seems like a problem with different symbol names due to different -frandom-seed=
gcc should use same seed with -frepo or something

Comment 1 Alexandre Oliva 2007-03-09 12:24:21 UTC
http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00540.html

Comment 2 Jakub Jelinek 2007-03-13 13:53:33 UTC
Should be fixed in gcc-4.1.2-4 in rawhide.