This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [REPOST] Invalid Code when reading from unaligned zero-sized array
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Bernd Edlinger <bernd dot edlinger at hotmail dot de>, Jeff Law <law at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 10 Dec 2013 11:04:53 +0100
- Subject: Re: [REPOST] Invalid Code when reading from unaligned zero-sized array
- Authentication-results: sourceware.org; auth=none
- References: <DUB122-W20B5CD3C7B50824A33E21AE4D50 at phx dot gbl> <9742631 dot bqH1dR3knH at polaris> <eb8f7f93-f9f7-44c2-ab8f-43249dcdcc4c at email dot android dot com>
> What are the transformations that are enabled by making something not
> BLKmode?
>
> On the gimple level I cannot think of one..
On the RTL level, it's simple: anything BLKmode is forced to memory instead of
being loaded into registers.
> >This could work as well, although I'd restrict this to arrays,
> >recursively.
>
> Works for me.
Are we sure that we really support out-of-bounds accesses for arbitrary arrays
though? It seems to me that we easily take advantage of them e.g. in loops to
invoke undefined behavior. IMO it's not clear whether we want to risk more
accidental ABI changes if they are not supported throughout the compiler.
--
Eric Botcazou