From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 5A0823856DC4; Fri, 6 May 2022 02:31:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A0823856DC4 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] Disallow SUBREG of MEM X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 89817d0e348b2b76a3f4f61ae40ce8692cf6734e X-Git-Newrev: 4c180902db3bc44b13b251e454c850f485b0fa5a Message-Id: <20220506023132.5A0823856DC4@sourceware.org> Date: Fri, 6 May 2022 02:31:32 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2022 02:31:32 -0000 https://gcc.gnu.org/g:4c180902db3bc44b13b251e454c850f485b0fa5a commit 4c180902db3bc44b13b251e454c850f485b0fa5a Author: Alexandre Oliva Date: Thu May 5 23:25:39 2022 -0300 Disallow SUBREG of MEM Introduce TARGET_ALLOW_SUBREG_OF_MEM, defaulting to 0. Reject SUBREG of MEM regardless of alignment, unless the macro is defined to nonzero. for gcc/ChangeLog PR target/100106 * emit-rtl.cc (validate_subreg) [!TARGET_ALLOW_SUBREG_OF_MEM]: Reject SUBREG of MEM. Diff: --- gcc/emit-rtl.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/emit-rtl.cc b/gcc/emit-rtl.cc index 9c03e27894f..f055179b3b8 100644 --- a/gcc/emit-rtl.cc +++ b/gcc/emit-rtl.cc @@ -983,8 +983,12 @@ validate_subreg (machine_mode omode, machine_mode imode, return subreg_offset_representable_p (regno, imode, offset, omode); } /* Do not allow SUBREG with stricter alignment than the inner MEM. */ - else if (reg && MEM_P (reg) && STRICT_ALIGNMENT - && MEM_ALIGN (reg) < GET_MODE_ALIGNMENT (omode)) + else if (reg && MEM_P (reg) +#if TARGET_ALLOW_SUBREG_OF_MEM /* ??? Reject them all eventually. */ + && STRICT_ALIGNMENT + && MEM_ALIGN (reg) < GET_MODE_ALIGNMENT (omode) +#endif + ) return false; /* The outer size must be ordered wrt the register size, otherwise