https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117490

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to uecker from comment #3)
> Ah, your are right. The declared type rules makes it valid. I forgot about
> it because it is never explicitly used for anything, but here it makes a
> difference.

I'll note that the middle-end doesn't have a declared-type rule and instead
a store alters the effective type used.  So for

void *p = malloc (sizeof (s3));
f2 (p, p);

f2() invokes UB according to the standard but

s3 x;
f2(&x, &x);

does not?  That seems silly.

Reply via email to