This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR35339 Optimize implied do loops in io statements
- From: Dominique d'Humières <dominiq at lps dot ens dot fr>
- To: nicolas Koenig <koenigni at student dot ethz dot ch>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 29 May 2017 17:32:11 +0200
- Subject: Re: [Patch, fortran] PR35339 Optimize implied do loops in io statements
- Authentication-results: sourceware.org; auth=none
Hi Nicolas,
Updating gfortran with your patch fails with
../../work/gcc/fortran/frontend-passes.c: In function 'bool traverse_io_block(gfc_code*, bool*, gfc_code*)':
../../work/gcc/fortran/frontend-passes.c:1067:20: error: expected unqualified-id before '(' token
#define swap(x, y) (x) ^= (y), (y) ^= (x), (x) ^= (y);
^
../../work/gcc/fortran/frontend-passes.c:1180:15: note: in expansion of macro 'swap'
std::swap(start->value.op.op1, start->value.op.op2);
^~~~
../../work/gcc/fortran/frontend-passes.c:1067:36: error: invalid operands of types 'gfc_expr*' and 'gfc_expr*' to binary 'operator^'
#define swap(x, y) (x) ^= (y), (y) ^= (x), (x) ^= (y);
~~~~^~~~~~
../../work/gcc/fortran/frontend-passes.c:1180:15: note: in expansion of macro 'swap'
std::swap(start->value.op.op1, start->value.op.op2);
^~~~
../../work/gcc/fortran/frontend-passes.c:1067:41: error: in evaluation of 'operator^=(struct gfc_expr*, struct gfc_expr*)'
#define swap(x, y) (x) ^= (y), (y) ^= (x), (x) ^= (y);
^
../../work/gcc/fortran/frontend-passes.c:1180:15: note: in expansion of macro 'swap'
std::swap(start->value.op.op1, start->value.op.op2);
^~~~
../../work/gcc/fortran/frontend-passes.c:1067:48: error: invalid operands of types 'gfc_expr*' and 'gfc_expr*' to binary 'operator^'
#define swap(x, y) (x) ^= (y), (y) ^= (x), (x) ^= (y);
~~~~^~~~~~
../../work/gcc/fortran/frontend-passes.c:1180:15: note: in expansion of macro 'swap'
std::swap(start->value.op.op1, start->value.op.op2);
^~~~
../../work/gcc/fortran/frontend-passes.c:1067:53: error: in evaluation of 'operator^=(struct gfc_expr*, struct gfc_expr*)'
#define swap(x, y) (x) ^= (y), (y) ^= (x), (x) ^= (y);
^
../../work/gcc/fortran/frontend-passes.c:1180:15: note: in expansion of macro 'swap'
std::swap(start->value.op.op1, start->value.op.op2);
^~~~
TIA
Dominique