public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Fix input operands of gcc.dg/guality/pr43077-1.c
@ 2021-05-11 14:36 Stefan Schulze Frielinghaus
  2021-05-11 14:44 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Schulze Frielinghaus @ 2021-05-11 14:36 UTC (permalink / raw)
  To: gcc-patches

The type of the output operands *p and *q of the extended asm statement
of function foo is unsigned long whereas the type of the corresponding
input operands is int.  This results, e.g. on IBM Z, in the case that
the immediates 2 and 3 are written into registers in SI mode and read in
DI mode resulting in wrong values.  Fixed by lifting the input operands
to type long.

gcc/testsuite/ChangeLog:

	* gcc.dg/guality/pr43077-1.c: Align types of output and input
	operands by lifting immediates to type long.

Ok for mainline?

---
 gcc/testsuite/gcc.dg/guality/pr43077-1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/guality/pr43077-1.c b/gcc/testsuite/gcc.dg/guality/pr43077-1.c
index 39bd26aae01..2d9376298d4 100644
--- a/gcc/testsuite/gcc.dg/guality/pr43077-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr43077-1.c
@@ -24,7 +24,7 @@ int __attribute__((noinline))
 foo (unsigned long *p, unsigned long *q)
 {
   int ret;
-  asm volatile ("" : "=r" (ret), "=r" (*p), "=r" (*q) : "0" (1), "1" (2), "2" (3));
+  asm volatile ("" : "=r" (ret), "=r" (*p), "=r" (*q) : "0" (1), "1" (2l), "2" (3l));
   return ret;
 }
 
-- 
2.23.0


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

* Re: [PATCH] testsuite: Fix input operands of gcc.dg/guality/pr43077-1.c
  2021-05-11 14:36 [PATCH] testsuite: Fix input operands of gcc.dg/guality/pr43077-1.c Stefan Schulze Frielinghaus
@ 2021-05-11 14:44 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2021-05-11 14:44 UTC (permalink / raw)
  To: Stefan Schulze Frielinghaus; +Cc: gcc-patches

On Tue, May 11, 2021 at 04:36:47PM +0200, Stefan Schulze Frielinghaus via Gcc-patches wrote:
> The type of the output operands *p and *q of the extended asm statement
> of function foo is unsigned long whereas the type of the corresponding
> input operands is int.  This results, e.g. on IBM Z, in the case that
> the immediates 2 and 3 are written into registers in SI mode and read in
> DI mode resulting in wrong values.  Fixed by lifting the input operands
> to type long.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.dg/guality/pr43077-1.c: Align types of output and input
> 	operands by lifting immediates to type long.
> 
> Ok for mainline?

Ok, thanks.

> diff --git a/gcc/testsuite/gcc.dg/guality/pr43077-1.c b/gcc/testsuite/gcc.dg/guality/pr43077-1.c
> index 39bd26aae01..2d9376298d4 100644
> --- a/gcc/testsuite/gcc.dg/guality/pr43077-1.c
> +++ b/gcc/testsuite/gcc.dg/guality/pr43077-1.c
> @@ -24,7 +24,7 @@ int __attribute__((noinline))
>  foo (unsigned long *p, unsigned long *q)
>  {
>    int ret;
> -  asm volatile ("" : "=r" (ret), "=r" (*p), "=r" (*q) : "0" (1), "1" (2), "2" (3));
> +  asm volatile ("" : "=r" (ret), "=r" (*p), "=r" (*q) : "0" (1), "1" (2l), "2" (3l));
>    return ret;
>  }
>  
> -- 
> 2.23.0

	Jakub


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

end of thread, other threads:[~2021-05-11 14:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11 14:36 [PATCH] testsuite: Fix input operands of gcc.dg/guality/pr43077-1.c Stefan Schulze Frielinghaus
2021-05-11 14:44 ` Jakub Jelinek

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