This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: Fix PR26734: GCC cannot bootstrap on IA64 HP-UX (repost).
- From: Maxim Kuvyrkov <mkuvyrkov at ispras dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 28 Mar 2006 15:28:56 -0500
- Subject: [PATCH]: Fix PR26734: GCC cannot bootstrap on IA64 HP-UX (repost).
Hi!
GCC fails to bootstrap at ia64-hpux due to wrong computation of the size
of DEPS_LIST rtx. Before my patch any rtx could contain either rtunion
or HOST_WIDE_INT, but not both. DEPS_LIST is defined to hold two
rtunions and one HOST_WIDE_INT. As it wasn't mentioned among special
cases of rtx_code_size its size calculated assuming all its fields are
rtunions.
This problem can be fixed by changing the type of the second operand of
DEPS_LIST rtx to 'int'.
SPECCPU 2000 results don't change with this patch applied.
Bootstrapped and regtested on ia64-unknown-linux, ia64-hp-hpux11.23 and
i686-unknown-linux.
Ok for trunk?
--
Maxim
2006-03-28 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
* rtl.def (DEPS_LIST): Change type of the second operand to 'int'.
* target.h (struct gcc_target.speculate_insn): Change type of the
second parameter to 'int'.
* lists.c (alloc_DEPS_LIST): Change signature. Update reference to
the second operand of the DEPS_LIST.
(copy_DEPS_LIST_list): Update reference to the second operand of the
DEPS_LIST.
* rtl.h (alloc_DEPS_LIST): Update signature.
* sched-int.h (ds_t): Change typedef to 'int'.
(DEP_STATUS, BITS_PER_DEP_STATUS): Update.
--- gcc/lists.c (revision 209)
+++ gcc/lists.c (local)
@@ -159,7 +159,7 @@ alloc_EXPR_LIST (int kind, rtx val, rtx
node available, we'll use it, otherwise a call to gen_rtx_DEPS_LIST
is made. */
rtx
-alloc_DEPS_LIST (rtx val, rtx next, HOST_WIDE_INT ds)
+alloc_DEPS_LIST (rtx val, rtx next, int ds)
{
rtx r;
@@ -169,7 +169,7 @@ alloc_DEPS_LIST (rtx val, rtx next, HOST
unused_deps_list = XEXP (r, 1);
XEXP (r, 0) = val;
XEXP (r, 1) = next;
- XWINT (r, 2) = ds;
+ XINT (r, 2) = ds;
PUT_REG_NOTE_KIND (r, VOIDmode);
gcc_assert (GET_CODE (r) == DEPS_LIST);
@@ -257,7 +257,7 @@ copy_DEPS_LIST_list (rtx list)
while (list)
{
- *resp = alloc_DEPS_LIST (XEXP (list, 0), 0, XWINT (list, 2));
+ *resp = alloc_DEPS_LIST (XEXP (list, 0), 0, XINT (list, 2));
PUT_REG_NOTE_KIND (*resp, REG_NOTE_KIND (list));
resp = &XEXP (*resp, 1);
list = XEXP (list, 1);
--- gcc/rtl.def (revision 209)
+++ gcc/rtl.def (local)
@@ -95,9 +95,8 @@ DEF_RTL_EXPR(INSN_LIST, "insn_list", "ue
/* a linked list of dependencies.
The insns are represented in print by their uids.
- Operand 2 is a degree of speculativeness of the dependence.
- Operand 3 is a degree of weakness of the dependence. */
-DEF_RTL_EXPR(DEPS_LIST, "deps_list", "uew", RTX_EXTRA)
+ Operand 2 is the status of a dependence (see sched-int.h for more). */
+DEF_RTL_EXPR(DEPS_LIST, "deps_list", "uei", RTX_EXTRA)
/* SEQUENCE appears in the result of a `gen_...' function
for a DEFINE_EXPAND that wants to make several insns.
--- gcc/rtl.h (revision 209)
+++ gcc/rtl.h (local)
@@ -1757,7 +1757,7 @@ void free_INSN_LIST_node (rtx);
rtx alloc_INSN_LIST (rtx, rtx);
rtx alloc_EXPR_LIST (int, rtx, rtx);
void free_DEPS_LIST_list (rtx *);
-rtx alloc_DEPS_LIST (rtx, rtx, HOST_WIDE_INT);
+rtx alloc_DEPS_LIST (rtx, rtx, int);
void remove_free_DEPS_LIST_elem (rtx, rtx *);
void remove_free_INSN_LIST_elem (rtx, rtx *);
rtx remove_list_elem (rtx, rtx *);
--- gcc/sched-int.h (revision 209)
+++ gcc/sched-int.h (local)
@@ -36,8 +36,8 @@ extern state_t curr_state;
/* Forward declaration. */
struct ready_list;
-/* Type to represent status of a dependence. A convinient short alias. */
-typedef HOST_WIDE_INT ds_t;
+/* Type to represent status of a dependence. */
+typedef int ds_t;
/* Type to represent weakness of speculative dependence. */
typedef int dw_t;
@@ -377,10 +377,10 @@ extern regset *glat_start, *glat_end;
for using to describe instruction's status. It is set whenever instuction
has at least one dependence, that cannot be overcome.
See also: check_dep_status () in sched-deps.c . */
-#define DEP_STATUS(LINK) XWINT (LINK, 2)
+#define DEP_STATUS(LINK) XINT (LINK, 2)
/* We exclude sign bit. */
-#define BITS_PER_DEP_STATUS (HOST_BITS_PER_WIDE_INT - 1)
+#define BITS_PER_DEP_STATUS (HOST_BITS_PER_INT - 1)
/* First '4' stands for 3 dep type bits and HARD_DEP bit.
Second '4' stands for BEGIN_{DATA, CONTROL}, BE_IN_{DATA, CONTROL}
--- gcc/target.h (revision 209)
+++ gcc/target.h (local)
@@ -329,7 +329,7 @@ struct gcc_target
0, if current pattern satisfies the requested speculation type,
1, if pattern of the instruction should be changed to the newly
generated one. */
- int (* speculate_insn) (rtx, HOST_WIDE_INT, rtx *);
+ int (* speculate_insn) (rtx, int, rtx *);
/* The following member value is a pointer to a function called
by the insn scheduler. It should return true if the check instruction