public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>,
	Roland McGrath <roland@redhat.com>,
	Steven Munroe <munroesj@us.ibm.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Fix powerpc inline fegetround
Date: Fri, 03 Feb 2006 22:17:00 -0000	[thread overview]
Message-ID: <20060203221722.GG4625@sunsite.mff.cuni.cz> (raw)

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

                 reply	other threads:[~2006-02-03 22:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060203221722.GG4625@sunsite.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    --cc=munroesj@us.ibm.com \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).