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

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
You're right, I've initially thought about that but then forgot.
Will test with
--- gcc/testsuite/gcc.dg/torture/pr122835.c     2025-11-25 17:25:55.213625612
+0100
+++ gcc/testsuite/gcc.dg/torture/pr122835.c     2025-11-25 19:11:01.639094677
+0100
@@ -1,5 +1,13 @@
 /* PR middle-end/122835 */
-/* { dg-do run } */
+/* { dg-do run { target i?86-*-* x86_64-*-* aarch64-*-* arm*-*-* powerpc*-*-*
s390*-*-* } } */
+
+#if defined(__x86_64__) || defined(__i386__)
+#define JMP "jmp"
+#elif defined(__aarch64__) || defined(__arm__) || defined(__powerpc__)
+#define JMP "b"
+#elif defined(__s390__)
+#define JMP "j"
+#endif

 int cnt;

@@ -21,7 +29,7 @@
   {
     int x __attribute__((cleanup (my_cleanup))) = 0;

-    asm goto ("jmp %l0" :::: l1);
+    asm goto (JMP "\t%l0" :::: l1);

     my_abort ();
   }
@@ -36,7 +44,7 @@
     {
       int y __attribute__((cleanup (my_cleanup))) = 0;

-      asm goto ("jmp %l1" :::: l2, l3);
+      asm goto (JMP "\t%l1" :::: l2, l3);

       my_abort ();
     }
@@ -53,7 +61,7 @@
     {
       int y __attribute__((cleanup (my_cleanup))) = 0;

-      asm goto ("jmp %l0" :::: l4, l5);
+      asm goto (JMP "\t%l0" :::: l4, l5);

       my_abort ();
     }

incremental patch.

Reply via email to