* gimplify.c (gimplify_modify_expr): Do not optimize zero-sized types
if want_value.
testsuite/
* gcc.c-torture/compile/pr35432.c: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138793
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-08-06 Aldy Hernandez <aldyh@redhat.com>
+
+ PR middle-end/35432
+ * gimplify.c (gimplify_modify_expr): Do not optimize zero-sized types
+ if want_value.
+
2008-08-06 Jan Hubicka <jh@suse.cz>
* predict.c (maybe_hot_frequency_p): When profile is absent, all
side as statements and throw away the assignment. Do this after
gimplify_modify_expr_rhs so we handle TARGET_EXPRs of addressable
types properly. */
- if (zero_sized_type (TREE_TYPE (*from_p)))
+ if (zero_sized_type (TREE_TYPE (*from_p)) && !want_value)
{
gimplify_stmt (from_p, pre_p);
gimplify_stmt (to_p, pre_p);
+2008-08-06 Aldy Hernandez <aldyh@redhat.com>
+ PR middle-end/35432
+ * gcc.c-torture/compile/pr35432.c: New file.
+
2008-08-06 Arnaud Charlet <charlet@adacore.com>
* gnat.dg/iface_test.ad[s,b]: New test.
--- /dev/null
+/* PR middle-end/35432 */
+
+struct A
+{
+ char c[0];
+};
+
+void foo(struct A a)
+{
+ (a = a).c;
+}