[PATCH] Fix PR middle-end/26306

Mark Mitchell mark@codesourcery.com
Sun Nov 5 17:33:00 GMT 2006

Eric Botcazou wrote:

> This is a regression present in every compiler of the 4.x series.  The 
> compiler aborts on the attached Ada testcase because it is trying to
> force a load of a volatile aggregate object with variable size.

Interesting; there was a similar problem with volatile in C++ coming 
from this same code.  I think it was something like:

   struct S {
     S(const S&);

   volatile S s;

   void f() {

though that might be wrong.  The point was that the gimplifier tried to 
generate a load of a type with TREE_ADDRESSABLE set, and that caused an 
abort because we know that copying such a type requires calling the copy 

IIRC, Jason Merrill worked around this in the C++ front end, which makes 
sense in that if we know in the front end that the code is pointless, 
then we can avoid showing it to the middle end.

However, if we do want to do this in the middle end, then checking 
TREE_ADDRESSABLE (rather than AGGREGATE_TYPE_P) might be better?  Not 
all aggregates have BLK_MODE, so the analogy with 3.4 isn't completely 

Mark Mitchell
(650) 331-3385 x713

More information about the Gcc-patches mailing list