[Bug c/60018] Bogus conversion warning with optimization flag -O1
manu at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 28 10:18:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60018
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #2)
> The issue is that at -O0 conversion_warning gets (fn3(), 0) || 0 and doesn't
> call unsafe_conversion_p on it, while on -O fold_binary folds away the || 0
> part and conversion_warning sees COMPOUND_EXPR, it then calls
> unsafe_conversion_p on it.
But in any case, it should look to the last operand of (... , ...) and see that
it is a constant 0. I think there is a duplicate already about -Wconversion not
recursing into compound expressions.
More information about the Gcc-bugs
mailing list