* [PATCH] Fix -Wsequence-point warnings on s_tan.c
@ 2009-04-26 11:50 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2009-04-26 11:50 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Glibc hackers
Hi!
The following patch fixes:
../sysdeps/ieee754/dbl-64/s_tan.c: In function 'tan':
../sysdeps/ieee754/dbl-64/s_tan.c:111: warning: operation on 't4' may be undefined
../sysdeps/ieee754/dbl-64/s_tan.c:219: warning: operation on 't4' may be undefined
../sysdeps/ieee754/dbl-64/s_tan.c:225: warning: operation on 't4' may be undefined
../sysdeps/ieee754/dbl-64/s_tan.c:330: warning: operation on 't4' may be undefined
../sysdeps/ieee754/dbl-64/s_tan.c:336: warning: operation on 't4' may be undefined
../sysdeps/ieee754/dbl-64/s_tan.c:434: warning: operation on 't4' may be undefined
../sysdeps/ieee754/dbl-64/s_tan.c:440: warning: operation on 't4' may be undefined
warnings when compiling with gcc 4.4.
2009-04-26 Jakub Jelinek <jakub@redhat.com>
* sysdeps/ieee754/dbl-64/s_tan.c (tan): Fix -Wsequence-point warnings.
--- libc/sysdeps/ieee754/dbl-64/s_tan.c.jj 2009-04-26 13:34:21.000000000 +0200
+++ libc/sysdeps/ieee754/dbl-64/s_tan.c 2009-04-26 13:42:38.000000000 +0200
@@ -108,7 +108,8 @@ double tan(double x) {
fi = xfg[i][1].d; gi = xfg[i][2].d; t2 = pz*(gi+fi)/(gi-pz);
if ((y=fi+(t2-fi*u3.d))==fi+(t2+fi*u3.d)) return (s*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=fi+(t2-(t4=fi*ua3.d+t3*ub3.d)))==fi+(t2+t4)) return (s*y);
+ t4 = fi*ua3.d+t3*ub3.d;
+ if ((y=fi+(t2-t4))==fi+(t2+t4)) return (s*y);
/* Second stage */
ffi = xfg[i][3].d;
@@ -216,13 +217,15 @@ double tan(double x) {
t2 = pz*(fi+gi)/(fi+pz);
if ((y=gi-(t2-gi*u10.d))==gi-(t2+gi*u10.d)) return (-sy*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=gi-(t2-(t4=gi*ua10.d+t3*ub10.d)))==gi-(t2+t4)) return (-sy*y); }
+ t4 = gi*ua10.d+t3*ub10.d;
+ if ((y=gi-(t2-t4))==gi-(t2+t4)) return (-sy*y); }
else {
/* tan */
t2 = pz*(gi+fi)/(gi-pz);
if ((y=fi+(t2-fi*u9.d))==fi+(t2+fi*u9.d)) return (sy*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=fi+(t2-(t4=fi*ua9.d+t3*ub9.d)))==fi+(t2+t4)) return (sy*y); }
+ t4 = fi*ua9.d+t3*ub9.d;
+ if ((y=fi+(t2-t4))==fi+(t2+t4)) return (sy*y); }
/* Second stage */
ffi = xfg[i][3].d;
@@ -327,13 +330,15 @@ double tan(double x) {
t2 = pz*(fi+gi)/(fi+pz);
if ((y=gi-(t2-gi*u18.d))==gi-(t2+gi*u18.d)) return (-sy*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=gi-(t2-(t4=gi*ua18.d+t3*ub18.d)))==gi-(t2+t4)) return (-sy*y); }
+ t4 = gi*ua18.d+t3*ub18.d;
+ if ((y=gi-(t2-t4))==gi-(t2+t4)) return (-sy*y); }
else {
/* tan */
t2 = pz*(gi+fi)/(gi-pz);
if ((y=fi+(t2-fi*u17.d))==fi+(t2+fi*u17.d)) return (sy*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=fi+(t2-(t4=fi*ua17.d+t3*ub17.d)))==fi+(t2+t4)) return (sy*y); }
+ t4 = fi*ua17.d+t3*ub17.d;
+ if ((y=fi+(t2-t4))==fi+(t2+t4)) return (sy*y); }
/* Second stage */
ffi = xfg[i][3].d;
@@ -431,13 +436,15 @@ double tan(double x) {
t2 = pz*(fi+gi)/(fi+pz);
if ((y=gi-(t2-gi*u26.d))==gi-(t2+gi*u26.d)) return (-sy*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=gi-(t2-(t4=gi*ua26.d+t3*ub26.d)))==gi-(t2+t4)) return (-sy*y); }
+ t4 = gi*ua26.d+t3*ub26.d;
+ if ((y=gi-(t2-t4))==gi-(t2+t4)) return (-sy*y); }
else {
/* tan */
t2 = pz*(gi+fi)/(gi-pz);
if ((y=fi+(t2-fi*u25.d))==fi+(t2+fi*u25.d)) return (sy*y);
t3 = (t2<ZERO) ? -t2 : t2;
- if ((y=fi+(t2-(t4=fi*ua25.d+t3*ub25.d)))==fi+(t2+t4)) return (sy*y); }
+ t4 = fi*ua25.d+t3*ub25.d;
+ if ((y=fi+(t2-t4))==fi+(t2+t4)) return (sy*y); }
/* Second stage */
ffi = xfg[i][3].d;
Jakub
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-04-26 11:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-26 11:50 [PATCH] Fix -Wsequence-point warnings on s_tan.c Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).