Unless I'm mistaken, we never mark dummy pointers as "const" for the middle end. For subroutine sub(a) integer, pointer, intent(in) :: a the C code would be "void sub(const int *a)". I think we miss the "const" in the when creating the GIMPLE. In principle this "const" should also be applied to other arguments which are have not the POINTER argument. (However, we need to be careful as the front end might generate pointer assignments itself.)
const for non function decls, mean nothing to the middle-end.
I mean on local variables, const mean nothing.
> const for non function decls, mean nothing to the middle-end. > I mean on local variables, const mean nothing. Good to know. Then every (non-VALUE) dummy argument except POINTERs and ALLOCATABLEs can be marked as "const" -- and POINTERS and ALLOCATABLE if they are INTENT(IN).
*** This bug has been marked as a duplicate of 23169 ***