This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
m68k patch for handling m5200 pushes and pops
- To: gcc-patches at gcc dot gnu dot org
- Subject: m68k patch for handling m5200 pushes and pops
- From: Will Cohen <wcohen at redhat dot com>
- Date: Mon, 13 Aug 2001 17:35:35 -0400
- Organization: Red Hat, Inc.
I found that some of the changes in how the push and pop are
generated for variants of the m68k (5200) were causing some problems. I
would
got the following message when attempting to building the libstdc++-v3
libraries:
/dunes/wcohen/virg-uber/m68k-build/gcc/xgcc
-B/dunes/wcohen/virg-uber/m68k-build/gcc/ -nostdinc++
-L/dunes/wcohen/virg-uber/m68k-build/m68k-elf/libstdc++-v3/src
-L/dunes/wcohen/virg-uber/m68k-build/m68k-elf/libstdc++-v3/src/.libs
-nostdinc -B/dunes/wcohen/virg-uber/m68k-build/m68k-elf/newlib/ -isystem
/dunes/wcohen/virg-uber/m68k-build/m68k-elf/newlib/targ-include -isystem
/dunes/wcohen/virg-uber/devo/newlib/libc/include
-B/usr/local/m68k-elf/bin/ -B/usr/local/m68k-elf/lib/ -isystem
/usr/local/m68k-elf/include -L/dunes/wcohen/virg-uber/m68k-build/ld
-nostdinc++
-I/dunes/wcohen/virg-uber/m68k-build/m68k-elf/libstdc++-v3/include/m68k-elf
-I/dunes/wcohen/virg-uber/m68k-build/m68k-elf/libstdc++-v3/include
-I../../../../devo/libstdc++-v3/libsupc++
-I../../../../devo/libstdc++-v3/libmath -g -O2 -fno-implicit-templates
-Wall -Wno-format -W -Wwrite-strings -Winline
-fdiagnostics-show-location=once -g -c c++locale.cc -o c++locale.o
c++locale.cc: In member function `void
std::numpunct<_CharT>::_M_initialize_numpunct(int*) [with _CharT =
char]':
c++locale.cc:62: Unrecognizable insn:
(insn 225 222 226 (set (mem/s:QI (pre_modify:SI (reg/f:SI 15 %sp)
(plus:SI (reg/f:SI 15 %sp)
(const_int -2 [0xfffffffe]))) 0)
(const_int 0 [0x0])) -1 (nil)
(nil))
c++locale.cc:62: Internal compiler error in extract_insn, at
recog.c:2128
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
I tracked this problem down to print_operand_address in m68k.c and
INDIRECTABLE_1_ADDRESS_P in m68k.h missing checks for PRE_MODIFY and
POST_MODIFY.
Here is my ChangeLog entry and the associated patch file:
2001-08-13 W. E. Cohen (wcohen@redhat.com)
* config/m68k/m68k.c (print_operand_address): Added cases for
PRE_MODIFY and POST_MODIFY. * config/m68k/m68k.h
(INDIRECTABLE_1_ADDRESS_P): Added checks for PRE_MODIFY and
POST_MODIFY.
I have verified that the patch corrects the problem and allows the C++
libraries to be built. Okay to check in?
-Will
--
Will Cohen, GCC Engineer ------ ,__o
Red Hat, 2600 Meridian pkwy, Durham, NC 27713 ------ _-\_<,
Office (919)-547-0012 x390 Fax (919)-547-0024 ------ (*)/'(*)
Index: m68k/m68k.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/m68k.c,v
retrieving revision 1.53
diff -c -2 -p -r1.53 m68k.c
*** m68k.c 2001/08/10 16:56:53 1.53
--- m68k.c 2001/08/13 21:31:22
*************** print_operand_address (file, addr)
*** 3594,3597 ****
--- 3594,3598 ----
#endif
break;
+ case PRE_MODIFY:
case PRE_DEC:
#ifdef MOTOROLA
*************** print_operand_address (file, addr)
*** 3601,3604 ****
--- 3602,3606 ----
#endif
break;
+ case POST_MODIFY:
case POST_INC:
#ifdef MOTOROLA
Index: m68k/m68k.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/m68k.h,v
retrieving revision 1.53
diff -c -2 -p -r1.53 m68k.h
*** m68k.h 2001/07/30 21:30:40 1.53
--- m68k.h 2001/08/13 21:31:23
*************** __transfer_from_trampoline () \
*** 1527,1530 ****
--- 1527,1533 ----
|| ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_INC) \
&& LEGITIMATE_BASE_REG_P (XEXP (X, 0))) \
+ || (!TARGET_5200 \
+ && (GET_CODE (X) == PRE_MODIFY || GET_CODE (X) == POST_MODIFY) \
+ && LEGITIMATE_BASE_REG_P (XEXP (X, 0))) \
|| (GET_CODE (X) == PLUS \
&& LEGITIMATE_BASE_REG_P (XEXP (X, 0)) \