public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/105252] New: [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions
@ 2022-04-13  4:33 zsojka at seznam dot cz
  2022-04-13  6:56 ` [Bug analyzer/105252] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zsojka at seznam dot cz @ 2022-04-13  4:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105252
           Summary: [12 Regression] ICE: in cmp_cst, at
                    analyzer/svalue.cc:309 with -O -fanalyzer
                    -fnon-call-exceptions
           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: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

Created attachment 52793
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52793&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fanalyzer -fnon-call-exceptions testcase.c 
during IPA pass: analyzer
In function 'bar',
    inlined from 'foo' at testcase.c:17:3:
testcase.c:9:5: internal compiler error: in cmp_cst, at analyzer/svalue.cc:309
    9 |   v %= (c | v) % m;
      |     ^~
0x82fef8 cmp_cst
        /repo/gcc-trunk/gcc/analyzer/svalue.cc:309
0x17a8abf cmp_cst
        /repo/gcc-trunk/gcc/analyzer/svalue.cc:340
0x17a8f03 ana::svalue::cmp_ptr(ana::svalue const*, ana::svalue const*)
        /repo/gcc-trunk/gcc/analyzer/svalue.cc:428
0x2543d40 cmp1<sort_ctx>
        /repo/gcc-trunk/gcc/sort.cc:153
0x2543d94 netsort<sort_ctx>
        /repo/gcc-trunk/gcc/sort.cc:170
0x2543d94 mergesort<sort_ctx>
        /repo/gcc-trunk/gcc/sort.cc:207
0x254431f gcc_qsort(void*, unsigned long, unsigned long, int (*)(void const*,
void const*))
        /repo/gcc-trunk/gcc/sort.cc:266
0x17417ed vec<ana::svalue const*, va_heap, vl_embed>::qsort(int (*)(void
const*, void const*))
        /repo/gcc-trunk/gcc/vec.h:1147
0x17417ed vec<ana::svalue const*, va_heap, vl_ptr>::qsort(int (*)(void const*,
void const*))
        /repo/gcc-trunk/gcc/vec.h:2121
0x17417ed ana::program_state::detect_leaks(ana::program_state const&,
ana::program_state const&, ana::svalue const*, ana::extrinsic_state const&,
ana::region_model_context*)
        /repo/gcc-trunk/gcc/analyzer/program-state.cc:1420
0x1741b66 ana::program_state::prune_for_point(ana::exploded_graph&,
ana::program_point const&, ana::exploded_node*, ana::uncertainty_t*) const
        /repo/gcc-trunk/gcc/analyzer/program-state.cc:1214
0x172f78f ana::exploded_graph::process_node(ana::exploded_node*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:3780
0x1730622 ana::exploded_graph::process_worklist()
        /repo/gcc-trunk/gcc/analyzer/engine.cc:3198
0x1732b27 ana::impl_run_checkers(ana::logger*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:5777
0x17339be ana::run_checkers()
        /repo/gcc-trunk/gcc/analyzer/engine.cc:5851
0x1722f48 execute
        /repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-8113-20220412190241-gaa7874596b9-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-8113-20220412190241-gaa7874596b9-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220412 (experimental) (GCC)

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

* [Bug analyzer/105252] [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions
  2022-04-13  4:33 [Bug analyzer/105252] New: [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions zsojka at seznam dot cz
@ 2022-04-13  6:56 ` rguenth at gcc dot gnu.org
  2022-04-13  7:53 ` [Bug analyzer/105252] [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions since r12-1931-ge61ffa201403e381 marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-13  6:56 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug analyzer/105252] [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions since r12-1931-ge61ffa201403e381
  2022-04-13  4:33 [Bug analyzer/105252] New: [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions zsojka at seznam dot cz
  2022-04-13  6:56 ` [Bug analyzer/105252] " rguenth at gcc dot gnu.org
@ 2022-04-13  7:53 ` marxin at gcc dot gnu.org
  2022-04-13 16:20 ` dmalcolm at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-04-13  7:53 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-04-13
            Summary|[12 Regression] ICE: in     |[12 Regression] ICE: in
                   |cmp_cst, at                 |cmp_cst, at
                   |analyzer/svalue.cc:309 with |analyzer/svalue.cc:309 with
                   |-O -fanalyzer               |-O -fanalyzer
                   |-fnon-call-exceptions       |-fnon-call-exceptions since
                   |                            |r12-1931-ge61ffa201403e381

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-1931-ge61ffa201403e381 (with -O -fanalyzer
-fnon-call-exceptions -fexceptions).

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

* [Bug analyzer/105252] [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions since r12-1931-ge61ffa201403e381
  2022-04-13  4:33 [Bug analyzer/105252] New: [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions zsojka at seznam dot cz
  2022-04-13  6:56 ` [Bug analyzer/105252] " rguenth at gcc dot gnu.org
  2022-04-13  7:53 ` [Bug analyzer/105252] [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions since r12-1931-ge61ffa201403e381 marxin at gcc dot gnu.org
@ 2022-04-13 16:20 ` dmalcolm at gcc dot gnu.org
  2022-04-14 12:51 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-04-13 16:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this bug.  I'm testing a fix.

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

* [Bug analyzer/105252] [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions since r12-1931-ge61ffa201403e381
  2022-04-13  4:33 [Bug analyzer/105252] New: [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2022-04-13 16:20 ` dmalcolm at gcc dot gnu.org
@ 2022-04-14 12:51 ` cvs-commit at gcc dot gnu.org
  2022-04-14 13:03 ` dmalcolm at gcc dot gnu.org
  2022-04-28 21:42 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-14 12:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:b209a349268d245f7a318861112df47bea15b89d

commit r12-8159-gb209a349268d245f7a318861112df47bea15b89d
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Wed Apr 13 12:02:07 2022 -0400

    analyzer: fix ICE comparing VECTOR_CSTs [PR105252]

    gcc/analyzer/ChangeLog:
            PR analyzer/105252
            * svalue.cc (cmp_cst): When comparing VECTOR_CSTs, compare the
            types of the encoded elements before calling cmp_cst on them.

    gcc/testsuite/ChangeLog:
            PR analyzer/105252
            * gcc.dg/analyzer/pr105252.c: New test.

    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

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

* [Bug analyzer/105252] [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions since r12-1931-ge61ffa201403e381
  2022-04-13  4:33 [Bug analyzer/105252] New: [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2022-04-14 12:51 ` cvs-commit at gcc dot gnu.org
@ 2022-04-14 13:03 ` dmalcolm at gcc dot gnu.org
  2022-04-28 21:42 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-04-14 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Should be fixed by the above patch.

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

* [Bug analyzer/105252] [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions since r12-1931-ge61ffa201403e381
  2022-04-13  4:33 [Bug analyzer/105252] New: [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2022-04-14 13:03 ` dmalcolm at gcc dot gnu.org
@ 2022-04-28 21:42 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-28 21:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:03e7ac9021361cfee6cb55ca08638bbb0dab12a9

commit r11-9949-g03e7ac9021361cfee6cb55ca08638bbb0dab12a9
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Thu Apr 28 17:42:07 2022 -0400

    analyzer: fix ICE comparing VECTOR_CSTs [PR105252]

    gcc/analyzer/ChangeLog:
            PR analyzer/105252
            * svalue.cc (cmp_cst): When comparing VECTOR_CSTs, compare the
            types of the encoded elements before calling cmp_cst on them.

    gcc/testsuite/ChangeLog:
            PR analyzer/105252
            * gcc.dg/analyzer/pr105252.c: New test.

    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

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

end of thread, other threads:[~2022-04-28 21:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13  4:33 [Bug analyzer/105252] New: [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions zsojka at seznam dot cz
2022-04-13  6:56 ` [Bug analyzer/105252] " rguenth at gcc dot gnu.org
2022-04-13  7:53 ` [Bug analyzer/105252] [12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer -fnon-call-exceptions since r12-1931-ge61ffa201403e381 marxin at gcc dot gnu.org
2022-04-13 16:20 ` dmalcolm at gcc dot gnu.org
2022-04-14 12:51 ` cvs-commit at gcc dot gnu.org
2022-04-14 13:03 ` dmalcolm at gcc dot gnu.org
2022-04-28 21:42 ` cvs-commit 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).