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

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 Jakub Jelinek from comment #2)
> Created attachment 37723 [details]
> gcc6-pr69850.patch
> 
> Untested fix.  Another possibility is to STRIP_NOPS and if it is this, set
> ifexp to integer_one_node.  But we need the TREE_NO_WARNING stuff anyway,
> because e.g. in function with nonnull parameter other than this, that at
> some point is changed, the comparison would be still desirable and valid.

Aren't compiler-generated expressions marked with ARTIFICIAL or some such? In
any case, setting TREE_NO_WARNING for compiler-generated expressions seems the
right thing to do.

I'd suggest to add "-Wnonnul-compare" explicitly to the testcase, otherwise it
may start silently failing if -Wall stops enabling the warning.

Reply via email to