]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR inline-asm/93202 ([RISCV] ICE when using inline asm 'h' operand modifier)
authorJakub Jelinek <jakub@redhat.com>
Wed, 22 Jan 2020 16:49:38 +0000 (17:49 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 22 Jan 2020 19:12:55 +0000 (20:12 +0100)
PR inline-asm/93202
* config/riscv/riscv.c (riscv_print_operand_reloc): Use
output_operand_lossage instead of gcc_unreachable.
* doc/md.texi (riscv f constraint): Fix typo.

* gcc.target/riscv/pr93202.c: New test.

gcc/ChangeLog
gcc/config/riscv/riscv.c
gcc/doc/md.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/riscv/pr93202.c [new file with mode: 0644]

index 3a024ce8f6e7d1db651f6b990bb625107da9bf6f..41478485b52a8f4784606629b5eda9031be130dd 100644 (file)
@@ -1,3 +1,13 @@
+2020-01-22  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2020-01-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR inline-asm/93202
+       * config/riscv/riscv.c (riscv_print_operand_reloc): Use
+       output_operand_lossage instead of gcc_unreachable.
+       * doc/md.texi (riscv f constraint): Fix typo.
+
 2020-01-22  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
index 5cb295d3abbaf0bddc0e106ad22c79348f3c8e5a..92e7f312583721a5d4c3c5b01691cb2a8c347a0a 100644 (file)
@@ -3089,7 +3089,8 @@ riscv_print_operand_reloc (FILE *file, rtx op, bool hi_reloc)
        break;
 
       default:
-       gcc_unreachable ();
+       output_operand_lossage ("invalid use of '%%%c'", hi_reloc ? 'h' : 'R');
+       return;
     }
 
   fprintf (file, "%s(", reloc);
index 30612a6aecb3c20c739d84e4e5e7c2f3a9cefb5f..50e13124bc30b951f5f08918a6ee710aba2ae890 100644 (file)
@@ -3566,7 +3566,7 @@ The @code{X} register.
 @table @code
 
 @item f
-A floating-point register (if availiable).
+A floating-point register (if available).
 
 @item I
 An I-type 12-bit signed immediate.
index 61eadf79eba8cd6b8ba4f3d87840eab3d7b3b50c..0c26e20115151d7d72ad1ead98477bda3795243a 100644 (file)
@@ -1,3 +1,11 @@
+2020-01-22  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2020-01-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR inline-asm/93202
+       * gcc.target/riscv/pr93202.c: New test.
+
 2020-01-22  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
diff --git a/gcc/testsuite/gcc.target/riscv/pr93202.c b/gcc/testsuite/gcc.target/riscv/pr93202.c
new file mode 100644 (file)
index 0000000..d8091b9
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR inline-asm/93202 */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-fpic" } */
+
+void
+foo (void)
+{
+  asm volatile ("%h0" :: "i" (&foo));  /* { dg-error "invalid use of '%h'" } */
+  asm volatile ("%R0" :: "i" (&foo));  /* { dg-error "invalid use of '%R'" } */
+}