On Fri, Dec 6, 2013 at 10:11 AM, Eric Botcazou <ebotca...@adacore.com> wrote: >> Here's the Correct Fix(tm). We may or may not decide to go for it because >> of concerns about ABI changes; in the latter case, any kludge that we'll >> put in place instead must be restricted to the cases caught by this patch. >> >> >> * stor-layout.c (compute_record_mode): Return BLKmode for a trailing >> array with size 0 or 1. > > Revised version without the one-by-one error...
It's not fully fixing the issue as _all_ aggregates that may be accessed beyond their declarations size are broken. I'd say we should simply stop giving aggregates a mode besides BLKmode. What can possibly break with that ... struct { char c[4]; } has SImode, we accept all trailing arrays as possibly extending beyond the struct declaration. Alternatively all structs with aggregate members should not have a mode != BLKmode. Previously you said it doesn't have ABI impacts and I doubt it has optimization impacts. Richard. > -- > Eric Botcazou