This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch/gfortran] PR16939, 17192,17193,17202,18689,18890 - for final correction.


Tobi,

Find enclosed diffs for trans-expr.c and trans-array.c.

I have done the requested modifications directly to the diffs including
brackets, char[0:len-1]s and suppressing CRs.

I should perhaps provide you with a commentary on some of the more obscure
points:

trans-expr:354-396
__________________

Character dereferencing:

Characters only require pointer results or pointer dummies to be
dereferenced because the rest are all ARRAY_TYPEs.

Non-characters are different because scalars always need to be dereferenced
one more time.

Since characterness always has to be tested for, twice in the original, it
seemed better to take that outside and to branch on it.

1096-1110
_________

The extraction of the string length has been repositioned to avoid
unnecessary repetition. It was not too bad as was but the insertion of the
string length was missing in a couple of places and so would have required
this repetition.

1133-1158
_________

Direct by reference results were missing the returned string length as
second argument. Note this enforcement of the gfortran standard is what
forces modification to the array intrinsics.

1161-1206
_________

Eliminate the extraction of the string length - use 1096-1110.
Build up a char ** temporary for scalar characters and provide its address
for the result argument.

1360-1376
_________

Provide the string length and dereference character scalar pointers for the
se->expr.
I tried to pass character pointers as direct by reference but could not
persuade either the dependencies check or gimple to play ball.  I do not
entirely understand why.  However, the code that is output by the patch is
correct.

trans-array.c: 2342-2348
________________________

Provide the string length so that function calls with dependencies can be
expanded properly (ie. if the result destination is the same as one of the
actual arguments, one of them needs turning into a temporary and a string
copy performing.  This doesn't work very well if the string length is not
known.)

Best regards

Paul



  

Attachment: trans-array.diff
Description: Binary data

Attachment: trans-expr.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]