[gfortran] Fix PR 15211

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Mon Jun 14 19:28:00 GMT 2004


Paul Brook wrote:
> On Monday 31 May 2004 19:54, Tobias Schlüter wrote:
> 
>>Looking again at the code in gfc_conv_intrinsic_len it occurred to me
>>that all strings in an array must be of the same length. Therefor this
>>one line fix should do the trick. The test for arg->ref == NULL is
>>clearly meant to separate the case of arg->ref == REF_SUBSTRING, but is
>>meaningless in the case of REF_ARRAY or REF_COMPONENT (which I will look
>>into after this is approved).
>>
>>2004-05-31  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
>>
>>	* trans-intrinsic.c (gfc_conv_intrinsic_len): Deal with arrays
>>	of strings.
> 
> 
> You need to iterate over all the refs. You can have an substring (or component 
> ref) of an arrayref.
> 

So, to make sure I understand correctly, checking (arg->ref == NULL || 
(arg->ref->next == NULL && arg->ref->type == REF_ARRAY)) should fix the 
PR, but leave us with a problem in the case of something like
  a(5)(1:3)
or
  a(5)%string
?

I can submit a patch with the revised check, but I don't think I can fix 
the other two examples, as my insight into the scalarizer is close to 
non-existant.

- Tobi



More information about the Gcc-patches mailing list