https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122031
Bug ID: 122031
Summary: gcc/tree-ssa-math-opts.cc:1661: Suspicious assignment
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
A build of recent gcc trunk with clang says:
../trunk/gcc/tree-ssa-math-opts.cc:1661:7: warning: explicitly assigning value
of variable of type 'tree' (aka 'union tree_node *') to itself [-Wself-assign]
Source code is
if (!((val_prec > rhs_prec && !unsigned_val_p && !unsigned_rhs_p)
|| (type_prec > val_prec && !unsigned_p && !unsigned_val_p)))
rhs = rhs;
This looks a bit odd to me.
git blame says:
7a5da9ab53a8 gcc/tree-ssa-math-opts.cc (Pan Li 2025-09-22 14:31:41
+0800 1661) rhs = rhs;