public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "suochenyao at 163 dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/97551] New: ICE: verify_cgraph_node failed with "-O2 -fno-toplevel-reorder -fno-tree-dce -fno-tree-forwprop -fno-tree-fre -fipa-cp-clone"
Date: Fri, 23 Oct 2020 15:43:00 +0000	[thread overview]
Message-ID: <bug-97551-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 97551
           Summary: ICE: verify_cgraph_node failed with "-O2
                    -fno-toplevel-reorder -fno-tree-dce -fno-tree-forwprop
                    -fno-tree-fre -fipa-cp-clone"
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: suochenyao at 163 dot com
  Target Milestone: ---

*******************************************************************************
OS and Platform:
CentOS Linux release 7.8.2003 (Core), x86_64 GNU/Linux
*******************************************************************************
Program:
int a=0, b=0;
char c=0;
long d=0;
long (e)(int f, int g) { return f && g || g > 0 && f || f <= 0 && g && f && g <
0 ?  : g; }
void h(int f) {
  for (; c;) {
    e(7, d);
    for (; a;)
      b = !f;
  }
}
void i() { h(0); }
int main() { return 0; }
*******************************************************************************
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/home/suocy/bin/gcc-dev/bin/gcc
COLLECT_LTO_WRAPPER=/home/suocy/bin/gcc-dev/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/home/suocy/bin/gcc-dev/
--disable-multilib --enable-languages=c,c++
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20201023 (experimental) (GCC)

git version: 43868df37b0e1fa19c32175b41dd7dc1e7c515fd
*******************************************************************************
Command Lines:
$ gcc -Wall -Wextra -fno-strict-aliasing -fwrapv -O2 -fno-toplevel-reorder
-fno-tree-dce -fno-tree-forwprop -fno-tree-fre -fipa-cp-clone a.c
a.c: In function ‘e’:
a.c:4:35: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
    4 | long (e)(int f, int g) { return f && g || g > 0 && f || f <= 0 && g &&
f && g < 0 ?  : g; }
      |                                 ~~^~~~
a.c:4:74: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
    4 | long (e)(int f, int g) { return f && g || g > 0 && f || f <= 0 && g &&
f && g < 0 ?  : g; }
      |                                                        
~~~~~~~~~~~~~~~~~^~~~~~~~
a.c:4:86: warning: the omitted middle operand in ‘?:’ will always be ‘true’,
suggest explicit middle operand [-Wparentheses]
    4 | long (e)(int f, int g) { return f && g || g > 0 && f || f <= 0 && g &&
f && g < 0 ?  : g; }
      |                                                                        
             ^
a.c: In function ‘i’:
a.c:12:12: error: edge points to wrong declaration:
   12 | void i() { h(0); }
      |            ^~~~
 <function_decl 0x7f042463f300 e.constprop.isra
    type <function_type 0x7f04246400a8
        type <void_type 0x7f04244edf18 void VOID
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f04244edf18
            pointer_to_this <pointer_type 0x7f04244f5000>>
        QI
        size <integer_cst 0x7f04244d4dc8 constant 8>
        unit-size <integer_cst 0x7f04244d4de0 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f04246400a8
        arg-types <tree_list 0x7f0424633a28 value <integer_type 0x7f04244ed5e8
int>
            chain <tree_list 0x7f04244e98c0 value <void_type 0x7f04244edf18
void>>>
        pointer_to_this <pointer_type 0x7f0424640498>>
    readonly addressable used nothrow static decl_5 QI a.c:4:7 align:8
warn_if_not_align:0 context <translation_unit_decl 0x7f04244e1c30 a.c>>
 Instead of: <function_decl 0x7f0424605600 e
    type <function_type 0x7f042460d2a0
        type <integer_type 0x7f04244ed738 long int public DI
            size <integer_cst 0x7f04244d4cd8 constant 64>
            unit-size <integer_cst 0x7f04244d4cf0 constant 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set 2 canonical-type
0x7f04244ed738 precision:64 min <integer_cst 0x7f04244d4f60
-9223372036854775808> max <integer_cst 0x7f04244d4f78 9223372036854775807>
            pointer_to_this <pointer_type 0x7f04244fd150>>
        QI
        size <integer_cst 0x7f04244d4dc8 constant 8>
        unit-size <integer_cst 0x7f04244d4de0 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f042460d2a0
        arg-types <tree_list 0x7f0424601c80 value <integer_type 0x7f04244ed5e8
int>
            chain <tree_list 0x7f0424601c58 value <integer_type 0x7f04244ed5e8
int>
                chain <tree_list 0x7f04244e98c0 value <void_type 0x7f04244edf18
void>>>>
        pointer_to_this <pointer_type 0x7f042460d3f0>>
    readonly addressable asm_written used nothrow public static decl_5 QI
a.c:4:7 align:8 warn_if_not_align:0 context <translation_unit_decl
0x7f04244e1c30 a.c> initial <error_mark 0x7f04244d4cc0>
    result <result_decl 0x7f04244e1a50 D.1937 type <integer_type 0x7f04244ed738
long int>
        ignored regdecl DI a.c:4:7 size <integer_cst 0x7f04244d4cd8 64>
unit-size <integer_cst 0x7f04244d4cf0 8>
        align:64 warn_if_not_align:0 context <function_decl 0x7f0424605600 e>
        (reg:DI 0 ax [orig:89 <retval> ] [89])>
    (mem:QI (symbol_ref:DI ("e") [flags 0x3] <function_decl 0x7f0424605600 e>)
[0  S1 A8]) chain <function_decl 0x7f0424605800 h>>
h.constprop.0/8 (h.constprop) @0x7f042462c540
  Type: function definition analyzed
  Visibility: no_reorder artificial
  References: d/3 (read) b/1 (write) a/0 (read) c/2 (read)
  Referring:
  Function h.constprop/8 is inline copy in i/6
  Availability: local
  Function flags: count:1073741824 (estimated locally) body local nonfreeing_fn
  Called by: i/6 (inlined) (1073741824 (estimated locally),1.00 per call)
  Calls: e.constprop.0.isra.0/10 (8687547438 (estimated locally),8.09 per call)
during IPA pass: inline
a.c:12:12: internal compiler error: verify_cgraph_node failed
0x9939e0 cgraph_node::verify_node()
        ../../gcc/cgraph.c:3800
0x9869d4 symtab_node::verify()
        ../../gcc/symtab.c:1318
0xe490cb expand_call_inline
        ../../gcc/tree-inline.c:4833
0xe4b9f9 gimple_expand_calls_inline
        ../../gcc/tree-inline.c:5266
0xe4b9f9 optimize_inline_calls(tree_node*)
        ../../gcc/tree-inline.c:5439
0xbb1a1b inline_transform(cgraph_node*)
        ../../gcc/ipa-inline-transform.c:749
0xceaf45 execute_one_ipa_transform_pass
        ../../gcc/passes.c:2240
0xceaf45 execute_all_ipa_transforms(bool)
        ../../gcc/passes.c:2287
0x99905d cgraph_node::expand()
        ../../gcc/cgraphunit.c:2303
0x99a39a output_in_order
        ../../gcc/cgraphunit.c:2621
0x99a39a symbol_table::compile()
        ../../gcc/cgraphunit.c:2839
0x99c9f7 symbol_table::compile()
        ../../gcc/cgraphunit.c:2755
0x99c9f7 symbol_table::finalize_compilation_unit()
        ../../gcc/cgraphunit.c:3023
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.

             reply	other threads:[~2020-10-23 15:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 15:43 suochenyao at 163 dot com [this message]
2020-10-26  9:54 ` [Bug ipa/97551] " marxin at gcc dot gnu.org
2021-04-27 11:39 ` jakub at gcc dot gnu.org
2021-07-28  7:04 ` rguenth at gcc dot gnu.org
2023-05-14 21:55 ` [Bug ipa/97551] [11 Regression] " pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-97551-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).