public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/105366] New: [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer
@ 2022-04-24 18:54 zsojka at seznam dot cz
  2022-04-25  6:58 ` [Bug analyzer/105366] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: zsojka at seznam dot cz @ 2022-04-24 18:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105366
           Summary: [11/12 Regression] ICE: in cmp_cst, at
                    analyzer/svalue.cc:309 with -O -fanalyzer
           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 52859
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52859&action=edit
reduced testcase

The testcase got quite ugly while reducing (taking address of functions), but
it ICEs the same way as the original testcase; this might be different than
PR105365 , since this also fails in gcc-11

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fanalyzer testcase.c 
during IPA pass: analyzer
testcase.c: In function 'foo':
testcase.c:13:7: internal compiler error: in cmp_cst, at analyzer/svalue.cc:309
   13 |   u32 r = u + c;
      |       ^
0x8341f0 cmp_cst
        /repo/gcc-trunk/gcc/analyzer/svalue.cc:309
0x17bd00d cmp_cst
        /repo/gcc-trunk/gcc/analyzer/svalue.cc:326
0x17bd3fa ana::svalue::cmp_ptr(ana::svalue const*, ana::svalue const*)
        /repo/gcc-trunk/gcc/analyzer/svalue.cc:435
0x256c220 cmp1<sort_ctx>
        /repo/gcc-trunk/gcc/sort.cc:153
0x256c274 netsort<sort_ctx>
        /repo/gcc-trunk/gcc/sort.cc:170
0x256c274 mergesort<sort_ctx>
        /repo/gcc-trunk/gcc/sort.cc:207
0x256c7ff gcc_qsort(void*, unsigned long, unsigned long, int (*)(void const*,
void const*))
        /repo/gcc-trunk/gcc/sort.cc:266
0x175632f vec<ana::svalue const*, va_heap, vl_embed>::qsort(int (*)(void
const*, void const*))
        /repo/gcc-trunk/gcc/vec.h:1147
0x175632f vec<ana::svalue const*, va_heap, vl_ptr>::qsort(int (*)(void const*,
void const*))
        /repo/gcc-trunk/gcc/vec.h:2121
0x175632f 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
0x17566c9 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
0x1744361 ana::exploded_graph::process_node(ana::exploded_node*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:3780
0x174520a ana::exploded_graph::process_worklist()
        /repo/gcc-trunk/gcc/analyzer/engine.cc:3198
0x174754b ana::impl_run_checkers(ana::logger*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:5777
0x1748443 ana::run_checkers()
        /repo/gcc-trunk/gcc/analyzer/engine.cc:5851
0x1738138 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-8236-20220424133922-g6b7441a46c7-checking-yes-rtl-df-extra-nobootstrap-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
--disable-bootstrap --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-8236-20220424133922-g6b7441a46c7-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220424 (experimental) (GCC)

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

* [Bug analyzer/105366] [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer
  2022-04-24 18:54 [Bug analyzer/105366] New: [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer zsojka at seznam dot cz
@ 2022-04-25  6:58 ` rguenth at gcc dot gnu.org
  2022-04-25 13:14 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-25  6:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.4

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

* [Bug analyzer/105366] [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer
  2022-04-24 18:54 [Bug analyzer/105366] New: [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer zsojka at seznam dot cz
  2022-04-25  6:58 ` [Bug analyzer/105366] " rguenth at gcc dot gnu.org
@ 2022-04-25 13:14 ` marxin at gcc dot gnu.org
  2022-04-25 15:54 ` [Bug analyzer/105366] [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer since r11-4511-gf635f0ce87d687b1 dmalcolm at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-04-25 13:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-04-25

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-4511-gf635f0ce87d687b1.

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

* [Bug analyzer/105366] [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer since r11-4511-gf635f0ce87d687b1
  2022-04-24 18:54 [Bug analyzer/105366] New: [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer zsojka at seznam dot cz
  2022-04-25  6:58 ` [Bug analyzer/105366] " rguenth at gcc dot gnu.org
  2022-04-25 13:14 ` marxin at gcc dot gnu.org
@ 2022-04-25 15:54 ` dmalcolm at gcc dot gnu.org
  2022-04-25 23:37 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-04-25 15:54 UTC (permalink / raw)
  To: gcc-bugs

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

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.

Seems to be the same root cause as PR105365; I'm not sure why one manifests
with GCC 11 and the other doesn't.

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

* [Bug analyzer/105366] [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer since r11-4511-gf635f0ce87d687b1
  2022-04-24 18:54 [Bug analyzer/105366] New: [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2022-04-25 15:54 ` [Bug analyzer/105366] [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer since r11-4511-gf635f0ce87d687b1 dmalcolm at gcc dot gnu.org
@ 2022-04-25 23:37 ` cvs-commit at gcc dot gnu.org
  2022-04-25 23:38 ` [Bug analyzer/105366] [11 " dmalcolm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-25 23:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:6ad3ca0077ec0d5f740cef5fdb743ffb61575941

commit r12-8254-g6ad3ca0077ec0d5f740cef5fdb743ffb61575941
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Mon Apr 25 19:36:37 2022 -0400

    analyzer: fix ICEs on complex constants [PR105365,105366]

    gcc/analyzer/ChangeLog:
            PR analyzer/105365
            PR analyzer/105366
            * svalue.cc
            (cmp_cst): Rename to...
            (cmp_csts_same_type): ...this.  Convert all recursive calls to
            calls to...
            (cmp_csts_and_types): ....this new function.
            (svalue::cmp_ptr): Update for renaming of cmp_cst

    gcc/testsuite/ChangeLog:
            PR analyzer/105365
            PR analyzer/105366
            * gcc.dg/analyzer/pr105365.c: New test.
            * gcc.dg/analyzer/pr105366.c: New test.

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

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

* [Bug analyzer/105366] [11 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer since r11-4511-gf635f0ce87d687b1
  2022-04-24 18:54 [Bug analyzer/105366] New: [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2022-04-25 23:37 ` cvs-commit at gcc dot gnu.org
@ 2022-04-25 23:38 ` dmalcolm at gcc dot gnu.org
  2022-04-28 21:43 ` cvs-commit at gcc dot gnu.org
  2022-04-28 21:46 ` dmalcolm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-04-25 23:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11/12 Regression] ICE: in  |[11 Regression] ICE: in
                   |cmp_cst, at                 |cmp_cst, at
                   |analyzer/svalue.cc:309 with |analyzer/svalue.cc:309 with
                   |-O -fanalyzer since         |-O -fanalyzer since
                   |r11-4511-gf635f0ce87d687b1  |r11-4511-gf635f0ce87d687b1

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

Keeping open for backporting to gcc 11.

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

* [Bug analyzer/105366] [11 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer since r11-4511-gf635f0ce87d687b1
  2022-04-24 18:54 [Bug analyzer/105366] New: [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2022-04-25 23:38 ` [Bug analyzer/105366] [11 " dmalcolm at gcc dot gnu.org
@ 2022-04-28 21:43 ` cvs-commit at gcc dot gnu.org
  2022-04-28 21:46 ` dmalcolm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-28 21:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:7f6033735bf5174f19ef0ab8efd92b075bcb277d

commit r11-9950-g7f6033735bf5174f19ef0ab8efd92b075bcb277d
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Thu Apr 28 17:42:44 2022 -0400

    analyzer: fix ICEs on complex constants [PR105365,105366]

    gcc/analyzer/ChangeLog:
            PR analyzer/105365
            PR analyzer/105366
            * svalue.cc
            (cmp_cst): Rename to...
            (cmp_csts_same_type): ...this.  Convert all recursive calls to
            calls to...
            (cmp_csts_and_types): ....this new function.
            (svalue::cmp_ptr): Update for renaming of cmp_cst

    gcc/testsuite/ChangeLog:
            PR analyzer/105365
            PR analyzer/105366
            * gcc.dg/analyzer/pr105365.c: New test.
            * gcc.dg/analyzer/pr105366.c: New test.

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

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

* [Bug analyzer/105366] [11 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer since r11-4511-gf635f0ce87d687b1
  2022-04-24 18:54 [Bug analyzer/105366] New: [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2022-04-28 21:43 ` cvs-commit at gcc dot gnu.org
@ 2022-04-28 21:46 ` dmalcolm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-04-28 21:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Should be fixed for gcc 11.4 by the above commit; closing.

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24 18:54 [Bug analyzer/105366] New: [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer zsojka at seznam dot cz
2022-04-25  6:58 ` [Bug analyzer/105366] " rguenth at gcc dot gnu.org
2022-04-25 13:14 ` marxin at gcc dot gnu.org
2022-04-25 15:54 ` [Bug analyzer/105366] [11/12 Regression] ICE: in cmp_cst, at analyzer/svalue.cc:309 with -O -fanalyzer since r11-4511-gf635f0ce87d687b1 dmalcolm at gcc dot gnu.org
2022-04-25 23:37 ` cvs-commit at gcc dot gnu.org
2022-04-25 23:38 ` [Bug analyzer/105366] [11 " dmalcolm at gcc dot gnu.org
2022-04-28 21:43 ` cvs-commit at gcc dot gnu.org
2022-04-28 21:46 ` 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).