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
* [Bug c/101172] [12 regression] ICE Segmentation fault
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 ` rguenth at gcc dot gnu.org
2021-06-23 6:38 ` [Bug c/101172] " rguenth at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-23 6:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101172
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2021-06-23
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Keywords| |error-recovery,
| |ice-on-invalid-code
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. The DECL_BIT_FIELD_REPRESENTATIVE of the field not NULL but its
type is.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101172] ICE Segmentation fault
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 ` rguenth at gcc dot gnu.org
2021-06-23 8:00 ` marxin at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-23 6:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101172
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[12 regression] ICE |ICE Segmentation fault
|Segmentation fault |
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note
36.c:17: confused by earlier errors, bailing out
is what we print for an internal compiler error that happens after an error was
reported for release builds.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101172] ICE Segmentation fault
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
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-23 8:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101172
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Btw. started with r11-2225-ge4f1cbc35b1e823a.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/101172] [11/12 Regression] ICE Segmentation fault
2021-06-23 2:30 [Bug c/101172] New: [12 regression] ICE Segmentation fault anbu1024.me at gmail dot com
` (2 preceding siblings ...)
2021-06-23 8:00 ` marxin at gcc dot gnu.org
@ 2021-06-23 8:06 ` pinskia at gcc dot gnu.org
2021-06-23 9:16 ` [Bug middle-end/101172] " jakub at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-06-23 8:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101172
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
Target Milestone|--- |11.2
Summary|ICE Segmentation fault |[11/12 Regression] ICE
| |Segmentation fault
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/101172] [11/12 Regression] ICE Segmentation fault
2021-06-23 2:30 [Bug c/101172] New: [12 regression] ICE Segmentation fault anbu1024.me at gmail dot com
` (3 preceding siblings ...)
2021-06-23 8:06 ` [Bug c/101172] [11/12 Regression] " pinskia at gcc dot gnu.org
@ 2021-06-23 9:16 ` jakub at gcc dot gnu.org
2021-06-23 9:19 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-23 9:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101172
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|c |middle-end
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/101172] [11/12 Regression] ICE Segmentation fault
2021-06-23 2:30 [Bug c/101172] New: [12 regression] ICE Segmentation fault anbu1024.me at gmail dot com
` (4 preceding siblings ...)
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
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-23 9:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101172
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 51054
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51054&action=edit
gcc12-pr101172.patch
Untested fix.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/101172] [11/12 Regression] ICE Segmentation fault
2021-06-23 2:30 [Bug c/101172] New: [12 regression] ICE Segmentation fault anbu1024.me at gmail dot com
` (5 preceding siblings ...)
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
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-24 10:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101172
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:65371066d8967560e3508af4a804e0ddb90acee7
commit r12-1771-g65371066d8967560e3508af4a804e0ddb90acee7
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Jun 24 12:22:14 2021 +0200
stor-layout: Avoid DECL_BIT_FIELD_REPRESENTATIVE with NULL TREE_TYPE
[PR101172]
finish_bitfield_representative has an early out if the field after a
bitfield has error_mark_node type, but that early out leads to TREE_TYPE
of the DECL_BIT_FIELD_REPRESENTATIVE being NULL, which breaks assumptions
on code that uses the DECL_BIT_FIELD_REPRESENTATIVE during error-recovery.
The following patch instead sets TREE_TYPE of the representative to
error_mark_node, something the users can deal with better. At this point
the representative can be set as DECL_BIT_FIELD_REPRESENTATIVE for multiple
bitfields, so making sure that we clear the DECL_BIT_FIELD_REPRESENTATIVE
instead would be harder (but doable, e.g. with the error_mark_node
TREE_TYPE
set by this patch set some flag in the caller and if the flag is there,
walk
all the fields once again and clear all DECL_BIT_FIELD_REPRESENTATIVE that
have error_mark_node TREE_TYPE).
2021-06-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/101172
* stor-layout.c (finish_bitfield_representative): If nextf has
error_mark_node type, set repr type to error_mark_node too.
* gcc.dg/pr101172.c: New test.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/101172] [11 Regression] ICE Segmentation fault
2021-06-23 2:30 [Bug c/101172] New: [12 regression] ICE Segmentation fault anbu1024.me at gmail dot com
` (6 preceding siblings ...)
2021-06-24 10:22 ` cvs-commit at gcc dot gnu.org
@ 2021-06-24 10:29 ` jakub at gcc dot gnu.org
2021-07-06 6:54 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-24 10:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101172
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[11/12 Regression] ICE |[11 Regression] ICE
|Segmentation fault |Segmentation fault
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/101172] [11 Regression] ICE Segmentation fault
2021-06-23 2:30 [Bug c/101172] New: [12 regression] ICE Segmentation fault anbu1024.me at gmail dot com
` (7 preceding siblings ...)
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
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-06 6:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101172
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/101172] [11 Regression] ICE Segmentation fault
2021-06-23 2:30 [Bug c/101172] New: [12 regression] ICE Segmentation fault anbu1024.me at gmail dot com
` (8 preceding siblings ...)
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
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-18 23:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101172
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:2b99794806d83e47249fd7c05bf521caee1fdcd4
commit r11-8765-g2b99794806d83e47249fd7c05bf521caee1fdcd4
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Jun 24 12:22:14 2021 +0200
stor-layout: Avoid DECL_BIT_FIELD_REPRESENTATIVE with NULL TREE_TYPE
[PR101172]
finish_bitfield_representative has an early out if the field after a
bitfield has error_mark_node type, but that early out leads to TREE_TYPE
of the DECL_BIT_FIELD_REPRESENTATIVE being NULL, which breaks assumptions
on code that uses the DECL_BIT_FIELD_REPRESENTATIVE during error-recovery.
The following patch instead sets TREE_TYPE of the representative to
error_mark_node, something the users can deal with better. At this point
the representative can be set as DECL_BIT_FIELD_REPRESENTATIVE for multiple
bitfields, so making sure that we clear the DECL_BIT_FIELD_REPRESENTATIVE
instead would be harder (but doable, e.g. with the error_mark_node
TREE_TYPE
set by this patch set some flag in the caller and if the flag is there,
walk
all the fields once again and clear all DECL_BIT_FIELD_REPRESENTATIVE that
have error_mark_node TREE_TYPE).
2021-06-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/101172
* stor-layout.c (finish_bitfield_representative): If nextf has
error_mark_node type, set repr type to error_mark_node too.
* gcc.dg/pr101172.c: New test.
(cherry picked from commit 65371066d8967560e3508af4a804e0ddb90acee7)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/101172] [11 Regression] ICE Segmentation fault
2021-06-23 2:30 [Bug c/101172] New: [12 regression] ICE Segmentation fault anbu1024.me at gmail dot com
` (9 preceding siblings ...)
2021-07-18 23:28 ` cvs-commit at gcc dot gnu.org
@ 2021-07-19 7:54 ` jakub at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-19 7:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101172
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 11.2 too.
^ 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).