This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH] Fix !$omp end .... symbols handling
On Thu, Feb 16, 2006 at 06:02:07PM +0100, Tobias.Schlueter@Physik.Uni-Muenchen.DE wrote:
> Ok, yes, I was expressing myself unclearly. I had meant to ask: why don't you
> commit the symbols after every OMP statement? I was afraid that you might have
> to add this code in several places.
Currently it commits symbols for all OMP statements (through
accept_statement () call or, if failed, undone through reject_statement ())
except the END ones.
The END ones when seen just modify start statement's omp_clauses:
if (st == (omp_st == ST_OMP_DO ? ST_OMP_END_DO : ST_OMP_END_PARALLEL_DO))
{
if (new_st.op == EXEC_OMP_END_NOWAIT)
cp->ext.omp_clauses->nowait |= new_st.ext.omp_bool;
else
gcc_assert (new_st.op == EXEC_NOP);
gfc_clear_new_st ();
st = next_statement ();
}
or
switch (new_st.op)
{
case EXEC_OMP_END_NOWAIT:
cp->ext.omp_clauses->nowait |= new_st.ext.omp_bool;
break;
case EXEC_OMP_CRITICAL:
if (((cp->ext.omp_name == NULL) ^ (new_st.ext.omp_name == NULL))
|| (new_st.ext.omp_name != NULL
&& strcmp (cp->ext.omp_name, new_st.ext.omp_name) != 0))
gfc_error ("Name after !$omp critical and !$omp end critical does"
" not match at %C");
gfc_free ((char *) new_st.ext.omp_name);
break;
case EXEC_OMP_END_SINGLE:
cp->ext.omp_clauses->lists[OMP_LIST_COPYPRIVATE]
= new_st.ext.omp_clauses->lists[OMP_LIST_COPYPRIVATE];
new_st.ext.omp_clauses->lists[OMP_LIST_COPYPRIVATE] = NULL;
gfc_free_omp_clauses (new_st.ext.omp_clauses);
break;
case EXEC_NOP:
break;
default:
gcc_unreachable ();
}
gfc_clear_new_st ();
and I don't want them in the parse tree at all (parse tree will contain
just say EXEC_OMP_SINGLE and statements enclosed in !$omp single .. !$omp
end single structured block as its ->block chain.
Jakub