mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-12 09:44:57 +08:00
fold-const.c (fold): STRIP_NOPS when deciding whether or not something is a candidate for...
* fold-const.c (fold): STRIP_NOPS when deciding whether or not something is a candidate for optimize_bit_field_compare. From-SVN: r27169
This commit is contained in:
parent
f20b5577f8
commit
b7f2c1fc1b
@ -1,3 +1,8 @@
|
|||||||
|
Wed May 26 09:53:05 1999 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
* fold-const.c (fold): STRIP_NOPS when deciding whether or not
|
||||||
|
something is a candidate for optimize_bit_field_compare.
|
||||||
|
|
||||||
Wed May 26 09:40:02 1999 Mark Mitchell <mark@codesourcery.com>
|
Wed May 26 09:40:02 1999 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
* gcc.texi (Passes): Document branch-shortening.
|
* gcc.texi (Passes): Document branch-shortening.
|
||||||
|
@ -6036,16 +6036,20 @@ fold (expr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If this is a comparison of a field, we may be able to simplify it. */
|
/* If this is a comparison of a field, we may be able to simplify it. */
|
||||||
if ((TREE_CODE (arg0) == COMPONENT_REF
|
{
|
||||||
|| TREE_CODE (arg0) == BIT_FIELD_REF)
|
tree xarg0 = arg0;
|
||||||
&& (code == EQ_EXPR || code == NE_EXPR)
|
STRIP_NOPS (xarg0);
|
||||||
/* Handle the constant case even without -O
|
if ((TREE_CODE (xarg0) == COMPONENT_REF
|
||||||
to make sure the warnings are given. */
|
|| TREE_CODE (xarg0) == BIT_FIELD_REF)
|
||||||
&& (optimize || TREE_CODE (arg1) == INTEGER_CST))
|
&& (code == EQ_EXPR || code == NE_EXPR)
|
||||||
{
|
/* Handle the constant case even without -O
|
||||||
t1 = optimize_bit_field_compare (code, type, arg0, arg1);
|
to make sure the warnings are given. */
|
||||||
return t1 ? t1 : t;
|
&& (optimize || TREE_CODE (arg1) == INTEGER_CST))
|
||||||
}
|
{
|
||||||
|
t1 = optimize_bit_field_compare (code, type, xarg0, arg1);
|
||||||
|
return t1 ? t1 : t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* If this is a comparison of complex values and either or both sides
|
/* If this is a comparison of complex values and either or both sides
|
||||||
are a COMPLEX_EXPR or COMPLEX_CST, it is best to split up the
|
are a COMPLEX_EXPR or COMPLEX_CST, it is best to split up the
|
||||||
|
Loading…
Reference in New Issue
Block a user