On Fri, Apr 1, 2011 at 5:14 AM, Joseph S. Myers <jos...@codesourcery.com> wrote: > On Fri, 1 Apr 2011, H.J. Lu wrote: > >> On Fri, Apr 1, 2011 at 4:49 AM, Joseph S. Myers <jos...@codesourcery.com> >> wrote: >> > On Thu, 31 Mar 2011, H.J. Lu wrote: >> > >> >> Hi, >> >> >> >> I'd like to bump the default alignment of complex float from 4 byte >> >> to 8 byte. ADJUST_ALIGNMENT doesn't work since SC is a stand >> >> mode. Is that OK to update mode_base_align directly? >> > >> > What do you mean by "default alignment"? You can't change the alignment >> > in ABI terms, or that returned by alignof; the alignment of complex types >> > is required to be the same as that of "an array type containing exactly >> > two elements of the corresponding real type". >> > >> >> My ABI uses 8byte alignment for SCmode. How can I do that? > > That is not a valid ABI for ISO C, supposing that SCmode is _Complex > float, unless float also uses 8-byte alignment (and the representation of > _Complex float must be the same as that of float[2], as well as the > alignment, meaning that it would be at least 16 bytes in that case). > > You can do what you like in registers, or choose to align variables for > optimization to more than the ABI-specified alignment, but you need to > keep the in-memory representation and alignment of _Complex float the same > as that of float[2].
flloat is still 4 byte aligned. What kinds of bad things will happen if SC is 8 byte aligned and float is 4 byte aligned? -- H.J.