public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/93053] [10 Regression] libgcc build failure with old binutils on aarch64
       [not found] <bug-93053-4@http.gcc.gnu.org/bugzilla/>
@ 2020-03-20 11:43 ` rguenth at gcc dot gnu.org
  2020-04-14 10:38 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-03-20 11:43 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
          Component|libgcc                      |target

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/93053] [10 Regression] libgcc build failure with old binutils on aarch64
       [not found] <bug-93053-4@http.gcc.gnu.org/bugzilla/>
  2020-03-20 11:43 ` [Bug target/93053] [10 Regression] libgcc build failure with old binutils on aarch64 rguenth at gcc dot gnu.org
@ 2020-04-14 10:38 ` jakub at gcc dot gnu.org
  2020-04-14 10:41 ` ktkachov at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-14 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I've tried manually:
--- cas_16_1.s~ 2020-04-14 12:19:03.000000000 +0200
+++ cas_16_1.s  2020-04-14 12:20:10.083098672 +0200
@@ -5,7 +5,7 @@
 # 1 "<command-line>" 2
 # 1 "/usr/src/gcc/libgcc/config/aarch64/lse.S"
 # 53 "/usr/src/gcc/libgcc/config/aarch64/lse.S"
- .arch armv8-a+lse
+ .arch armv8-a


  .hidden __aarch64_have_lse_atomics
@@ -37,7 +37,8 @@
 STARTFN __aarch64_cas16_relax
  JUMP_IF_NOT_LSE 8f
 # 166 "/usr/src/gcc/libgcc/config/aarch64/lse.S"
- casp x0, x1, x2, x3, [x4]
+// casp x0, x1, x2, x3, [x4]
+ .word 0x48207c82
  ret

 8: mov x16, x0
which assembles (the constant taken from aarch64-linux-objdump -dr before the
changes), but for some reason when disassembled aarch64-linux-objdump -dr knows
that it was .word and not casp instruction.
Any way to emit insns not supported by the assembler?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/93053] [10 Regression] libgcc build failure with old binutils on aarch64
       [not found] <bug-93053-4@http.gcc.gnu.org/bugzilla/>
  2020-03-20 11:43 ` [Bug target/93053] [10 Regression] libgcc build failure with old binutils on aarch64 rguenth at gcc dot gnu.org
  2020-04-14 10:38 ` jakub at gcc dot gnu.org
@ 2020-04-14 10:41 ` ktkachov at gcc dot gnu.org
  2020-04-14 11:59 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2020-04-14 10:41 UTC (permalink / raw)
  To: gcc-bugs

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

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktkachov at gcc dot gnu.org

--- Comment #9 from ktkachov at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #8)
> I've tried manually:
> --- cas_16_1.s~	2020-04-14 12:19:03.000000000 +0200
> +++ cas_16_1.s	2020-04-14 12:20:10.083098672 +0200
> @@ -5,7 +5,7 @@
>  # 1 "<command-line>" 2
>  # 1 "/usr/src/gcc/libgcc/config/aarch64/lse.S"
>  # 53 "/usr/src/gcc/libgcc/config/aarch64/lse.S"
> - .arch armv8-a+lse
> + .arch armv8-a
>  
>  
>   .hidden __aarch64_have_lse_atomics
> @@ -37,7 +37,8 @@
>  STARTFN __aarch64_cas16_relax
>   JUMP_IF_NOT_LSE 8f
>  # 166 "/usr/src/gcc/libgcc/config/aarch64/lse.S"
> - casp x0, x1, x2, x3, [x4]
> +// casp x0, x1, x2, x3, [x4]
> + .word 0x48207c82
>   ret
>  
>  8: mov x16, x0
> which assembles (the constant taken from aarch64-linux-objdump -dr before
> the changes), but for some reason when disassembled aarch64-linux-objdump
> -dr knows that it was .word and not casp instruction.
> Any way to emit insns not supported by the assembler?

There is the .inst directive

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/93053] [10 Regression] libgcc build failure with old binutils on aarch64
       [not found] <bug-93053-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-04-14 10:41 ` ktkachov at gcc dot gnu.org
@ 2020-04-14 11:59 ` jakub at gcc dot gnu.org
  2020-04-14 12:51 ` [Bug target/93053] [9/10 " jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-14 11:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 48269
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48269&action=edit
gcc10-pr93053.patch

So how about this (tested just that when preprocessing + assembling with
-DHAVE_AS_LSE and without it generates the same object files in all cases, but
not actually with running configure with old or new gas)?

Note, as -moutline-atomics has been backported to 9.x, the regression is now on
the 9 branch too (but P1 there too (and even more important, because there is
higher probability older gcc will be used with older binutils), because 9.3
didn't have that yet).

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/93053] [9/10 Regression] libgcc build failure with old binutils on aarch64
       [not found] <bug-93053-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-04-14 11:59 ` jakub at gcc dot gnu.org
@ 2020-04-14 12:51 ` jakub at gcc dot gnu.org
  2020-04-14 14:36 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-14 12:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Or, if the .macro COMMENT hack is too ugly, we could tweak it like:
#ifdef HAVE_AS_LSE
# define LDOP   glue4(LDNM, A, L, S) s(0), s(0), [x1]
#else
# define LDOP   .inst 0x38200020 + OPN + B + N
#endif
...
        LDOP
which would make it clearer that if one wants to change which registers the
insn will use, one needs to adjust the opcodes too.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/93053] [9/10 Regression] libgcc build failure with old binutils on aarch64
       [not found] <bug-93053-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2020-04-14 12:51 ` [Bug target/93053] [9/10 " jakub at gcc dot gnu.org
@ 2020-04-14 14:36 ` rguenth at gcc dot gnu.org
  2020-04-15  9:02 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-04-14 14:36 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.0                        |9.4
      Known to work|                            |9.3.0
      Known to fail|                            |9.3.1

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
This was now backported, retargeting as P1 on the branch.  Please do not
backport further until this issue is resolved.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/93053] [9/10 Regression] libgcc build failure with old binutils on aarch64
       [not found] <bug-93053-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2020-04-14 14:36 ` rguenth at gcc dot gnu.org
@ 2020-04-15  9:02 ` cvs-commit at gcc dot gnu.org
  2020-04-15  9:14 ` [Bug target/93053] [9 " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-15  9:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:5b2f76e36d861c881c6770b4f47c1fae6c0c8965

commit r10-7732-g5b2f76e36d861c881c6770b4f47c1fae6c0c8965
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Apr 15 11:01:19 2020 +0200

    aarch64: Fix bootstrap with old binutils [PR93053]

    As reported in the PR, GCC 10 (and also 9.3.1 but not 9.3.0) fails to build
    when using older binutils which lack LSE support, because those
instructions
    are used in libgcc.
    Thanks to Kyrylo's hint, the following patches (hopefully) allow it to
build
    even with older binutils by using .inst directive if LSE support isn't
    available in the assembler.

    2020-04-15  Jakub Jelinek  <jakub@redhat.com>

            PR target/93053
            * configure.ac (LIBGCC_CHECK_AS_LSE): Add HAVE_AS_LSE checking.
            * config/aarch64/lse.S: Include auto-target.h, if HAVE_AS_LSE
            is not defined, use just .arch armv8-a.
            (B, M, N, OPN): Define.
            (COMMENT): New .macro.
            (CAS, CASP, SWP, LDOP): Use .inst directive if HAVE_AS_LSE is not
            defined.  Otherwise, move the operands right after the glue? and
            comment out operands where the macros are used.
            * configure: Regenerated.
            * config.in: Regenerated.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/93053] [9 Regression] libgcc build failure with old binutils on aarch64
       [not found] <bug-93053-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2020-04-15  9:02 ` cvs-commit at gcc dot gnu.org
@ 2020-04-15  9:14 ` jakub at gcc dot gnu.org
  2020-04-22 14:18 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-15  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[9/10 Regression] libgcc    |[9 Regression] libgcc build
                   |build failure with old      |failure with old binutils
                   |binutils on aarch64         |on aarch64

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/93053] [9 Regression] libgcc build failure with old binutils on aarch64
       [not found] <bug-93053-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2020-04-15  9:14 ` [Bug target/93053] [9 " jakub at gcc dot gnu.org
@ 2020-04-22 14:18 ` cvs-commit at gcc dot gnu.org
  2020-04-22 16:10 ` cvs-commit at gcc dot gnu.org
  2021-01-22 16:31 ` avieira at gcc dot gnu.org
  10 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-22 14:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Andre Simoes Dias Vieira
<avieira@gcc.gnu.org>:

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

commit r9-8525-gbfe912a35c0c39a623ba6e0066b6010e0ade0f5e
Author: Andre Vieira <andre.simoesdiasvieira@arm.com>
Date:   Wed Apr 22 15:16:20 2020 +0100

    aarch64: Fix bootstrap with old binutils [PR93053]

    As reported in the PR, GCC 10 (and also 9.3.1 but not 9.3.0) fails to build
    when using older binutils which lack LSE support, because those
instructions
    are used in libgcc.
    Thanks to Kyrylo's hint, the following patches (hopefully) allow it to
build
    even with older binutils by using .inst directive if LSE support isn't
    available in the assembler.

    2020-04-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

            Backport from mainline.
            2020-04-15  Jakub Jelinek  <jakub@redhat.com>

            PR target/93053
            * configure.ac (LIBGCC_CHECK_AS_LSE): Add HAVE_AS_LSE checking.
            * config/aarch64/lse.S: Include auto-target.h, if HAVE_AS_LSE
            is not defined, use just .arch armv8-a.
            (B, M, N, OPN): Define.
            (COMMENT): New .macro.
            (CAS, CASP, SWP, LDOP): Use .inst directive if HAVE_AS_LSE is not
            defined.  Otherwise, move the operands right after the glue? and
            comment out operands where the macros are used.
            * configure: Regenerated.
            * config.in: Regenerated.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/93053] [9 Regression] libgcc build failure with old binutils on aarch64
       [not found] <bug-93053-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2020-04-22 14:18 ` cvs-commit at gcc dot gnu.org
@ 2020-04-22 16:10 ` cvs-commit at gcc dot gnu.org
  2021-01-22 16:31 ` avieira at gcc dot gnu.org
  10 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-22 16:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by Andre Simoes Dias Vieira
<avieira@gcc.gnu.org>:

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

commit r8-10213-ga69a60c4969cea06c1d44b5e3e4970595041e510
Author: Andre Vieira <andre.simoesdiasvieira@arm.com>
Date:   Thu Apr 16 10:16:18 2020 +0100

    aarch64: Fix bootstrap with old binutils [PR93053]

    As reported in the PR, GCC 10 (and also 9.3.1 but not 9.3.0) fails to build
    when using older binutils which lack LSE support, because those
instructions
    are used in libgcc.
    Thanks to Kyrylo's hint, the following patches (hopefully) allow it to
build
    even with older binutils by using .inst directive if LSE support isn't
    available in the assembler.

    2020-04-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

            Backport from mainline
            2020-04-15  Jakub Jelinek  <jakub@redhat.com>

            PR target/93053
            * configure.ac (LIBGCC_CHECK_AS_LSE): Add HAVE_AS_LSE checking.
            * config/aarch64/lse.S: Include auto-target.h, if HAVE_AS_LSE
            is not defined, use just .arch armv8-a.
            (B, M, N, OPN): Define.
            (COMMENT): New .macro.
            (CAS, CASP, SWP, LDOP): Use .inst directive if HAVE_AS_LSE is not
            defined.  Otherwise, move the operands right after the glue? and
            comment out operands where the macros are used.
            * configure: Regenerated.
            * config.in: Regenerated.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/93053] [9 Regression] libgcc build failure with old binutils on aarch64
       [not found] <bug-93053-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2020-04-22 16:10 ` cvs-commit at gcc dot gnu.org
@ 2021-01-22 16:31 ` avieira at gcc dot gnu.org
  10 siblings, 0 replies; 11+ messages in thread
From: avieira at gcc dot gnu.org @ 2021-01-22 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

avieira at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |avieira at gcc dot gnu.org
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #17 from avieira at gcc dot gnu.org ---
I believe this has been fixed on all relevant branches.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-01-22 16:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93053-4@http.gcc.gnu.org/bugzilla/>
2020-03-20 11:43 ` [Bug target/93053] [10 Regression] libgcc build failure with old binutils on aarch64 rguenth at gcc dot gnu.org
2020-04-14 10:38 ` jakub at gcc dot gnu.org
2020-04-14 10:41 ` ktkachov at gcc dot gnu.org
2020-04-14 11:59 ` jakub at gcc dot gnu.org
2020-04-14 12:51 ` [Bug target/93053] [9/10 " jakub at gcc dot gnu.org
2020-04-14 14:36 ` rguenth at gcc dot gnu.org
2020-04-15  9:02 ` cvs-commit at gcc dot gnu.org
2020-04-15  9:14 ` [Bug target/93053] [9 " jakub at gcc dot gnu.org
2020-04-22 14:18 ` cvs-commit at gcc dot gnu.org
2020-04-22 16:10 ` cvs-commit at gcc dot gnu.org
2021-01-22 16:31 ` avieira at gcc dot gnu.org

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).