From 77840fd9056d8cc9dd5913ac5b9b366da3cf1008 Mon Sep 17 00:00:00 2001
From: Jason Merrill <jason@redhat.com>
Date: Fri, 7 Feb 2020 16:10:18 -0500
Subject: [PATCH 1/4] c++: Fix TREE_SIDE_EFFECTS after digest_init.
To: gcc-patches@gcc.gnu.org
* typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
if appropriate.
---
gcc/cp/typeck2.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
@@ -1929,11 +1929,15 @@ process_init_constructor (tree type, tree init, int nested, int flags,
TREE_SIDE_EFFECTS (init) = true;
}
else if (picflags & PICFLAG_NOT_ALL_CONSTANT)
- /* Make sure TREE_CONSTANT isn't set from build_constructor. */
- TREE_CONSTANT (init) = false;
+ {
+ /* Make sure TREE_CONSTANT isn't set from build_constructor. */
+ TREE_CONSTANT (init) = false;
+ TREE_SIDE_EFFECTS (init) = false;
+ }
else
{
TREE_CONSTANT (init) = 1;
+ TREE_SIDE_EFFECTS (init) = false;
if (!(picflags & PICFLAG_NOT_ALL_SIMPLE))
TREE_STATIC (init) = 1;
}
--
2.18.1