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]

[Committed] Remove dead code from fold_builtin_copysign


The following patch removes an unreachable statement (after a
return) from fold_builtin_copysign, spotted by Dan Nicolaescu.

The following patch has been tested on x86_64-unknown-linux-gnu with
a full "make bootstrap", all default languages, and regression tested
with a top-level "make -k check" with no new failures.

Committed to mainline as revision 111615.


2006-03-01  Roger Sayle  <roger@eyesopen.com>

	* builtins.c (fold_builtin_copysign): Delete unreachable code.


Index: builtins.c
===================================================================
*** builtins.c	(revision 111486)
--- builtins.c	(working copy)
*************** fold_builtin_copysign (tree fndecl, tree
*** 8208,8216 ****

        c1 = TREE_REAL_CST (arg1);
        c2 = TREE_REAL_CST (arg2);
        real_copysign (&c1, &c2);
        return build_real (type, c1);
-       c1.sign = c2.sign;
      }

    /* copysign(X, Y) is fabs(X) when Y is always non-negative.
--- 8208,8216 ----

        c1 = TREE_REAL_CST (arg1);
        c2 = TREE_REAL_CST (arg2);
+       /* c1.sign := c2.sign.  */
        real_copysign (&c1, &c2);
        return build_real (type, c1);
      }

    /* copysign(X, Y) is fabs(X) when Y is always non-negative.


Roger
--


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