Commit 4e9bb42b by Aldy Hernandez Committed by Aldy Hernandez

expmed.c (store_bit_field): Reset alias set for memory.

2002-03-13  Aldy Hernandez  <aldyh@redhat.com>

        * expmed.c (store_bit_field): Reset alias set for memory.
        (extract_bit_field): Same.

From-SVN: r50706
parent 2f9834e8
2002-03-13 Aldy Hernandez <aldyh@redhat.com>
* expmed.c (store_bit_field): Reset alias set for memory.
(extract_bit_field): Same.
2002-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2002-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-common.c (c_tree_code_type, c_tree_code_length, * c-common.c (c_tree_code_type, c_tree_code_length,
......
...@@ -392,6 +392,15 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size) ...@@ -392,6 +392,15 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size)
} }
} }
/* We may be accessing data outside the field, which means
we can alias adjacent data. */
if (GET_CODE (op0) == MEM)
{
op0 = shallow_copy_rtx (op0);
set_mem_alias_set (op0, 0);
set_mem_expr (op0, 0);
}
/* If OP0 is a register, BITPOS must count within a word. /* If OP0 is a register, BITPOS must count within a word.
But as we have it, it counts within whatever size OP0 now has. But as we have it, it counts within whatever size OP0 now has.
On a bigendian machine, these are not the same, so convert. */ On a bigendian machine, these are not the same, so convert. */
...@@ -1069,6 +1078,15 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp, ...@@ -1069,6 +1078,15 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
} }
} }
/* We may be accessing data outside the field, which means
we can alias adjacent data. */
if (GET_CODE (op0) == MEM)
{
op0 = shallow_copy_rtx (op0);
set_mem_alias_set (op0, 0);
set_mem_expr (op0, 0);
}
/* ??? We currently assume TARGET is at least as big as BITSIZE. /* ??? We currently assume TARGET is at least as big as BITSIZE.
If that's wrong, the solution is to test for it and set TARGET to 0 If that's wrong, the solution is to test for it and set TARGET to 0
if needed. */ if needed. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment