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, committed] Fix PowerPC fath-math inconsistency


	The rs6000 port avoids some more complicated FP comparisons when
-ffast-math is invoked.	 However, the consistency checking functions, like
rs6000_validate_mode() and the generating functions, like
rs6000_generate_compare(), are inconsistent about which -ffast-math
sub-option they test.  This patch converts the code to consistently check
flag_finite_math_only.

Bootstrapped and regression tested on powerpc-ibm-aix5.2.0.0.

David


	* config/rs6000/rs6000.c (rs6000_generate_compare): Test
	flag_finite_math_only, not flag_unsafe_math_optimizations.

Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.794
diff -c -p -r1.794 rs6000.c
*** rs6000.c	14 Mar 2005 07:24:25 -0000	1.794
--- rs6000.c	20 Mar 2005 20:24:48 -0000
*************** rs6000_generate_compare (enum rtx_code c
*** 10161,10170 ****
      }
  
    /* Some kinds of FP comparisons need an OR operation;
!      under flag_unsafe_math_optimizations we don't bother.  */
    if (rs6000_compare_fp_p
!       && ! flag_unsafe_math_optimizations
!       && ! (TARGET_HARD_FLOAT && TARGET_E500 && !TARGET_FPRS)
        && (code == LE || code == GE
  	  || code == UNEQ || code == LTGT
  	  || code == UNGT || code == UNLT))
--- 10161,10170 ----
      }
  
    /* Some kinds of FP comparisons need an OR operation;
!      under flag_finite_math_only we don't bother.  */
    if (rs6000_compare_fp_p
!       && !flag_finite_math_only
!       && !(TARGET_HARD_FLOAT && TARGET_E500 && !TARGET_FPRS)
        && (code == LE || code == GE
  	  || code == UNEQ || code == LTGT
  	  || code == UNGT || code == UNLT))


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