From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D52BB3857347; Wed, 19 Oct 2022 09:08:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D52BB3857347 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666170531; bh=QVPpVQ5AlWXd+6ujrJ9q5+LNYoFsudUjTP0infgAPjw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SoQN8ysDItyrGM7R65mG5vINyNRC1vaw/UYaBy1s+x2nqEXmk63N0GhiEWXxrE8Zh JdPxeJ0yTH8T6V1MZbpDT8rmFlHWyQpHud0pYNWRKQoZ97UV/FIewVCnFXGMy30E5p Hagq+1wstXsOCAgxg19+y0Id1Db8w1TtCJZUTbW0= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/89224] [10/11/12/13 Regression] subscript of const vector has the wrong type Date: Wed, 19 Oct 2022 09:08:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 8.2.0 X-Bugzilla-Keywords: accepts-invalid, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc priority Message-ID: In-Reply-To: References: 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=3D89224 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org, | |rguenth at gcc dot gnu.org Priority|P3 |P2 --- Comment #10 from Richard Biener --- The issue is likely that lvalue_kind of unit-size align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7ffff653b348 precision:8 min max > readonly unsigned V16QI size unit-size align:128 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7ffff6684c78 nunits:16> readonly used unsigned V16QI t.ii:7:25 size unit-size align:128 warn_if_not_align:0 context arg-type > returns clk_ordinary and thus convert_vector_to_array_for_subscript returns false. And that's because 214 case PARM_DECL: 215 case RESULT_DECL: 216 case PLACEHOLDER_EXPR: 217 return clk_ordinary; we wrap the PARM_DECL in a VIEW_CONVERT_EXPR but that just gets stripped here. So maybe convert_vector_to_array_for_subscript is wrong in just using lvalue_p? I've went here just tracing cp_build_array_ref, otherwise I know nothing about C++ or how the c-c++-common lvalue_p should behave here.=