[gomp4] reduction bug fix

Thomas Schwinge thomas@codesourcery.com
Thu Oct 9 16:54:00 GMT 2014


Hi Cesar!

On Wed, 8 Oct 2014 09:57:22 -0700, Cesar Philippidis <cesar@codesourcery.com> wrote:
> On 10/08/2014 02:38 AM, Thomas Schwinge wrote:
> 
> > On Fri, 3 Oct 2014 09:22:52 -0700, Cesar Philippidis <cesar@codesourcery.com> wrote:
> >> There is a reduction bug [...]

> >> This patch also includes a runtime test case. I won't apply it to
> >> gomp-4_0-branch just yet. But I wanted to demonstrate a test case
> >> nonetheless.
> > 
> > You can add it as a compile test, and I'll toggle to a run test as part
> > of the merge into our internal development branch.
> 
> OK. I've added a compile test to gcc.dg/goaccc/. Note that this test
> depends on -std=c99, so I couldn't put it in the c-c++-common directory.

Oh, sorry if that was unclear.  I meant to have it already now added to
libgomp/testsuite/, but as a compile-only test, and then I would toggle
that to an execution test later on.  I've changed that...

> >> Is this OK for gomp-4_0-branch?
> > 
> > Yes, with the following addressed:
> > 
> >> --- a/gcc/omp-low.c
> >> +++ b/gcc/omp-low.c
> >> @@ -10140,11 +10140,20 @@ process_reduction_data (gimple_seq *body, gimple_seq *in_stmt_seqp,
> > 
> >     [...]/source-gcc/gcc/omp-low.c: In function 'void _ZL22process_reduction_dataPP21gimple_statement_baseS1_S1_P11omp_context.isra.167.constprop.180(gimple_statement_base**, gimple_statement_base**, gimple_statement_base**, gimple)':
> >     [...]/source-gcc/gcc/omp-low.c:10172:14: warning: 'inner' may be used uninitialized in this function [-Wmaybe-uninitialized]
> >        gimple_seq inner;
> >                   ^

..., and addressed this in r216040:

commit d77ae8538ddf8a550f431f7849da735cba8f37bb
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Oct 9 16:30:40 2014 +0000

    Follow-up on reduction bug fix.
    
    	gcc/
    	* omp-low.c (process_reduction_data): Initialize variable inner.
    	gcc/testsuite/
    	* gcc.dg/goacc/collapse.c: Move file to
    	libgomp/testsuite/libgomp.oacc-c/collapse-4.c.
    	libgomp/
    	* testsuite/libgomp.oacc-c/collapse-4.c: New file, moved from
    	gcc/testsuite/gcc.dg/goacc/collapse.c.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@216040 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.gomp                                                   | 4 ++++
 gcc/omp-low.c                                                        | 2 +-
 gcc/testsuite/ChangeLog.gomp                                         | 5 +++++
 libgomp/ChangeLog.gomp                                               | 5 +++++
 .../collapse.c => libgomp/testsuite/libgomp.oacc-c/collapse-4.c      | 1 +
 5 files changed, 16 insertions(+), 1 deletion(-)

diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp
index 76f8d2b..ce0dcc7 100644
--- gcc/ChangeLog.gomp
+++ gcc/ChangeLog.gomp
@@ -1,3 +1,7 @@
+2014-10-09  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* omp-low.c (process_reduction_data): Initialize variable inner.
+
 2014-10-08  Cesar Philippidis  <cesar@codesourcery.com>
 
 	* omp-low.c (lower_reduction_clauses): Clarify comment.
diff --git gcc/omp-low.c gcc/omp-low.c
index 42e84b0..b8022c2 100644
--- gcc/omp-low.c
+++ gcc/omp-low.c
@@ -10013,7 +10013,7 @@ process_reduction_data (gimple_seq *body, gimple_seq *in_stmt_seqp,
   gcc_assert (is_gimple_omp_oacc_specifically (ctx->stmt));
 
   gimple_stmt_iterator gsi;
-  gimple_seq inner;
+  gimple_seq inner = NULL;
   gimple stmt;
 
   /* A collapse clause may have inserted a new bind block.  */
diff --git gcc/testsuite/ChangeLog.gomp gcc/testsuite/ChangeLog.gomp
index 01bc225..48651ad 100644
--- gcc/testsuite/ChangeLog.gomp
+++ gcc/testsuite/ChangeLog.gomp
@@ -1,3 +1,8 @@
+2014-10-09  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* gcc.dg/goacc/collapse.c: Move file to
+	libgomp/testsuite/libgomp.oacc-c/collapse-4.c.
+
 2014-10-08  Cesar Philippidis  <cesar@codesourcery.com>
 
 	* gcc.dg/goacc/collapse.c: New test.
diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp
index abc38a6..0acc4ca 100644
--- libgomp/ChangeLog.gomp
+++ libgomp/ChangeLog.gomp
@@ -1,3 +1,8 @@
+2014-10-09  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* testsuite/libgomp.oacc-c/collapse-4.c: New file, moved from
+	gcc/testsuite/gcc.dg/goacc/collapse.c.
+
 2014-09-23  Thomas Schwinge  <thomas@codesourcery.com>
 
 	* libgomp.map (OACC_2.0): Add acc_on_device, acc_on_device_.
diff --git gcc/testsuite/gcc.dg/goacc/collapse.c libgomp/testsuite/libgomp.oacc-c/collapse-4.c
similarity index 83%
rename from gcc/testsuite/gcc.dg/goacc/collapse.c
rename to libgomp/testsuite/libgomp.oacc-c/collapse-4.c
index 1ec20a4..7df0de2 100644
--- gcc/testsuite/gcc.dg/goacc/collapse.c
+++ libgomp/testsuite/libgomp.oacc-c/collapse-4.c
@@ -1,3 +1,4 @@
+/* TODO: change to a run test once libgomp supports all data clauses.  */
 /* { dg-do compile } */
 /* { dg-options "-O2 -std=c99" } */
 


Grüße,
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20141009/3a55c684/attachment.sig>


More information about the Gcc-patches mailing list