public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/101172] New: [12 regression] ICE Segmentation fault
@ 2021-06-23  2:30 anbu1024.me at gmail dot com
  2021-06-23  6:37 ` [Bug c/101172] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: anbu1024.me at gmail dot com @ 2021-06-23  2:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101172
           Summary: [12 regression] ICE Segmentation fault
           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 36.c 

union U
{
  int a[3];
  struct
  {
    int a : 3;
    struct this_struct var;
  } b;
};

const union U hello = {.a = {1, 2, 3}};


void foo()
{
  int x = hello.b.a;
}

-------------------------------------------------------------------------------

$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210620 (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 36.c 
36.c:8:24: error: field ‘var’ has incomplete type
    8 |     struct this_struct var;
      |                        ^~~
36.c: In function ‘foo’:
36.c:17:18: internal compiler error: Segmentation fault
   17 |   int x = hello.b.a;
      |           ~~~~~~~^~
0xe600af crash_signal
        ../../gcc-12-20210620/gcc/toplev.c:327
0xb85ab1 fold_const_aggregate_ref_1(tree_node*, tree_node* (*)(tree_node*))
        ../../gcc-12-20210620/gcc/gimple-fold.c:8184
0xb86e49 fold_const_aggregate_ref(tree_node*)
        ../../gcc-12-20210620/gcc/gimple-fold.c:8250
0xb86e49 maybe_fold_reference
        ../../gcc-12-20210620/gcc/gimple-fold.c:333
0xb8bc86 fold_gimple_assign
        ../../gcc-12-20210620/gcc/gimple-fold.c:483
0xb8bc86 fold_stmt_1
        ../../gcc-12-20210620/gcc/gimple-fold.c:6250
0xbd1071 gimplify_modify_expr
        ../../gcc-12-20210620/gcc/gimplify.c:5982
0xbb909f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-12-20210620/gcc/gimplify.c:14094
0xbbc9f6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-12-20210620/gcc/gimplify.c:6865
0xbbe8d6 gimplify_and_add(tree_node*, gimple**)
        ../../gcc-12-20210620/gcc/gimplify.c:494
0xbbe8d6 internal_get_tmp_var
        ../../gcc-12-20210620/gcc/gimplify.c:647
0xbb887e get_formal_tmp_var(tree_node*, gimple**)
        ../../gcc-12-20210620/gcc/gimplify.c:668
0xbb887e gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-12-20210620/gcc/gimplify.c:15083
0xbb9363 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-12-20210620/gcc/gimplify.c:14399
0xbd0dff gimplify_modify_expr
        ../../gcc-12-20210620/gcc/gimplify.c:5806
0xbb909f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-12-20210620/gcc/gimplify.c:14094
0xbbc9f6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-12-20210620/gcc/gimplify.c:6865
0xbc3c9d gimplify_and_add(tree_node*, gimple**)
        ../../gcc-12-20210620/gcc/gimplify.c:494
0xbc3c9d gimplify_decl_expr
        ../../gcc-12-20210620/gcc/gimplify.c:1831
0xbb939a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-12-20210620/gcc/gimplify.c:14291
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 20210619
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 36.c 
36.c:8:24: error: field ‘var’ has incomplete type
    8 |     struct this_struct var;
      |                        ^~~
36.c:17: confused by earlier errors, bailing out

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

end of thread, other threads:[~2021-07-19  7:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23  2:30 [Bug c/101172] New: [12 regression] ICE Segmentation fault anbu1024.me at gmail dot com
2021-06-23  6:37 ` [Bug c/101172] " rguenth at gcc dot gnu.org
2021-06-23  6:38 ` [Bug c/101172] " rguenth at gcc dot gnu.org
2021-06-23  8:00 ` marxin at gcc dot gnu.org
2021-06-23  8:06 ` [Bug c/101172] [11/12 Regression] " pinskia at gcc dot gnu.org
2021-06-23  9:16 ` [Bug middle-end/101172] " jakub at gcc dot gnu.org
2021-06-23  9:19 ` jakub at gcc dot gnu.org
2021-06-24 10:22 ` cvs-commit at gcc dot gnu.org
2021-06-24 10:29 ` [Bug middle-end/101172] [11 " jakub at gcc dot gnu.org
2021-07-06  6:54 ` rguenth at gcc dot gnu.org
2021-07-18 23:28 ` cvs-commit at gcc dot gnu.org
2021-07-19  7:54 ` jakub 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).