This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4] Add new oacc_transform patch
- From: Cesar Philippidis <cesar at codesourcery dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Cc: Nathan Sidwell <nathan_sidwell at mentor dot com>
- Date: Tue, 28 Jul 2015 08:30:49 -0700
- Subject: Re: [gomp4] Add new oacc_transform patch
- Authentication-results: sourceware.org; auth=none
- References: <55AE7E19 dot 90508 at codesourcery dot com> <87io94r61k dot fsf at kepler dot schwinge dot homeip dot net>
On 07/28/2015 02:21 AM, Thomas Schwinge wrote:
> Cesar, please address the following compiler diagnostig:
>
>> 2015-07-21 Cesar Philippidis <cesar@codesourcery.com>
>>
>> gcc/
>> * omp-low.c (execute_oacc_transform): New function.
>> (class pass_oacc_transform): New function.
>> (make_pass_oacc_transform): New function.
>> * passes.def: Add pass_oacc_transform to all_passes.
>> * tree-pass.h (make_pass_oacc_transform): Declare.
>>
>>
>> diff --git a/gcc/omp-low.c b/gcc/omp-low.c
>> index 388013c..23989f9 100644
>> --- a/gcc/omp-low.c
>> +++ b/gcc/omp-low.c
>> @@ -14394,4 +14394,76 @@ make_pass_late_lower_omp (gcc::context *ctxt)
>> return new pass_late_lower_omp (ctxt);
>> }
>>
>> +/* Main entry point for oacc transformations which run on the device
>> + compiler. */
>> +
>> +static unsigned int
>> +execute_oacc_transform ()
>> +{
>> + basic_block bb;
>> + gimple_stmt_iterator gsi;
>> + gimple stmt;
>> +
>> + if (!lookup_attribute ("oacc function",
>> + DECL_ATTRIBUTES (current_function_decl)))
>> + return 0;
>> +
>> +
>> + FOR_ALL_BB_FN (bb, cfun)
>> + {
>> + gsi = gsi_start_bb (bb);
>> +
>> + while (!gsi_end_p (gsi))
>> + {
>> + stmt = gsi_stmt (gsi);
>> + gsi_next (&gsi);
>> + }
>> + }
>> +
>> + return 0;
>> +}
>
> [...]/source-gcc/gcc/omp-low.c: In function 'unsigned int execute_oacc_transform()':
> [...]/source-gcc/gcc/omp-low.c:14406:10: error: variable 'stmt' set but not used [-Werror=unused-but-set-variable]
> gimple stmt;
> ^
I could apply the attached patch, but I figured that you'd need the stmt
iterator for acc_on_device anyway. Should I apply the patch to
gomp-4_0-branch?
Cesar
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 479b28a..e237c75 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -14431,26 +14431,10 @@ make_pass_late_lower_omp (gcc::context *ctxt)
static unsigned int
execute_oacc_transform ()
{
- basic_block bb;
- gimple_stmt_iterator gsi;
- gimple stmt;
-
if (!lookup_attribute ("oacc function",
DECL_ATTRIBUTES (current_function_decl)))
return 0;
-
- FOR_ALL_BB_FN (bb, cfun)
- {
- gsi = gsi_start_bb (bb);
-
- while (!gsi_end_p (gsi))
- {
- stmt = gsi_stmt (gsi);
- gsi_next (&gsi);
- }
- }
-
return 0;
}