public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
@ 2004-02-26  1:43 kazu at cs dot umass dot edu
  2004-02-26  1:52 ` [Bug optimization/14303] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-02-26  1:43 UTC (permalink / raw)
  To: gcc-bugs

tree-ssa comes as close as:

foo (x)
{
  double q;
  double p;

<bb 0>:
  if (ABS_EXPR <x> < 0.0) goto <L0>; else goto <L1>;

<L0>:;
  link_error ();

<L1>:;
  return;

}

But the comparison "<" is not folded.
On machines without hardware floating point support, like H8,
the testcase would fail because the "<" is not folded in rtl.
("<" is handled by a libcall.)
This kind of thing should be optimized in tree level.

-- 
           Summary: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not
                    fully folded
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org,roger at eyesopen dot
                    com


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


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

* [Bug optimization/14303] [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
  2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
@ 2004-02-26  1:52 ` pinskia at gcc dot gnu dot org
  2004-02-26  1:53 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-26  1:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-26 01:52 -------
I already confirmed this in PR 10348, closing them as dups of this bug.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |pessimizes-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-26 01:52:24
               date|                            |
   Target Milestone|---                         |tree-ssa


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


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

* [Bug optimization/14303] [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
  2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
  2004-02-26  1:52 ` [Bug optimization/14303] " pinskia at gcc dot gnu dot org
  2004-02-26  1:53 ` pinskia at gcc dot gnu dot org
@ 2004-02-26  1:53 ` pinskia at gcc dot gnu dot org
  2004-02-29  1:49 ` steven at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-26  1:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-26 01:52 -------
*** Bug 14200 has been marked as a duplicate of this bug. ***

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


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


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

* [Bug optimization/14303] [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
  2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
  2004-02-26  1:52 ` [Bug optimization/14303] " pinskia at gcc dot gnu dot org
@ 2004-02-26  1:53 ` pinskia at gcc dot gnu dot org
  2004-02-26  1:53 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-26  1:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-26 01:53 -------
*** Bug 10348 has been marked as a duplicate of this bug. ***

-- 


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


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

* [Bug optimization/14303] [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
  2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
                   ` (2 preceding siblings ...)
  2004-02-26  1:53 ` pinskia at gcc dot gnu dot org
@ 2004-02-29  1:49 ` steven at gcc dot gnu dot org
  2004-02-29  2:20 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-02-29  1:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2004-02-29 01:49 -------
I would propose something along the lines of this if I knew when this 
transformation is valid/safe... 
 
Index: fold-const.c 
=================================================================== 
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v 
retrieving revision 1.213.2.75 
diff -c -3 -p -r1.213.2.75 fold-const.c 
*** fold-const.c        27 Feb 2004 21:50:48 -0000      1.213.2.75 
--- fold-const.c        29 Feb 2004 01:44:44 -0000 
*************** fold (tree expr) 
*** 7245,7250 **** 
--- 7245,7261 ---- 
              return fold (build (code, type, arg0, 
                                  build_real (TREE_TYPE (arg1), dconst0))); 
 
+           /* abs(x) < 0.0 -> false 
+              abs(x) >= 0.0 -> true.  */ 
+           if (REAL_VALUES_EQUAL (cst, dconst0) 
+               && TREE_CODE (arg0) == ABS_EXPR) 
+             { 
+               if (code == LT_EXPR) 
+                 return boolean_false_node; 
+               if (code == GE_EXPR) 
+                 return boolean_true_node; 
+             } 
+ 
            /* x != NaN is always true, other ops are always false.  */ 
            if (REAL_VALUE_ISNAN (cst) 
                && ! HONOR_SNANS (TYPE_MODE (TREE_TYPE (arg1)))) 

-- 


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


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

* [Bug optimization/14303] [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
  2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
                   ` (3 preceding siblings ...)
  2004-02-29  1:49 ` steven at gcc dot gnu dot org
@ 2004-02-29  2:20 ` pinskia at gcc dot gnu dot org
  2004-03-05  2:52 ` kazu at cs dot umass dot edu
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-29  2:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-29 02:20 -------
The patch is not quiet right for Nan's, see <http://std.dkuug.dk/JTC1/SC22/WG14/www/
docs/n819.htm>.  I think this came up when the patch to optimize this on the RTL level.  I 
do not know what is correct behavior for GCC to follow.  Maybe only follow this when -
ffast-math is enabled.

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


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


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

* [Bug optimization/14303] [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
  2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
                   ` (4 preceding siblings ...)
  2004-02-29  2:20 ` pinskia at gcc dot gnu dot org
@ 2004-03-05  2:52 ` kazu at cs dot umass dot edu
  2004-03-06 14:36 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-03-05  2:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2004-03-05 02:52 -------
Here is Roger's patch on rtl level.

http://gcc.gnu.org/ml/gcc-patches/2002-07/msg01096.html

Perhaps we can use HONOR_NANS and TYPE_MODE in a way similar to
What Roger did!?

In the following, Roger says "abs(x) < 0.0" is *always* false.

http://gcc.gnu.org/ml/gcc-patches/2002-07/msg01121.html


-- 


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


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

* [Bug optimization/14303] [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
  2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
                   ` (5 preceding siblings ...)
  2004-03-05  2:52 ` kazu at cs dot umass dot edu
@ 2004-03-06 14:36 ` pinskia at gcc dot gnu dot org
  2004-05-24 17:06 ` [Bug tree-optimization/14303] " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-06 14:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-06 14:36 -------
A patch is here: <http://gcc.gnu.org/ml/gcc-patches/2004-03/msg00600.html>.

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


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


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

* [Bug tree-optimization/14303] [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
  2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
                   ` (6 preceding siblings ...)
  2004-03-06 14:36 ` pinskia at gcc dot gnu dot org
@ 2004-05-24 17:06 ` pinskia at gcc dot gnu dot org
  2005-02-11 13:43 ` phython at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-24 17:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-24 01:15 -------
When the tree-combiner comes in the fold patch is only needed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|patch                       |
   Last reconfirmed|2004-02-26 01:52:24         |2004-05-24 01:15:11
               date|                            |
   Target Milestone|3.5.0                       |---


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


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

* [Bug tree-optimization/14303] [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
  2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
                   ` (7 preceding siblings ...)
  2004-05-24 17:06 ` [Bug tree-optimization/14303] " pinskia at gcc dot gnu dot org
@ 2005-02-11 13:43 ` phython at gcc dot gnu dot org
  2005-02-13 18:35 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: phython at gcc dot gnu dot org @ 2005-02-11 13:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From phython at gcc dot gnu dot org  2005-02-11 05:05 -------
Created an attachment (id=8168)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8168&action=view)
Testcase one


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |phython at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug tree-optimization/14303] [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
  2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
                   ` (8 preceding siblings ...)
  2005-02-11 13:43 ` phython at gcc dot gnu dot org
@ 2005-02-13 18:35 ` cvs-commit at gcc dot gnu dot org
  2005-02-13 23:15 ` phython at gcc dot gnu dot org
  2005-02-17  1:56 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-02-13 18:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-02-13 06:21 -------
Subject: Bug 14303

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	phython@gcc.gnu.org	2005-02-13 06:21:36

Modified files:
	gcc            : ChangeLog fold-const.c 

Log message:
	2005-02-13  James A. Morrison  <phython@gcc.gnu.org>
	
	PR tree-optimization/14303
	PR tree-optimization/15784
	* fold-const.c (fold): Fold ABS_EXPR<x> >= 0 to true, when possible.
	Fold ABS_EXPR<x> < 0 to false.  Fold ABS_EXPR<x> == 0 to x == 0 and
	ABS_EXPR<x> != 0 to x != 0.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7460&r2=2.7461
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.506&r2=1.507



-- 


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


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

* [Bug tree-optimization/14303] [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
  2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
                   ` (9 preceding siblings ...)
  2005-02-13 18:35 ` cvs-commit at gcc dot gnu dot org
@ 2005-02-13 23:15 ` phython at gcc dot gnu dot org
  2005-02-17  1:56 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: phython at gcc dot gnu dot org @ 2005-02-13 23:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From phython at gcc dot gnu dot org  2005-02-13 16:45 -------
 Fixed in the last patch.

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


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


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

* [Bug tree-optimization/14303] [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded
  2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
                   ` (10 preceding siblings ...)
  2005-02-13 23:15 ` phython at gcc dot gnu dot org
@ 2005-02-17  1:56 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-17  1:56 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.0


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


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

end of thread, other threads:[~2005-02-16 19:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-26  1:43 [Bug optimization/14303] New: [tree-ssa] gcc.c-torture/execute/20020720-1.c is not fully folded kazu at cs dot umass dot edu
2004-02-26  1:52 ` [Bug optimization/14303] " pinskia at gcc dot gnu dot org
2004-02-26  1:53 ` pinskia at gcc dot gnu dot org
2004-02-26  1:53 ` pinskia at gcc dot gnu dot org
2004-02-29  1:49 ` steven at gcc dot gnu dot org
2004-02-29  2:20 ` pinskia at gcc dot gnu dot org
2004-03-05  2:52 ` kazu at cs dot umass dot edu
2004-03-06 14:36 ` pinskia at gcc dot gnu dot org
2004-05-24 17:06 ` [Bug tree-optimization/14303] " pinskia at gcc dot gnu dot org
2005-02-11 13:43 ` phython at gcc dot gnu dot org
2005-02-13 18:35 ` cvs-commit at gcc dot gnu dot org
2005-02-13 23:15 ` phython at gcc dot gnu dot org
2005-02-17  1:56 ` pinskia 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).