public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/112336] New: ICE in gen_reg_rtx emit-rtl.cc:1208 while compiling "unsigned _BitInt(1) Foo;" with -fsanitize=address
@ 2023-11-01 14:45 fkastl at suse dot cz
2023-11-01 15:31 ` [Bug sanitizer/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size) pinskia at gcc dot gnu.org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: fkastl at suse dot cz @ 2023-11-01 14:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112336
Bug ID: 112336
Summary: ICE in gen_reg_rtx emit-rtl.cc:1208 while compiling
"unsigned _BitInt(1) Foo;" with -fsanitize=address
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: fkastl at suse dot cz
Target Milestone: ---
Host: x86_64-linux
Target: x86_64-linux
Compiling a file with a single line (a reduced ext-int.c from llvm testsuite):
--- ice.c ---
unsigned _BitInt(1) GlobSize1;
---
with -fsanitize=address:
gcc -fsanitize=address ice.c
results in an ICE:
ice.c:1:1: internal compiler error: in gen_reg_rtx, at emit-rtl.cc:1208
1 | unsigned _BitInt(1) GlobSize1;
| ^~~~~~~~
0x77249b gen_reg_rtx(machine_mode)
../../src/gcc/emit-rtl.cc:1208
0xe94b89 maybe_legitimize_operand
../../src/gcc/optabs.cc:8044
0xe94b89 maybe_legitimize_operands(insn_code, unsigned int, unsigned int,
expand_operand*)
../../src/gcc/optabs.cc:8199
0xe90ee9 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
../../src/gcc/optabs.cc:8218
0xe99c0c expand_binop_directly
../../src/gcc/optabs.cc:1457
0xe97b29 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
../../src/gcc/optabs.cc:1544
0xbde1c0 expand_and(machine_mode, rtx_def*, rtx_def*, rtx_def*)
../../src/gcc/expmed.cc:5483
0xbf8544 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../src/gcc/expr.cc:11005
0xc01fce expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
../../src/gcc/expr.h:310
0xc01fce expand_expr_addr_expr_1
../../src/gcc/expr.cc:8728
0xc02639 expand_expr_addr_expr
../../src/gcc/expr.cc:8849
0xbf7894 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../src/gcc/expr.cc:12163
0x1370de3 expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
../../src/gcc/expr.h:310
0x1370de3 output_constant
../../src/gcc/varasm.cc:5261
0x136fee8 output_constructor_regular_field
../../src/gcc/varasm.cc:5612
0x136fee8 output_constructor
../../src/gcc/varasm.cc:5878
0x136fee8 output_constructor_regular_field
../../src/gcc/varasm.cc:5612
0x136fee8 output_constructor
../../src/gcc/varasm.cc:5878
0x1371df5 assemble_variable_contents
../../src/gcc/varasm.cc:2231
0x1376f8d assemble_variable(tree_node*, int, int, int)
../../src/gcc/varasm.cc:2410
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug sanitizer/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size)
2023-11-01 14:45 [Bug target/112336] New: ICE in gen_reg_rtx emit-rtl.cc:1208 while compiling "unsigned _BitInt(1) Foo;" with -fsanitize=address fkastl at suse dot cz
@ 2023-11-01 15:31 ` pinskia at gcc dot gnu.org
2023-11-01 15:32 ` pinskia at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-01 15:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112336
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|middle-end |sanitizer
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2023-11-01
Summary|ICE in gen_reg_rtx |fsanitize=address vs
|emit-rtl.cc:1208 while |_BitInt with a non-mode
|compiling "unsigned |size (smaller than max mode
|_BitInt(1) Foo;" with |size)
|-fsanitize=address |
CC| |dodji at gcc dot gnu.org,
| |dvyukov at gcc dot gnu.org,
| |kcc at gcc dot gnu.org,
| |marxin at gcc dot gnu.org,
| |pinskia at gcc dot gnu.org
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
8, 16, 32, and 64 all work.
Any other size does not.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug sanitizer/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size)
2023-11-01 14:45 [Bug target/112336] New: ICE in gen_reg_rtx emit-rtl.cc:1208 while compiling "unsigned _BitInt(1) Foo;" with -fsanitize=address fkastl at suse dot cz
2023-11-01 15:31 ` [Bug sanitizer/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size) pinskia at gcc dot gnu.org
@ 2023-11-01 15:32 ` pinskia at gcc dot gnu.org
2023-11-22 16:40 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-01 15:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112336
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Well sizes than 128 that is.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug sanitizer/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size)
2023-11-01 14:45 [Bug target/112336] New: ICE in gen_reg_rtx emit-rtl.cc:1208 while compiling "unsigned _BitInt(1) Foo;" with -fsanitize=address fkastl at suse dot cz
2023-11-01 15:31 ` [Bug sanitizer/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size) pinskia at gcc dot gnu.org
2023-11-01 15:32 ` pinskia at gcc dot gnu.org
@ 2023-11-22 16:40 ` jakub at gcc dot gnu.org
2023-11-22 18:18 ` [Bug middle-end/112336] " jakub at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-11-22 16:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112336
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Seems one doesn't need the sanitizer for that,
unsigned _BitInt(1) v1;
unsigned _BitInt(1) *p1 = &v1;
ICEs as well.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size)
2023-11-01 14:45 [Bug target/112336] New: ICE in gen_reg_rtx emit-rtl.cc:1208 while compiling "unsigned _BitInt(1) Foo;" with -fsanitize=address fkastl at suse dot cz
` (2 preceding siblings ...)
2023-11-22 16:40 ` jakub at gcc dot gnu.org
@ 2023-11-22 18:18 ` jakub at gcc dot gnu.org
2023-11-23 12:00 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-11-22 18:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112336
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
Status|NEW |ASSIGNED
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 56667
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56667&action=edit
gcc14-pr112336.patch
Untested fix.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size)
2023-11-01 14:45 [Bug target/112336] New: ICE in gen_reg_rtx emit-rtl.cc:1208 while compiling "unsigned _BitInt(1) Foo;" with -fsanitize=address fkastl at suse dot cz
` (3 preceding siblings ...)
2023-11-22 18:18 ` [Bug middle-end/112336] " jakub at gcc dot gnu.org
@ 2023-11-23 12:00 ` cvs-commit at gcc dot gnu.org
2023-11-23 12:01 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-23 12:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112336
--- 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:f9982ef4f55bd3a63745e03ac6d68b4a92fa8bce
commit r14-5776-gf9982ef4f55bd3a63745e03ac6d68b4a92fa8bce
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Nov 23 12:59:54 2023 +0100
expr: Fix &bitint_var handling in initializers [PR112336]
As the following testcase shows, we ICE when trying to emit ADDR_EXPR of
a bitint variable which doesn't have mode width.
The problem is in the EXTEND_BITINT stuff which makes sure we treat the
padding bits on memory reads from user bitint vars as undefined.
When expanding ADDR_EXPR on such vars inside outside of initializers,
expand_expr_addr* uses EXPAND_CONST_ADDRESS modifier and EXTEND_BITINT
does nothing, but in initializers it keeps using EXPAND_INITIALIZER
modifier. So, we need to treat EXPAND_INITIALIZER the same as
EXPAND_CONST_ADDRESS for this regard.
2023-11-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/112336
* expr.cc (EXTEND_BITINT): Don't call reduce_to_bit_field_precision
if modifier is EXPAND_INITIALIZER.
* gcc.dg/bitint-41.c: New test.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size)
2023-11-01 14:45 [Bug target/112336] New: ICE in gen_reg_rtx emit-rtl.cc:1208 while compiling "unsigned _BitInt(1) Foo;" with -fsanitize=address fkastl at suse dot cz
` (4 preceding siblings ...)
2023-11-23 12:00 ` cvs-commit at gcc dot gnu.org
@ 2023-11-23 12:01 ` jakub at gcc dot gnu.org
2023-11-24 7:16 ` pinskia at gcc dot gnu.org
2023-11-24 7:17 ` pinskia at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-11-23 12:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112336
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be fixed now.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size)
2023-11-01 14:45 [Bug target/112336] New: ICE in gen_reg_rtx emit-rtl.cc:1208 while compiling "unsigned _BitInt(1) Foo;" with -fsanitize=address fkastl at suse dot cz
` (5 preceding siblings ...)
2023-11-23 12:01 ` jakub at gcc dot gnu.org
@ 2023-11-24 7:16 ` pinskia at gcc dot gnu.org
2023-11-24 7:17 ` pinskia at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-24 7:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112336
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |14.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size)
2023-11-01 14:45 [Bug target/112336] New: ICE in gen_reg_rtx emit-rtl.cc:1208 while compiling "unsigned _BitInt(1) Foo;" with -fsanitize=address fkastl at suse dot cz
` (6 preceding siblings ...)
2023-11-24 7:16 ` pinskia at gcc dot gnu.org
@ 2023-11-24 7:17 ` pinskia at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-24 7:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112336
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |iamanonymous.cs at gmail dot com
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 112695 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-11-24 7:17 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-01 14:45 [Bug target/112336] New: ICE in gen_reg_rtx emit-rtl.cc:1208 while compiling "unsigned _BitInt(1) Foo;" with -fsanitize=address fkastl at suse dot cz
2023-11-01 15:31 ` [Bug sanitizer/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size) pinskia at gcc dot gnu.org
2023-11-01 15:32 ` pinskia at gcc dot gnu.org
2023-11-22 16:40 ` jakub at gcc dot gnu.org
2023-11-22 18:18 ` [Bug middle-end/112336] " jakub at gcc dot gnu.org
2023-11-23 12:00 ` cvs-commit at gcc dot gnu.org
2023-11-23 12:01 ` jakub at gcc dot gnu.org
2023-11-24 7:16 ` pinskia at gcc dot gnu.org
2023-11-24 7:17 ` pinskia 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).