https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104213

--- Comment #10 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I did but it didn't work either.  So I think we need to properly propagate the
suppression bits.  Something like this:

diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index bf2f60cce9a..0d266241b8c 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -6126,6 +6126,7 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p,
gimple_seq *post_p,
   else
     {
       assign = gimple_build_assign (*to_p, *from_p);
+      copy_warning (assign, *expr_p);
       gimple_set_location (assign, EXPR_LOCATION (*expr_p));
       if (COMPARISON_CLASS_P (*from_p))
    copy_warning (assign, *from_p);

which, along with the patch above, works.

Reply via email to