fix incorrect SRA transformation on non-integral VIEW_CONVERT argument

Richard Guenther richard.guenther@gmail.com
Thu May 3 10:25:00 GMT 2012


On Thu, May 3, 2012 at 10:21 AM, Olivier Hainque <hainque@adacore.com> wrote:
>
> On Apr 30, 2012, at 16:18 , Olivier Hainque wrote:
>>> Can you formally relate those three representations and tell me why
>>> VIEW_CONVERT_EXPR is useful (not only convenient because of less operands)
>>> to use on lvalues (thus memory, compared to registers or constants)?
>>
>> I have ideas on how they are supposed to relate (corresponding to your
>> intuitive understanding, what is documented), but MEM_REF and BIT_FIELD_REF
>> were introduced much more recently though, so I'm pretty sure that there are
>> details that escape me.
>
>  One area of potential difference came to mind yesterday: regarding the
>  processing of type alignment differences. VCE to more aligned (of the
>  same size) would make a temp copy to yield a correctly aligned object.
>
>  Would MEM_REF do that as well ?

A temporary copy?  You mean if I do VIEW_CONVERT_EXPR <double> (longlong)
on x86 with -malign-double (so long long is 4 byte aligned and double is 8 byte
aligned) the access guarantees only 4 byte alignment but if we "spill" that to
a temporary the temporary will use double as type and thus get larger alignment
of 8 bytes?

MEM_REF <double> (&longlong) would assume 8-byte alignment of longlong
unless you use a double type variant with 4-byte alignment.

Richard.



More information about the Gcc-patches mailing list