[Bug analyzer/110520] -Wanalyzer-null-dereference false nagetive with `*ptr = 10086`

2023-10-25 Thread dale.mengli.ming at proton dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110520

--- Comment #2 from mengli ming  ---
(In reply to David Malcolm from comment #1)
> Thanks for filing this bug.
> 
> With trunk (for gcc 14) I correctly get a NPD warning (true positive):
>   https://godbolt.org/z/a5h38cz7d
> 
> With gcc 13.2, I don't (false negative):
>   https://godbolt.org/z/PKnToYK8v
> 
> I've been rewriting C string handling for gcc 14, so it's likely this now
> working is a side-effect of that.
> 
> Keeping open to track adding a regression test for this.

Thank you for your explanation. (^_^)

[Bug analyzer/110520] -Wanalyzer-null-dereference false nagetive with `*ptr = 10086`

2023-09-06 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110520

David Malcolm  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2023-09-06

--- Comment #1 from David Malcolm  ---
Thanks for filing this bug.

With trunk (for gcc 14) I correctly get a NPD warning (true positive):
  https://godbolt.org/z/a5h38cz7d

With gcc 13.2, I don't (false negative):
  https://godbolt.org/z/PKnToYK8v

I've been rewriting C string handling for gcc 14, so it's likely this now
working is a side-effect of that.

Keeping open to track adding a regression test for this.