OSDN Git Service

PR middle-end/43419
authormatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Mar 2010 16:07:53 +0000 (16:07 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:13:16 +0000 (14:13 +0900)
* builtins.c (expand_builtin_pow): Don't transform pow(x, 0.5)
into sqrt(x) if we need to preserve signed zeros.

testsuite/
* gcc.dg/pr43419.c: New testcase.

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

gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/ChangeLog

index 932483a..35a5c5f 100644 (file)
@@ -1,3 +1,9 @@
+2010-03-18  Michael Matz  <matz@suse.de>
+
+       PR middle-end/43419
+       * builtins.c (expand_builtin_pow): Don't transform pow(x, 0.5)
+       into sqrt(x) if we need to preserve signed zeros.
+
 2010-03-18  Steven Bosscher  <steven@gcc.gnu.org>
            Eric Botcazou  <ebotcazou@adacore.com>
 
index 8541b82..bb80297 100644 (file)
@@ -3074,16 +3074,10 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
          && ((flag_unsafe_math_optimizations
               && optimize_insn_for_speed_p ()
               && powi_cost (n/2) <= POWI_MAX_MULTS)
-             /* Even the c == 0.5 case cannot be done unconditionally
+             /* Even the c==0.5 case cannot be done unconditionally
                 when we need to preserve signed zeros, as
                 pow (-0, 0.5) is +0, while sqrt(-0) is -0.  */
-             || (!HONOR_SIGNED_ZEROS (mode) && n == 1)
-             /* For c == 1.5 we can assume that x * sqrt (x) is always
-                smaller than pow (x, 1.5) if sqrt will not be expanded
-                as a call.  */
-             || (n == 3
-                 && (optab_handler (sqrt_optab, mode)->insn_code
-                     != CODE_FOR_nothing))))
+             || (!HONOR_SIGNED_ZEROS (mode) && n == 1)))
        {
          tree call_expr = build_call_nofold (fn, 1, narg0);
          /* Use expand_expr in case the newly built call expression
index 3fbfdc9..ba7b963 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-18  Michael Matz  <matz@suse.de>
+
+       PR middle-end/43419
+       * gcc.dg/pr43419.c: New testcase.
+
 2010-03-18  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR rtl-optimization/43360
 2010-03-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libfortran/43265
-       *gfortran.dg/read_empty_file.f: New test.
-       *gfortran.dg/read_eof_all.f90: New test.
-       *gfortran.dg/namelist_27.f90: Eliminate infinite loop posibility.
-       *gfortran.dg/namelist_28.f90: Eliminate infinite loop posibility.
+       * gfortran.dg/read_empty_file.f: New test.
+       * gfortran.dg/read_eof_all.f90: New test.
+       * gfortran.dg/namelist_27.f90: Eliminate infinite loop posibility.
+       * gfortran.dg/namelist_28.f90: Eliminate infinite loop posibility.
 
 2010-03-17  Michael Matz  <matz@suse.de>