This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Trust TREE_ADDRESSABLE


On June 7, 2014 1:54:06 PM CEST, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
>On Sat, Jun 7, 2014 at 12:59 PM, Eric Botcazou wrote:
>>> >In Ada we don't mark (external) variables as addressable if we
>don't
>>> >see their address taken.
>>>
>>> You have to (now).  The testing was of course to detect this...
>>
>> Well, you need to define what TREE_ADDRESSABLE means now, because
>according to
>>
>> /* In VAR_DECL, PARM_DECL and RESULT_DECL nodes, nonzero means
>address
>>    of this is needed.  So it cannot be in a register.
>> [...]
>> #define TREE_ADDRESSABLE(NODE) ((NODE)->base.addressable_flag)
>>
>> your change is clearly wrong and the Ada compiler clearly right.
>
>"Clearly"?
>
>An external variable is a VAR_DECL that cannot be in a register. It
>can be loaded into a register (or stored into), and for that its
>address is needed. So I would expect an external variable to be marked
>addressable by default.
>
>I was always surprised that this was not the case before Richi's
>change.

Well, honza was as well, so I thought I must be wrong.

>
>>  And auditing
>> the various front-ends might also be in order here if they really
>need to mark
>> every single external variable as addressable to be safe wrt
>aliasing.
>
>Right. And this should have been done (clearly ;-) ) before the patch
>was committed...

I thought that bootstrap and regtest plus what I remember from debug sessions was enough.

Anyway, an easy fix is to make all globals TREE_ADDRESSABLE somewhere in the varpool  code.

But I have no idea how to audit the frontends and judge their language specific knowledge they put into deciding whether a deck may have its address taken.

Richard.

>Ciao!
>Steven



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]