public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "anbu1024.me at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/101365] New: [12 Regression] ICE: in fold_convert_loc, at fold-const.c:243
Date: Wed, 07 Jul 2021 14:13:57 +0000	[thread overview]
Message-ID: <bug-101365-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 101365
           Summary: [12 Regression] ICE: in fold_convert_loc, at
                    fold-const.c:243
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

int var_0;

void func_0()
{
  var_0++;
}

int var_0[] = {1};

================================

$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210704 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

================================

$ gcc-sp12 test.c 
test.c:9:5: error: conflicting types for ‘var_0’; have ‘int[]’
    9 | int var_0[] = {1};
      |     ^~~~~
test.c:2:5: note: previous declaration of ‘var_0’ with type ‘int’
    2 | int var_0;
      |     ^~~~~
test.c: In function ‘func_0’:
test.c:6:8: internal compiler error: in fold_convert_loc, at fold-const.c:2431
    6 |   var_0++;
      |   ~~~~~^~
0x6d5399 fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../gcc-12-20210704/gcc/fold-const.c:2431
0xbddc1e gimplify_self_mod_expr(tree_node**, gimple**, gimple**, bool,
tree_node*)
        ../../gcc-12-20210704/gcc/gimplify.c:3204
0xbc77b8 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-12-20210704/gcc/gimplify.c:14140
0xbcb3f6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-12-20210704/gcc/gimplify.c:6869
0xbcbb4d gimplify_bind_expr
        ../../gcc-12-20210704/gcc/gimplify.c:1426
0xbc96ae gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-12-20210704/gcc/gimplify.c:14411
0xbe0f59 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-12-20210704/gcc/gimplify.c:6869
0xbe0f59 gimplify_body(tree_node*, bool)
        ../../gcc-12-20210704/gcc/gimplify.c:15442
0xbe139d gimplify_function_tree(tree_node*)
        ../../gcc-12-20210704/gcc/gimplify.c:15596
0xa202e7 cgraph_node::analyze()
        ../../gcc-12-20210704/gcc/cgraphunit.c:670
0xa22d17 analyze_functions
        ../../gcc-12-20210704/gcc/cgraphunit.c:1234
0xa239bd symbol_table::finalize_compilation_unit()
        ../../gcc-12-20210704/gcc/cgraphunit.c:2508
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.

================================

$ gcc-sp11 --version
gcc (GCC) 11.1.1 20210703
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

================================

$ gcc-sp11 test.c 
test.c:9:5: error: conflicting types for ‘var_0’; have ‘int[]’
    9 | int var_0[] = {1};
      |     ^~~~~
test.c:2:5: note: previous declaration of ‘var_0’ with type ‘int’
    2 | int var_0;
      |     ^~~~~
test.c:6: confused by earlier errors, bailing out

             reply	other threads:[~2021-07-07 14:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 14:13 anbu1024.me at gmail dot com [this message]
2021-08-28 20:28 ` [Bug c/101365] [9/10/11/12 " pinskia at gcc dot gnu.org
2021-08-28 20:30 ` pinskia at gcc dot gnu.org
2021-08-28 20:33 ` 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-101365-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).