public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][GCC] Fix oversized shifts in PR/88903 testcase.
@ 2019-01-21 15:58 Tamar Christina
  2019-01-22  8:17 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Tamar Christina @ 2019-01-21 15:58 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd, rguenther

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

Hi All,

The testcase for PR/tree-optimization 88903 hits
undefined behavior for the overwide shifts.  This is
causing the testcases to fail for all Arm platforms.

This updates the testcase to add an explicit & such
that the behavior is consistent.

Regtested on aarch64-none-linux-gnu and no issues.

Ok for trunk?

Thanks,
Tamar

gcc/testsuite/ChangeLog:

2019-01-21  Tamar Christina  <tamar.christina@arm.com>

	PR/tree-optimization 88903
	* gcc.dg/vect/pr88903-1.c: Add explicit &.

-- 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: rb10608.patch --]
[-- Type: text/x-diff; name="rb10608.patch", Size: 729 bytes --]

diff --git a/gcc/testsuite/gcc.dg/vect/pr88903-1.c b/gcc/testsuite/gcc.dg/vect/pr88903-1.c
index dead2b5e723eaff77fa1edb6ae32d12b005c680e..77dbfd47c91be8cce0edde8b09b7b90d40268306 100644
--- a/gcc/testsuite/gcc.dg/vect/pr88903-1.c
+++ b/gcc/testsuite/gcc.dg/vect/pr88903-1.c
@@ -7,8 +7,8 @@ foo()
 {
   for (int i = 0; i < 512; ++i)
     {
-      x[2*i] = x[2*i] << (i+1);
-      x[2*i+1] = x[2*i+1] << (i+1);
+      x[2*i] = x[2*i] << ((i+1) & 31);
+      x[2*i+1] = x[2*i+1] << ((i+1) & 31);
     }
 }
 
@@ -20,7 +20,7 @@ main()
     x[i] = i;
   foo ();
   for (int i = 0; i < 1024; ++i)
-    if (x[i] != i << (i/2+1))
+    if (x[i] != i << ((i/2+1) & 31))
       __builtin_abort ();
   return 0;
 }


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

* Re: [PATCH][GCC] Fix oversized shifts in PR/88903 testcase.
  2019-01-21 15:58 [PATCH][GCC] Fix oversized shifts in PR/88903 testcase Tamar Christina
@ 2019-01-22  8:17 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2019-01-22  8:17 UTC (permalink / raw)
  To: Tamar Christina; +Cc: gcc-patches, nd

On Mon, 21 Jan 2019, Tamar Christina wrote:

> Hi All,
> 
> The testcase for PR/tree-optimization 88903 hits
> undefined behavior for the overwide shifts.  This is
> causing the testcases to fail for all Arm platforms.
> 
> This updates the testcase to add an explicit & such
> that the behavior is consistent.
> 
> Regtested on aarch64-none-linux-gnu and no issues.
> 
> Ok for trunk?

OK.

Richard.

> Thanks,
> Tamar
> 
> gcc/testsuite/ChangeLog:
> 
> 2019-01-21  Tamar Christina  <tamar.christina@arm.com>
> 
> 	PR/tree-optimization 88903
> 	* gcc.dg/vect/pr88903-1.c: Add explicit &.
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)

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

end of thread, other threads:[~2019-01-22  8:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-21 15:58 [PATCH][GCC] Fix oversized shifts in PR/88903 testcase Tamar Christina
2019-01-22  8:17 ` Richard Biener

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