+2005-08-31 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23167
+ * gimplify.c (gimplify_expr): Handle TREE_ADDRESSABLE types when
+ generating synthetic loads from volatile lvalues.
+
005-09-02 Nick Clifton <nickc@redhat.com>
* config/stormy16/stormy16-lib2.c (__popcounthi2, __parityhi2,
/* Historically, the compiler has treated a bare
reference to a volatile lvalue as forcing a load. */
tree type = TYPE_MAIN_VARIANT (TREE_TYPE (*expr_p));
- tree tmp = create_tmp_var (type, "vol");
+ /* Normally, we do want to create a temporary for a
+ TREE_ADDRESSABLE type because such a type should not be
+ copied by bitwise-assignment. However, we make an
+ exception here, as all we are doing here is ensuring that
+ we read the bytes that make up the type. We use
+ create_tmp_var_raw because create_tmp_var will abort when
+ given a TREE_ADDRESSSABLE type. */
+ tree tmp = create_tmp_var_raw (type, "vol");
+ gimple_add_tmp_var (tmp);
*expr_p = build (MODIFY_EXPR, type, tmp, *expr_p);
}
else