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. > 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... Ciao! Steven