[Bug c/101090] incorrect -Wunused-value warning on remquo with constant values
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jun 16 13:10:09 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101090
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Last reconfirmed| |2021-06-16
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
We warn about
(gdb) p expr
$2 = <compound_expr 0x7ffff669cbb8>
(gdb) p debug_generic_expr (expr)
quo = 0;, 1.0e+0
which is folded from the call via do_mpfr_remquo:
/* Dereference the quo pointer argument. */
arg_quo = build_fold_indirect_ref (arg_quo);
/* Proceed iff a valid pointer type was passed in. */
if (TYPE_MAIN_VARIANT (TREE_TYPE (arg_quo)) == integer_type_node)
{
/* Set the value. */
tree result_quo
= fold_build2 (MODIFY_EXPR, TREE_TYPE (arg_quo), arg_quo,
build_int_cst (TREE_TYPE (arg_quo),
integer_quo));
TREE_SIDE_EFFECTS (result_quo) = 1;
/* Combine the quo assignment with the rem. */
result = non_lvalue (fold_build2 (COMPOUND_EXPR, type,
result_quo, result_rem));
but we should probably set TREE_NO_WARNING on the COMPOUND_EXPR.
More information about the Gcc-bugs
mailing list