]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix C++ libgomp regressions
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 26 May 2021 07:51:36 +0000 (09:51 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 26 May 2021 08:03:35 +0000 (10:03 +0200)
This is only a stopgap fix.

gcc/
* gimplify.c (gimplify_decl_expr): Do not clear TREE_READONLY on a
DECL which is a reference for OMP.

gcc/gimplify.c

index ed825a93aa1b3c74dcd2ce69fd6ee9afc1c27abf..54bf59ab9d02f36cead4fbd465ae90634e551589 100644 (file)
@@ -1829,7 +1829,7 @@ gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p)
              gimplify_and_add (init, seq_p);
              ggc_free (init);
              /* Clear TREE_READONLY if we really have an initialization.  */
-             if (!DECL_INITIAL (decl))
+             if (!DECL_INITIAL (decl) && !omp_is_reference (decl))
                TREE_READONLY (decl) = 0;
            }
          else