https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70847

Kai Tietz <ktietz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktietz at gcc dot gnu.org

--- Comment #3 from Kai Tietz <ktietz at gcc dot gnu.org> ---
This seems to be related to cp_fold_r's behavior to walk subtree for
OBJ_TYPE_REF.
Normally we can assume that in case of an OBJ_TYPE_REF tree, it was already
folded.  So we don't need to walk it again .

The following patch solves the issue for me on m32c.

Index: ../gcc/cp/cp-gimplify.c
===================================================================
--- ../gcc/cp/cp-gimplify.c     (revision 235430)
+++ ../gcc/cp/cp-gimplify.c     (working copy)
@@ -986,7 +986,8 @@
       cp_walk_tree (&OMP_FOR_PRE_BODY (stmt), cp_fold_r, data, NULL);
       *walk_subtrees = 0;
     }
-
+  else if (code == OBJ_TYPE_REF)
+    *walk_subtrees = 0;
   return NULL;
 }

Reply via email to