public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/24989] New: boolvar != 1 is not converted to !boolvar
@ 2005-11-22 19:40 pinskia at gcc dot gnu dot org
2005-11-22 19:41 ` [Bug middle-end/24989] " pinskia at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-22 19:40 UTC (permalink / raw)
To: gcc-bugs
The following two function should be the same:
_Bool f(_Bool a)
{
return a!=1;
}
_Bool f1(_Bool a)
{
_Bool b = !a;
return b;
}
Right now f1 is the most optimal.
--
Summary: boolvar != 1 is not converted to !boolvar
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
OtherBugsDependingO 18908,19987
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24989
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/24989] boolvar != 1 is not converted to !boolvar
2005-11-22 19:40 [Bug middle-end/24989] New: boolvar != 1 is not converted to !boolvar pinskia at gcc dot gnu dot org
@ 2005-11-22 19:41 ` pinskia at gcc dot gnu dot org
2005-11-23 4:04 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-22 19:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2005-11-22 19:41 -------
I am working on a patch to fix this. This should also fix f3 in PR 18908.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2005-11-22 19:41:49
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24989
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/24989] boolvar != 1 is not converted to !boolvar
2005-11-22 19:40 [Bug middle-end/24989] New: boolvar != 1 is not converted to !boolvar pinskia at gcc dot gnu dot org
2005-11-22 19:41 ` [Bug middle-end/24989] " pinskia at gcc dot gnu dot org
@ 2005-11-23 4:04 ` pinskia at gcc dot gnu dot org
2005-11-24 6:14 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-23 4:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2005-11-23 04:04 -------
This actually has a xfail testcase associated with it (I think I forgot to file
the bug when I added the testcase).
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |xfail
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24989
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/24989] boolvar != 1 is not converted to !boolvar
2005-11-22 19:40 [Bug middle-end/24989] New: boolvar != 1 is not converted to !boolvar pinskia at gcc dot gnu dot org
2005-11-22 19:41 ` [Bug middle-end/24989] " pinskia at gcc dot gnu dot org
2005-11-23 4:04 ` pinskia at gcc dot gnu dot org
@ 2005-11-24 6:14 ` pinskia at gcc dot gnu dot org
2005-11-24 21:19 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-24 6:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2005-11-24 06:14 -------
XPASS: gcc.dg/tree-ssa/bool-7.c scan-tree-dump-times != 1 0
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24989
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/24989] boolvar != 1 is not converted to !boolvar
2005-11-22 19:40 [Bug middle-end/24989] New: boolvar != 1 is not converted to !boolvar pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-11-24 6:14 ` pinskia at gcc dot gnu dot org
@ 2005-11-24 21:19 ` pinskia at gcc dot gnu dot org
2005-11-25 5:05 ` pinskia at gcc dot gnu dot org
2005-11-25 5:05 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-24 21:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2005-11-24 21:19 -------
Patch posted:
http://gcc.gnu.org/ml/gcc-patches/2005-11/msg01780.html
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2005-
| |11/msg01780.html
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24989
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/24989] boolvar != 1 is not converted to !boolvar
2005-11-22 19:40 [Bug middle-end/24989] New: boolvar != 1 is not converted to !boolvar pinskia at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-11-25 5:05 ` pinskia at gcc dot gnu dot org
@ 2005-11-25 5:05 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-25 5:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2005-11-25 05:05 -------
Subject: Bug 24989
Author: pinskia
Date: Fri Nov 25 05:05:26 2005
New Revision: 107488
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107488
Log:
2005-11-25 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/24989
* fold-const.c (fold_build): Convert bool_var != 1 and
bool_var == 0 to !bool_var.
2005-11-24 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/24989
* gcc.dg/tree-ssa/bool-10.c: New test.
* gcc.dg/tree-ssa/bool-11.c: New test.
* gcc.dg/tree-ssa/bool-7.c: Un-xfail.
Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/tree-ssa/bool-7.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24989
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/24989] boolvar != 1 is not converted to !boolvar
2005-11-22 19:40 [Bug middle-end/24989] New: boolvar != 1 is not converted to !boolvar pinskia at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-11-24 21:19 ` pinskia at gcc dot gnu dot org
@ 2005-11-25 5:05 ` pinskia at gcc dot gnu dot org
2005-11-25 5:05 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-25 5:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2005-11-25 05:05 -------
Fixed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24989
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-11-25 5:05 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-22 19:40 [Bug middle-end/24989] New: boolvar != 1 is not converted to !boolvar pinskia at gcc dot gnu dot org
2005-11-22 19:41 ` [Bug middle-end/24989] " pinskia at gcc dot gnu dot org
2005-11-23 4:04 ` pinskia at gcc dot gnu dot org
2005-11-24 6:14 ` pinskia at gcc dot gnu dot org
2005-11-24 21:19 ` pinskia at gcc dot gnu dot org
2005-11-25 5:05 ` pinskia at gcc dot gnu dot org
2005-11-25 5:05 ` 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).