[Bug middle-end/49168] [4.7 Regression] Aligned store used with unaligned address

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Thu May 26 08:21:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49168

--- Comment #1 from rguenther at suse dot de <rguenther at suse dot de> 2011-05-26 07:58:45 UTC ---
On Wed, 25 May 2011, hjl.tools at gmail dot com wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49168
> 
>            Summary: [4.7 Regression] Aligned store used with unaligned
>                     address
>            Product: gcc
>            Version: 4.7.0
>             Status: UNCONFIRMED
>           Severity: normal
>           Priority: P3
>          Component: middle-end
>         AssignedTo: unassigned@gcc.gnu.org
>         ReportedBy: hjl.tools@gmail.com
>                 CC: rguenth@gcc.gnu.org
> 
> 
> On Linux/x86-64, revision 174223 gave
> 
> [hjl@gnu-6 gcc]$ cat /tmp/x.c
> #include <stdarg.h>
> 
> void
> flt128_va (void *mem, va_list *ap)
> { 
>   __float128 d = va_arg (*ap, __float128);
>   __builtin_memcpy (mem, &d, sizeof (d));
> }
> [hjl@gnu-6 gcc]$ ./xgcc -B./ -O2 -S /tmp/x.c 
> [hjl@gnu-6 gcc]$ cat x.s
>     .file    "x.c"
>     .text
>     .p2align 4,,15
>     .globl    flt128_va
>     .type    flt128_va, @function
> flt128_va:
> .LFB0:
>     .cfi_startproc
>     movl    4(%rsi), %edx
>     cmpl    $176, %edx
>     jb    .L5
>     movq    8(%rsi), %rax
>     addq    $15, %rax
>     andq    $-16, %rax
>     leaq    16(%rax), %rdx
>     movq    %rdx, 8(%rsi)
>     movdqa    (%rax), %xmm0
>     movdqa    %xmm0, (%rdi)
>     ret
>     .p2align 4,,10
>     .p2align 3
> .L5:
>     mov    %edx, %eax
>     addq    16(%rsi), %rax
>     addl    $16, %edx
>     movl    %edx, 4(%rsi)
>     movdqa    (%rax), %xmm0
>     movdqa    %xmm0, (%rdi)
>     ret
>     .cfi_endproc
> .LFE0:
>     .size    flt128_va, .-flt128_va
> 
> It may be caused by revision 174206:
> 
> http://gcc.gnu.org/ml/gcc-cvs/2011-05/msg00987.html

If __float128 needs alignment then it needs to be handled
via movmisalign_optab on non-strict-align targets.

Richard.



More information about the Gcc-bugs mailing list