tree-optimization/99863 - clear vector CTOR TREE_SIDE_EFFECTS
authorRichard Biener <rguenther@suse.de>
Thu, 1 Apr 2021 09:51:33 +0000 (11:51 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 1 Apr 2021 10:46:48 +0000 (12:46 +0200)
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  <rguenther@suse.de>

PR tree-optimization/99863
* gimplify.c (gimplify_init_constructor): Recompute vector
constructor flags.

gcc/gimplify.c

index 6da6698..1f417a5 100644 (file)
@@ -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);
       }