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] Fix PR middle-end/26306


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() {
    s;
  }

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 constructor.

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 accurate.

--
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]