* [PATCH] Fix powerpc inline fegetround
@ 2006-02-03 22:17 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2006-02-03 22:17 UTC (permalink / raw)
To: Ulrich Drepper, Roland McGrath, Steven Munroe; +Cc: Glibc hackers
Hi!
GCC 4.1 seems to be optimizing more aggressively and on powerpc32
in test-i{float,double,ldoubl} happens to move over inlined
fegetround () across fesetround call (not inlined), which results
in not the saved, but the new rounding mode being restored, so many tests
fail. The following patch fixes that, make check is clean again.
2006-02-03 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/fpu/bits/fenvinline.h (fegetround): Make asm
volatile.
--- libc/sysdeps/powerpc/fpu/bits/fenvinline.h.jj 2001-07-06 06:56:02.000000000 +0200
+++ libc/sysdeps/powerpc/fpu/bits/fenvinline.h 2006-02-03 23:12:18.000000000 +0100
@@ -1,5 +1,6 @@
/* Inline floating-point environment handling functions for powerpc.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2006
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,8 +23,9 @@
/* Inline definition for fegetround. */
# define fegetround() \
(__extension__ ({ int __fegetround_result; \
- __asm__ ("mcrfs 7,7 ; mfcr %0" \
- : "=r"(__fegetround_result) : : "cr7"); \
+ __asm__ __volatile__ \
+ ("mcrfs 7,7 ; mfcr %0" \
+ : "=r"(__fegetround_result) : : "cr7"); \
__fegetround_result & 3; }))
/* The weird 'i#*X' constraints on the following suppress a gcc
Jakub
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-02-03 22:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-03 22:17 [PATCH] Fix powerpc inline fegetround 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).