This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix IA-64 bootstrap failure
> Jan Hubicka <jh@suse.cz> writes:
>
> >> Jan Hubicka <jh@suse.cz> writes:
> >>
> >> > I've commited as obvious the attached patch that solves the bootstrap
> >> > failure by clearing out pointer pointing to value being released.
> >>
> >> Doesn't work for me, I still get a ICE while compiling c-decl.c on
> >> ia64-linux.
> >
> > Sorry, I missed your emails, so didin't reply earlier.
> > Do you still get the failure?
>
> Yes.
>
> stage1/xgcc -Bstage1/ -B/usr/local/ia64-suse-linux/bin/ -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wold-style-definition -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include ../../gcc/c-decl.c -o c-decl.o
> ../../gcc/c-decl.c: In function `xref_tag':
> ../../gcc/c-decl.c:4737: internal compiler error: Segmentation fault
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Hi,
this patch solve at least same crash I can get on i386 bootstrap with
-fsched2-use-superblocks. The problem is that we remove location list header
when it is no longer containing usefull values, but alias.c dereference it.
I believe that the scheme of removing the datastructures produce same decisions
as it would if the useless values were not recycled.
Bootstrapped/regtested i686-pc-gnu-linux, OK for mainline/3.4 branch?
2004-01-28 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.
Index: alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/alias.c,v
retrieving revision 1.212
diff -c -3 -p -r1.212 alias.c
*** alias.c 22 Jan 2004 11:35:58 -0000 1.212
--- alias.c 28 Jan 2004 19:45:14 -0000
*************** find_base_term (rtx x)
*** 1325,1330 ****
--- 1325,1332 ----
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;
}
--- 1504,1520 ----
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;
}