This is the mail archive of the
mailing list for the GCC project.
Re: [PING] tighten gimple addressability checks
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Olivier Hainque" <hainque at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org, "Diego Novillo" <dnovillo at google dot com>
- Date: Fri, 7 Dec 2007 18:59:15 +0100
- Subject: Re: [PING] tighten gimple addressability checks
- References: <20071026122043.GA30522@cardhu.act-europe.fr> <20071207170127.GA8172@cardhu.act-europe.fr>
On Dec 7, 2007 6:01 PM, Olivier Hainque <firstname.lastname@example.org> wrote:
> Olivier Hainque wrote:
> > is_gimple_addressable is fairly permissive today, and I think too
> > permissive in some cases.
> > In particular, COMPONENT_REFs are all considered addressable while
> > the address of BIT_FIELD decls sometimes really can't be taken.
> This is a suggestion to fix regressions (compiler crash on valid
> code) compared to the 3.4 series. As I wrote then:
> > I realize this is invasive and would be happy to discuss enhancements
> > or alternate ways out as necessary.
"2) Some DECL_BIT_FIELD components can actually have their address taken
and rejecting all of those would lead to severe pessimization, typically
from useless creation of temporaries, if not compiler crashes when
variable sizes are at sake."
Can you elaborate on this somewhat? I believe that for
is_gimple_addressable (tree t)
return (is_gimple_id (t) || handled_component_p (t)
|| INDIRECT_REF_P (t));
there is indeed the defect that this allows BIT_FIELD_REF. I don't think
that the middle-end expects a sub-reference of a non-aligned unit (that
is, your claim that we would need to recurse sounds like another Ada
speciality - *sigh*).
But without some elaboration on why we cannot just fix is_gimple_addressable
I would go with such a patch instead.