This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: spec2000 regression
- To: Jason Merrill <jason_merrill at redhat dot com>, gcc-patches at gcc dot gnu dot org, rth at cygnus dot com, aj at suse dot de
- Subject: Re: spec2000 regression
- From: Jan Hubicka <jh at suse dot cz>
- Date: Wed, 15 Aug 2001 14:41:27 +0200
- Cc: Jan Hubicka <jh at suse dot cz>, gcc at gcc dot gnu dot org
- References: <20010815123730.P19872@atrey.karlin.mff.cuni.cz> <m366bpsi91.fsf@prospero.cambridge.redhat.com>
> >>>>> "Jan" == Jan Hubicka <jh@suse.cz> writes:
>
> > So remaining patch I can't analyze completely is yours to alias.c
> > I've failed to find the corresponding email at gcc-patches mailing list
> > (even when I believe I've went across it in the pass)
>
> The subject line is "PATCH to get_alias_set". There were two messages.
>
> > so please can you double-check the patch and try to explain me what
> > exactly it is shooting for?
>
> It's trying to avoid recalculating the alias set for a variable. I suppose
> it could cause a performance regression if the initial alias set were
> wrong, but I would expect that to cause other problems as well.
Hi,
the problem is that actually code first sets the DECL_RTL and then calls
set_mem_attributes, that calls get_alias_set, but it thinks that the alias set
is already computed, but it isn't.
I am now testing following patch. OK to install if it succeeds?
It fixes my testcase:
long *a;
short *b;
main()
{
*a = 1;
*b = 2;
return *a;
}
Now gets again:
pushl %ebp
movl %esp, %ebp
pushl %eax
pushl %eax
movl a, %eax
andl $-16, %esp
movl $1, (%eax)
movl b, %eax
movw $2, (%eax)
movl %ebp, %esp
movl $1, %eax
popl %ebp
ret
Honza
Wed Aug 15 14:38:26 CEST 2001 Jan Hubicka <jh@suse.cz>
* alias.c (get_alias_set): Check that the alias set is already
computed.
Index: alias.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/alias.c,v
retrieving revision 1.137
diff -c -3 -p -r1.137 alias.c
*** alias.c 2001/08/08 16:56:50 1.137
--- alias.c 2001/08/15 12:38:13
*************** get_alias_set (t)
*** 530,536 ****
return it. This is necessary for C++ anonymous unions, whose
component variables don't look like union members (boo!). */
if (TREE_CODE (t) == VAR_DECL
! && DECL_RTL_SET_P (t) && GET_CODE (DECL_RTL (t)) == MEM)
return MEM_ALIAS_SET (DECL_RTL (t));
/* Give the language another chance to do something special. */
--- 530,537 ----
return it. This is necessary for C++ anonymous unions, whose
component variables don't look like union members (boo!). */
if (TREE_CODE (t) == VAR_DECL
! && DECL_RTL_SET_P (t) && GET_CODE (DECL_RTL (t)) == MEM
! && MEM_ALIAS_SET (DECL_RTL (t)))
return MEM_ALIAS_SET (DECL_RTL (t));
/* Give the language another chance to do something special. */