OSDN Git Service

2009-08-14 Paolo Bonzini <bonzini@gnu.org>
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Aug 2009 12:14:04 +0000 (12:14 +0000)
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Aug 2009 12:14:04 +0000 (12:14 +0000)
PR target/40934
* config/i386/i386.c (ix86_fp_comparison_strategy):
Only enable/disable sahf at function granularity.

gcc/testsuite:
2009-08-14  Paolo Bonzini  <bonzini@gnu.org>

PR target/40934
* gcc.target/i386/pr40934.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150754 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr40934.c [new file with mode: 0644]

index 0862182..5e51aea 100644 (file)
@@ -1,3 +1,9 @@
+2009-08-14  Paolo Bonzini  <bonzini@gnu.org>
+
+       PR target/40934
+       * config/i386/i386.c (ix86_fp_comparison_strategy):
+       Only enable/disable sahf at function granularity. 
+
 2009-08-14  Hans-Peter Nilsson  <hp@axis.com>
 
        PR rtl-optimization/41064
index acb7753..8b73fca 100644 (file)
@@ -14594,7 +14594,7 @@ ix86_fp_comparison_strategy (enum rtx_code code ATTRIBUTE_UNUSED)
   if (TARGET_CMOVE)
     return IX86_FPCMP_COMI;
 
-  if (TARGET_SAHF && (TARGET_USE_SAHF || optimize_insn_for_size_p ()))
+  if (TARGET_SAHF && (TARGET_USE_SAHF || optimize_function_for_size_p (cfun)))
     return IX86_FPCMP_SAHF;
 
   return IX86_FPCMP_ARITH;
index db94b62..e6864f5 100644 (file)
@@ -1,3 +1,8 @@
+2009-08-14  Paolo Bonzini  <bonzini@gnu.org>
+
+       PR target/40934
+       * gcc.target/i386/pr40934.c: New.
+
 2009-08-14  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/41019
diff --git a/gcc/testsuite/gcc.target/i386/pr40934.c b/gcc/testsuite/gcc.target/i386/pr40934.c
new file mode 100644 (file)
index 0000000..41f46f8
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -march=i586 -ffast-math" } */
+
+extern double host_frametime;
+extern float pitchvel;
+V_DriftPitch (float delta, float move)
+{
+  if (!delta)
+    move = host_frametime;
+  if (delta > 0)
+    ;
+  else if (delta < 0 && move > -delta)
+    pitchvel = 0;
+}