[ adding gcc-patches ]
On 13-12-18 14:30, Tom de Vries wrote: > [ Patch copy-pasted from here ( > https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02076.html ). Patch was > resubmitted here ( > https://gcc.gnu.org/ml/gcc-patches/2016-07/msg00043.html ). ] > > Hi, > > this issue just popped up again for PR88460: an openmp test-case problem > manifests as an ICE. We've seen the same problem for openacc test-cases. > > From my point of view, the main problem with the current state is that > we don't known what symbol the ICE relates to, and can only find out by > reproducing the compile in a debugging session and doing "call > debug_generic_expr (node.decl)" ( see > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88460#c0 ), which is > cumbersome for gcc developers, and not helpful for openmp and openacc users. > > This patch attempts to address that issue by changing the assert into an > error. [ We could make the error message more specific, by > distinguishing between the node->in_other_partition and > node->used_from_other_partition cases. ] > > Is the approach in this patch OK (perhaps conditionalizing it to be only > effective for openacc and openmp)? > > Alternatively, we could instead print a message ahead of the ICE. > > Can we have some feedback on what would be an acceptable solution here? > > Thanks, > - Tom > > 2015-07-24 Cesar Philippidis <ce...@codesourcery.com> > > gcc/ > * lto-cgraph.c (input_overwrite_node): Error instead of assert > on missing cgraph partitions. > (input_varpool_node): Likewise. > > > diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c > index d70537d..7e2fc80 100644 > --- a/gcc/lto-cgraph.c > +++ b/gcc/lto-cgraph.c > @@ -1218,9 +1218,11 @@ input_overwrite_node (struct lto_file_decl_data > *file_data, > LDPR_NUM_KNOWN); > node->instrumentation_clone = bp_unpack_value (bp, 1); > node->split_part = bp_unpack_value (bp, 1); > - gcc_assert (flag_ltrans > - || (!node->in_other_partition > - && !node->used_from_other_partition)); > + > + int success = flag_ltrans || (!node->in_other_partition > + && !node->used_from_other_partition); > + if (!success) > + error ("Missing %<%s%>", node->name ()); > } > > /* Return string alias is alias of. */ > @@ -1432,9 +1434,11 @@ input_varpool_node (struct lto_file_decl_data > *file_data, > node->set_section_for_node (section); > node->resolution = streamer_read_enum (ib, ld_plugin_symbol_resolution, > LDPR_NUM_KNOWN); > - gcc_assert (flag_ltrans > - || (!node->in_other_partition > - && !node->used_from_other_partition)); > + > + int success = flag_ltrans || (!node->in_other_partition > + && !node->used_from_other_partition); > + if (!success) > + error ("Missing %<%s%>", node->name ()); > > return node; > } >