Dead code in fortran/simplify.c

Message ID 20200225004024.GA76976@troutmask.apl.washington.edu
State New
Headers show
Series
  • Dead code in fortran/simplify.c
Related show

Commit Message

Steve Kargl Feb. 25, 2020, 12:40 a.m.
Dead code is probably not the right description.
Something like 'result that is not used' is better.
In event, the patch removes 3 useless lines.
Please commit.


-- 
Steve

Comments

Tobias Burnus Feb. 25, 2020, 8:28 a.m. | #1
Thanks for the cleanup. Committed (with "git commit --author 'St...'" + 
git push) as Rev. r10-6836-gfe86f537f010828b7f77ff459cef138e84071660

Tobias

On 2/25/20 1:40 AM, Steve Kargl wrote:
> Dead code is probably not the right description.

> Something like 'result that is not used' is better.

> In event, the patch removes 3 useless lines.

> Please commit.

>

> Index: gcc/fortran/simplify.c

> ===================================================================

> --- gcc/fortran/simplify.c	(revision 280157)

> +++ gcc/fortran/simplify.c	(working copy)

> @@ -1774,11 +1792,6 @@ degrees_f (mpfr_t x, mpfr_rnd_t rnd_mode)

>   {

>     mpfr_t tmp;

>     mpfr_init (tmp);

> -

> -  /* Set x = x % 2pi to avoid offsets with large angles.  */

> -  mpfr_const_pi (tmp, rnd_mode);

> -  mpfr_mul_ui (tmp, tmp, 2, rnd_mode);

> -  mpfr_fmod (tmp, x, tmp, rnd_mode);

>   

>     /* Set x = x * 180.  */

>     mpfr_mul_ui (x, x, 180, rnd_mode);

>
Steve Kargl Feb. 25, 2020, 3:07 p.m. | #2
On Tue, Feb 25, 2020 at 09:28:59AM +0100, Tobias Burnus wrote:
> Thanks for the cleanup. Committed (with "git commit --author 'St...'" + git

> push) as Rev. r10-6836-gfe86f537f010828b7f77ff459cef138e84071660

> 


Thanks.

-- 
Steve

Patch

Index: gcc/fortran/simplify.c
===================================================================
--- gcc/fortran/simplify.c	(revision 280157)
+++ gcc/fortran/simplify.c	(working copy)
@@ -1774,11 +1792,6 @@  degrees_f (mpfr_t x, mpfr_rnd_t rnd_mode)
 {
   mpfr_t tmp;
   mpfr_init (tmp);
-
-  /* Set x = x % 2pi to avoid offsets with large angles.  */
-  mpfr_const_pi (tmp, rnd_mode);
-  mpfr_mul_ui (tmp, tmp, 2, rnd_mode);
-  mpfr_fmod (tmp, x, tmp, rnd_mode);
 
   /* Set x = x * 180.  */
   mpfr_mul_ui (x, x, 180, rnd_mode);