[Patch, fortran] PR35339 Optimize implied do loops in io statements

Nicolas Koenig koenigni@student.ethz.ch
Mon May 29 16:24:00 GMT 2017


Hello Dominique,

mea culpa, their was a bit confusion with the file being open in emacs
and vi at the same time. Attached is the new patch with the #define removed.

Nicolas


On 05/29/2017 05:32 PM, Dominique d'Humières wrote:
> 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
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: p5.diff
Type: text/x-patch
Size: 7600 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20170529/47b0f96a/attachment.bin>


More information about the Fortran mailing list