]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite; Fix execute/pr52286.c for 16bit
authorAndrew Pinski <quic_apinski@quicinc.com>
Sat, 14 Sep 2024 19:55:07 +0000 (12:55 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Sat, 14 Sep 2024 20:19:10 +0000 (13:19 -0700)
The code path which was added for 16bit had a broken inline-asm which would
only assign maybe half of the registers for the `long` type to 0.

Adding L to the input operand of the inline-asm fixes the issue by now assigning
the full 32bit value of the input register that would match up with the output register.

Fixes r0-115223-gb0408f13d4b317 which added the 16bit code path to fix the testcase for 16bit.

Pushed as obvious.

PR testsuite/116716

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr52286.c: Fix inline-asm for 16bit case.

gcc/testsuite/gcc.c-torture/execute/pr52286.c

index bb56295ab5296124538b12f842e3a64b56d8e00b..4fd5d6ac813d8b5d0a002420a3e67c536448872b 100644 (file)
@@ -11,7 +11,7 @@ main ()
   b = (~a | 1) & -2038094497;
 #else
   long a, b;
-  asm ("" : "=r" (a) : "0" (0));
+  asm ("" : "=r" (a) : "0" (0L));
   b = (~a | 1) & -2038094497L;
 #endif
   if (b >= 0)