http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53335
Bug #: 53335 Summary: [4.6,4.7,4.8] pragma visibility(hidden) propagates beyond pop Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: major Priority: P3 Component: middle-end AssignedTo: unassig...@gcc.gnu.org ReportedBy: vincenzo.innoce...@cern.ch Created attachment 27391 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27391 directory containing two source files and a script. source files obtained preprocessing real-life code This problem is quite serious as prevent any further testing involving visibility in the attached example from real-life code (a simpler test does not show the "buggy" behavior) function defined after the #pragma GCC visibility pop are hidden anyhow… in the example below they are the kernel_measure* functions which are defined way below the #pragma GCC visibility pop (see output of grep) just tar -zxf vpragma.tgz cd vpragma cat make sed 's/.*visibility.*//g' kk.c > kkv.c c++ kk.c rr.c -shared -o bha.so -fPIC ; nm -C bha.so | grep kernel c++ kkv.c rr.c -shared -o bha.so -fPIC ; nm -C bha.so | grep kernel diff kk.c kkv.c grep -n kernel_ kk.c source make 0000000000001524 t kernel_measureLU(int, double, Random_struct*) 0000000000000e80 t kernel_measureFFT(int, double, Random_struct*) 0000000000000fea t kernel_measureSOR(int, double, Random_struct*) 0000000000001130 t kernel_measureMonteCarlo(double, Random_struct*) 000000000000126a t kernel_measureSparseMatMult(int, int, double, Random_struct*) 00000000000016e4 T kernel_measureLU(int, double, Random_struct*) 0000000000001040 T kernel_measureFFT(int, double, Random_struct*) 00000000000011aa T kernel_measureSOR(int, double, Random_struct*) 00000000000012f0 T kernel_measureMonteCarlo(double, Random_struct*) 000000000000142a T kernel_measureSparseMatMult(int, int, double, Random_struct*) 2310c2310 < #pragma GCC visibility push(hidden) --- > 2334c2334 < #pragma GCC visibility pop --- > 2622: double kernel_measureFFT(int N, double mintime, Random R) 2656: double kernel_measureSOR(int N, double min_time, Random R) 2684: double kernel_measureMonteCarlo(double min_time, Random R) 2707: double kernel_measureSparseMatMult(int N, int nz, 2773: double kernel_measureLU(int N, double min_time, Random R)