public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/103107] New: [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189
@ 2021-11-06 12:06 zsojka at seznam dot cz
  2021-11-06 19:33 ` [Bug ipa/103107] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: zsojka at seznam dot cz @ 2021-11-06 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103107
           Summary: [12 Regression] ICE: tree check: expected class
                    'expression', have 'exceptional' (constructor) in
                    prepare_debug_expressions, at
                    ipa-param-manipulation.c:1189
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og -g -fipa-sra -fno-tree-dce testcase.c
In function 'bar.isra':
cc1: internal compiler error: tree check: expected class 'expression', have
'exceptional' (constructor) in prepare_debug_expressions, at
ipa-param-manipulation.c:1189
0x7e2a2b tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /repo/gcc-trunk/gcc/tree.c:8739
0x7037bd expr_check(tree_node*, char const*, int, char const*)
        /repo/gcc-trunk/gcc/tree.h:3602
0x7037bd ipa_param_body_adjustments::prepare_debug_expressions(tree_node*)
        /repo/gcc-trunk/gcc/ipa-param-manipulation.c:1189
0x11162c2 ipa_param_body_adjustments::prepare_debug_expressions(tree_node*)
        /repo/gcc-trunk/gcc/ipa-param-manipulation.c:1164
0x111725d ipa_param_body_adjustments::common_initialization(tree_node*,
tree_node**, vec<ipa_replace_map*, va_gc, vl_embed>*)
        /repo/gcc-trunk/gcc/ipa-param-manipulation.c:1365
0x13dc391 tree_function_versioning(tree_node*, tree_node*,
vec<ipa_replace_map*, va_gc, vl_embed>*, ipa_param_adjustments*, bool,
bitmap_head*, basic_block_def*)
        /repo/gcc-trunk/gcc/tree-inline.c:6307
0xe8dfcd cgraph_node::materialize_clone()
        /repo/gcc-trunk/gcc/cgraphclones.c:1141
0xe7c7f5 cgraph_node::get_untransformed_body()
        /repo/gcc-trunk/gcc/cgraph.c:3907
0xe87f0d cgraph_node::expand()
        /repo/gcc-trunk/gcc/cgraphunit.c:1799
0xe87f0d cgraph_node::expand()
        /repo/gcc-trunk/gcc/cgraphunit.c:1781
0xe89597 expand_all_functions
        /repo/gcc-trunk/gcc/cgraphunit.c:1992
0xe89597 symbol_table::compile()
        /repo/gcc-trunk/gcc/cgraphunit.c:2356
0xe8c067 symbol_table::compile()
        /repo/gcc-trunk/gcc/cgraphunit.c:2269
0xe8c067 symbol_table::finalize_compilation_unit()
        /repo/gcc-trunk/gcc/cgraphunit.c:2537
Please submit a full bug report,
with preprocessed source if appropriate.
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-4968-20211106001624-g851dff042a2-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/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-4968-20211106001624-g851dff042a2-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211106 (experimental) (GCC)

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

* [Bug ipa/103107] [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189
  2021-11-06 12:06 [Bug ipa/103107] New: [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 zsojka at seznam dot cz
@ 2021-11-06 19:33 ` pinskia at gcc dot gnu.org
  2021-11-08  8:13 ` [Bug ipa/103107] [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 since r12-4920-g1ece90ffa9ce63b4 marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-06 19:33 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

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

* [Bug ipa/103107] [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 since r12-4920-g1ece90ffa9ce63b4
  2021-11-06 12:06 [Bug ipa/103107] New: [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 zsojka at seznam dot cz
  2021-11-06 19:33 ` [Bug ipa/103107] " pinskia at gcc dot gnu.org
@ 2021-11-08  8:13 ` marxin at gcc dot gnu.org
  2021-11-08  9:12 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-08  8:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[12 Regression] ICE: tree   |[12 Regression] ICE: tree
                   |check: expected class       |check: expected class
                   |'expression', have          |'expression', have
                   |'exceptional' (constructor) |'exceptional' (constructor)
                   |in                          |in
                   |prepare_debug_expressions,  |prepare_debug_expressions,
                   |at                          |at
                   |ipa-param-manipulation.c:11 |ipa-param-manipulation.c:11
                   |89                          |89 since
                   |                            |r12-4920-g1ece90ffa9ce63b4
   Last reconfirmed|                            |2021-11-08
     Ever confirmed|0                           |1
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=103099
                 CC|                            |jamborm at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-4920-g1ece90ffa9ce63b4.

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

* [Bug ipa/103107] [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 since r12-4920-g1ece90ffa9ce63b4
  2021-11-06 12:06 [Bug ipa/103107] New: [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 zsojka at seznam dot cz
  2021-11-06 19:33 ` [Bug ipa/103107] " pinskia at gcc dot gnu.org
  2021-11-08  8:13 ` [Bug ipa/103107] [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 since r12-4920-g1ece90ffa9ce63b4 marxin at gcc dot gnu.org
@ 2021-11-08  9:12 ` rguenth at gcc dot gnu.org
  2021-11-08  9:15 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-11-08  9:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think I've seen a duplicate.

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

* [Bug ipa/103107] [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 since r12-4920-g1ece90ffa9ce63b4
  2021-11-06 12:06 [Bug ipa/103107] New: [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2021-11-08  9:12 ` rguenth at gcc dot gnu.org
@ 2021-11-08  9:15 ` marxin at gcc dot gnu.org
  2021-11-08 11:57 ` jamborm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-08  9:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #2)
> I think I've seen a duplicate.

You probably mean PR103099, but the suggested fix from the PR does not fix
this.

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

* [Bug ipa/103107] [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 since r12-4920-g1ece90ffa9ce63b4
  2021-11-06 12:06 [Bug ipa/103107] New: [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2021-11-08  9:15 ` marxin at gcc dot gnu.org
@ 2021-11-08 11:57 ` jamborm at gcc dot gnu.org
  2021-11-08 16:54 ` cvs-commit at gcc dot gnu.org
  2021-11-08 17:04 ` jamborm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu.org @ 2021-11-08 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jamborm at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Mine.

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

* [Bug ipa/103107] [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 since r12-4920-g1ece90ffa9ce63b4
  2021-11-06 12:06 [Bug ipa/103107] New: [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2021-11-08 11:57 ` jamborm at gcc dot gnu.org
@ 2021-11-08 16:54 ` cvs-commit at gcc dot gnu.org
  2021-11-08 17:04 ` jamborm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-08 16:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Jambor <jamborm@gcc.gnu.org>:

https://gcc.gnu.org/g:239d82d4c05b30632fd09ba4056de7dac5aee070

commit r12-5003-g239d82d4c05b30632fd09ba4056de7dac5aee070
Author: Martin Jambor <mjambor@suse.cz>
Date:   Mon Nov 8 17:49:54 2021 +0100

    ipa: Unshare expresseions before putting them into debug statements (PR
103099, PR 103107)

    My recent patch to improve debug experience when there are removed
    parameters (by ipa-sra or ipa-split) was not careful to unshare the
    expressions that were then put into debug statements, which manifests
    itself as PR 103099.  This patch adds unsharing them using
    unshare_expr_without_location which is a bit more careful with stripping
    locations than what we were doing manually and so also fixes PR 103107.

    gcc/ChangeLog:

    2021-11-08  Martin Jambor  <mjambor@suse.cz>

            PR ipa/103099
            PR ipa/103107
            * tree-inline.c (remap_gimple_stmt): Unshare the expression without
            location before invoking remap_with_debug_expressions on it.
            * ipa-param-manipulation.c
            (ipa_param_body_adjustments::prepare_debug_expressions): Likewise.

    gcc/testsuite/ChangeLog:

    2021-11-08  Martin Jambor  <mjambor@suse.cz>

            PR ipa/103099
            PR ipa/103107
            * g++.dg/ipa/pr103099.C: New test.
            * gcc.dg/ipa/pr103107.c: Likewise.

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

* [Bug ipa/103107] [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 since r12-4920-g1ece90ffa9ce63b4
  2021-11-06 12:06 [Bug ipa/103107] New: [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2021-11-08 16:54 ` cvs-commit at gcc dot gnu.org
@ 2021-11-08 17:04 ` jamborm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu.org @ 2021-11-08 17:04 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

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

--- Comment #6 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Fixed.  Thanks for testing and sorry for the breakage.

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

end of thread, other threads:[~2021-11-08 17:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-06 12:06 [Bug ipa/103107] New: [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 zsojka at seznam dot cz
2021-11-06 19:33 ` [Bug ipa/103107] " pinskia at gcc dot gnu.org
2021-11-08  8:13 ` [Bug ipa/103107] [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189 since r12-4920-g1ece90ffa9ce63b4 marxin at gcc dot gnu.org
2021-11-08  9:12 ` rguenth at gcc dot gnu.org
2021-11-08  9:15 ` marxin at gcc dot gnu.org
2021-11-08 11:57 ` jamborm at gcc dot gnu.org
2021-11-08 16:54 ` cvs-commit at gcc dot gnu.org
2021-11-08 17:04 ` jamborm 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).