This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fix soft-fp shadowing between __FP_FRAC_ADD_3 and _FP_MUL_MEAT_2_wide_3mul (bug 15667)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Sat, 22 Jun 2013 12:10:59 +0000
- Subject: Fix soft-fp shadowing between __FP_FRAC_ADD_3 and _FP_MUL_MEAT_2_wide_3mul (bug 15667)
This patch fixes bug 15667, soft-fp variables _c1 and _c2 in
__FP_FRAC_ADD_3 shadowing those in _FP_MUL_MEAT_2_wide_3mul.
I renamed the variables to include the full macro name. Probably this
should be done for all variables defined internally by any soft-fp
macro (maybe using abbreviated versions of the macro names if the full
names are too long and make the code too cumbersome); this patch
simply addresses the particular case where shadowing actually occurs
and shows up as test failures with the soft-fp fma patch I'll send
separately after some further testing.
Tested on MIPS64 in conjunction with that fma patch.
2013-06-22 Joseph Myers <joseph@codesourcery.com>
[BZ #15667]
* soft-fp/op-4.h (__FP_FRAC_ADD_3): Rename variables _c1 and _c2
to __FP_FRAC_ADD_3_c1 and __FP_FRAC_ADD_3_c2.
diff --git a/soft-fp/op-4.h b/soft-fp/op-4.h
index 007b01f..f16870d 100644
--- a/soft-fp/op-4.h
+++ b/soft-fp/op-4.h
@@ -525,14 +539,14 @@
#ifndef __FP_FRAC_ADD_3
#define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
do { \
- _FP_W_TYPE _c1, _c2; \
+ _FP_W_TYPE __FP_FRAC_ADD_3_c1, __FP_FRAC_ADD_3_c2; \
r0 = x0 + y0; \
- _c1 = r0 < x0; \
+ __FP_FRAC_ADD_3_c1 = r0 < x0; \
r1 = x1 + y1; \
- _c2 = r1 < x1; \
- r1 += _c1; \
- _c2 |= r1 < _c1; \
- r2 = x2 + y2 + _c2; \
+ __FP_FRAC_ADD_3_c2 = r1 < x1; \
+ r1 += __FP_FRAC_ADD_3_c1; \
+ __FP_FRAC_ADD_3_c2 |= r1 < __FP_FRAC_ADD_3_c1; \
+ r2 = x2 + y2 + __FP_FRAC_ADD_3_c2; \
} while (0)
#endif
--
Joseph S. Myers
joseph@codesourcery.com