This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
darwin bootstrap fix 2 in a series of N
- From: Geoffrey Keating <gkeating at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 5 Sep 2003 21:04:42 -0700 (PDT)
- Subject: darwin bootstrap fix 2 in a series of N
This fixes the first of the most recent collection of Darwin bootstrap
problems, which is visible as:
/Users/regress/tbox/cvs-gcc/gcc/gcc/f/data.c: In function
`ffedata_value':
/Users/regress/tbox/cvs-gcc/gcc/gcc/f/data.c:304: error: insn does not
satisfy its constraints:
(call_insn:HI 1788 3853 1789 93
/Users/regress/tbox/cvs-gcc/gcc/gcc/f/data.c:1689 (parallel [
(call (mem:SI (reg/u:SI 2 r2) [0 S4 A8])
(const_int 32 [0x20]))
(use (const_int 0 [0x0]))
(clobber (reg:SI 65 lr))
]) 377 {*call_indirect_nonlocal_sysv}
(insn_list:REG_DEP_OUTPUT 1779 (insn_list:REG_DEP_OUTPUT 1778
(insn_list:REG_DEP_OUTPUT 1777 (insn_list:REG_DEP_OUTPUT 1776
(insn_list 1787 (insn_list 1786 (insn_list 1785 (insn_list 1780
(nil)))))))))
(nil)
(expr_list (use (reg:SI 5 r5 [ size ]))
(expr_list (use (reg:SI 4 r4 [ ptr2 ]))
(expr_list (use (reg:SI 3 r3 [ ptr1 ]))
(nil)))))
/Users/regress/tbox/cvs-gcc/gcc/gcc/f/data.c:304: internal compiler
error: in reload_cse_simplify_operands, at postreload.c:378
The reloads for that insn are:
Reloads for insn # 1788
Reload 0: reload_in (SI) = (symbol_ref:SI ("!t__ffetarget_memcpy_")
[flags 0x41] <function_decl 0xbc82f4 ffetarget_memcpy_>)
BASE_REGS, RELOAD_FOR_INPUT (opnum = 0), can't combine
reload_in_reg: (reg/v/u/f:SI 424 [ fn ])
reload_reg_rtx: (reg:SI 2 r2)
Reload 1: reload_out (SI) = (scratch:SI)
LINK_REGS, RELOAD_FOR_OUTPUT (opnum = 3)
reload_out_reg: (scratch:SI)
reload_reg_rtx: (reg:SI 65 lr)
and it's choosing r2 because, well, that's what PREFERRED_RELOAD_CLASS
says to do: a reload of a SYMBOL_REG returns BASE_REGS. However, for
this reload, BASE_REGS will not work.
This patch takes the bootstrap all the way through the GCC build to
the C++ library, where it dies with:
/var/tmp//ccGA5aaB.s:1088:non-relocatable subtraction expression,
"__ZNSt5ctypeIwE2idE" minus "L00000000002$pb"
/var/tmp//ccGA5aaB.s:1088:symbol: "__ZNSt5ctypeIwE2idE" can't be
undefined in a subtraction expression
--
- Geoffrey Keating <geoffk@apple.com>
===File ~/patches/gcc-darwin-reloadclassbotch.patch=========
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 2.982
diff -u -p -u -p -r2.982 ChangeLog
--- ChangeLog 5 Sep 2003 19:59:50 -0000 2.982
+++ ChangeLog 6 Sep 2003 03:57:54 -0000
@@ -1,3 +1,8 @@
+2003-09-05 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/darwin.h (PREFERRED_RELOAD_CLASS): Always return
+ a subset of the input class.
+
2003-09-05 Nitin Yewale <NitinY@KPITCummins.com>
* config/h8300/h8300-protos.h: Declare h8300_hard_regno_rename_ok
Index: config/rs6000/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/darwin.h,v
retrieving revision 1.40
diff -u -p -u -p -r1.40 darwin.h
--- config/rs6000/darwin.h 20 Aug 2003 02:58:58 -0000 1.40
+++ config/rs6000/darwin.h 6 Sep 2003 03:57:54 -0000
@@ -245,16 +245,17 @@ do { \
a SYMBOL_REF. */
#undef PREFERRED_RELOAD_CLASS
-#define PREFERRED_RELOAD_CLASS(X,CLASS) \
- (((GET_CODE (X) == CONST_DOUBLE \
- && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \
- ? NO_REGS \
- : (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \
- && (CLASS) == NON_SPECIAL_REGS) \
- ? GENERAL_REGS \
- : (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == HIGH) \
- ? BASE_REGS \
- : (CLASS)))
+#define PREFERRED_RELOAD_CLASS(X,CLASS) \
+ ((GET_CODE (X) == CONST_DOUBLE \
+ && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \
+ ? NO_REGS \
+ : ((GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == HIGH) \
+ && reg_class_subset_p (BASE_REGS, (CLASS))) \
+ ? BASE_REGS \
+ : (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \
+ && (CLASS) == NON_SPECIAL_REGS) \
+ ? GENERAL_REGS \
+ : (CLASS))
/* Fix for emit_group_load (): force large constants to be pushed via regs. */
#define ALWAYS_PUSH_CONSTS_USING_REGS_P 1
============================================================