public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/112434] New: unexpected error when compiling for riscv64: invalid 'asm': invalid use of '%c'
@ 2023-11-08  2:28 rsworktech at outlook dot com
  2023-11-08  3:20 ` [Bug c/112434] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rsworktech at outlook dot com @ 2023-11-08  2:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112434
           Summary: unexpected error when compiling for riscv64: invalid
                    'asm': invalid use of '%c'
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsworktech at outlook dot com
  Target Milestone: ---

Created attachment 56528
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56528&action=edit
Reduced source file

When compiling the provided source file, an unexpected error happens:

testcase.i: In function 'produce_asm_define':
testcase.i:15:3: error: invalid 'asm': invalid use of '%c'
   15 |   __asm__("# FUNCTION_OFFSET_INSTANCE = %c0"
      |   ^~~~~~~


This could be reproduced on riscv64 or x86_64(using a cross compiler)
Commandline used for reproduction:

On x86_64: riscv64-linux-gnu-gcc -S testcase.i
On riscv64: gcc -S testcase.i

It is expected that this file could be compiled without error because:
1. On x86_64, the following commandline works fine: gcc -S testcase.i
2. On x86_64, cross compilation to aarch64 works fine: aarch64-linux-gnu-gcc -S
testcase.i
3. On riscv64, the same source file could be compiled by clang: clang -S
testcase.i

This is also reproducible with gcc 12.3.0.

The reduced testcase.i is attached.

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

* [Bug c/112434] unexpected error when compiling for riscv64: invalid 'asm': invalid use of '%c'
  2023-11-08  2:28 [Bug c/112434] New: unexpected error when compiling for riscv64: invalid 'asm': invalid use of '%c' rsworktech at outlook dot com
@ 2023-11-08  3:20 ` pinskia at gcc dot gnu.org
  2023-11-08  4:02 ` [Bug target/112434] " pinskia at gcc dot gnu.org
  2024-05-28 15:32 ` rsworktech at outlook dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-08  3:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The c inline-asm modifiers is not documented for riscv ...

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

* [Bug target/112434] unexpected error when compiling for riscv64: invalid 'asm': invalid use of '%c'
  2023-11-08  2:28 [Bug c/112434] New: unexpected error when compiling for riscv64: invalid 'asm': invalid use of '%c' rsworktech at outlook dot com
  2023-11-08  3:20 ` [Bug c/112434] " pinskia at gcc dot gnu.org
@ 2023-11-08  4:02 ` pinskia at gcc dot gnu.org
  2024-05-28 15:32 ` rsworktech at outlook dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-08  4:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Oh wait is documented as a "generic" one.

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

* [Bug target/112434] unexpected error when compiling for riscv64: invalid 'asm': invalid use of '%c'
  2023-11-08  2:28 [Bug c/112434] New: unexpected error when compiling for riscv64: invalid 'asm': invalid use of '%c' rsworktech at outlook dot com
  2023-11-08  3:20 ` [Bug c/112434] " pinskia at gcc dot gnu.org
  2023-11-08  4:02 ` [Bug target/112434] " pinskia at gcc dot gnu.org
@ 2024-05-28 15:32 ` rsworktech at outlook dot com
  2 siblings, 0 replies; 4+ messages in thread
From: rsworktech at outlook dot com @ 2024-05-28 15:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Levi Zim <rsworktech at outlook dot com> ---
This bug still occurs in gcc 14.1.1

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

end of thread, other threads:[~2024-05-28 15:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-08  2:28 [Bug c/112434] New: unexpected error when compiling for riscv64: invalid 'asm': invalid use of '%c' rsworktech at outlook dot com
2023-11-08  3:20 ` [Bug c/112434] " pinskia at gcc dot gnu.org
2023-11-08  4:02 ` [Bug target/112434] " pinskia at gcc dot gnu.org
2024-05-28 15:32 ` rsworktech at outlook dot com

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