------- Comment #7 from rguenth at gcc dot gnu dot org  2009-04-07 15:29 -------
Minor data point (-O1 -g):

        movss   4(%rbx), %xmm3
        movss   (%rbx), %xmm2
        movss   (%rsp), %xmm1
        movss   4(%rsp), %xmm0
        call    __mulsc3

Breakpoint 1, 0x00007ffff7667990 in __mulsc3 () from /lib64/libgcc_s.so.1

(gdb) p $xmm0
$1 = {v4_float = {4, 0, 0, 0}, v2_double = {5.3464347077054713e-315, 0}, 
  v16_int8 = {0, 0, -128, 64, 0 <repeats 12 times>}, v8_int16 = {0, 16512, 0, 
    0, 0, 0, 0, 0}, v4_int32 = {1082130432, 0, 0, 0}, v2_int64 = {1082130432, 
    0}, uint128 = 0x00000000000000000000000040800000}
(gdb) p $xmm1
$2 = {v4_float = {2.24207754e-44, 0, 0, 0}, v2_double = {
    7.9050503334599447e-323, 0}, v16_int8 = {16, 0 <repeats 15 times>}, 
  v8_int16 = {16, 0, 0, 0, 0, 0, 0, 0}, v4_int32 = {16, 0, 0, 0}, v2_int64 = {
    16, 0}, uint128 = 0x00000000000000000000000000000010}
(gdb) p $xmm2
$3 = {v4_float = {2, 0, 0, 0}, v2_double = {5.3049894774131808e-315, 0}, 
  v16_int8 = {0, 0, 0, 64, 0 <repeats 12 times>}, v8_int16 = {0, 16384, 0, 0, 
    0, 0, 0, 0}, v4_int32 = {1073741824, 0, 0, 0}, v2_int64 = {1073741824, 0}, 
  uint128 = 0x00000000000000000000000040000000}
(gdb) p $xmm3
$4 = {v4_float = {0, 0, 0, 0}, v2_double = {0, 0}, v16_int8 = {
    0 <repeats 16 times>}, v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0}, v4_int32 = {0, 
    0, 0, 0}, v2_int64 = {0, 0}, uint128 = 0x00000000000000000000000000000000}

thus xmm1 is garbled.

marking the specific std::transform always_inline fixes the issue.  The
arguments to that transform are already garbled:

__unary_op=
        {<std::unary_function<std::complex<float>, std::complex<float> >> =
{<No data fields>}, op = {<std::binary_function<std::complex<float>,
std::complex<float>, std::complex<float> >> = {<No data fields>}, <No data
fields>}, value = {_M_value = 4 + -3.60319284e+33 * I}

Marking std::bind2nd noinline makes it fail at -O2 as well, its arguments
look good:

(gdb) p __x
$1 = (const std::complex<float> &) @0x7fffffffde10: {_M_value = 4 + 0 * I}

but its assembly looks weird:

_ZSt7bind2ndISt10multipliesISt7complexIfEES2_ESt9binder2ndIT_ERKS5_RKT0_:
.LFB1710:
        .file 1 "/usr/include/c++/4.4/backward/binders.h"
        .loc 1 164 0
        .cfi_startproc
.LVL0:
        .loc 1 167 0
        movl    (%rsi), %edx
        movl    4(%rsi), %eax
        movl    %edx, -20(%rsp)
        movl    %eax, -16(%rsp)
        .loc 1 168 0
        movq    -24(%rsp), %xmm0
        ret

so the error seems to be in the source or compilation of
std::bind2nd<std::multiplies<std::complex<float> >, std::complex<float> >

Paolo, can you provide an idea on how the result type of that looks like?
(I'm lost in the headers ... ;))


-- 


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

Reply via email to