This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/35846] ICE on nested character constructors



------- Comment #5 from domob at gcc dot gnu dot org  2008-09-20 11:52 -------
After coming back to this bug, I believe the problem is that gfc_conv_expr
takes care of finding out string lengths' for things like TRIM(x) which don't
have a cl->length, but gfc_conv_expr_descriptor which is called e.g. for the
array constructors does not do so and calls gfc_conv_string_length with a cl
whose length is NULL.

As the problem seems to be specific to array constructors and all array
constructor elements must have the same character length, I propose to re-use
gfc_conv_expr in gfc_conv_string_length to find out the string length if it is
NULL by taking the first element of each array constructor and then calling
gfc_conv_expr to get the result's string_length.

I'll submit a patch shortly if no further problems occur.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35846


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