From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2977A3858C2C; Tue, 2 Jan 2024 23:33:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2977A3858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704238399; bh=m93cyWjqIweQXiZRuT8OipK0+NZvVJH3FJOGrjTwk0c=; h=From:To:Subject:Date:From; b=LWf/BLTwK6ogPuILLtt3dCsrBMTD0oiYvApmGjv/Q+QblJmFX1wycLMVxgFdqGT3R bZQc9O75U8wiqVby6siypP1gWikr3ouyBjcNFABXEk+B13EH2NzqJIcTPyjYf8NHV6 lmVRUmkcyvUhaxYyxwMjlweCPMl6oVpbEGAI6WQU= From: "patrick at rivosinc dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113210] New: [14] RISC-V vector ICE: tree check: expected integer_cst, have cond_expr in get_len, at tree.h:6481 Date: Tue, 02 Jan 2024 23:33:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: patrick at rivosinc dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113210 Bug ID: 113210 Summary: [14] RISC-V vector ICE: tree check: expected integer_cst, have cond_expr in get_len, at tree.h:6481 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: patrick at rivosinc dot com Target Milestone: --- Created attachment 56982 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D56982&action=3Dedit -freport-bug output Testcase: char a, c; short b; void d() { c =3D a - 1; b =3D c; unsigned short *e =3D &b; while (++*e > 256) ; } Command: > /scratch/tc-testing/tc-jan-1-trunk/build-rv64gcv/bin/riscv64-unknown-linu= x-gnu-gcc -march=3Drv64gcv -O2 red.c -freport-bug during GIMPLE pass: vect red.c: In function 'd': red.c:3:6: internal compiler error: tree check: expected integer_cst, have cond_expr in get_len, at tree.h:6481 3 | void d() { | ^ 0xab8132 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../../gcc/gcc/tree.cc:8952 0xc97cb2 tree_check(tree_node const*, char const*, int, char const*, tree_c= ode) ../../../gcc/gcc/tree.h:3900 0xc97cb2 wi::extended_tree<131072>::get_len() const ../../../gcc/gcc/tree.h:6481 0xc97cb2 wi::int_traits > >::decompose(long*, unsigned int, generic_wide_int > const&) ../../../gcc/gcc/wide-int.h:1050 0xc97cb2 wide_int_ref_storage::wide_int_ref_storage > >(generic_wide_int > const&, unsigned int) ../../../gcc/gcc/wide-int.h:1099 0xc97cb2 generic_wide_int >::generic_wide_int > >(generic_wide_int > const&, unsigned int) ../../../gcc/gcc/wide-int.h:855 0xc97cb2 wi::binary_traits >, in= t, wi::int_traits > >::precision_ty= pe, wi::int_traits::precision_type>::result_type wi::add >, int>(generic_wide_int > const&, int const&) ../../../gcc/gcc/wide-int.h:2871 0x156f0e7 wi::binary_traits >, i= nt, wi::int_traits > >::precision_ty= pe, wi::int_traits::precision_type>::operator_result operator+ >, int>(generic_wide_int > const&, int const&) ../../../gcc/gcc/wide-int.h:3857 0x156f0e7 vect_analyze_loop_costing ../../../gcc/gcc/tree-vect-loop.cc:2270 0x157ff01 vect_analyze_loop_2 ../../../gcc/gcc/tree-vect-loop.cc:3166 0x1581a20 vect_analyze_loop_1 ../../../gcc/gcc/tree-vect-loop.cc:3461 0x15821b9 vect_analyze_loop(loop*, vec_info_shared*) ../../../gcc/gcc/tree-vect-loop.cc:3619 0x15c84d4 try_vectorize_loop_1 ../../../gcc/gcc/tree-vectorizer.cc:1066 0x15c84d4 try_vectorize_loop ../../../gcc/gcc/tree-vectorizer.cc:1182 0x15c8dfc execute ../../../gcc/gcc/tree-vectorizer.cc:1298 Please submit a full bug report, with preprocessed source. Please include the complete backtrace with any bug report. See for instructions. Preprocessed source stored into /scratch/tmp/ccdgSv2l.out file, please atta= ch this to your bugreport. Godbolt: https://godbolt.org/z/x851M9q7n The ICE goes away if you change the 256 -> 255 -freport-bug output attached.=