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

--- Comment #1 from vries at gcc dot gnu.org ---
I only run into this with -flto-partition=balanced.

>From the exe.wpa.000i.cgraph dump:
...
Total unit size: 2034, partition size: 1000
Step 0: added main._omp_fn.0/24, size 22, cost 1/0 best 1/0, step 0
Step 1: added main._omp_fn.1/23, size 44, cost 2/0 best 2/0, step 1
  ...
Step 17: added main._omp_fn.17/7, size 694, cost 18/0 best 18/0, step 17
Step 18: added main._omp_fn.18/6, size 735, cost 19/0 best 19/0, step 18
Step 19: added main._omp_fn.19/5, size 775, cost 20/0 best 19/0, step 18
Step 20: added main._omp_fn.20/4, size 816, cost 21/0 best 19/0, step 18
Step 21: added main/3, size 2034, cost 53/21 best 19/0, step 18
Unwinding 3 insertions to step 18
New partition
Step 19: added main._omp_fn.19/5, size 40, cost 1/21 best 1/21, step 19
Step 20: added main._omp_fn.20/4, size 81, cost 2/21 best 2/21, step 20
Step 21: added main/3, size 1299, cost 72/23 best 2/21, step 20
Privatizing symbol name: main._omp_fn.0 -> main._omp_fn.0.lto_priv.0
Promoting as hidden: main._omp_fn.0
Privatizing symbol name: main._omp_fn.1 -> main._omp_fn.1.lto_priv.1
Promoting as hidden: main._omp_fn.1
...

In .exe.ltrans0.s, main._omp_fn.18 is privatized, but exported as global
hidden:
...
        .text
        .globl  main._omp_fn.18.lto_priv.18
        .hidden main._omp_fn.18.lto_priv.18
        .type   main._omp_fn.18.lto_priv.18, @function
main._omp_fn.18.lto_priv.18:
...

In .exe.ltrans1.s, it is referenced, and declared as hidden:
...
        .hidden main._omp_fn.18.lto_priv.18
...

Conversely, in .exe.ltrans1.s, main._omp_fn.20 is not privatized:
...
        .type   main._omp_fn.20, @function
main._omp_fn.20:
...

But in .exe.ltrans0.s, main._omp_fn.20 is referenced, and not declared:
...
.omp_func_table.4851:
        .quad   main._omp_fn.20
...

Reply via email to