Bug 104090 - [10/11/12 Regression] powerpc: asm machine directive wrong for FSL processors
Summary: [10/11/12 Regression] powerpc: asm machine directive wrong for FSL processors
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: 10.4
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 104673 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-01-18 10:59 UTC by Sebastian Huber
Modified: 2022-02-25 08:00 UTC (History)
1 user (show)

See Also:
Host:
Target: powerpc-rtems
Build:
Known to work: 10.3.0
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Huber 2022-01-18 10:59:45 UTC
The latest GCC 10/11/12 branches do not build the powerpc-rtems target due to a build error in the -mcpu=8540 multilib:

/tmp/sh/b-gcc-powerpc-rtems6/./gcc/xgcc -B/tmp/sh/b-gcc-powerpc-rtems6/./gcc/ -nostdinc -B/tmp/sh/b-gcc-powerpc-rtems6/powerpc-rtems6/m8540/nof/newlib/ -isystem /tmp/sh/b-gcc-powerpc-rtems6/powerpc-rtems6/m8540/nof/newlib/targ-include -isystem /home/EB/sebastian_h/src/gcc/newlib/libc/include -B/tmp/sh/i-powerpc-rtems6/powerpc-rtems6/bin/ -B/tmp/sh/i-powerpc-rtems6/powerpc-rtems6/lib/ -isystem /tmp/sh/i-powerpc-rtems6/powerpc-rtems6/include -isystem /tmp/sh/i-powerpc-rtems6/powerpc-rtems6/sys-include  -mcpu=8540 -msoft-float -g -O2 -O2 -I/home/EB/sebastian_h/src/gcc/libgcc/../newlib/libc/sys/rtems/include -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -I. -I. -I../../../.././gcc -I/home/EB/sebastian_h/src/gcc/libgcc -I/home/EB/sebastian_h/src/gcc/libgcc/. -I/home/EB/sebastian_h/src/gcc/libgcc/../gcc -I/home/EB/sebastian_h/src/gcc/libgcc/../include  -DHAVE_CC_TLS  -o _negvdi2.o -MT _negvdi2.o -MD -MP -MF _negvdi2.dep -DL_negvdi2 -c /home/EB/sebastian_h/src/gcc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
/tmp/ccZJ18fW.s: Assembler messages:
/tmp/ccZJ18fW.s:24: Error: unrecognized opcode: `isel'
make: *** [Makefile:501: _negvdi2.o] Error 1

The assembler is called like this:

/tmp/sh/b-gcc-powerpc-rtems6/./gcc/as -I /home/EB/sebastian_h/src/gcc/libgcc/../newlib/libc/sys/rtems/include -I . -I . -I ../../../.././gcc -I /home/EB/sebastian_h/src/gcc/libgcc -I /home/EB/sebastian_h/src/gcc/libgcc/. -I /home/EB/sebastian_h/src/gcc/libgcc/../gcc -I /home/EB/sebastian_h/src/gcc/libgcc/../include -a32 -me500 -mbig -o _negvdi2.o _negvdi2.s

Using -me500 seems to be all right, however, the file contains a machine directive:

    .file    "libgcc2.c"
    .machine ppc
    .section    ".text"

If I remove the ".machine ppc" by hand, the file can be assembled with the above command line.

The affect of the patch for PR100108 is:

diff -u _negvdi2.s.before _negvdi2.s.after
--- _negvdi2.s.before   2022-01-11 09:07:43.313828636 +0100
+++ _negvdi2.s.after    2022-01-11 08:54:08.424946502 +0100
@@ -1,5 +1,5 @@
        .file   "libgcc2.c"
-       .machine power9
+       .machine ppc
        .section        ".text"
 .Ltext0:
        .align 2
Comment 1 Sebastian Huber 2022-01-18 11:14:00 UTC
I work on a patch, see:

https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588641.html
Comment 2 GCC Commits 2022-01-19 06:51:05 UTC
The master branch has been updated by Sebastian Huber <sh@gcc.gnu.org>:

https://gcc.gnu.org/g:1ead972cef7622682c5e6c4fa563c4a894d6e0c3

commit r12-6721-g1ead972cef7622682c5e6c4fa563c4a894d6e0c3
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Tue Jan 18 12:44:53 2022 +0100

    powerc: Fix asm machine directive for some CPUs
    
    For some CPUs, the assembler machine directive cannot be determined by ISA
    flags.
    
    gcc/
    
            PR target/104090
            * config/rs6000/rs6000.cc (rs6000_machine_from_flags): Use also
            rs6000_cpu.
Comment 3 GCC Commits 2022-02-02 19:24:35 UTC
The releases/gcc-11 branch has been updated by Sebastian Huber <sh@gcc.gnu.org>:

https://gcc.gnu.org/g:3cb53c10831be59d967d9dce8e7980fee4703500

commit r11-9534-g3cb53c10831be59d967d9dce8e7980fee4703500
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Tue Jan 18 12:44:53 2022 +0100

    powerpc: Fix asm machine directive for some CPUs
    
    For some CPUs, the assembler machine directive cannot be determined by ISA
    flags.
    
    gcc/
    
            PR target/104090
            * config/rs6000/rs6000.c (rs6000_machine_from_flags): Use also
            rs6000_cpu.
Comment 4 GCC Commits 2022-02-03 06:53:45 UTC
The releases/gcc-10 branch has been updated by Sebastian Huber <sh@gcc.gnu.org>:

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

commit r10-10435-gd568abb25fc799123168aac840372b28bb81f85d
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Tue Jan 18 12:44:53 2022 +0100

    powerpc: Fix asm machine directive for some CPUs
    
    For some CPUs, the assembler machine directive cannot be determined by ISA
    flags.
    
    gcc/
    
            PR target/104090
            * config/rs6000/rs6000.c (rs6000_machine_from_flags): Use also
            rs6000_cpu.
Comment 5 Sebastian Huber 2022-02-03 06:54:29 UTC
Fixed on all relevant branches.
Comment 6 Chris Packham 2022-02-25 08:00:25 UTC
*** Bug 104673 has been marked as a duplicate of this bug. ***