From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 259DB385842E; Mon, 15 Nov 2021 22:32:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 259DB385842E From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103223] [12 regression] Access attribute dropped when ipa-sra is applied Date: Mon, 15 Nov 2021 22:32:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2021 22:32:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103223 --- Comment #9 from Martin Sebor --- Outside of code comments only the user-visible attribute access interface is documented in the manual. The main difference is probably that attribute access can be added by the u= ser for any pair of arguments (without a limit on the number of arguments).=20 Another difference is that the implicit attribute access captures the VLA argument bounds and the [static N] specifier that tells us that array must = have at least N elements (this latter part could be used for optimization). The attribute access mode none means that the argument isn't dereferenced but m= ust point to an object of the specified size (I'm guessing that's not quite the same as the 'x' character in fn spec). For the common subset it might make sense to transform attribute access to fnspec when it applies to the first N arguments (with N being the fnspec limit). Come to think of it, an alternate approach to solving the IPA problem with = lost attribute access might be to extend attr fnspec to encode the same things a= s it and for the warnings to use fnspec instead. The same caveat applies that n= ot all of what attribute access describes can be used for optimization, so the= API would have to make the distinction quite clear.=