This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] feupdateenv fixes for hppa


libc-alpha,

feudatepenv uses the 'const' input variable as temporary storage, and it
should not. The newest gcc in debian alerted me to this bug. Patch passes
test-suite.

Cheers,
Carlos.

 sysdeps/hppa/fpu/feupdateenv.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

2004-04-05  Carlos O'Donell  <carlos@baldric.uwo.ca>

	* sysdeps/hppa/fpu/feupdateenv.c (feupdateenv): Use only sw[0]
	and call feraiseexcept.

--- libc-orig/sysdeps/hppa/fpu/feupdateenv.c	2003-12-18 00:13:38.000000000 -0500
+++ libc/sysdeps/hppa/fpu/feupdateenv.c	2004-04-01 06:01:00.000000000 -0500
@@ -27,11 +27,10 @@
 
   /* Get the current exception status. */
   __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
-  sw[0] &= FE_ALL_EXCEPT;
-  envp->__status_word = envp->__status_word | sw[0];
-  
   /* Install new environment.  */
   fesetenv (envp);
+  /* Raise the saved exceptions */
+  feraiseexcept(sw[0] & FE_ALL_EXCEPT);
 
   /* Success.  */
   return 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]