public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/104089] New: ICE in constant_svalue, at analyzer/svalue.h:271
@ 2022-01-18 10:38 asolokha at gmx dot com
  2022-01-18 20:57 ` [Bug analyzer/104089] " cvs-commit at gcc dot gnu.org
  2022-01-18 21:00 ` dmalcolm at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: asolokha at gmx dot com @ 2022-01-18 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104089
           Summary: ICE in constant_svalue, at analyzer/svalue.h:271
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc 12.0.0 20220116 snapshot (g:90045c5df5b3c8853e7740fb72a11aead1c489bb) ICEs
when compiling the following testcase, reduced from
gcc/testsuite/gcc.dg/torture/float16-tg-3.c, w/ -fanalyzer -frounding-math:

volatile _Float16 true_min = 5.96046447753906250000000000000000000e-8F16;

int
main (void)
{
  return __builtin_fpclassify (0, 1, 4, 3, 2, true_min);
}

% gcc-12.0.0 -fanalyzer -frounding-math -c caqiocbw.c
during IPA pass: analyzer
caqiocbw.c: In function 'main':
caqiocbw.c:6:10: internal compiler error: in constant_svalue, at
analyzer/svalue.h:271
    6 |   return __builtin_fpclassify (0, 1, 4, 3, 2, true_min);
      |          ^~~~~~~~~~~~~~~~~~~~
0x7b22a8 ana::constant_svalue::constant_svalue(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/analyzer/svalue.h:271
0x7b22a8 ana::region_model_manager::get_or_create_constant_svalue(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/analyzer/region-model-manager.cc:216
0x12a37da ana::region_model_manager::get_or_create_unaryop(tree_node*,
tree_code, ana::svalue const*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/analyzer/region-model-manager.cc:441
0x128ba67 ana::region_model::on_assignment(gassign const*,
ana::region_model_context*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/analyzer/region-model.cc:870
0x1265bc8 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*,
ana::path_context*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/analyzer/engine.cc:1305
0x1268ff6 ana::exploded_graph::process_node(ana::exploded_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/analyzer/engine.cc:3694
0x1269fea ana::exploded_graph::process_worklist()
       
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/analyzer/engine.cc:3137
0x126c670 ana::impl_run_checkers(ana::logger*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/analyzer/engine.cc:5716
0x126d56e ana::run_checkers()
       
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/analyzer/engine.cc:5787
0x125c2a8 execute
       
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/analyzer/analyzer-pass.cc:87

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug analyzer/104089] ICE in constant_svalue, at analyzer/svalue.h:271
  2022-01-18 10:38 [Bug analyzer/104089] New: ICE in constant_svalue, at analyzer/svalue.h:271 asolokha at gmx dot com
@ 2022-01-18 20:57 ` cvs-commit at gcc dot gnu.org
  2022-01-18 21:00 ` dmalcolm at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-18 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>:

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

commit r12-6700-g2aefe248aa4160205c44808166393a42031d2dea
Author: David Malcolm <dmalcolm@redhat.com>
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 <dmalcolm@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug analyzer/104089] ICE in constant_svalue, at analyzer/svalue.h:271
  2022-01-18 10:38 [Bug analyzer/104089] New: ICE in constant_svalue, at analyzer/svalue.h:271 asolokha at gmx dot com
  2022-01-18 20:57 ` [Bug analyzer/104089] " cvs-commit at gcc dot gnu.org
@ 2022-01-18 21:00 ` dmalcolm at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-01-18 21:00 UTC (permalink / raw)
  To: gcc-bugs

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

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this bug.  It should be fixed by the above commit.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-18 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 10:38 [Bug analyzer/104089] New: ICE in constant_svalue, at analyzer/svalue.h:271 asolokha at gmx dot com
2022-01-18 20:57 ` [Bug analyzer/104089] " cvs-commit at gcc dot gnu.org
2022-01-18 21:00 ` dmalcolm at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).