From: Richard Biener Date: Thu, 1 Apr 2021 09:51:33 +0000 (+0200) Subject: tree-optimization/99863 - clear vector CTOR TREE_SIDE_EFFECTS X-Git-Tag: basepoints/gcc-12~308 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=512429a885e87bef51057a001681b7d8d106e807;p=thirdparty%2Fgcc.git tree-optimization/99863 - clear vector CTOR TREE_SIDE_EFFECTS When we gimplify a vector CTOR the original CONSTRUCTOR tree remains but we fail to recompute flags such as TREE_SIDE_EFFECTS. This causes later GENERIC folding of them in vector lowering to give up since the match.pd machinery is careful about TREE_SIDE_EFFECTS. Fixing this makes vector lowering produce much less garbage and thus following the IL for PR99793 easier. 2021-04-01 Richard Biener PR tree-optimization/99863 * gimplify.c (gimplify_init_constructor): Recompute vector constructor flags. --- diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 6da66985ad62..1f417a527020 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -5231,6 +5231,7 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, TREE_TYPE (ce->value))) TREE_STATIC (ctor) = 0; } + recompute_constructor_flags (ctor); if (!is_gimple_reg (TREE_OPERAND (*expr_p, 0))) TREE_OPERAND (*expr_p, 1) = get_formal_tmp_var (ctor, pre_p); }