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] Tree SRA and atomicity/volatility


Eric Botcazou wrote:

> 2007-01-06  Eric Botcazou  <ebotcazou@adacore.com>
> 
> 	* tree-sra.c (sra_walk_fns) <ldst>: Document new restriction.
> 	(sra_walk_modify_expr) <rhs_elt>: Treat the reference as a use
> 	if the lhs has side-effects.
> 	<lhs_elt>: Treat the reference as a use if the rhs has side-effects.
>
> :ADDPATCH Tree-SRA:

I've read through this thread, and I think Eric's patch makes sense.  (I
think Richard G. eventually came to the same conclusion, so I'm not
claiming this is some brilliant insight on my part.)  Even in C, keeping
volatile accesses "more atomic" seems like a good thing.  And,
certainly, any possible pessimization by not doing individual accesses
to move data out of volatile structures is going to be insignificant, to
overall program runtime.

As the previous thread about volatile (involving differences, if any,
between scalars and BLKmode objects) shows, it's hard to simultaneously
(a) precisely define volatile and (b) hew to existing
practice/expectations.  But, we can bias the compiler towards more
atomicity, and, in practice, people will be happier with GCC if we don't
try to get too clever in the presence of volatile.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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