Fix powerpc-nofpu __fe_enabled_env and __fe_nonieee_env (bug 17261).

On powerpc, floating-point environment macros are defined as pointers
to constants in the library that contain the bit-patterns of the
desired environment, instead of being magic constants cast to pointer
type.

For soft-float, the bit-patterns used for fenv_t are not laid out the
same as for hard-float.  (e500 has a third layout used; that's not an
ABI issue because these values are only meaningful within a single
process, all of whose glibc libraries must come from the same build of
glibc.)  While the __fe_dfl_env value for soft-float was appropriate
for the soft-float fenv_t representation, the other two constants had
the same bit-patterns as for hard-float.  Those bit patterns had the
effect of having exceptions already raised, causing
math/test-fenv-return to fail; this patch fixes the patterns used.
(__fe_nonieee_env also had exceptions unmasked, though they should be
masked to match hard-float semantics.  Since there is no separate
non-IEEE mode for soft-float, it's most appropriate for
__fe_nonieee_env to be the same as __fe_dfl_env; this patch makes it
an alias.)

Tested for powerpc-nofpu.

	[BZ #17261]
	* sysdeps/powerpc/nofpu/fenv_const.c (__fe_enabled_env): Change
	value to 0.
	(__fe_nonieee_env): Define as an alias for __fe_dfl_env.
This commit is contained in:
Joseph Myers 2014-08-12 20:31:54 +00:00
parent 9a8a57209a
commit 898c62f488
3 changed files with 25 additions and 18 deletions

View File

@ -1,3 +1,10 @@
2014-08-12 Joseph Myers <joseph@codesourcery.com>
[BZ #17261]
* sysdeps/powerpc/nofpu/fenv_const.c (__fe_enabled_env): Change
value to 0.
(__fe_nonieee_env): Define as an alias for __fe_dfl_env.
2014-08-12 Roland McGrath <roland@hack.frob.com>
* NEWS: Mention x86-64 ld.so use of Intel MPX instructions.

28
NEWS
View File

@ -9,20 +9,20 @@ Version 2.20
* The following bugs are resolved with this release:
6804, 9894, 12994, 13347, 13651, 14308, 14770, 15119, 15132, 15347,
15514, 15698, 15804, 15894, 15946, 16002, 16064, 16095, 16198, 16284,
16287, 16315, 16348, 16349, 16354, 16357, 16362, 16447, 16516, 16532,
16539, 16545, 16561, 16562, 16564, 16574, 16599, 16600, 16609, 16610,
16611, 16613, 16619, 16623, 16629, 16632, 16634, 16639, 16642, 16648,
16649, 16670, 16674, 16677, 16680, 16681, 16683, 16689, 16695, 16701,
16706, 16707, 16712, 16713, 16714, 16724, 16731, 16739, 16740, 16743,
16754, 16758, 16759, 16760, 16770, 16786, 16789, 16791, 16796, 16799,
16800, 16815, 16823, 16824, 16831, 16838, 16839, 16849, 16854, 16876,
16877, 16878, 16882, 16885, 16888, 16890, 16892, 16912, 16915, 16916,
16917, 16918, 16922, 16927, 16928, 16932, 16943, 16958, 16965, 16966,
16967, 16977, 16978, 16984, 16990, 16996, 17009, 17022, 17031, 17042,
17048, 17050, 17058, 17061, 17062, 17069, 17075, 17078, 17079, 17084,
17086, 17088, 17092, 17097, 17125, 17135, 17137, 17150, 17153, 17213.
6804, 9894, 12994, 13347, 13651, 14308, 14770, 15119, 15132, 15347, 15514,
15698, 15804, 15894, 15946, 16002, 16064, 16095, 16198, 16284, 16287,
16315, 16348, 16349, 16354, 16357, 16362, 16447, 16516, 16532, 16539,
16545, 16561, 16562, 16564, 16574, 16599, 16600, 16609, 16610, 16611,
16613, 16619, 16623, 16629, 16632, 16634, 16639, 16642, 16648, 16649,
16670, 16674, 16677, 16680, 16681, 16683, 16689, 16695, 16701, 16706,
16707, 16712, 16713, 16714, 16724, 16731, 16739, 16740, 16743, 16754,
16758, 16759, 16760, 16770, 16786, 16789, 16791, 16796, 16799, 16800,
16815, 16823, 16824, 16831, 16838, 16839, 16849, 16854, 16876, 16877,
16878, 16882, 16885, 16888, 16890, 16892, 16912, 16915, 16916, 16917,
16918, 16922, 16927, 16928, 16932, 16943, 16958, 16965, 16966, 16967,
16977, 16978, 16984, 16990, 16996, 17009, 17022, 17031, 17042, 17048,
17050, 17058, 17061, 17062, 17069, 17075, 17078, 17079, 17084, 17086,
17088, 17092, 17097, 17125, 17135, 17137, 17150, 17153, 17213, 17261.
* Reverted change of ABI data structures for s390 and s390x:
On s390 and s390x the size of struct ucontext and jmp_buf was increased in

View File

@ -27,8 +27,8 @@ const unsigned long long __fe_dfl_env __attribute__ ((aligned (8))) =
/* Floating-point environment where none of the exceptions are masked. */
const unsigned long long __fe_enabled_env __attribute__ ((aligned (8))) =
0xfff80000000000f8ULL;
0x0000000000000000ULL;
/* Floating-point environment with the NI bit set. */
const unsigned long long __fe_nonieee_env __attribute__ ((aligned (8))) =
0xfff8000000000004ULL;
/* Floating-point environment with the NI bit set. No difference for
soft float from the default environment. */
strong_alias (__fe_dfl_env, __fe_nonieee_env)