[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-08 Thread rguenth at gcc dot gnu dot org
--- Comment #21 from rguenth at gcc dot gnu dot org 2009-04-08 08:39 --- Ah, the key is the complex type! Thus, the following testcase works struct Y {}; struct X { Y y; __complex__ float val; }; struct X __attribute__((noinline)) foo (float *p) { struct X x; __real x.val =

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-08 Thread paolo dot carlini at oracle dot com
--- Comment #22 from paolo dot carlini at oracle dot com 2009-04-08 09:11 --- Excellent, thanks. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39678

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread rguenth at gcc dot gnu dot org
--- Comment #5 from rguenth at gcc dot gnu dot org 2009-04-07 14:51 --- The expected output is 10 10 10 10 (10,0) (10,0) (10,0) (10,0) correct? With -O0 I get 10 10 10 10 (nan,nan) (nan,nan) (10,0) (10,0) while for -m32 it is ok. So it appears only the float variant is affected?

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread rguenth at gcc dot gnu dot org
--- 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, 0x77667990 in

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #8 from paolo dot carlini at oracle dot com 2009-04-07 15:32 --- Ok, give me a few minutes, I'm going to dig a bit further... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39678

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread rguenth at gcc dot gnu dot org
--- Comment #9 from rguenth at gcc dot gnu dot org 2009-04-07 15:44 --- Wait - it's ok. class binder2nd : public unary_functiontypename _Operation::first_argument_type, typename _Operation::result_type { protected: _Operation op; typename

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread rguenth at gcc dot gnu dot org
--- Comment #10 from rguenth at gcc dot gnu dot org 2009-04-07 15:45 --- It seems to be an ABI mismatch in the backend somehow. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread rguenth at gcc dot gnu dot org
--- Comment #11 from rguenth at gcc dot gnu dot org 2009-04-07 15:46 --- Created an attachment (id=17603) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17603action=view) preprocessed testcase with bind2nd marked noinline Testcase, look at the compiled piece for the call to

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #12 from paolo dot carlini at oracle dot com 2009-04-07 15:48 --- You are too fast ;) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39678

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread rguenth at gcc dot gnu dot org
--- Comment #13 from rguenth at gcc dot gnu dot org 2009-04-07 15:57 --- The intel compiler generates ..___tag_value__ZSt7bind2ndISt10multipliesISt7complexIfEES2_ESt9binder2ndIT_ERKS5_RKT0_.69: #165.5 movq (%rsi), %rax #167.53

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread rguenth at gcc dot gnu dot org
--- Comment #14 from rguenth at gcc dot gnu dot org 2009-04-07 16:04 --- With a small testcase it works: struct Y {}; struct X { Y y; float real; float imag; }; struct X __attribute__((noinline)) foo (float *p) { struct X x; x.real = p[0]; x.imag = p[1]; return x; }

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread rguenth at gcc dot gnu dot org
--- Comment #15 from rguenth at gcc dot gnu dot org 2009-04-07 16:05 --- So maybe it's a C++ FE issue after all ... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39678

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #16 from paolo dot carlini at oracle dot com 2009-04-07 16:24 --- Sorry for the noise, forgot that we don't care any more about 4_1 and 4_2 ;) Anyway, the issue is apparently *very* old... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39678

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #17 from paolo dot carlini at oracle dot com 2009-04-07 16:44 --- I guess I'm going to reduce the big one with 'delta', if you have special advice about that, just let me know... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39678

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #18 from paolo dot carlini at oracle dot com 2009-04-07 19:01 --- Created an attachment (id=17604) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17604action=view) A bit smaller -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39678

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #19 from paolo dot carlini at oracle dot com 2009-04-07 20:47 --- Created an attachment (id=17605) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17605action=view) Smaller... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39678

[Bug target/39678] std::transform is incorrect with std::multiples and bind2nd for complexfloat

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #20 from paolo dot carlini at oracle dot com 2009-04-07 22:04 --- Created an attachment (id=17606) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17606action=view) Even closer to minimal (as C++ code) and more correct --