From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15461 invoked by alias); 3 Feb 2006 22:17:45 -0000 Received: (qmail 15445 invoked by uid 22791); 3 Feb 2006 22:17:45 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Feb 2006 22:17:44 +0000 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id k13MHQi2027722; Fri, 3 Feb 2006 23:17:26 +0100 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id k13MHMrH027720; Fri, 3 Feb 2006 23:17:22 +0100 Date: Fri, 03 Feb 2006 22:17:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , Roland McGrath , Steven Munroe Cc: Glibc hackers Subject: [PATCH] Fix powerpc inline fegetround Message-ID: <20060203221722.GG4625@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00015.txt.bz2 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 * 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