[Patch, Fortran] PR57906 - fix issue with coarray component assignment

Tobias Burnus burnus@net-b.de
Mon Jul 22 17:18:00 GMT 2013


For coarrays, an assignment does not affect the allocation status. That 
also implies that the type parameters, shape and effective types between 
the LHS and RHS have to match.

For coarrays components, that's handled (since Rev. 200955) by 
re-assigning the saved data after the assignment:

  tmp  = LHS;
  LHS = RHS;
  LHS.caf = RHS.caf;

However, as the PR shows, the middle end for some reasons optimizes the 
latter assignment away. My impression is that that's due to the 
"restrict" issue (PR45586). The patch now only assigns the data 
component, which seems to work:

  tmp  = LHS;
  LHS = RHS;
  LHS.caf.data = RHS.caf.data;

Other changes:
- Change space+tab to tab
- Add a test case, which I seemingly forgot to include in r200955


Build and regtested on x86-64-gnu-linux.
OK for the trunk?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coarray-comp-fix.diff
Type: text/x-patch
Size: 3423 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130722/a039931d/attachment.bin>


More information about the Fortran mailing list