diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2006-11-16 21:25:16 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2006-11-16 21:25:16 +0000 |
commit | a9e64c639ef604bfc2d734b3973dfc0953875877 (patch) | |
tree | 3474f1e6d8e5a0484dd9285fb4f30365e230b1df /gcc/gimplify.c | |
parent | c8cf9f0f27b4bc784419f60976390c6e4111ccae (diff) | |
download | gcc-a9e64c639ef604bfc2d734b3973dfc0953875877.zip gcc-a9e64c639ef604bfc2d734b3973dfc0953875877.tar.gz gcc-a9e64c639ef604bfc2d734b3973dfc0953875877.tar.bz2 |
re PR middle-end/26306 (ICE on volatile array with non-constant bounds)
PR middle-end/26306
* gimplify.c (gimplify_expr): Only force a load for references to
non-BLKmode volatile values.
* doc/implement-c.texi (Qualifiers implementation): Document the
interpretation of what a volatile access is.
* doc/extend.texi (C++ Extensions): Rework same documentation.
From-SVN: r118900
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index ab2efac..81a18a0 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -5854,7 +5854,8 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, gimple_test_f, fallback); break; - case ARRAY_REF: case ARRAY_RANGE_REF: + case ARRAY_REF: + case ARRAY_RANGE_REF: gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, gimple_test_f, fallback); gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p, @@ -5863,16 +5864,17 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, default: /* Anything else with side-effects must be converted to - a valid statement before we get here. */ + a valid statement before we get here. */ gcc_unreachable (); } *expr_p = NULL; } - else if (COMPLETE_TYPE_P (TREE_TYPE (*expr_p))) + else if (COMPLETE_TYPE_P (TREE_TYPE (*expr_p)) + && TYPE_MODE (TREE_TYPE (*expr_p)) != BLKmode) { - /* Historically, the compiler has treated a bare - reference to a volatile lvalue as forcing a load. */ + /* Historically, the compiler has treated a bare reference + to a non-BLKmode volatile lvalue as forcing a load. */ tree type = TYPE_MAIN_VARIANT (TREE_TYPE (*expr_p)); /* Normally, we do not want to create a temporary for a TREE_ADDRESSABLE type because such a type should not be @@ -5887,7 +5889,10 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, } else /* We can't do anything useful with a volatile reference to - incomplete type, so just throw it away. */ + an incomplete type, so just throw it away. Likewise for + a BLKmode type, since any implicit inner load should + already have been turned into an explicit one by the + gimplification process. */ *expr_p = NULL; } |