This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgomp/64672] ICEs in libgomp.oacc-fortran when using the '-g -flto' options in the test suite.


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

--- Comment #9 from vries at gcc dot gnu.org ---
I tried the example, and added -fopenmp. In lto1, I observed:
...
(gdb) p flag_openmp
$2 = 0
(gdb) p flag_openacc
$3 = 0
(gdb) p flag_tree_parallelize_loops
$4 = 1
(gdb) p flag_offload_abi 
$5 = OFFLOAD_ABI_UNSET
...

So, the enabler in this code in builtins.def is flag_tree_parallelize_loops,
not flag_openmp:
...
#define DEF_GOMP_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
  DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,    \
               false, true, true, ATTRS, false, \
               (flag_openmp || flag_tree_parallelize_loops \
        || flag_offload_abi != OFFLOAD_ABI_UNSET))
...

I verified this by adding -ftree-parallelize-loops=0, and found that indeed
support for omp builtins was dropped in lto1:
...
(gdb) p builtin_info.decl[BUILT_IN_OMP_GET_THREAD_NUM]
$3 = (tree_node *) 0x0
...

Perhaps for consistency, we should mark both fopenmp and fopenacc as LTO
options?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]