This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR optimization/11637 (x86)


Hi,

This is again a problem with -fnon-call-exceptions, a regression present on 
the 3.3 branch (and latent on mainline).

The compiler emits

  movl    5.0000000745058059692383e-2, (%eax)
   
in the assembly file, which is not quite a pure x86 idiom.


2003-09-13  Eric Botcazou  <ebotcazou@libertysurf.fr>

        PR optimization/11637
        * config/i386/i386.md (movsf_1): Remove 'F' from alternative #4.


2003-09-13  Eric Botcazou  <ebotcazou@libertysurf.fr>

        * g++.dg/opt/float1.C: New test.


-- 
Eric Botcazou
Index: config/i386/i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.404.2.19
diff -u -r1.404.2.19 i386.md
--- config/i386/i386.md	8 Jul 2003 19:16:42 -0000	1.404.2.19
+++ config/i386/i386.md	13 Sep 2003 08:12:01 -0000
@@ -2079,7 +2079,7 @@
 
 (define_insn "*movsf_1"
   [(set (match_operand:SF 0 "nonimmediate_operand" "=f#xr,m,f#xr,r#xf,m,x#rf,x#rf,x#rf,m,!*y,!rm,!*y")
-	(match_operand:SF 1 "general_operand" "fm#rx,f#rx,G,rmF#fx,Fr#fx,C,x,xm#rf,x#rf,rm,*y,*y"))]
+	(match_operand:SF 1 "general_operand" "fm#rx,f#rx,G,rmF#fx,r#fx,C,x,xm#rf,x#rf,rm,*y,*y"))]
   "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
    && (reload_in_progress || reload_completed
        || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
// PR optimization/11637
// Origin: <nick@ilm.com>

// This used to fail to assemble on x86 because of
// a broken constraint in the SF move insn.

// { dg-do compile }
// { dg-options "-O2 -fnon-call-exceptions" }

void f(long int seed);

void g(float &o)
{
  float a = 0.05f;
  float b = 1.0 - a;
  float c = 1.0 + a;

  f(0);
  o = a;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]