public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* testsuite: Fix pr55569.c excess errors
@ 2022-12-20  9:22 Jonathan Yong
  2022-12-20 16:55 ` Andrew Pinski
  2022-12-20 18:55 ` Mike Stump
  0 siblings, 2 replies; 4+ messages in thread
From: Jonathan Yong @ 2022-12-20  9:22 UTC (permalink / raw)
  To: Gcc Patch List

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

This fixes the following:

Excess errors:

gcc/testsuite/gcc.c-torture/compile/pr55569.c:13:12: warning: overflow 
in conversion from 'long long unsigned int' to 'long int' changes value 
from '4611686018427387903' to '-1' [-Woverflow]

gcc/testsuite/gcc.c-torture/compile/pr55569.c:13:34: warning: iteration 
2147483647 invokes undefined behavior [-Waggressive-loop-optimizations]

Patch OK?

[-- Attachment #2: 0001-testsuite-Fix-pr55569.c-excess-errors.patch --]
[-- Type: text/x-patch, Size: 1260 bytes --]

From 11cc6c38c4b44849110240da3ed553fcc3b35d05 Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10walls@gmail.com>
Date: Tue, 20 Dec 2022 09:16:16 +0000
Subject: [PATCH] testsuite: Fix pr55569.c excess errors

This fixes the following:

Excess errors:
gcc/testsuite/gcc.c-torture/compile/pr55569.c:13:12: warning: overflow in conversion from 'long long unsigned int' to 'long int' changes value from '4611686018427387903' to '-1' [-Woverflow]
gcc/testsuite/gcc.c-torture/compile/pr55569.c:13:34: warning: iteration 2147483647 invokes undefined behavior [-Waggressive-loop-optimizations]

gcc/testsuite/ChangeLog:
	* gcc.c-torture/compile/pr55569.c: fix excess errors.

Signed-off-by: Jonathan Yong <10walls@gmail.com>
---
 gcc/testsuite/gcc.c-torture/compile/pr55569.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.c-torture/compile/pr55569.c b/gcc/testsuite/gcc.c-torture/compile/pr55569.c
index cf274cdbb99..6c2c7c7b6f7 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr55569.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr55569.c
@@ -4,7 +4,7 @@ int *bar (void);
 void
 foo (void)
 {
-  long x;
+  __INTPTR_TYPE__ x;
   int *y = bar ();
 
   /* The loop below may be optimized to a call to memset with a size
-- 
2.39.0


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

* Re: testsuite: Fix pr55569.c excess errors
  2022-12-20  9:22 testsuite: Fix pr55569.c excess errors Jonathan Yong
@ 2022-12-20 16:55 ` Andrew Pinski
  2022-12-20 23:32   ` Jonathan Yong
  2022-12-20 18:55 ` Mike Stump
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Pinski @ 2022-12-20 16:55 UTC (permalink / raw)
  To: Jonathan Yong; +Cc: Gcc Patch List

On Tue, Dec 20, 2022 at 1:22 AM Jonathan Yong via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> This fixes the following:

It is not obvious from the email, why this patch is needed but I
figured it was due to LLP64 targets or some other targets where long
is not the same size of the size_t type.
I think this patch is good but I cannot approve it. The commit message
should be improved to make a mention of LLP64 targets and long being a
smaller size than size_t.

Thanks,
Andrew

>
> Excess errors:
>
> gcc/testsuite/gcc.c-torture/compile/pr55569.c:13:12: warning: overflow
> in conversion from 'long long unsigned int' to 'long int' changes value
> from '4611686018427387903' to '-1' [-Woverflow]
>
> gcc/testsuite/gcc.c-torture/compile/pr55569.c:13:34: warning: iteration
> 2147483647 invokes undefined behavior [-Waggressive-loop-optimizations]
>
> Patch OK?

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

* Re: testsuite: Fix pr55569.c excess errors
  2022-12-20  9:22 testsuite: Fix pr55569.c excess errors Jonathan Yong
  2022-12-20 16:55 ` Andrew Pinski
@ 2022-12-20 18:55 ` Mike Stump
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Stump @ 2022-12-20 18:55 UTC (permalink / raw)
  To: Jonathan Yong; +Cc: Gcc Patch List

On Dec 20, 2022, at 1:22 AM, Jonathan Yong via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> This fixes the following:
> 
> Excess errors:
> 
> gcc/testsuite/gcc.c-torture/compile/pr55569.c:13:12: warning: overflow in conversion from 'long long unsigned int' to 'long int' changes value from '4611686018427387903' to '-1' [-Woverflow]
> 
> gcc/testsuite/gcc.c-torture/compile/pr55569.c:13:34: warning: iteration 2147483647 invokes undefined behavior [-Waggressive-loop-optimizations]
> 
> Patch OK?

Ok.


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

* Re: testsuite: Fix pr55569.c excess errors
  2022-12-20 16:55 ` Andrew Pinski
@ 2022-12-20 23:32   ` Jonathan Yong
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Yong @ 2022-12-20 23:32 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Gcc Patch List

On 12/20/22 16:55, Andrew Pinski wrote:
> On Tue, Dec 20, 2022 at 1:22 AM Jonathan Yong via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>>
>> This fixes the following:
> 
> It is not obvious from the email, why this patch is needed but I
> figured it was due to LLP64 targets or some other targets where long
> is not the same size of the size_t type.
> I think this patch is good but I cannot approve it. The commit message
> should be improved to make a mention of LLP64 targets and long being a
> smaller size than size_t.
> 
> Thanks,
> Andrew
> 

You are right that this is for LLP64 win32. I will change the subject to 
"testsuite: Fix pr55569.c excess errors on LLP64"

This fixes the following on LLP64 mingw-w64 target:

Excess errors:

gcc/testsuite/gcc.c-torture/compile/pr55569.c:13:12: warning: overflow 
in conversion from 'long long unsigned int' to 'long int' changes value 
from '4611686018427387903' to '-1' [-Woverflow]

gcc/testsuite/gcc.c-torture/compile/pr55569.c:13:34: warning: iteration 
2147483647 invokes undefined behavior [-Waggressive-loop-optimizations]


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

end of thread, other threads:[~2022-12-20 23:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-20  9:22 testsuite: Fix pr55569.c excess errors Jonathan Yong
2022-12-20 16:55 ` Andrew Pinski
2022-12-20 23:32   ` Jonathan Yong
2022-12-20 18:55 ` Mike Stump

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