public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/15945] New: Incorrect floating point optimization
@ 2004-06-11 16:43 jakub at gcc dot gnu dot org
  2004-06-11 16:55 ` [Bug middle-end/15945] [3.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2004-06-11 16:43 UTC (permalink / raw)
  To: gcc-bugs

The following testcase is miscompiled with gcc-3_4-branch at -O3 on
s390x-redhat-linux (worked properly in GCC 3.3.x and earlier).

/* { dg-do run { target *-*-linux* } } */
/* { dg-options "-O3 -lm" } */

#include <fenv.h>
#include <stdlib.h>

typedef union
{
  int i[2];
  double x;
} U;

double __attribute__ ((noinline))
foo (double x)
{
  U u, v;

  u.x = x;
  u.i[0] = 0x7ff00000;
  v.i[0] = 0x7ff00000;
  u.i[1] = 0;
  v.i[1] = 0;
  return u.x / v.x;
}

double d;

int
main (void)
{
  feclearexcept (FE_ALL_EXCEPT);
  d = foo (2.0);
  if (fetestexcept (FE_INVALID) == 0)
    abort ();
  return 0;
}

Unless -ffast-math, the division should not be optimized out, as it is supposed
to generate invalid exception.
This causes miscompilation of glibc.

-- 
           Summary: Incorrect floating point optimization
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: s390x-redhat-linux


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


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

* [Bug middle-end/15945] [3.4 Regression] Incorrect floating point optimization
  2004-06-11 16:43 [Bug middle-end/15945] New: Incorrect floating point optimization jakub at gcc dot gnu dot org
@ 2004-06-11 16:55 ` pinskia at gcc dot gnu dot org
  2004-06-11 21:47 ` [Bug middle-end/15945] [3.4/3.5 " pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-11 16:55 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
      Known to fail|                            |3.4.0
      Known to work|                            |3.3.3
            Summary|Incorrect floating point    |[3.4 Regression] Incorrect
                   |optimization                |floating point optimization
   Target Milestone|---                         |3.4.2


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


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

* [Bug middle-end/15945] [3.4/3.5 Regression] Incorrect floating point optimization
  2004-06-11 16:43 [Bug middle-end/15945] New: Incorrect floating point optimization jakub at gcc dot gnu dot org
  2004-06-11 16:55 ` [Bug middle-end/15945] [3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2004-06-11 21:47 ` pinskia at gcc dot gnu dot org
  2004-06-14 17:45 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-11 21:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-11 21:47 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-06/msg00767.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |patch
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-11 21:47:44
               date|                            |
            Summary|[3.4 Regression] Incorrect  |[3.4/3.5 Regression]
                   |floating point optimization |Incorrect floating point
                   |                            |optimization


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


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

* [Bug middle-end/15945] [3.4/3.5 Regression] Incorrect floating point optimization
  2004-06-11 16:43 [Bug middle-end/15945] New: Incorrect floating point optimization jakub at gcc dot gnu dot org
  2004-06-11 16:55 ` [Bug middle-end/15945] [3.4 Regression] " pinskia at gcc dot gnu dot org
  2004-06-11 21:47 ` [Bug middle-end/15945] [3.4/3.5 " pinskia at gcc dot gnu dot org
@ 2004-06-14 17:45 ` cvs-commit at gcc dot gnu dot org
  2004-06-14 17:48 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-14 17:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-14 17:45 -------
Subject: Bug 15945

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jakub@gcc.gnu.org	2004-06-14 17:45:09

Modified files:
	gcc            : ChangeLog simplify-rtx.c 

Log message:
	PR middle-end/15945
	* simplify-rtx.c (simplify_binary_operation): Don't optimize out
	Inf + -Inf, Inf - Inf, Inf / Inf and 0 * Inf if flag_trapping_math.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3963&r2=2.3964
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/simplify-rtx.c.diff?cvsroot=gcc&r1=1.192&r2=1.193



-- 


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


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

* [Bug middle-end/15945] [3.4/3.5 Regression] Incorrect floating point optimization
  2004-06-11 16:43 [Bug middle-end/15945] New: Incorrect floating point optimization jakub at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-06-14 17:45 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-14 17:48 ` cvs-commit at gcc dot gnu dot org
  2004-06-14 19:18 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-14 17:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-14 17:48 -------
Subject: Bug 15945

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	jakub@gcc.gnu.org	2004-06-14 17:48:02

Modified files:
	gcc            : ChangeLog simplify-rtx.c 

Log message:
	PR middle-end/15945
	* simplify-rtx.c (simplify_binary_operation): Don't optimize out
	Inf + -Inf, Inf - Inf, Inf / Inf and 0 * Inf if flag_trapping_math.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.502&r2=2.2326.2.503
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/simplify-rtx.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.172.4.1&r2=1.172.4.2



-- 


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


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

* [Bug middle-end/15945] [3.4/3.5 Regression] Incorrect floating point optimization
  2004-06-11 16:43 [Bug middle-end/15945] New: Incorrect floating point optimization jakub at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-06-14 17:48 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-14 19:18 ` pinskia at gcc dot gnu dot org
  2004-06-14 20:25 ` andreas dot meier_ at gmx dot de
  2004-06-14 20:33 ` bangerth at dealii dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-14 19:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-14 19:18 -------
Fixed.

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


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


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

* [Bug middle-end/15945] [3.4/3.5 Regression] Incorrect floating point optimization
  2004-06-11 16:43 [Bug middle-end/15945] New: Incorrect floating point optimization jakub at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-06-14 19:18 ` pinskia at gcc dot gnu dot org
@ 2004-06-14 20:25 ` andreas dot meier_ at gmx dot de
  2004-06-14 20:33 ` bangerth at dealii dot org
  6 siblings, 0 replies; 8+ messages in thread
From: andreas dot meier_ at gmx dot de @ 2004-06-14 20:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From andreas dot meier_ at gmx dot de  2004-06-14 20:25 -------
Target milestone should be 3.4.1.

Andreas

-- 


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


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

* [Bug middle-end/15945] [3.4/3.5 Regression] Incorrect floating point optimization
  2004-06-11 16:43 [Bug middle-end/15945] New: Incorrect floating point optimization jakub at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-06-14 20:25 ` andreas dot meier_ at gmx dot de
@ 2004-06-14 20:33 ` bangerth at dealii dot org
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-06-14 20:33 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.2                       |3.4.1


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


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

end of thread, other threads:[~2004-06-14 20:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-11 16:43 [Bug middle-end/15945] New: Incorrect floating point optimization jakub at gcc dot gnu dot org
2004-06-11 16:55 ` [Bug middle-end/15945] [3.4 Regression] " pinskia at gcc dot gnu dot org
2004-06-11 21:47 ` [Bug middle-end/15945] [3.4/3.5 " pinskia at gcc dot gnu dot org
2004-06-14 17:45 ` cvs-commit at gcc dot gnu dot org
2004-06-14 17:48 ` cvs-commit at gcc dot gnu dot org
2004-06-14 19:18 ` pinskia at gcc dot gnu dot org
2004-06-14 20:25 ` andreas dot meier_ at gmx dot de
2004-06-14 20:33 ` bangerth at dealii 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).