aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1997-11-05 01:49:52 +0000
committerJim Wilson <wilson@gcc.gnu.org>1997-11-04 17:49:52 -0800
commit4911814e8ea36c1e9732ed59a21ea297ca144d53 (patch)
treefecdf61648e68171f6b02195f5065bda05670fd4 /gcc
parent474eff885594b2e22a52fc103ef020d1c929df1f (diff)
downloadgcc-4911814e8ea36c1e9732ed59a21ea297ca144d53.zip
gcc-4911814e8ea36c1e9732ed59a21ea297ca144d53.tar.gz
gcc-4911814e8ea36c1e9732ed59a21ea297ca144d53.tar.bz2
Fix bitfield insert/extract aliasing problem found by GNAT.
* mips.md (insv, extzv, extv): Add change_address call. (movsi_ulw, movsi_usw): Change QImode to BLKmode in pattern. From-SVN: r16331
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/config/mips/mips.md15
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d95844d..a24d9fe 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
Tue Nov 4 16:55:11 1997 Jim Wilson <wilson@cygnus.com>
+ * mips.md (insv, extzv, extv): Add change_address call.
+ (movsi_ulw, movsi_usw): Change QImode to BLKmode in pattern.
+
* integrate.c (save_for_inline_copying): Copy parm_reg_stack_loc.
* reload.c (find_reloads, case 'm' and 'o'): Reject HIGH constants.
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 3e4382f..9c6852f 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -3152,6 +3152,9 @@ move\\t%0,%z4\\n\\
if (GET_CODE (operands[1]) != MEM)
FAIL;
+ /* Change the mode to BLKmode for aliasing purposes. */
+ operands[1] = change_address (operands[1], BLKmode, XEXP (operands[1], 0));
+
/* Otherwise, emit a lwl/lwr pair to load the value. */
emit_insn (gen_movsi_ulw (operands[0], operands[1]));
DONE;
@@ -3176,6 +3179,9 @@ move\\t%0,%z4\\n\\
if (GET_CODE (operands[1]) != MEM)
FAIL;
+ /* Change the mode to BLKmode for aliasing purposes. */
+ operands[1] = change_address (operands[1], BLKmode, XEXP (operands[1], 0));
+
/* Otherwise, emit a lwl/lwr pair to load the value. */
emit_insn (gen_movsi_ulw (operands[0], operands[1]));
DONE;
@@ -3200,6 +3206,9 @@ move\\t%0,%z4\\n\\
if (GET_CODE (operands[0]) != MEM)
FAIL;
+ /* Change the mode to BLKmode for aliasing purposes. */
+ operands[0] = change_address (operands[0], BLKmode, XEXP (operands[0], 0));
+
/* Otherwise, emit a swl/swr pair to load the value. */
emit_insn (gen_movsi_usw (operands[0], operands[3]));
DONE;
@@ -3209,7 +3218,7 @@ move\\t%0,%z4\\n\\
(define_insn "movsi_ulw"
[(set (match_operand:SI 0 "register_operand" "=&d,&d")
- (unspec:SI [(match_operand:QI 1 "general_operand" "R,o")] 0))]
+ (unspec:SI [(match_operand:BLK 1 "general_operand" "R,o")] 0))]
""
"*
{
@@ -3237,8 +3246,8 @@ move\\t%0,%z4\\n\\
(set_attr "length" "2,4")])
(define_insn "movsi_usw"
- [(set (match_operand:QI 0 "memory_operand" "=R,o")
- (unspec:QI [(match_operand:SI 1 "reg_or_0_operand" "dJ,dJ")] 1))]
+ [(set (match_operand:BLK 0 "memory_operand" "=R,o")
+ (unspec:BLK [(match_operand:SI 1 "reg_or_0_operand" "dJ,dJ")] 1))]
""
"*
{