This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[m68k] Fix for Bug #17114
- From: Peter Barada <peter at the-baradas dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: peter at the-baradas dot com
- Date: Fri, 3 Sep 2004 18:16:30 -0400 (EDT)
- Subject: [m68k] Fix for Bug #17114
The following patch fixes bug #17114 where the constraint allows code
that JUMP_IF_VALID_ADDRESS doesn't. I've tighted up the register
offset constraint to accapt only valid offsets, as well as to accept
register indirect per Jim Wilson's suggestions.
Tested on uberbaum.
gcc/ChangeLog:
2004-09-103 Peter Barada <peter@the-baradas.com>
* config/m68k/m68k.h (EXTRA_CONSTRAINT): Accept only vaid
offsets in 'U' case; alos allow register indirect in 'U' case.
Index: gcc/config/m68k/m68k.h
===================================================================
RCS file: /cvs/uberbaum/gcc/config/m68k/m68k.h,v
retrieving revision 1.120
diff -c -3 -p -r1.120 m68k.h
*** gcc/config/m68k/m68k.h 6 Aug 2004 07:14:56 -0000 1.120
--- gcc/config/m68k/m68k.h 28 Aug 2004 16:08:08 -0000
*************** extern enum reg_class regno_reg_class[];
*** 617,626 ****
&& GET_CODE (XEXP (OP, 0)) == REG) \
: \
(((CODE) == 'U') \
! ? (GET_CODE (OP) == MEM \
&& GET_CODE (XEXP (OP, 0)) == PLUS \
&& GET_CODE (XEXP (XEXP (OP, 0), 0)) == REG \
! && GET_CODE (XEXP (XEXP (OP, 0), 1)) == CONST_INT) \
: \
0))))
--- 617,630 ----
&& GET_CODE (XEXP (OP, 0)) == REG) \
: \
(((CODE) == 'U') \
! ? ((GET_CODE (OP) == MEM \
&& GET_CODE (XEXP (OP, 0)) == PLUS \
&& GET_CODE (XEXP (XEXP (OP, 0), 0)) == REG \
! && GET_CODE (XEXP (XEXP (OP, 0), 1)) == CONST_INT \
! && (INTVAL (XEXP (XEXP (OP, 0), 1)) >= -32768 \
! && INTVAL (XEXP (XEXP (OP, 0), 1)) <= 32767)) \
! || (GET_CODE (OP) == MEM \
! && GET_CODE (XEXP (OP, 0)) == REG)) \
: \
0))))