This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] fix pr40934, unrecognizable fp comparison
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Uros Bizjak <ubizjak at gmail dot com>
- Date: Thu, 13 Aug 2009 18:07:30 +0200
- Subject: [PATCH] fix pr40934, unrecognizable fp comparison
Citing the PR audit trail, "optimize_insn_for_size_p () is not stable
through RTL passes, so we either don't split or generate invalid insn
in certain cases (like the one above). [...] Splitters depend on stable
predicates to split expanded sequences, we have no other choice".
I made the testcase generic. This won't catch the PR directly because I
couldn't add -march=i586. However, since I had tested the patch causing
this regression with all four of -march=i386/i486/i586/i686, my testing
would have caught it.
Ok?
Paolo
2009-08-13 Paolo Bonzini <bonzini@gnu.org>
* config/i386/i386.c (ix86_fp_comparison_strategy):
Only enable/disable sahf at function granularity.
2009-08-13 Paolo Bonzini <bonzini@gnu.org>
* gcc.dg/pr40934.c: New.
Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c (revision 150334)
+++ gcc/config/i386/i386.c (working copy)
@@ -14619,7 +14619,7 @@ ix86_fp_comparison_strategy (enum rtx_co
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;
/* { dg-do compile } */
/* { dg-options "-O2 -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;
}