This is the mail archive of the gcc-patches@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] |
I've tried to trigger that code and could not see it work. I cannot see a runtime error, neither with
For this I didn't do anything by now, if it is ok I suggest we look at this separatly?
This means you only ever set typespec_ctor for character arrays. This is fine with me, because that's the information we need, but I suggest giving the variable a name that indicates this fact (lest someone uses it for other type).
Renamed the variable to typespec_chararray_ctor; is this what you meant?
Unneeded braces. It looks like we could easily emit an error for strings of constant length that are too long, couldn't we?+ if (generated_length || ! cl + || (cl->expr_type == EXPR_CONSTANT + && cl->ts.type == BT_INTEGER + && mpz_get_si (cl->value.integer) < max_length)) + { + gfc_set_constant_character_len (max_length, p->expr, true); + }
Removed the braces (and the use of mpz_get_si here, too). For the error, I believe this is what you talked about with Tobias, right (i.e., no need as reducing length is valid)?
+ /* get_array_ctor_strlen walks the elements of the constructor, if a
+ typespec was given, we already know the string length and want the one
+ specified there. */
+ /* XXX: Adding typespec_chararray_ctor here was merely a hack to make
+ gfortran.dg/array_constructor_17.f90 work (ICE otherwise). Is this
+ ok anyway or should I look for another solution? */
+ if (typespec_chararray_ctor && ss->expr->ts.cl->length
+ && ss->expr->ts.cl->length->expr_type != EXPR_CONSTANT)
-- François-Xavier Coudert http://www.homepages.ucl.ac.uk/~uccafco/
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |