This testcase: int test (int a) { return (double) a; } Produces: cvtsi2sd %edi, %xmm0 cvttsd2si %xmm0, %eax ret However, following code does the same (at least for -ffast-math): movl %edi, %eax ret
Confirmed, I doubt this shows up that much anyways.
(In reply to comment #0) > int test (int a) > { > return (double) a; > } I just wrote the very same testcase today, extracted from my code... > Produces: > > cvtsi2sd %edi, %xmm0 > cvttsd2si %xmm0, %eax > ret Still does. Did you have any idea how to handle it? > However, following code does the same (at least for -ffast-math): > movl %edi, %eax > ret I don't think -ffast-math is relevant here, on x86 the int->double conversion is exact hence the reverse has to be as well. (In reply to comment #1) > Confirmed, I doubt this shows up that much anyways. Just posting to mention that it does show up...
Author: rguenth Date: Fri Apr 27 10:34:13 2012 New Revision: 186898 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186898 Log: 2012-04-27 Marc Glisse <marc.glisse@inria.fr> PR middle-end/27139 * tree-ssa-forwprop.c (combine_conversions): Handle INT->FP->INT. * gcc.dg/tree-ssa/forwprop-18.c: New test. Added: trunk/gcc/testsuite/gcc.dg/tree-ssa/forwprop-18.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-forwprop.c
Hello Uros, is there any other case you think should be handled, or should we close the bug?
Closing then.