From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1033) id 9E05F3858010; Wed, 30 Jun 2021 00:41:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E05F3858010 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: David Edelsohn To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1922] aix: align text CSECTs to at least 32 bytes. X-Act-Checkin: gcc X-Git-Author: David Edelsohn X-Git-Refname: refs/heads/master X-Git-Oldrev: 6bc18203dd2a696cdfcd9d45eae3b9cce7b08822 X-Git-Newrev: 652abe22205f268c90b3b15f28c56c030ef68a34 Message-Id: <20210630004139.9E05F3858010@sourceware.org> Date: Wed, 30 Jun 2021 00:41:39 +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: Wed, 30 Jun 2021 00:41:39 -0000 https://gcc.gnu.org/g:652abe22205f268c90b3b15f28c56c030ef68a34 commit r12-1922-g652abe22205f268c90b3b15f28c56c030ef68a34 Author: David Edelsohn Date: Tue May 11 21:07:19 2021 -0400 aix: align text CSECTs to at least 32 bytes. gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_xcoff_section_type_flags): Increase code CSECT alignment to at least 32 bytes. * config/rs6000/xcoff.h (TEXT_SECTION_ASM_OP): Add 32 byte alignment designation. Diff: --- gcc/config/rs6000/rs6000.c | 6 +++++- gcc/config/rs6000/xcoff.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 2c249e186e1..075c156ae13 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-3.0-or-later /* Subroutines used for code generation on IBM RS/6000. Copyright (C) 1991-2021 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) @@ -21361,8 +21362,11 @@ rs6000_xcoff_section_type_flags (tree decl, const char *name, int reloc) flags |= SECTION_BSS; /* Align to at least UNIT size. */ - if ((flags & SECTION_CODE) != 0 || !decl || !DECL_P (decl)) + if (!decl || !DECL_P (decl)) align = MIN_UNITS_PER_WORD; + /* Align code CSECT to at least 32 bytes. */ + else if ((flags & SECTION_CODE) != 0) + align = MAX ((DECL_ALIGN (decl) / BITS_PER_UNIT), 32); else /* Increase alignment of large objects if not already stricter. */ align = MAX ((DECL_ALIGN (decl) / BITS_PER_UNIT), diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h index 5ba565f63bb..f3546fadf33 100644 --- a/gcc/config/rs6000/xcoff.h +++ b/gcc/config/rs6000/xcoff.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-3.0-or-later /* Definitions of target machine for GNU compiler, for some generic XCOFF file format Copyright (C) 2001-2021 Free Software Foundation, Inc. @@ -249,7 +250,7 @@ #define DOUBLE_INT_ASM_OP "\t.llong\t" /* Output before instructions. */ -#define TEXT_SECTION_ASM_OP "\t.csect .text[PR]" +#define TEXT_SECTION_ASM_OP "\t.csect .text[PR],5" /* Output before writable data. */ #define DATA_SECTION_ASM_OP \