public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/20924] New: [4.0/4.1 regression] inline float divide does not set correct fpu status flags
@ 2005-04-09 22:24 schwab at suse dot de
  2005-04-10  7:33 ` [Bug target/20924] " aj at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: schwab at suse dot de @ 2005-04-09 22:24 UTC (permalink / raw)
  To: gcc-bugs

Neither the min-latency nor the max-throughput inline float divide set the 
Invalid Operation flag in the fpsr when calculating 0/0. 
 
$ cat divdf3.c 
#include <fenv.h> 
#include <stdio.h> 
#include <stdlib.h> 
 
double 
divdf3 (double a, double b) 
{ 
  return a / b; 
} 
 
int 
main (int argc, char **argv) 
{ 
  if (argc != 3) exit (1); 
  double a = atof (argv[1]); 
  double b = atof (argv[2]); 
  double c = divdf3 (a, b); 
  int e = fetestexcept (FE_INVALID); 
  printf ("%g / %g = %g, FE_INVALID %sset\n", a, b, c, e ? "" : "not "); 
} 
$ gcc divdf3.c -o divdf3 -lm 
$ ./divdf3 0 0 
0 / 0 = nan, FE_INVALID not set 
$ gcc -mno-inline-float-divide divdf3.c -o divdf3 -lm 
$ ./divdf3 0 0 
0 / 0 = nan, FE_INVALID set

-- 
           Summary: [4.0/4.1 regression] inline float divide does not set
                    correct fpu status flags
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schwab at suse dot de
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: ia64-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20924


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

* [Bug target/20924] [4.0/4.1 regression] inline float divide does not set correct fpu status flags
  2005-04-09 22:24 [Bug target/20924] New: [4.0/4.1 regression] inline float divide does not set correct fpu status flags schwab at suse dot de
@ 2005-04-10  7:33 ` aj at gcc dot gnu dot org
  2005-04-10 12:36 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: aj at gcc dot gnu dot org @ 2005-04-10  7:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From aj at gcc dot gnu dot org  2005-04-10 07:33 -------
This problem shows with running the glibc testsuite.  If the inlined functions
are used, the functions are not setting the state and this is a violation of
ISO C.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aj at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20924


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

* [Bug target/20924] [4.0/4.1 regression] inline float divide does not set correct fpu status flags
  2005-04-09 22:24 [Bug target/20924] New: [4.0/4.1 regression] inline float divide does not set correct fpu status flags schwab at suse dot de
  2005-04-10  7:33 ` [Bug target/20924] " aj at gcc dot gnu dot org
@ 2005-04-10 12:36 ` pinskia at gcc dot gnu dot org
  2005-04-11 23:14 ` sje at cup dot hp dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-10 12:36 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sje at cup dot hp dot com
           Keywords|                            |wrong-code
   Target Milestone|---                         |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20924


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

* [Bug target/20924] [4.0/4.1 regression] inline float divide does not set correct fpu status flags
  2005-04-09 22:24 [Bug target/20924] New: [4.0/4.1 regression] inline float divide does not set correct fpu status flags schwab at suse dot de
  2005-04-10  7:33 ` [Bug target/20924] " aj at gcc dot gnu dot org
  2005-04-10 12:36 ` pinskia at gcc dot gnu dot org
@ 2005-04-11 23:14 ` sje at cup dot hp dot com
  2005-04-12 17:37 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: sje at cup dot hp dot com @ 2005-04-11 23:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From sje at cup dot hp dot com  2005-04-11 23:14 -------
The problem is that the inline divide instructions are generating frcpa
instructions that use the floating point status register (fpsr) 1 when
they should be using fpsr 0.

I will test a patch overnight and submit it if it passes the testing.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-04-11 23:14:10
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20924


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

* [Bug target/20924] [4.0/4.1 regression] inline float divide does not set correct fpu status flags
  2005-04-09 22:24 [Bug target/20924] New: [4.0/4.1 regression] inline float divide does not set correct fpu status flags schwab at suse dot de
                   ` (2 preceding siblings ...)
  2005-04-11 23:14 ` sje at cup dot hp dot com
@ 2005-04-12 17:37 ` pinskia at gcc dot gnu dot org
  2005-04-13 15:58 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-12 17:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-12 17:37 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-04/msg01300.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20924


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

* [Bug target/20924] [4.0/4.1 regression] inline float divide does not set correct fpu status flags
  2005-04-09 22:24 [Bug target/20924] New: [4.0/4.1 regression] inline float divide does not set correct fpu status flags schwab at suse dot de
                   ` (3 preceding siblings ...)
  2005-04-12 17:37 ` pinskia at gcc dot gnu dot org
@ 2005-04-13 15:58 ` cvs-commit at gcc dot gnu dot org
  2005-04-13 17:39 ` [Bug target/20924] [4.0 " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-04-13 15:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-04-13 15:57 -------
Subject: Bug 20924

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	sje@gcc.gnu.org	2005-04-13 15:57:38

Modified files:
	gcc            : ChangeLog 
	gcc/config/ia64: ia64.md 

Log message:
	PR target/20924
	* config/ia64/ia64.md (divsf3_internal_lat): Generate frcpa with
	fpsr 0 instead of fpsr 1.
	(divsf3_internal_thr): Ditto.
	(divdf3_internal_lat): Ditto.
	(divdf3_internal_thr): Ditto.
	(divxf3_internal_lat): Ditto.
	(divxf3_internal_thr): Ditto.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8276&r2=2.8277
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/ia64.md.diff?cvsroot=gcc&r1=1.148&r2=1.149



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20924


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

* [Bug target/20924] [4.0 regression] inline float divide does not set correct fpu status flags
  2005-04-09 22:24 [Bug target/20924] New: [4.0/4.1 regression] inline float divide does not set correct fpu status flags schwab at suse dot de
                   ` (4 preceding siblings ...)
  2005-04-13 15:58 ` cvs-commit at gcc dot gnu dot org
@ 2005-04-13 17:39 ` pinskia at gcc dot gnu dot org
  2005-04-14 15:43 ` cvs-commit at gcc dot gnu dot org
  2005-04-14 15:53 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-13 17:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-13 17:39 -------
Fixed at least on the mainline.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.0/4.1 regression] inline |[4.0 regression] inline
                   |float divide does not set   |float divide does not set
                   |correct fpu status flags    |correct fpu status flags


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20924


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

* [Bug target/20924] [4.0 regression] inline float divide does not set correct fpu status flags
  2005-04-09 22:24 [Bug target/20924] New: [4.0/4.1 regression] inline float divide does not set correct fpu status flags schwab at suse dot de
                   ` (5 preceding siblings ...)
  2005-04-13 17:39 ` [Bug target/20924] [4.0 " pinskia at gcc dot gnu dot org
@ 2005-04-14 15:43 ` cvs-commit at gcc dot gnu dot org
  2005-04-14 15:53 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-04-14 15:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-04-14 15:43 -------
Subject: Bug 20924

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	sje@gcc.gnu.org	2005-04-14 15:43:07

Modified files:
	gcc            : ChangeLog 
	gcc/config/ia64: ia64.md 

Log message:
	PR target/20924
	* config/ia64/ia64.md (divsf3_internal_lat): Generate frcpa with
	fpsr 0 instead of fpsr 1.
	(divsf3_internal_thr): Ditto.
	(divdf3_internal_lat): Ditto.
	(divdf3_internal_thr): Ditto.
	(divxf3_internal_lat): Ditto.
	(divxf3_internal_thr): Ditto.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.153&r2=2.7592.2.154
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/ia64.md.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.146.8.1&r2=1.146.8.2



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20924


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

* [Bug target/20924] [4.0 regression] inline float divide does not set correct fpu status flags
  2005-04-09 22:24 [Bug target/20924] New: [4.0/4.1 regression] inline float divide does not set correct fpu status flags schwab at suse dot de
                   ` (6 preceding siblings ...)
  2005-04-14 15:43 ` cvs-commit at gcc dot gnu dot org
@ 2005-04-14 15:53 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-14 15:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-14 15:53 -------
Fixed.

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


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20924


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

* [Bug target/20924] [4.0 regression] inline float divide does not set correct fpu status flags
       [not found] <bug-20924-50@http.gcc.gnu.org/bugzilla/>
  2007-03-10 19:35 ` mmitchel at gcc dot gnu dot org
@ 2007-03-10 19:44 ` mmitchel at gcc dot gnu dot org
  1 sibling, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-03-10 19:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from mmitchel at gcc dot gnu dot org  2007-03-10 19:44 -------
Subject: Bug 20924

Author: mmitchel
Date: Sat Mar 10 19:44:11 2007
New Revision: 122802

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122802
Log:
        PR c++/20924
        * tree.c (walk_type_fields): Recurse into the element type of
        ARRAY_TYPEs if there is a pointer set.

        PR c++/20924
        * g++.dg/template/array18.C: New test.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/template/array18.C
Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_2-branch/gcc/tree.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20924


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

* [Bug target/20924] [4.0 regression] inline float divide does not set correct fpu status flags
       [not found] <bug-20924-50@http.gcc.gnu.org/bugzilla/>
@ 2007-03-10 19:35 ` mmitchel at gcc dot gnu dot org
  2007-03-10 19:44 ` mmitchel at gcc dot gnu dot org
  1 sibling, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-03-10 19:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from mmitchel at gcc dot gnu dot org  2007-03-10 19:35 -------
Subject: Bug 20924

Author: mmitchel
Date: Sat Mar 10 19:35:03 2007
New Revision: 122801

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122801
Log:
        PR c++/20924
        * tree.c (walk_type_fields): Recurse into the element type of
        ARRAY_TYPEs if there is a pointer set.

        PR c++/20924
        * g++.dg/template/array18.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/array18.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20924


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

end of thread, other threads:[~2007-03-10 19:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-09 22:24 [Bug target/20924] New: [4.0/4.1 regression] inline float divide does not set correct fpu status flags schwab at suse dot de
2005-04-10  7:33 ` [Bug target/20924] " aj at gcc dot gnu dot org
2005-04-10 12:36 ` pinskia at gcc dot gnu dot org
2005-04-11 23:14 ` sje at cup dot hp dot com
2005-04-12 17:37 ` pinskia at gcc dot gnu dot org
2005-04-13 15:58 ` cvs-commit at gcc dot gnu dot org
2005-04-13 17:39 ` [Bug target/20924] [4.0 " pinskia at gcc dot gnu dot org
2005-04-14 15:43 ` cvs-commit at gcc dot gnu dot org
2005-04-14 15:53 ` pinskia at gcc dot gnu dot org
     [not found] <bug-20924-50@http.gcc.gnu.org/bugzilla/>
2007-03-10 19:35 ` mmitchel at gcc dot gnu dot org
2007-03-10 19:44 ` mmitchel at gcc dot gnu dot org

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