This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/82765] [6/7/8 Regression] ICE at -Os on valid code on x86_64-linux-gnu: in tree_to_shwi, at tree.c:6611
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 30 Oct 2017 08:13:55 +0000
- Subject: [Bug c/82765] [6/7/8 Regression] ICE at -Os on valid code on x86_64-linux-gnu: in tree_to_shwi, at tree.c:6611
- Auto-submitted: auto-generated
- References: <bug-82765-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82765
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Priority|P3 |P2
Component|tree-optimization |c
Version|unknown |8.0
Target Milestone|--- |6.5
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I believe this is a frontend bug. We're parsing the literal into a __int128
type and using that to index the array.
IMHO the FE should truncate array indices to a type equal or smaller than
sizetype
given the domain type of the array is
<integer_type 0x7ffff68b4dc8
type <integer_type 0x7ffff68a9000 sizetype public unsigned DI
size <integer_cst 0x7ffff6891cd8 constant 64>
unit-size <integer_cst 0x7ffff6891cf0 constant 8>
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff68a9000 precision:64 min <integer_cst 0x7ffff6891d08 0> max <integer_cst
0x7ffff68934c0 18446744073709551615>>
DI size <integer_cst 0x7ffff6891cd8 64> unit-size <integer_cst
0x7ffff6891cf0 8>
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff68b4dc8 precision:64 min <integer_cst 0x7ffff6891d08 0> max <integer_cst
0x7ffff6891d08 0>>