This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: c/838: sparc-solaris2.7 extra testsuite failures when RTL checking
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>, law at redhat dot com, gcc-patches at gcc dot gnu dot org
- Subject: Re: c/838: sparc-solaris2.7 extra testsuite failures when RTL checking
- From: Graham Stott <grahams at redhat dot com>
- Date: Wed, 22 Nov 2000 21:41:04 +0000
- References: <10011220159.AA11877@vlsi1.ultra.nyu.edu> <3A1BD1AF.318C2F6C@redhat.com>
Graham Stott wrote:
>
> Richard
>
> Richard Kenner wrote:
> >
> > > DECL_NONADDRESSABLE_P (field)
> > > ! ? (GET_CODE (to_rtx) == REG ? 0 : MEM_AL
> > > IAS_SET (to_rtx))
> > > : get_alias_set (TREE_TYPE (field)));
> > I would write it as
> >
> > (GET_CODE (to_rtx) == MEM ? MEM_ALIAS_SET (to_rtx) : 0)
> >
> > Slightly simpler is just to change the original condition to
> >
> > DECL_NONADDRESSABLE_P (field) && GET_CODE (to_rtx) == MEM
> >
>
> This looks OK to me. We will then use the alias set of the fields type if the
> field it not addressable or not a MEM.
>
> Jeff do you prefer this over the original patch.
>
> > and leave the rest alone.
> >
> > But how is this coming up? I thought DECL_NONADDRESSABLE_P is never set
> > in C? (Note that the change is still needed, but this needs to be understood).
> It is set for bitfields which are indeed not addressable in C (i.e. one cannot
> take the address of a bitfield).
>
> Graham
I have updated my patch following Kenner's suggestion.
Bootstrapped on x86-linux with no regressions.
OK to commit?
ChangeLog
* expr.c (store_constructor): If a field is non addressable and
the target is a MEM use MEM_ALIAS_SET otherwise use get_alias_set.
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.277
diff -c -p -r1.277 expr.c
*** expr.c 2000/11/21 06:55:41 1.277
--- expr.c 2000/11/22 18:54:41
*************** store_constructor (exp, target, align, c
*** 4408,4414 ****
#endif
store_constructor_field (to_rtx, bitsize, bitpos, mode,
TREE_VALUE (elt), type, align, cleared,
! DECL_NONADDRESSABLE_P (field)
? MEM_ALIAS_SET (to_rtx)
: get_alias_set (TREE_TYPE (field)));
}
--- 4408,4415 ----
#endif
store_constructor_field (to_rtx, bitsize, bitpos, mode,
TREE_VALUE (elt), type, align, cleared,
! (DECL_NONADDRESSABLE_P (field)
! && GET_CODE (to_rtx) == MEM)
? MEM_ALIAS_SET (to_rtx)
: get_alias_set (TREE_TYPE (field)));
}