aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreao <andreao@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-30 22:20:31 +0000
committerandreao <andreao@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-30 22:20:31 +0000
commit12cb1b77a28f096159eceb97d2c26c7bbd9a1664 (patch)
treea69c9856c45308e44bf9b52e21afe94cd756f4e7
parentda28e2ef1ac7c8733e34e3ae20b32c8d83b2790e (diff)
ci on behalf of Gabriele Svelto
Added a simple fix for dealing with potentially unaligned packed fields. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/st/cli-be@145320 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/config/cil32/gimple-to-cil.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/config/cil32/gimple-to-cil.c b/gcc/config/cil32/gimple-to-cil.c
index 14e5a8a2366..6e81dc38c4d 100644
--- a/gcc/config/cil32/gimple-to-cil.c
+++ b/gcc/config/cil32/gimple-to-cil.c
@@ -654,6 +654,10 @@ gen_modify_expr (cil_stmt_iterator *csi, tree lhs, tree rhs)
gen_addr_expr (csi, obj);
gimple_to_cil_node (csi, rhs);
stmt = cil_build_stmt_arg (CIL_STFLD, fld);
+
+ if (contains_packed_reference (lhs))
+ cil_set_prefix_unaligned (stmt, 1);
+
cil_set_prefix_volatile (stmt, TREE_THIS_VOLATILE (lhs));
csi_insert_after (csi, stmt, CSI_CONTINUE_LINKING);
}
@@ -2096,6 +2100,10 @@ gen_comp_ref (cil_stmt_iterator *csi, tree node)
{
gen_addr_expr (csi, obj);
stmt = cil_build_stmt_arg (CIL_LDFLD, fld);
+
+ if (contains_packed_reference (node))
+ cil_set_prefix_unaligned (stmt, 1);
+
cil_set_prefix_volatile (stmt, TREE_THIS_VOLATILE (node));
csi_insert_after (csi, stmt, CSI_CONTINUE_LINKING);
}