http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59326

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm.  So apart from missing support for OMP_CLAUSE in hash_tree and more
important
in compare_tree_sccs_1 (all OMP_CLAUSE trees are currently considered equal
and thus merged).

The issue with the IPA cloning pass not running is that -fopenmp and
-fopenmp-simd are not LTO language frontend options and thus not handed
down to WPA or LTRANS stage.  Thus checking flag_openmp or flag_openmp_simd
(or probably flag_enable_cilkplus) in the IPA pass gate function will not
work (it's never set).

You either need to make those flags work for LTO or by other means
compute whether to execute the pass.  Hacks:

Index: gcc/omp-low.c
===================================================================
--- gcc/omp-low.c       (revision 205484)
+++ gcc/omp-low.c       (working copy)
@@ -11765,7 +11765,7 @@ public:

   /* opt_pass methods: */
   bool gate () { return flag_openmp || flag_openmp_simd
-                       || flag_enable_cilkplus; }
+                       || flag_enable_cilkplus || flag_ltrans; }
   unsigned int execute () { return ipa_omp_simd_clone (); }
 };

Index: gcc/lto/lto.c
===================================================================
--- gcc/lto/lto.c       (revision 205484)
+++ gcc/lto/lto.c       (working copy)
@@ -1402,6 +1410,11 @@ compare_tree_sccs_1 (tree t1, tree t2, t
                   TREE_STRING_LENGTH (t1)) != 0)
       return false;

+  /* Do not merge OMP_CLAUSE trees.
+     ???  No technical reason not to, just implement proper compare.  */
+  if (code == OMP_CLAUSE)
+    return false;
+
 #undef compare_values


with those I get

lto1: internal compiler error: Segmentation fault
0xaed293 crash_signal
  /space/rguenther/src/svn/trunk/gcc/toplev.c:336
0xb6a4d4 copy_forbidden
  /space/rguenther/src/svn/trunk/gcc/tree-inline.c:3261
0xb6edcd tree_versionable_function_p(tree_node*)
  /space/rguenther/src/svn/trunk/gcc/tree-inline.c:5100
0x6ce38e cgraph_function_versioning(cgraph_node*, vec<cgraph_edge*, va_heap,
vl_ptr>, vec<ipa_replace_map*, va_gc, vl_embed>*, bitmap_head_def*, bool,
bitmap_head_def*, basic_block_def*, char const*)
  /space/rguenther/src/svn/trunk/gcc/cgraphclones.c:848
0x9cae4f simd_clone_create
  /space/rguenther/src/svn/trunk/gcc/omp-low.c:10916
0x9ce798 expand_simd_clones
  /space/rguenther/src/svn/trunk/gcc/omp-low.c:11698
0x9ce92c ipa_omp_simd_clone
  /space/rguenther/src/svn/trunk/gcc/omp-low.c:11738
0x9ce9d0 execute
  /space/rguenther/src/svn/trunk/gcc/omp-low.c:11769

appearantly that's the cgraph_get_body stuff Honza mentioned.

Reply via email to