Fix ICE with ODR mering and variable sized types

Richard Biener richard.guenther@gmail.com
Mon Sep 22 09:16:00 GMT 2014


On Fri, Sep 19, 2014 at 8:55 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> this patch fixes ICE by avoiding mangling of types with variadic size (those are
> not really supported).  Bootstrapped/regtested x86_64-linux, tested with libreoffice,
> comitted.

Hmm, but how do global vars end up having variadic type?  Isn't the
bug that you are ending up with some local entity here?

Richard.

>         PR lto/63286
>         * tree.c (need_assembler_name_p): Do not mangle variadic types.
> Index: tree.c
> ===================================================================
> --- tree.c      (revision 215328)
> +++ tree.c      (working copy)
> @@ -5003,6 +5003,7 @@ need_assembler_name_p (tree decl)
>        && decl == TYPE_NAME (TREE_TYPE (decl))
>        && !is_lang_specific (TREE_TYPE (decl))
>        && AGGREGATE_TYPE_P (TREE_TYPE (decl))
> +      && !variably_modified_type_p (TREE_TYPE (decl), NULL_TREE)
>        && !type_in_anonymous_namespace_p (TREE_TYPE (decl)))
>      return !DECL_ASSEMBLER_NAME_SET_P (decl);
>    /* Only FUNCTION_DECLs and VAR_DECLs are considered.  */



More information about the Gcc-patches mailing list