https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110360
Mikael Morin <mikael at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mikael at gcc dot gnu.org --- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> --- (In reply to anlauf from comment #0) > but the second line contains junk, as the tree-dump shows: > > static void val (character(kind=1)[1:1], integer(kind=8)); > static integer(kind=4) a = 65; > > val ("A", 1); > { > character(kind=1) char.1; > > char.1 = (character(kind=1)) a; > val (&char.1, 1); > } > > Clearly, the second case is inconsistent with the ABI, see the prototype, and > Yes, but it's not worse than the first one: "A" is a pointer, not a value. I would say that it is the middle-end that is inconsistent here. (In reply to anlauf from comment #3) > Created attachment 55381 [details] > Revised patch > > This patch actually regtests OK. The previous one failed on one of the > c_char_tests. Looks good. I would suggest to create an overload that avoids duplicating the build_int_cst (integer_type_node, 1) in several places. Shouldn't it be build_int_cst (gfc_charlen_type_node, 1) by the way?