This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: fabs() intrinsic totally broken in P4, as of 2002-02-11
- From: Jan Hubicka <jh at suse dot cz>
- To: Tom Womack <tom at womack dot net>, rth at cygnus dot com, gcc-patches at gcc dot gnu dot org
- Cc: gcc at gcc dot gnu dot org, Jan Hubicka <jh at suse dot cz>
- Date: Sun, 17 Feb 2002 18:02:41 +0100
- Subject: Re: fabs() intrinsic totally broken in P4, as of 2002-02-11
- References: <001a01c1b6ff$f03e1240$5637f380@maths.nottingham.ac.uk>
> I found this out after half an hour spent staring at some code which had
> suddenly broken when compiled with -march=pentium4.
>
> Consider the program
>
> #include <math.h>
> #include <stdio.h>
>
> int main(void)
> {
> double a,b,c;
> double d,e,f;
> scanf("%lf %lf %lf",&a,&b,&c);
> d=fabs(a);e=fabs(b);f=fabs(c);
> printf("%f %f %f %f %f %f\n",a,b,c,d,e,f);
> return 0;
> }
I can't run the SSE binarry here, but after the attached fix I get
seemingly correct assembly. The same bug has been disussed with Lars
in other email.
Bootstrapped/regtested i686
Sun Feb 17 18:00:34 CET 2002 Jan Hubicka <jh@suse.cz>
* regrename.c (kill_set_value): Handle subregs properly.
Index: regrename.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/regrename.c,v
retrieving revision 1.42
diff -c -3 -p -r1.42 regrename.c
*** regrename.c 2002/02/13 22:44:12 1.42
--- regrename.c 2002/02/17 17:00:11
*************** kill_set_value (x, set, data)
*** 1186,1195 ****
void *data;
{
struct value_data *vd = data;
! if (GET_CODE (set) != CLOBBER && REG_P (x))
{
kill_value (x, vd);
! set_value_regno (REGNO (x), GET_MODE (x), vd);
}
}
--- 1186,1196 ----
void *data;
{
struct value_data *vd = data;
! if (GET_CODE (set) != CLOBBER)
{
kill_value (x, vd);
! if (REG_P (x))
! set_value_regno (REGNO (x), GET_MODE (x), vd);
}
}