https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111067
--- Comment #2 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> --- I tried with: diff --git a/gcc/testsuite/g++.dg/opt/icf1.C b/gcc/testsuite/g++.dg/opt/icf1.C index fbb275e635a..d4e4bbf91b9 100644 --- a/gcc/testsuite/g++.dg/opt/icf1.C +++ b/gcc/testsuite/g++.dg/opt/icf1.C @@ -1,6 +1,7 @@ // Test that -fipa-icf combines i and j. // { dg-do run { target c++11 } } // { dg-options -fipa-icf } +// { dg-add-options bind_pic_locally } [[no_unique_address]] extern const int i[] = { 1,2,3 }; [[no_unique_address]] extern const int j[] = { 1,2,3 }; and similarly on the other files, but it does not make the tests pass.