[Bug tree-optimization/15618] Missed bool optimization

2005-05-03 Thread cvs-commit at gcc dot gnu dot org

--- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-05-04 
01:52 ---
Subject: Bug 15618

CVSROOT:/cvs/gcc
Module name:gcc
Changes by: [EMAIL PROTECTED]   2005-05-04 01:52:07

Modified files:
gcc: ChangeLog fold-const.c 
gcc/testsuite  : ChangeLog 
Added files:
gcc/testsuite/gcc.dg/tree-ssa: bool-1.c bool-2.c bool-3.c 
   bool-4.c bool-5.c bool-6.c 
   bool-7.c bool-8.c bool-9.c 

Log message:
2004-05-03  Andrew Pinski  <[EMAIL PROTECTED]>

PR middle-end/15618
* fold-const.c (fold_widened_comparison): Treat BOOLEAN_TYPE
the same as INTEGER_TYPE.
(fold_binary): Fold "bool_var != 0" to bool_var.
Fold "bool_var == 1" to bool_var.
2005-05-03  Andrew Pinski  <[EMAIL PROTECTED]>

PR middle-end/15618
* gcc.dg/tree-ssa/bool-[1-9].c: New tests.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8592&r2=2.8593
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.573&r2=1.574
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5438&r2=1.5439
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/bool-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/bool-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/bool-3.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/bool-4.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/bool-5.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/bool-6.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/bool-7.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/bool-8.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/bool-9.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


[Bug tree-optimization/15618] Missed bool optimization

2005-05-03 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-04 
01:52 ---
Fixed.

-- 
   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.1.0


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


[Bug tree-optimization/15618] Missed bool optimization

2005-05-02 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-03 
01:16 ---
Patch here: .

-- 
   What|Removed |Added

URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2005-
   ||05/msg00135.html
   Keywords||patch


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


[Bug tree-optimization/15618] Missed bool optimization

2005-05-01 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-01 
19:00 ---
Oh, this now longer will help the C++ front-end as we have "#define bool char".
I really hate that, we should not do it but we do :(.

-- 


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


[Bug tree-optimization/15618] Missed bool optimization

2005-05-01 Thread schlie at comcast dot net

--- Additional Comments From schlie at comcast dot net  2005-05-01 17:53 
---
(In reply to comment #6)
> I have a fix which I am testing.  One change to fold_binary to fold "bool_var 
> != 0" to bool_var and
> one to  fold_widened_comparison to treat BOOLEAN_TYPE like INTEGER_TYPE.
> 
> This improves the gimplification process for PR8361 so we get about 4 less 
> statements.  And it
> lows the memory usage a little.

As widening operations are a target specific optimization, should any such 
optimization be in
the target's code generator, where it may decide how to best treat bool types 
and/or operations?



-- 


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


[Bug tree-optimization/15618] Missed bool optimization

2005-05-01 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-01 
17:29 ---
I have a fix which I am testing.  One change to fold_binary to fold "bool_var 
!= 0" to bool_var and one to 
fold_widened_comparison to treat BOOLEAN_TYPE like INTEGER_TYPE.

This improves the gimplification process for PR8361 so we get about 4 less 
statements.  And it lows the 
memory usage a little.

-- 
   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED


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


[Bug tree-optimization/15618] Missed bool optimization

2005-02-06 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2005-02-07 05:40 
---
Here is the last tree SSA form:

;; Function f (f)

f (f1)
{
  _Bool D.1138;
  int D.1120;
  int D.1119;

:
  D.1138_5 = f1_2 != 0;
  D.1120_1 = (int) D.1138_5;
  return D.1120_1;

}

;; Function f3 (f3)

f3 (f1)
{
  _Bool D.1148;
  int f4;
  int D.1126;
  int D.1125;

:
  D.1148_4 = f1_2 != 0;
  f4_1 = (int) D.1148_4;
  return f4_1;

}

;; Function f5 (f5)

f5 (f1)
{
  int D.1130;

:
  D.1130_2 = (int) f1_1;
  return D.1130_2;

}


-- 
   What|Removed |Added

 CC||kazu at cs dot umass dot edu


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