From: Jakub Jelinek Date: Wed, 7 Mar 2018 09:19:36 +0000 (+0100) Subject: re PR c++/84704 (internal compiler error: gimplification failed) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b6f03d13126216b986b651a39bfc968267d56e3a;p=gcc.git re PR c++/84704 (internal compiler error: gimplification failed) PR c++/84704 * gimple-expr.c (create_tmp_var_raw): Set DECL_NAMELESS flag on tmp_var. * tree-pretty-print.c (dump_decl_name): For TDF_COMPARE_DEBUG, don't print names of DECL_NAMELESS DECL_IGNORED_P decls. From-SVN: r258317 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 078a9091b36..38d5535b3d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2018-03-07 Jakub Jelinek + PR c++/84704 + * gimple-expr.c (create_tmp_var_raw): Set DECL_NAMELESS flag + on tmp_var. + * tree-pretty-print.c (dump_decl_name): For TDF_COMPARE_DEBUG, + don't print names of DECL_NAMELESS DECL_IGNORED_P decls. + PR middle-end/84723 * multiple_target.c: Include tree-inline.h and intl.h. (expand_target_clones): Diagnose and fail if node->definition and diff --git a/gcc/gimple-expr.c b/gcc/gimple-expr.c index 56caacabba2..d07c89bebab 100644 --- a/gcc/gimple-expr.c +++ b/gcc/gimple-expr.c @@ -446,6 +446,9 @@ create_tmp_var_raw (tree type, const char *prefix) DECL_ARTIFICIAL (tmp_var) = 1; /* And we don't want debug info for it. */ DECL_IGNORED_P (tmp_var) = 1; + /* And we don't want even the fancy names of those printed in + -fdump-final-insns= dumps. */ + DECL_NAMELESS (tmp_var) = 1; /* Make the variable writable. */ TREE_READONLY (tmp_var) = 0; diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 73eb27c8e8f..276ad00a7b2 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -247,21 +247,32 @@ dump_fancy_name (pretty_printer *pp, tree name) static void dump_decl_name (pretty_printer *pp, tree node, dump_flags_t flags) { - if (DECL_NAME (node)) + tree name = DECL_NAME (node); + if (name) { if ((flags & TDF_ASMNAME) && HAS_DECL_ASSEMBLER_NAME_P (node) && DECL_ASSEMBLER_NAME_SET_P (node)) pp_tree_identifier (pp, DECL_ASSEMBLER_NAME_RAW (node)); + /* For -fcompare-debug don't dump DECL_NAMELESS names at all, + -g might have created more fancy names and their indexes + could get out of sync. Usually those should be DECL_IGNORED_P + too, SRA can create even non-DECL_IGNORED_P DECL_NAMELESS fancy + names, let's hope those never get out of sync after doing the + dump_fancy_name sanitization. */ + else if ((flags & TDF_COMPARE_DEBUG) + && DECL_NAMELESS (node) + && DECL_IGNORED_P (node)) + name = NULL_TREE; /* For DECL_NAMELESS names look for embedded uids in the names and sanitize them for TDF_NOUID. */ else if ((flags & TDF_NOUID) && DECL_NAMELESS (node)) - dump_fancy_name (pp, DECL_NAME (node)); + dump_fancy_name (pp, name); else - pp_tree_identifier (pp, DECL_NAME (node)); + pp_tree_identifier (pp, name); } char uid_sep = (flags & TDF_GIMPLE) ? '_' : '.'; - if ((flags & TDF_UID) || DECL_NAME (node) == NULL_TREE) + if ((flags & TDF_UID) || name == NULL_TREE) { if (TREE_CODE (node) == LABEL_DECL && LABEL_DECL_UID (node) != -1) pp_printf (pp, "L%c%d", uid_sep, (int) LABEL_DECL_UID (node));