This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR middle-end/26306
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 05 Nov 2006 09:33:34 -0800
- Subject: Re: [PATCH] Fix PR middle-end/26306
- References: <200611051703.14455.ebotcazou@adacore.com>
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