This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix IA-64 bootstrap failure
- From: Jan Hubicka <jh at suse dot cz>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Jakub Jelinek <jakub at redhat dot com>,Jim Wilson <wilson at specifixinc dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 2 Feb 2004 21:32:07 +0100
- Subject: Re: Fix IA-64 bootstrap failure
- References: <20040126205106.GH20409@kam.mff.cuni.cz> <jezncaxpcm.fsf@sykes.suse.de> <20040128125841.GK8094@kam.mff.cuni.cz> <jeisiw19hr.fsf@sykes.suse.de> <20040128200432.GZ8094@kam.mff.cuni.cz> <40185493.9030909@specifixinc.com> <20040129004557.GC558@kam.mff.cuni.cz> <20040129073703.GY31589@devserv.devel.redhat.com> <20040129101810.GD32159@kam.mff.cuni.cz>
>
> Right. Thanks for noticing it!
> Since you went trought the fixing the issue too, can you please try to
> verify my reasioning in the mail? I am not at all sure about it, but it
> seems to make sense to me.
> Still i am not sure whether your patch shall not produce better code
> than mine, then we shall go with it of course.
Hi,
to make review easier, here is updated version of patch. I would really
like to see it accepted for mainline/branch so the IA-64 bootstrap works
again and I can try to ask Mark for aproving CSElib patches for mainline
I've re-tested the patch on current tree and also verified that it does
not affect code generated for IA-64 on combine.c.
Honza
2004-02-02 Jan Hubicka <jh@suse.cz>
* alias.c (find_base_term, get_addr): Do not dereference NULL
pointer when all VALUE's locations has been invalidated.
(rtx_equal_for_memref_p): Simplify checking of VALUEs.
Index: alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/alias.c,v
retrieving revision 1.213
diff -c -3 -p -r1.213 alias.c
*** alias.c 2 Feb 2004 00:17:08 -0000 1.213
--- alias.c 2 Feb 2004 20:27:46 -0000
*************** rtx_equal_for_memref_p (rtx x, rtx y)
*** 1139,1147 ****
/* Some RTL can be compared without a recursive examination. */
switch (code)
{
- case VALUE:
- return CSELIB_VAL_PTR (x) == CSELIB_VAL_PTR (y);
-
case REG:
return REGNO (x) == REGNO (y);
--- 1139,1144 ----
*************** rtx_equal_for_memref_p (rtx x, rtx y)
*** 1151,1156 ****
--- 1148,1154 ----
case SYMBOL_REF:
return XSTR (x, 0) == XSTR (y, 0);
+ case VALUE:
case CONST_INT:
case CONST_DOUBLE:
/* There's no need to compare the contents of CONST_DOUBLEs or
*************** find_base_term (rtx x)
*** 1325,1330 ****
--- 1323,1330 ----
case VALUE:
val = CSELIB_VAL_PTR (x);
+ if (!val)
+ return 0;
for (l = val->locs; l; l = l->next)
if ((x = find_base_term (l->loc)) != 0)
return x;
*************** get_addr (rtx x)
*** 1502,1515 ****
if (GET_CODE (x) != VALUE)
return x;
v = CSELIB_VAL_PTR (x);
! for (l = v->locs; l; l = l->next)
! if (CONSTANT_P (l->loc))
! return l->loc;
! for (l = v->locs; l; l = l->next)
! if (GET_CODE (l->loc) != REG && GET_CODE (l->loc) != MEM)
! return l->loc;
! if (v->locs)
! return v->locs->loc;
return x;
}
--- 1502,1518 ----
if (GET_CODE (x) != VALUE)
return x;
v = CSELIB_VAL_PTR (x);
! if (v)
! {
! for (l = v->locs; l; l = l->next)
! if (CONSTANT_P (l->loc))
! return l->loc;
! for (l = v->locs; l; l = l->next)
! if (GET_CODE (l->loc) != REG && GET_CODE (l->loc) != MEM)
! return l->loc;
! if (v->locs)
! return v->locs->loc;
! }
return x;
}