public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/35691] New: Missed (a == 0) && (b == 0) into (a|(typeof(a)(b)) == 0 when the types don't match
@ 2008-03-25 4:32 pinskia at gcc dot gnu dot org
2008-03-25 9:43 ` [Bug middle-end/35691] " rguenth at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-03-25 4:32 UTC (permalink / raw)
To: gcc-bugs
While looking into PR 35429, I noticed this small missed optimization.
If we have:
typedef unsigned int1;
int foo(int z0, int1 z1)
{
return z0 != 0 || z1 != 0;
}
int foo1(int z0, int1 z1)
{
return z0 == 0 && z1 == 0;
}
--- CUT ---
Both of those should optimize as int is the same size as unsigned and we are
comparing against 0. The same thing should happen with int and long on a ILP32
target.
--
Summary: Missed (a == 0) && (b == 0) into (a|(typeof(a)(b)) == 0
when the types don't match
Product: gcc
Version: 4.4.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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35691
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug middle-end/35691] Missed (a == 0) && (b == 0) into (a|(typeof(a)(b)) == 0 when the types don't match
2008-03-25 4:32 [Bug middle-end/35691] New: Missed (a == 0) && (b == 0) into (a|(typeof(a)(b)) == 0 when the types don't match pinskia at gcc dot gnu dot org
@ 2008-03-25 9:43 ` rguenth at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-25 9:43 UTC (permalink / raw)
To: gcc-bugs
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-03-25 09:42:22
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35691
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-25 9:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-25 4:32 [Bug middle-end/35691] New: Missed (a == 0) && (b == 0) into (a|(typeof(a)(b)) == 0 when the types don't match pinskia at gcc dot gnu dot org
2008-03-25 9:43 ` [Bug middle-end/35691] " rguenth 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).