public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/112330] [14 Regression] LoongArch: Outputted .align directive may trigger assembler error with GAS 2.41
Date: Tue, 14 Nov 2023 09:37:41 +0000	[thread overview]
Message-ID: <bug-112330-4-52l3zkyHd9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112330-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112330

--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Xi Ruoyao <xry111@gcc.gnu.org>:

https://gcc.gnu.org/g:fe23a2ff1f5072559552be0e41ab55bf72f5c79f

commit r14-5434-gfe23a2ff1f5072559552be0e41ab55bf72f5c79f
Author: Xi Ruoyao <xry111@xry111.site>
Date:   Fri Nov 3 21:19:59 2023 +0800

    LoongArch: Disable relaxation if the assembler don't support conditional
branch relaxation [PR112330]

    As the commit message of r14-4674 has indicated, if the assembler does
    not support conditional branch relaxation, a relocation overflow may
    happen on conditional branches when relaxation is enabled because the
    number of NOP instructions inserted by the assembler will be more than
    the number estimated by GCC.

    To work around this issue, disable relaxation by default if the
    assembler is detected incapable to perform conditional branch relaxation
    at GCC build time.  We also need to pass -mno-relax to the assembler to
    really disable relaxation.  But, if the assembler does not support
    -mrelax option at all, we should not pass -mno-relax to the assembler or
    it will immediately error out.  Also handle this with the build time
    assembler capability probing, and add a pair of options
    -m[no-]pass-mrelax-to-as to allow using a different assembler from the
    build-time one.

    With this change, if GCC is built with GAS 2.41, relaxation will be
    disabled by default.  So the default value of -mexplicit-relocs= is also
    changed to 'always' if -mno-relax is specified or implied by the
    build-time default, because using assembler macros for symbol addresses
    produces no benefit when relaxation is disabled.

    gcc/ChangeLog:

            PR target/112330
            * config/loongarch/genopts/loongarch.opt.in: Add
            -m[no]-pass-relax-to-as.  Change the default of -m[no]-relax to
            account conditional branch relaxation support status.
            * config/loongarch/loongarch.opt: Regenerate.
            * configure.ac (gcc_cv_as_loongarch_cond_branch_relax): Check if
            the assembler supports conditional branch relaxation.
            * configure: Regenerate.
            * config.in: Regenerate.  Note that there are some unrelated
            changes introduced by r14-5424 (which does not contain a
            config.in regeneration).
            * config/loongarch/loongarch-opts.h
            (HAVE_AS_COND_BRANCH_RELAXATION): Define to 0 if not defined.
            * config/loongarch/loongarch-driver.h (ASM_MRELAX_DEFAULT):
            Define.
            (ASM_MRELAX_SPEC): Define.
            (ASM_SPEC): Use ASM_MRELAX_SPEC instead of "%{mno-relax}".
            * config/loongarch/loongarch.cc: Take the setting of
            -m[no-]relax into account when determining the default of
            -mexplicit-relocs=.
            * doc/invoke.texi: Document -m[no-]relax and
            -m[no-]pass-mrelax-to-as for LoongArch.  Update the default
            value of -mexplicit-relocs=.

  parent reply	other threads:[~2023-11-14  9:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-01  8:38 [Bug target/112330] New: [14 Regression] LoongArch: LTO bootstrap failure " xry111 at gcc dot gnu.org
2023-11-01  8:42 ` [Bug target/112330] " xry111 at gcc dot gnu.org
2023-11-01  8:54 ` xry111 at gcc dot gnu.org
2023-11-01  9:00 ` chenglulu at loongson dot cn
2023-11-01  9:07 ` xry111 at gcc dot gnu.org
2023-11-01  9:10 ` chenglulu at loongson dot cn
2023-11-01  9:23 ` xry111 at gcc dot gnu.org
2023-11-01  9:33 ` chenglulu at loongson dot cn
2023-11-01  9:56 ` xry111 at gcc dot gnu.org
2023-11-01  9:58 ` [Bug target/112330] [14 Regression] LoongArch: Bootstrap " xry111 at gcc dot gnu.org
2023-11-02  6:57 ` chenglulu at loongson dot cn
2023-11-02  7:43 ` xry111 at gcc dot gnu.org
2023-11-02  7:59 ` chenglulu at loongson dot cn
2023-11-02  8:07 ` xry111 at gcc dot gnu.org
2023-11-02  8:43 ` chenglulu at loongson dot cn
2023-11-02  9:54 ` rguenth at gcc dot gnu.org
2023-11-02 11:41 ` [Bug target/112330] [14 Regression] LoongArch: Outputted .align directive may trigger assembler error " xry111 at gcc dot gnu.org
2023-11-14  9:37 ` cvs-commit at gcc dot gnu.org [this message]
2023-11-14  9:47 ` xry111 at gcc dot gnu.org
2024-02-22  3:17 ` cvs-commit at gcc dot gnu.org
2024-02-22  3:25 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-112330-4-52l3zkyHd9@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).