This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR84512
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <jh at suse dot de>
- Date: Fri, 16 Mar 2018 12:42:52 +0100
- Subject: Re: [PATCH] Fix PR84512
- References: <alpine.LSU.2.20.1802271339480.18265@zhemvz.fhfr.qr>
On 02/27/2018 01:42 PM, Richard Biener wrote:
Index: gcc/testsuite/gcc.dg/tree-ssa/pr84512.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/pr84512.c (nonexistent)
+++ gcc/testsuite/gcc.dg/tree-ssa/pr84512.c (working copy)
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int foo()
+{
+ int a[10];
+ for(int i = 0; i < 10; ++i)
+ a[i] = i*i;
+ int res = 0;
+ for(int i = 0; i < 10; ++i)
+ res += a[i];
+ return res;
+}
+
+/* { dg-final { scan-tree-dump "return 285;" "optimized" } } */
This fails for nvptx, because it doesn't have the required vector
operations. To fix the fail, I've added requiring effective target
vect_int_mult.
Thanks,
- Tom
[testsuite] Require vect_int_mult in pr84512.c
2018-03-16 Tom de Vries <tom@codesourcery.com>
* gcc.dg/tree-ssa/pr84512.c: Require effective target vect_int_mult.
---
gcc/testsuite/gcc.dg/tree-ssa/pr84512.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr84512.c b/gcc/testsuite/gcc.dg/tree-ssa/pr84512.c
index 288fa5d..41b6c06 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr84512.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr84512.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-optimized" } */
+/* { dg-require-effective-target vect_int_mult } */
int foo()
{