https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86569
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Bet this is:
if (TREE_NO_WARNING (org_x)
&& warn_nonnull_compare
&& COMPARISON_CLASS_P (org_x))
{
if (x == error_mark_node || TREE_CODE (x) == INTEGER_CST)
;
else if (COMPARISON_CLASS_P (x))
TREE_NO_WARNING (x) = 1;
/* Otherwise give up on optimizing these, let GIMPLE folders
optimize those later on. */
else if (op0 != TREE_OPERAND (org_x, 0)
|| op1 != TREE_OPERAND (org_x, 1))
{
x = build2_loc (loc, code, TREE_TYPE (org_x), op0, op1);
TREE_NO_WARNING (x) = 1;
}
else
x = org_x;
}
in cp-gimplify.c. Just removing the && warn_nonnull_compare line is likely not
sufficient, as TREE_NO_WARNING is set in many places guarded with
warn_something.
So we'd need to go for:
if (COMPARISON_CLASS_P (org_x))
{
if (x == error_mark_node || TREE_CODE (x) == INTEGER_CST)
;
else if (COMPARISON_CLASS_P (x))
{
if (TREE_NO_WARNING (org_x) && warn_nonnull_compare)
TREE_NO_WARNING (x) = 1;
}
/* Otherwise give up on optimizing these, let GIMPLE folders
optimize those later on. */
else if (op0 != TREE_OPERAND (org_x, 0)
|| op1 != TREE_OPERAND (org_x, 1))
{
x = build2_loc (loc, code, TREE_TYPE (org_x), op0, op1);
if (TREE_NO_WARNING (org_x) && warn_nonnull_compare)
TREE_NO_WARNING (x) = 1;
}
else
x = org_x;
}
or so.