[PATCH] Fix PR middle-end/26306
Mark Mitchell
mark@codesourcery.com
Mon Nov 6 17:54:00 GMT 2006
Richard Kenner wrote:
> When you're talking about an aggegate type, you can easily get caught up in
> higher-level semantics.
My beef with AGGREGATE_TYPE_P is that I can't see any reason that an
SImode "struct S { int i; }" should be treated differently from plain
"int i". Even accepting the arguments about hardware registers, etc., I
would still have a hard time explaining why the struct should behave
differently from the scalar.
> Nobody writes code that does this sort of stuff anymore: volatile is
> typically used for very different purposes now (shared memory). So, in my
> opinion, all we care about is legacy code and for that, the only important
> thing is to generate EXACTLY the same things we used to: trying to define
> some new semantic for a case that nobody will use in modern code seems
> dubious to me.
Even under that argument, AGGREGATE_TYPE_P still isn't the right thing,
since, IIUC, what we tested before was BLKmode. Shouldn't the test be
using that instead, if our goal is to replicate the old semantics?
I'm not sure why the semantics of:
struct S { int i; };
volatile struct S s;
s;
should be different between machines just because on some machines we
give the structure SImode while on others we might give it BLKmode.
But, given that volatile is (as you say) a very low-level thing, with
inherently system-dependent variations, I'd be OK with that.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
More information about the Gcc-patches
mailing list