public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/113227] New: Maybe optimization (a>0) && (b>0) with or&<0
@ 2024-01-04 2:21 syq at gcc dot gnu.org
2024-01-04 2:42 ` [Bug tree-optimization/113227] " syq at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: syq at gcc dot gnu.org @ 2024-01-04 2:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113227
Bug ID: 113227
Summary: Maybe optimization (a>0) && (b>0) with or&<0
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: syq at gcc dot gnu.org
Target Milestone: ---
_Bool f (int a, int b) {
return a > 0 && b > 0;
}
_Bool f (int a, int b)
{
_Bool _1;
_Bool _6;
_Bool _7;
<bb 2> [local count: 1073741824]:
_6 = b_3(D) > 0;
_7 = a_2(D) > 0;
_1 = _6 & _7;
return _1;
}
maybe we can do it like this?
_Bool f (int a, int b)
{
int _1 = (a | b);
return ((_1) > 0);
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/113227] Maybe optimization (a>0) && (b>0) with or&<0
2024-01-04 2:21 [Bug tree-optimization/113227] New: Maybe optimization (a>0) && (b>0) with or&<0 syq at gcc dot gnu.org
@ 2024-01-04 2:42 ` syq at gcc dot gnu.org
2024-01-04 2:42 ` syq at gcc dot gnu.org
2024-01-04 6:03 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: syq at gcc dot gnu.org @ 2024-01-04 2:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113227
--- Comment #1 from YunQiang Su <syq at gcc dot gnu.org> ---
Sorry for noise. This proposal is wrong.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/113227] Maybe optimization (a>0) && (b>0) with or&<0
2024-01-04 2:21 [Bug tree-optimization/113227] New: Maybe optimization (a>0) && (b>0) with or&<0 syq at gcc dot gnu.org
2024-01-04 2:42 ` [Bug tree-optimization/113227] " syq at gcc dot gnu.org
@ 2024-01-04 2:42 ` syq at gcc dot gnu.org
2024-01-04 6:03 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: syq at gcc dot gnu.org @ 2024-01-04 2:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113227
YunQiang Su <syq at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #2 from YunQiang Su <syq at gcc dot gnu.org> ---
It is not correct.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/113227] Maybe optimization (a>0) && (b>0) with or&<0
2024-01-04 2:21 [Bug tree-optimization/113227] New: Maybe optimization (a>0) && (b>0) with or&<0 syq at gcc dot gnu.org
2024-01-04 2:42 ` [Bug tree-optimization/113227] " syq at gcc dot gnu.org
2024-01-04 2:42 ` syq at gcc dot gnu.org
@ 2024-01-04 6:03 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-04 6:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113227
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Yes `(a > 0) & (b > 0)` is not the same as `(a|b) > 0`. I think we already
catch all of the related `(a CMP 0) &/| (b CMP 0)`; see PR 95731 for those.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-04 6:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-04 2:21 [Bug tree-optimization/113227] New: Maybe optimization (a>0) && (b>0) with or&<0 syq at gcc dot gnu.org
2024-01-04 2:42 ` [Bug tree-optimization/113227] " syq at gcc dot gnu.org
2024-01-04 2:42 ` syq at gcc dot gnu.org
2024-01-04 6:03 ` pinskia at gcc dot gnu.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).