public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei
@ 2022-03-09  5:16 i at rvalue dot moe
  2022-03-09  5:22 ` [Bug target/104853] " i at rvalue dot moe
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: i at rvalue dot moe @ 2022-03-09  5:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104853
           Summary: [RISC-V] -march=rv64g not including extension Zifencei
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: i at rvalue dot moe
  Target Milestone: ---

I'm trying to compile some code including inline assembly instruction
`fence.i`. According to RISC-V ISA spec, G is defined as abbreviation for
IMAFDZicsrZifencei, which includes instruction `fence.i`. But I get assembler
message indicating that `fence.i` is unrecognized.

I report this to GCC instead of binutils because when I use `gcc -S` and then
use `as` manually, it works fine.

Also, it works fine before I upgrade to GCC 11.2.0

Minimum recurrence:

$ gcc --version
gcc (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ cat > test.c
int main(){
    asm volatile("fence.i" ::: "memory");
}
$ gcc -c test.c -march=rv64g
test.c: Assembler messages:
test.c:2: Error: unrecognized opcode `fence.i'

Manually use `as`:

$ gcc -S test.c -march=rv64g -o test.s
$ as -march=rv64g test.s -o test.o
$ objdump -d test.o

test.o:     file format elf64-littleriscv


Disassembly of section .text:

0000000000000000 <main>:
   0:   ff010113                addi    sp,sp,-16
   4:   00813423                sd      s0,8(sp)
   8:   01010413                addi    s0,sp,16
   c:   0000100f                fence.i
  10:   00000793                li      a5,0
  14:   00078513                mv      a0,a5
  18:   00813403                ld      s0,8(sp)
  1c:   01010113                addi    sp,sp,16
  20:   00008067                ret

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
@ 2022-03-09  5:22 ` i at rvalue dot moe
  2022-03-09  7:13 ` kito at gcc dot gnu.org
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: i at rvalue dot moe @ 2022-03-09  5:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from rvalue <i at rvalue dot moe> ---
It do works with `-march=rv64g_zifencei`, but I don't think it's the right way
to work.

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
  2022-03-09  5:22 ` [Bug target/104853] " i at rvalue dot moe
@ 2022-03-09  7:13 ` kito at gcc dot gnu.org
  2022-03-09  7:19 ` i at rvalue dot moe
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kito at gcc dot gnu.org @ 2022-03-09  7:13 UTC (permalink / raw)
  To: gcc-bugs

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

Kito Cheng <kito at gcc dot gnu.org> changed:

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

--- Comment #2 from Kito Cheng <kito at gcc dot gnu.org> ---
Do you mind give few more version info for binutils and configuration info for
gcc?

You can obtain those info by following two commands:
$ gcc -v
$ as --version

Thanks

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
  2022-03-09  5:22 ` [Bug target/104853] " i at rvalue dot moe
  2022-03-09  7:13 ` kito at gcc dot gnu.org
@ 2022-03-09  7:19 ` i at rvalue dot moe
  2022-03-09  7:53 ` kito at gcc dot gnu.org
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: i at rvalue dot moe @ 2022-03-09  7:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from rvalue <i at rvalue dot moe> ---
(In reply to Kito Cheng from comment #2)
> Do you mind give few more version info for binutils and configuration info
> for gcc?
> 
> You can obtain those info by following two commands:
> $ gcc -v
> $ as --version
> 
> Thanks

Sure.

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc/configure
--enable-languages=c,c++,fortran,go,lto,objc,obj-c++,d --enable-bootstrap
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit
--enable-cet=auto --enable-checking=release --enable-clocale=gnu
--enable-default-pie --enable-default-ssp --enable-gnu-indirect-function
--enable-gnu-unique-object --enable-linker-build-id --enable-lto
--disable-multilib --enable-plugin --enable-shared --enable-threads=posix
--disable-libssp --disable-libstdcxx-pch --disable-werror
--with-build-config=bootstrap-lto --enable-link-serialization=1
gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC)
$ as --version
GNU assembler (GNU Binutils) 2.38
Copyright (C) 2022 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `riscv64-unknown-linux-gnu'.

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
                   ` (2 preceding siblings ...)
  2022-03-09  7:19 ` i at rvalue dot moe
@ 2022-03-09  7:53 ` kito at gcc dot gnu.org
  2022-03-12 17:30 ` i at rvalue dot moe
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kito at gcc dot gnu.org @ 2022-03-09  7:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Kito Cheng <kito at gcc dot gnu.org> ---
Thanks your info, that cause by the default ISA spec version bump issue,
binutils 2.38 and GCC 11.* using different default ISA spec cause this issue,
I've push a patch to GCC 11 branch [1] for this issue, could you try this
patch? thanks.


See more detail for the full story about ISA spec:

https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/aE1ZeHHCYf4

[1]
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=9871d39f752bc9c114ed694662a519d04896f491

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
                   ` (3 preceding siblings ...)
  2022-03-09  7:53 ` kito at gcc dot gnu.org
@ 2022-03-12 17:30 ` i at rvalue dot moe
  2022-03-12 19:20 ` i at rvalue dot moe
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: i at rvalue dot moe @ 2022-03-12 17:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from rvalue <i at rvalue dot moe> ---
(In reply to Kito Cheng from comment #4)
> Thanks your info, that cause by the default ISA spec version bump issue,
> binutils 2.38 and GCC 11.* using different default ISA spec cause this
> issue, I've push a patch to GCC 11 branch [1] for this issue, could you try
> this patch? thanks.
> 
> 
> See more detail for the full story about ISA spec:
> 
> https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/aE1ZeHHCYf4
> 
> [1]
> https://gcc.gnu.org/git/?p=gcc.git;a=commit;
> h=9871d39f752bc9c114ed694662a519d04896f491

I've tried this patch just now.
Unfortunately, the gcc rebuilt reports the same error as before.

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
                   ` (4 preceding siblings ...)
  2022-03-12 17:30 ` i at rvalue dot moe
@ 2022-03-12 19:20 ` i at rvalue dot moe
  2022-03-12 19:44 ` i at rvalue dot moe
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: i at rvalue dot moe @ 2022-03-12 19:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from rvalue <i at rvalue dot moe> ---
I've got some verbose output from gcc, and it seems that a duplicate `-march`
is passed to `as`

$ gcc -c test.c -march=rv64g --verbose
Using built-in specs.
COLLECT_GCC=/usr/sbin/gcc
Target: riscv64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc/configure
--enable-languages=c,c++,fortran,go,lto,objc,obj-c++,d --enable-bootstrap
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit
--enable-cet=auto --enable-checking=release --enable-clocale=gnu
--enable-default-pie --enable-default-ssp --enable-gnu-indirect-function
--enable-gnu-unique-object --enable-linker-build-id --enable-lto
--disable-multilib --enable-plugin --enable-shared --enable-threads=posix
--disable-libssp --disable-libstdcxx-pch --disable-werror
--with-build-config=bootstrap-lto --enable-link-serialization=1
gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC)
COLLECT_GCC_OPTIONS='-c' '-march=rv64g' '-v' '-mabi=lp64d' '-march=rv64imafd'
 /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/cc1 -quiet -v test.c -quiet
-dumpbase test.c -dumpbase-ext .c -march=rv64g -mabi=lp64d -march=rv64imafd
-version -o /tmp/ccCK3sIZ.s
GNU C17 (GCC) version 11.2.0 (riscv64-unknown-linux-gnu)
        compiled by GNU C version 11.2.0, GMP version 6.2.1, MPFR version
4.1.0-p13, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/../../../../riscv64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/include
 /usr/local/include
 /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/include-fixed
 /usr/include
End of search list.
GNU C17 (GCC) version 11.2.0 (riscv64-unknown-linux-gnu)
        compiled by GNU C version 11.2.0, GMP version 6.2.1, MPFR version
4.1.0-p13, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 42e88359d8058cfa8524073dbb277472
COLLECT_GCC_OPTIONS='-c' '-march=rv64g' '-v' '-mabi=lp64d' '-march=rv64imafd'
 as -v --traditional-format -fpic -march=rv64g -march=rv64imafd -mabi=lp64d -o
test.o /tmp/ccCK3sIZ.s
GNU assembler version 2.38 (riscv64-unknown-linux-gnu) using BFD version (GNU
Binutils) 2.38
test.c: Assembler messages:
test.c:2: Error: unrecognized opcode `fence.i'

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
                   ` (5 preceding siblings ...)
  2022-03-12 19:20 ` i at rvalue dot moe
@ 2022-03-12 19:44 ` i at rvalue dot moe
  2022-03-30  9:06 ` kito at gcc dot gnu.org
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: i at rvalue dot moe @ 2022-03-12 19:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from rvalue <i at rvalue dot moe> ---
Well, I've found something that could be problematic here:

https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/riscv/arch-canonicalize;h=49a6204b9cb64cb0e375c6003c423bf115a0a8a6;hb=HEAD#l60

It's never updated in ISA spec version bumping.

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
                   ` (6 preceding siblings ...)
  2022-03-12 19:44 ` i at rvalue dot moe
@ 2022-03-30  9:06 ` kito at gcc dot gnu.org
  2022-03-30 22:51 ` i at rvalue dot moe
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kito at gcc dot gnu.org @ 2022-03-30  9:06 UTC (permalink / raw)
  To: gcc-bugs

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

Kito Cheng <kito at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-03-30
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #8 from Kito Cheng <kito at gcc dot gnu.org> ---
Hi rvalue:

I pushed couple fixes to gcc 11 release branch, mostly back from trunk and a
fix for setting right isa spec value:
g:f41871dfdbd9d0c3368c0bc32d879fd5485e7abb

I expect that could fix that issue, could you try again with top of gcc 11
branch?

Thanks!

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
                   ` (7 preceding siblings ...)
  2022-03-30  9:06 ` kito at gcc dot gnu.org
@ 2022-03-30 22:51 ` i at rvalue dot moe
  2022-03-31  0:57 ` kito at gcc dot gnu.org
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: i at rvalue dot moe @ 2022-03-30 22:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from rvalue <i at rvalue dot moe> ---
Hi Kito:

Thank you for your follow-up patch! Confirmed that these patches do work. The
test program compiles successfully with no `-misa-spec` flag or
`-misa-spec=2.2` flag.

But when I set `-misa-spec=20190608` or `-misa-spec=20191213`, it still fails.
I think the file mentioned in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104853#c7 is still buggy. Is there
any future plan about this problem?

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
                   ` (8 preceding siblings ...)
  2022-03-30 22:51 ` i at rvalue dot moe
@ 2022-03-31  0:57 ` kito at gcc dot gnu.org
  2022-04-11 14:57 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kito at gcc dot gnu.org @ 2022-03-31  0:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Kito Cheng <kito at gcc dot gnu.org> ---
I plan to fix that in next few day for trunk and backport to GCC 11.

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
                   ` (9 preceding siblings ...)
  2022-03-31  0:57 ` kito at gcc dot gnu.org
@ 2022-04-11 14:57 ` cvs-commit at gcc dot gnu.org
  2022-04-11 16:03 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-11 14:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Kito Cheng <kito@gcc.gnu.org>:

https://gcc.gnu.org/g:4132f6ba9583e128a00d55961ae8c8e7245b2223

commit r12-8084-g4132f6ba9583e128a00d55961ae8c8e7245b2223
Author: Kito Cheng <kito.cheng@sifive.com>
Date:   Mon Apr 11 16:29:34 2022 +0800

    RISC-V: Support -misa-spec for arch-canonicalize and multilib-generator.
[PR104853]

    We migrate the default ISA spec version from 2.2 to 20191213, but those
scripts
    aren't updated at the same time, this patch is making both scripts support
    different ISA spec versions.

    gcc/ChangeLog:

            PR target/104853
            * config.gcc: Pass -misa-spec to arch-canonicalize and
            multilib-generator.
            * config/riscv/arch-canonicalize: Adding -misa-spec option.
            (SUPPORTED_ISA_SPEC): New.
            (arch_canonicalize): New argument `isa_spec`.
            Handle multiple ISA spec versions.
            * config/riscv/multilib-generator: Adding -misa-spec option.

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
                   ` (10 preceding siblings ...)
  2022-04-11 14:57 ` cvs-commit at gcc dot gnu.org
@ 2022-04-11 16:03 ` cvs-commit at gcc dot gnu.org
  2022-04-11 16:05 ` kito at gcc dot gnu.org
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-11 16:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Kito Cheng <kito@gcc.gnu.org>:

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

commit r11-9809-gfa21fcfb67587837c1704703a710496999393c1d
Author: Kito Cheng <kito.cheng@sifive.com>
Date:   Mon Apr 11 16:29:34 2022 +0800

    RISC-V: Support -misa-spec for arch-canonicalize and multilib-generator.
[PR104853]

    We migrate the default ISA spec version from 2.2 to 20191213, but those
scripts
    aren't updated at the same time, this patch is making both scripts support
    different ISA spec versions.

    gcc/ChangeLog:

            PR target/104853
            * config.gcc: Pass -misa-spec to arch-canonicalize and
            multilib-generator.
            * config/riscv/arch-canonicalize: Adding -misa-spec option.
            (SUPPORTED_ISA_SPEC): New.
            (arch_canonicalize): New argument `isa_spec`.
            Handle multiple ISA spec versions.
            * config/riscv/multilib-generator: Adding -misa-spec option.

    (cherry picked from commit 4132f6ba9583e128a00d55961ae8c8e7245b2223)

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
                   ` (11 preceding siblings ...)
  2022-04-11 16:03 ` cvs-commit at gcc dot gnu.org
@ 2022-04-11 16:05 ` kito at gcc dot gnu.org
  2022-04-14 20:40 ` bau2wux4sh at pkv73 dot anonbox.net
  2022-04-15 18:38 ` i at rvalue dot moe
  14 siblings, 0 replies; 16+ messages in thread
From: kito at gcc dot gnu.org @ 2022-04-11 16:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Kito Cheng <kito at gcc dot gnu.org> ---
Hi rvalue:

Pushed the fix to trunk and GCC 11 branch for fixing both arch-canonicalize and
multilib-generator script.

Tested GCC 11/trunk with --with-isa-spec=2.2/20191213.

Could you try that to make sure that work to you?

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
                   ` (12 preceding siblings ...)
  2022-04-11 16:05 ` kito at gcc dot gnu.org
@ 2022-04-14 20:40 ` bau2wux4sh at pkv73 dot anonbox.net
  2022-04-15 18:38 ` i at rvalue dot moe
  14 siblings, 0 replies; 16+ messages in thread
From: bau2wux4sh at pkv73 dot anonbox.net @ 2022-04-14 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

John Doe <bau2wux4sh at pkv73 dot anonbox.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bau2wux4sh at pkv73 dot anonbox.ne
                   |                            |t

--- Comment #14 from John Doe <bau2wux4sh at pkv73 dot anonbox.net> ---
Shouldn't it also be necessary to re-generate the existing configurations files
(e.g. gcc/config/riscv/t-elf-multilib) with the modified multilib-generator
script? Maybe it also makes sense to add _zicsr / _zifence multilib targets to
those for MULTILIB_REUSE while at it?

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

* [Bug target/104853] [RISC-V] -march=rv64g not including extension Zifencei
  2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
                   ` (13 preceding siblings ...)
  2022-04-14 20:40 ` bau2wux4sh at pkv73 dot anonbox.net
@ 2022-04-15 18:38 ` i at rvalue dot moe
  14 siblings, 0 replies; 16+ messages in thread
From: i at rvalue dot moe @ 2022-04-15 18:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from rvalue <i at rvalue dot moe> ---
Hi, Kito:

I've tried these patches and found that it doesn't work with isa-spec
20190608/20191213.

Release 11.2.0 with following patches applied: 9871d39f752b, f41871dfdbd9,
f049717d8d50, 330aff0a9f7b, fa21fcfb6758

Verbose output:

$ cat > test.c
int main(){
    asm volatile("fence.i" ::: "memory");
}
$ gcc test.c -o test -v -march=rv64gc -misa-spec=20191213
Using built-in specs.
COLLECT_GCC=/usr/sbin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc/configure
--enable-languages=c,c++,fortran,go,lto,objc,obj-c++,d --enable-bootstrap
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit
--enable-cet=auto --enable-checking=release --enable-clocale=gnu
--enable-default-pie --enable-default-ssp --enable-gnu-indirect-function
--enable-gnu-unique-object --enable-linker-build-id --enable-lto
--disable-multilib --enable-plugin --enable-shared --enable-threads=posix
--disable-libssp --disable-libstdcxx-pch --disable-werror
--enable-link-serialization=1 gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC)
COLLECT_GCC_OPTIONS='-o' 'test' '-v' '-march=rv64gc' '-misa-spec=20191213'
'-mabi=lp64d' '-march=rv64imafdc'
 /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/cc1 -quiet -v test.c -quiet
-dumpbase test.c -dumpbase-ext .c -march=rv64gc -misa-spec=20191213 -mabi=lp64d
-march=rv64imafdc -version -o /tmp/ccQTUxnc.s
GNU C17 (GCC) version 11.2.0 (riscv64-unknown-linux-gnu)
        compiled by GNU C version 11.2.0, GMP version 6.2.1, MPFR version
4.1.0-p13, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/../../../../riscv64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/include
 /usr/local/include
 /usr/lib/gcc/riscv64-unknown-linux-gnu/11.2.0/include-fixed
 /usr/include
End of search list.
GNU C17 (GCC) version 11.2.0 (riscv64-unknown-linux-gnu)
        compiled by GNU C version 11.2.0, GMP version 6.2.1, MPFR version
4.1.0-p13, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 7a7a4553dc5ab0b4f8fc26761070a0ed
COLLECT_GCC_OPTIONS='-o' 'test' '-v' '-march=rv64gc' '-misa-spec=20191213'
'-mabi=lp64d' '-march=rv64imafdc'
 as -v --traditional-format -fpic -march=rv64gc -march=rv64imafdc -mabi=lp64d
-misa-spec=20191213 -o /tmp/cc2my6Or.o /tmp/ccQTUxnc.s
GNU assembler version 2.38 (riscv64-unknown-linux-gnu) using BFD version (GNU
Binutils) 2.38
test.c: Assembler messages:
test.c:2: Error: unrecognized opcode `fence.i'

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

end of thread, other threads:[~2022-04-15 18:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09  5:16 [Bug target/104853] New: [RISC-V] -march=rv64g not including extension Zifencei i at rvalue dot moe
2022-03-09  5:22 ` [Bug target/104853] " i at rvalue dot moe
2022-03-09  7:13 ` kito at gcc dot gnu.org
2022-03-09  7:19 ` i at rvalue dot moe
2022-03-09  7:53 ` kito at gcc dot gnu.org
2022-03-12 17:30 ` i at rvalue dot moe
2022-03-12 19:20 ` i at rvalue dot moe
2022-03-12 19:44 ` i at rvalue dot moe
2022-03-30  9:06 ` kito at gcc dot gnu.org
2022-03-30 22:51 ` i at rvalue dot moe
2022-03-31  0:57 ` kito at gcc dot gnu.org
2022-04-11 14:57 ` cvs-commit at gcc dot gnu.org
2022-04-11 16:03 ` cvs-commit at gcc dot gnu.org
2022-04-11 16:05 ` kito at gcc dot gnu.org
2022-04-14 20:40 ` bau2wux4sh at pkv73 dot anonbox.net
2022-04-15 18:38 ` i at rvalue dot moe

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