This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C PATCH] Get rid of spurious warning (PR c/60036)


On Tue, 4 Feb 2014, Marek Polacek wrote:

> Starting with revision 206620, if we have LHS op= RHS and RHS has
> side effects, we preevaluate RHS first, which means that we wrap it
> in C_MAYBE_CONST_EXPR_EXPR + SAVE_EXPR.  This regressed -Wconversion,
> since we now issue bogus warnings.  The reason is that conversion_warning
> doesn't grok C_MAYBE_CONST_EXPR_EXPR/SAVE_EXPR, meaning that it
> just calls unsafe_conversion_p on it that warns.  But for e.g. relational
> and equality operators that's useless as those always yield 0 or 1.
> This patch fixes this by unwrapping the expr first.
> 
> Regtested/bootstrapped on x86_64-linux, ok for trunk?

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]