This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/12676] m68k.c: LP64 bug
- From: "schwab at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Oct 2003 13:57:38 -0000
- Subject: [Bug target/12676] m68k.c: LP64 bug
- References: <20031019011644.12676.matt@3am-software.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12676
------- Additional Comments From schwab at suse dot de 2003-10-19 13:57 -------
It does matter because if sizeof(HOST_WIDE_INT) > sizeof(int) then the common
type will be long, thus the comparison will be a signed comparison.
Please try this patch instead:
Index: m68k.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/m68k.c,v
retrieving revision 1.111
diff -u -p -a -u -p -a -r1.111 m68k.c
--- m68k.c 13 Oct 2003 21:16:28 -0000 1.111
+++ m68k.c 19 Oct 2003 13:54:23 -0000
@@ -2467,7 +2467,7 @@ output_addsi3 (rtx *operands)
/* These insns can result from reloads to access
stack slots over 64k from the frame pointer. */
if (GET_CODE (operands[2]) == CONST_INT
- && INTVAL (operands[2]) + 0x8000 >= (unsigned) 0x10000)
+ && (INTVAL (operands[2]) < -32768 || INTVAL (operands[2]) > 32767))
return "move%.l %2,%0\n\tadd%.l %1,%0";
#ifdef SGS
if (GET_CODE (operands[2]) == REG)