public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ports/6506] fesetenv() does not work on hppa with gcc 4.3
  2008-05-10 18:15 [Bug ports/6506] New: fesetenv() does not work on hppa with gcc 4.3 aurelien at aurel32 dot net
@ 2008-05-10 18:15 ` aurelien at aurel32 dot net
  2008-05-11 12:42 ` carlos at codesourcery dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: aurelien at aurel32 dot net @ 2008-05-10 18:15 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From aurelien at aurel32 dot net  2008-05-10 18:15 -------
Created an attachment (id=2730)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=2730&action=view)
Patch to fix the problem.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6506

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug ports/6506] New: fesetenv() does not work on hppa with gcc 4.3
@ 2008-05-10 18:15 aurelien at aurel32 dot net
  2008-05-10 18:15 ` [Bug ports/6506] " aurelien at aurel32 dot net
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: aurelien at aurel32 dot net @ 2008-05-10 18:15 UTC (permalink / raw)
  To: glibc-bugs

fesetenv() does not work on hppa with gcc 4.3, as gcc optimizes out most of the 
code. This is due to wrong input/output operands/constraints.

-- 
           Summary: fesetenv() does not work on hppa with gcc 4.3
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ports
        AssignedTo: carlos at systemhalted dot org
        ReportedBy: aurelien at aurel32 dot net
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: hppa1.1-unknown-linux-gnu
  GCC host triplet: hppa1.1-unknown-linux-gnu
GCC target triplet: hppa1.1-unknown-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=6506

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug ports/6506] fesetenv() does not work on hppa with gcc 4.3
  2008-05-10 18:15 [Bug ports/6506] New: fesetenv() does not work on hppa with gcc 4.3 aurelien at aurel32 dot net
  2008-05-10 18:15 ` [Bug ports/6506] " aurelien at aurel32 dot net
@ 2008-05-11 12:42 ` carlos at codesourcery dot com
  2008-05-11 13:05 ` aurelien at aurel32 dot net
  2008-05-12 12:41 ` carlos at codesourcery dot com
  3 siblings, 0 replies; 5+ messages in thread
From: carlos at codesourcery dot com @ 2008-05-11 12:42 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From carlos at codesourcery dot com  2008-05-11 12:41 -------
Aurel,

Thanks for doing the work in this case. I appreciate your efforts.

@@ -35,7 +35,7 @@ fesetenv (const fenv_t *envp)
   bufptr = temp.buf;
   __asm__ (
 	   "fstd,ma %%fr0,8(%1)\n"
-	   : "=m" (temp), "+r" (bufptr) : : "%r0");
+	   : "=m" (temp) : "r" (bufptr) : "%r0");

This looks correct, and if it prevents the compiler from optimizing away later
stores into the union, then that's good. I don't think this is the bug.

@@ -56,7 +56,7 @@ fesetenv (const fenv_t *envp)
      is loaded last and T-Bit is enabled. */
   __asm__ (
 	   "fldd,mb -8(%1),%%fr0\n"
-	   : "=m" (temp), "+r" (bufptr) : : "%r0" );
+	   : : "m" (temp), "r" (bufptr) : "%r0" );

This is probably the real bug, temp should never have been an output. Removing
the "=" (write-only) constraint and the "+" read/write constraint was the right
thing to do (along with moving them to inputs).

What is the results of running the testsuite after this patch?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


http://sourceware.org/bugzilla/show_bug.cgi?id=6506

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug ports/6506] fesetenv() does not work on hppa with gcc 4.3
  2008-05-10 18:15 [Bug ports/6506] New: fesetenv() does not work on hppa with gcc 4.3 aurelien at aurel32 dot net
  2008-05-10 18:15 ` [Bug ports/6506] " aurelien at aurel32 dot net
  2008-05-11 12:42 ` carlos at codesourcery dot com
@ 2008-05-11 13:05 ` aurelien at aurel32 dot net
  2008-05-12 12:41 ` carlos at codesourcery dot com
  3 siblings, 0 replies; 5+ messages in thread
From: aurelien at aurel32 dot net @ 2008-05-11 13:05 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From aurelien at aurel32 dot net  2008-05-11 13:05 -------
(In reply to comment #2)
> Aurel,
> 
> Thanks for doing the work in this case. I appreciate your efforts.
> 
> @@ -35,7 +35,7 @@ fesetenv (const fenv_t *envp)
>    bufptr = temp.buf;
>    __asm__ (
>            "fstd,ma %%fr0,8(%1)\n"
> -          : "=m" (temp), "+r" (bufptr) : : "%r0");
> +          : "=m" (temp) : "r" (bufptr) : "%r0");
> 
> This looks correct, and if it prevents the compiler from optimizing away 
later
> stores into the union, then that's good. I don't think this is the bug.

I confirm this change is actually not necessary to get fesetenv() working, but 
I prefered to do the change, so that it don't break with a future version of 
gcc.
 
> @@ -56,7 +56,7 @@ fesetenv (const fenv_t *envp)
>       is loaded last and T-Bit is enabled. */
>    __asm__ (
>            "fldd,mb -8(%1),%%fr0\n"
> -          : "=m" (temp), "+r" (bufptr) : : "%r0" );
> +          : : "m" (temp), "r" (bufptr) : "%r0" );
> 
> This is probably the real bug, temp should never have been an output. 
Removing
> the "=" (write-only) constraint and the "+" read/write constraint was the 
right
> thing to do (along with moving them to inputs).
> 
> What is the results of running the testsuite after this patch?

Oh, I forget to tell that with this patch test-fenv now passes with gcc-4.3. 
Otherwise, it does not include any regression.



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6506

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug ports/6506] fesetenv() does not work on hppa with gcc 4.3
  2008-05-10 18:15 [Bug ports/6506] New: fesetenv() does not work on hppa with gcc 4.3 aurelien at aurel32 dot net
                   ` (2 preceding siblings ...)
  2008-05-11 13:05 ` aurelien at aurel32 dot net
@ 2008-05-12 12:41 ` carlos at codesourcery dot com
  3 siblings, 0 replies; 5+ messages in thread
From: carlos at codesourcery dot com @ 2008-05-12 12:41 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From carlos at codesourcery dot com  2008-05-12 12:41 -------
Aurel,

Thank for the good work. The patch looks good. I've checked it in. Marking this
fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=6506

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-05-12 12:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-10 18:15 [Bug ports/6506] New: fesetenv() does not work on hppa with gcc 4.3 aurelien at aurel32 dot net
2008-05-10 18:15 ` [Bug ports/6506] " aurelien at aurel32 dot net
2008-05-11 12:42 ` carlos at codesourcery dot com
2008-05-11 13:05 ` aurelien at aurel32 dot net
2008-05-12 12:41 ` carlos at codesourcery dot com

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).