[Bug c++/91222] [10 Regression] 507.cactuBSSN_r build fails in warn_types_mismatch at ipa-devirt.c:1006 since r273571

ktkachov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 2 11:24:00 GMT 2019


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

--- Comment #26 from ktkachov at gcc dot gnu.org ---
(In reply to Jan Hubicka from comment #25)
> > --- Comment #24 from ktkachov at gcc dot gnu.org ---
> > Thanks. Unfortunately I still see the ICE building 507.cactuBSSN_r on aarch64
> > with -flto in the same place:
> >  995       gcc_assert (TYPE_NAME (t1)
> >  996                   && TREE_CODE (TYPE_NAME (t1)) == TYPE_DECL);
> Sorry to hear that seems cactusBSSN triggers a lot of interesting
> behaviour here.  This conditional should fix it.
> 
> Index: ipa-devirt.c
> ===================================================================
> --- ipa-devirt.c	(revision 276420)
> +++ ipa-devirt.c	(working copy)
> @@ -986,8 +986,8 @@ warn_types_mismatch (tree t1, tree t2, l
>        || (type_with_linkage_p (TYPE_MAIN_VARIANT (t2))
>  	  && type_in_anonymous_namespace_p (TYPE_MAIN_VARIANT (t2))))
>      {
> -      if (type_with_linkage_p (TYPE_MAIN_VARIANT (t1))
> -	  && !type_in_anonymous_namespace_p (TYPE_MAIN_VARIANT (t1)))
> +      if (!type_with_linkage_p (TYPE_MAIN_VARIANT (t1))
> +	  || !type_in_anonymous_namespace_p (TYPE_MAIN_VARIANT (t1)))
>  	{
>  	  std::swap (t1, t2);
>  	  std::swap (loc_t1, loc_t2);

Thanks! That fixes the benchmark build (and the rest of SPEC builds fine with
-flto). It also bootstraps and tests on aarch64-none-linux-gnu fine.


More information about the Gcc-bugs mailing list