This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] OpenACC fortran front end
- From: Cesar Philippidis <cesar at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, <fortran at gcc dot gnu dot org>, Ilmir Usmanov <i dot usmanov at samsung dot com>, Tobias Burnus <burnus at net-b dot de>
- Date: Thu, 13 Nov 2014 23:29:49 -0800
- Subject: Re: [patch] OpenACC fortran front end
- Authentication-results: sourceware.org; auth=none
- References: <545BF570 dot 8070508 at codesourcery dot com> <20141113164320 dot GW5026 at tucnak dot redhat dot com> <54655E88 dot 2010502 at codesourcery dot com> <20141114065252 dot GD5026 at tucnak dot redhat dot com>
On 11/13/2014 10:52 PM, Jakub Jelinek wrote:
> On Thu, Nov 13, 2014 at 05:44:40PM -0800, Cesar Philippidis wrote:
>> Thanks. I couldn't figure out how to assign the bugs in the PR. Maybe my
>> account doesn't have permission to do so. Regardless, I'll work on them.
>
> Use your @gcc.gnu.org account instead, then you have far more permissions
> in bugzilla.
Thanks. I'll look into that.
>> --- a/gcc/fortran/gfortran.h
>> +++ b/gcc/fortran/gfortran.h
>> @@ -1262,14 +1262,8 @@ typedef struct gfc_omp_clauses
>> gfc_expr_list *tile_list;
>> unsigned async:1, gang:1, worker:1, vector:1, seq:1, independent:1;
>> unsigned wait:1, par_auto:1, gang_static:1;
>
> The /* !$ACC DECLARE locus. */ comment wouldn't hurt here.
>
>> --- a/gcc/fortran/match.c
>> +++ b/gcc/fortran/match.c
>> @@ -2491,8 +2491,8 @@ match_exit_cycle (gfc_statement st, gfc_exec_op op)
>>
>> if (o != NULL)
>> {
>> - gfc_error ("%s statement at %C leaving OpenMP or OpenACC structured block",
>> - gfc_ascii_statement (st));
>> + gfc_error ("%s statement at %C leaving %s structured block",
>> + gfc_ascii_statement (st), is_oacc (p) ? "OpenACC" : "OpenMP");
>
> You want
> gfc_error (is_oacc (p)
> ? "%s statement at %C leaving OpenACC structured block"
> : "%s statement at %C leaving OpenMP structured block",
> gfc_ascii_statement (st));
> instead to be more translation friendly.
>
>> @@ -5545,3 +5547,28 @@ duplicate_main:
>> gfc_done_2 ();
>> return true;
>> }
>> +
>> +/* Return true if this state data represents an OpenACC region. */
>> +bool
>> +is_oacc (gfc_state_data *sd)
>> +{
>> + switch (sd->construct->op)
>> + {
>> + case EXEC_OACC_PARALLEL_LOOP:break;
>> + case EXEC_OACC_PARALLEL:
>
> What is that break; doing there? Then you fall through into end of function
> without return (and missing space before it).
It's bogus. I've applied the attach patch to gomp-4_0-branch which
addresses these two problems.
Thanks,
Cesar
2014-11-13 Cesar Philippidis <cesar@codesourcery.com>
gcc/fortran/
* match.c (match_exit_cycle): Restructure error strings.
* parse.c (is_oacc): Remove bogus break.
Index: gcc/fortran/match.c
===================================================================
--- gcc/fortran/match.c (revision 217532)
+++ gcc/fortran/match.c (working copy)
@@ -2491,8 +2491,10 @@ match_exit_cycle (gfc_statement st, gfc_
if (o != NULL)
{
- gfc_error ("%s statement at %C leaving %s structured block",
- gfc_ascii_statement (st), is_oacc (p) ? "OpenACC" : "OpenMP");
+ gfc_error (is_oacc (p)
+ ? "%s statement at %C leaving OpenACC structured block"
+ : "%s statement at %C leaving OpenMP structured block",
+ gfc_ascii_statement (st));
return MATCH_ERROR;
}
Index: gcc/fortran/parse.c
===================================================================
--- gcc/fortran/parse.c (revision 217532)
+++ gcc/fortran/parse.c (working copy)
@@ -5554,7 +5554,7 @@ is_oacc (gfc_state_data *sd)
{
switch (sd->construct->op)
{
- case EXEC_OACC_PARALLEL_LOOP:break;
+ case EXEC_OACC_PARALLEL_LOOP:
case EXEC_OACC_PARALLEL:
case EXEC_OACC_KERNELS_LOOP:
case EXEC_OACC_KERNELS: