This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/24427] New: missing optimization opportunity with binary operators
- From: "dvilleneuve at kronos dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Oct 2005 13:07:18 -0000
- Subject: [Bug tree-optimization/24427] New: missing optimization opportunity with binary operators
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In the code below, the test is always true and could be found as such by using
distributivity on binary operators to factor out constant values. This is not
currently done, by looking at the assembly code produced.
<code>
extern int f(unsigned);
int f(unsigned u)
{
if( (u|4) & 6 ) /* could be tested as (u&6) || (4&6), always true */
return 5;
else
return 10;
}
</code>
--
Summary: missing optimization opportunity with binary operators
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: enhancement
Priority: P4
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dvilleneuve at kronos dot com
GCC target triplet: i386-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24427