[Bug analyzer/104089] ICE in constant_svalue, at analyzer/svalue.h:271

2022-01-18 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104089

David Malcolm  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from David Malcolm  ---
Thanks for filing this bug.  It should be fixed by the above commit.

[Bug analyzer/104089] ICE in constant_svalue, at analyzer/svalue.h:271

2022-01-18 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104089

--- Comment #1 from CVS Commits  ---
The master branch has been updated by David Malcolm :

https://gcc.gnu.org/g:2aefe248aa4160205c44808166393a42031d2dea

commit r12-6700-g2aefe248aa4160205c44808166393a42031d2dea
Author: David Malcolm 
Date:   Tue Jan 18 11:41:19 2022 -0500

analyzer: fix ICE on unary ops folding to casts of constants [PR104089]

gcc/analyzer/ChangeLog:
PR analyzer/104089
* region-model-manager.cc
(region_model_manager::get_or_create_constant_svalue): Assert that
we have a CONSTANT_CLASS_P.
(region_model_manager::maybe_fold_unaryop): Only fold a constant
when fold_unary's result is a constant or a cast of a constant.

gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/pr104089.c: New test.
PR analyzer/104089

Signed-off-by: David Malcolm