public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] uninit-pr108968-register.c: use __UINTPTR_TYPE__ for LLP64
@ 2024-01-31 13:38 Jonathan Yong
  2024-01-31 13:52 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Yong @ 2024-01-31 13:38 UTC (permalink / raw)
  To: Gcc Patch List

[-- Attachment #1: Type: text/plain, Size: 133 bytes --]

Ensure sp variable is long enough by using __UINTPTR_TYPE__ for
rsp.

Attached patch okay? Changes unsigned long to __UINTPTR_TYPE__.

[-- Attachment #2: 0001-uninit-pr108968-register.c-use-__UINTPTR_TYPE__-for-.patch --]
[-- Type: text/x-patch, Size: 1167 bytes --]

From 8b5e79e1345d99ec6d3595013a20a9c672edb403 Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10walls@gmail.com>
Date: Wed, 31 Jan 2024 13:31:30 +0000
Subject: [PATCH] uninit-pr108968-register.c: use __UINTPTR_TYPE__ for LLP64

Ensure sp variable is long enough by using __UINTPTR_TYPE__ for
rsp.

gcc/testsuite/ChangeLog:

	* c-c++-common/analyzer/uninit-pr108968-register.c:
	Use __UINTPTR_TYPE__ instead of unsigned long for LLP64.
---
 gcc/testsuite/c-c++-common/analyzer/uninit-pr108968-register.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/c-c++-common/analyzer/uninit-pr108968-register.c b/gcc/testsuite/c-c++-common/analyzer/uninit-pr108968-register.c
index a76c09e7b14..e9a1c21990b 100644
--- a/gcc/testsuite/c-c++-common/analyzer/uninit-pr108968-register.c
+++ b/gcc/testsuite/c-c++-common/analyzer/uninit-pr108968-register.c
@@ -4,6 +4,6 @@
 struct cpu_info {};
 struct cpu_info *get_cpu_info(void)
 {
-  register unsigned long sp asm("rsp");
+  register __UINTPTR_TYPE__ sp asm("rsp");
   return (struct cpu_info *)((sp | (STACK_SIZE - 1)) + 1) - 1; /* { dg-bogus "use of uninitialized value 'sp'" } */
 }
-- 
2.43.0


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

* Re: [PATCH] uninit-pr108968-register.c: use __UINTPTR_TYPE__ for LLP64
  2024-01-31 13:38 [PATCH] uninit-pr108968-register.c: use __UINTPTR_TYPE__ for LLP64 Jonathan Yong
@ 2024-01-31 13:52 ` Richard Biener
  2024-01-31 16:13   ` Jonathan Yong
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2024-01-31 13:52 UTC (permalink / raw)
  To: Jonathan Yong; +Cc: Gcc Patch List

On Wed, Jan 31, 2024 at 2:39 PM Jonathan Yong <10walls@gmail.com> wrote:
>
> Ensure sp variable is long enough by using __UINTPTR_TYPE__ for
> rsp.
>
> Attached patch okay? Changes unsigned long to __UINTPTR_TYPE__.

OK.

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

* Re: [PATCH] uninit-pr108968-register.c: use __UINTPTR_TYPE__ for LLP64
  2024-01-31 13:52 ` Richard Biener
@ 2024-01-31 16:13   ` Jonathan Yong
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Yong @ 2024-01-31 16:13 UTC (permalink / raw)
  To: Richard Biener; +Cc: Gcc Patch List

On 1/31/24 13:52, Richard Biener wrote:
> On Wed, Jan 31, 2024 at 2:39 PM Jonathan Yong <10walls@gmail.com> wrote:
>>
>> Ensure sp variable is long enough by using __UINTPTR_TYPE__ for
>> rsp.
>>
>> Attached patch okay? Changes unsigned long to __UINTPTR_TYPE__.
> 
> OK.

Thanks, pushed to master branch.

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

end of thread, other threads:[~2024-01-31 16:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31 13:38 [PATCH] uninit-pr108968-register.c: use __UINTPTR_TYPE__ for LLP64 Jonathan Yong
2024-01-31 13:52 ` Richard Biener
2024-01-31 16:13   ` Jonathan Yong

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