https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110360
--- Comment #10 from anlauf at gcc dot gnu.org ---
Hmm, the testers show failures for the new testcase for the following cases:
x86 / -m32 / -O1 and higher,
Power9 BE, all optimization levels.
I can reproduce the case of x86 / -m32 / -O1 for the following reduced test:
program p
implicit none
call val4 (4_"A" , 4_"A" ) ! OK
call val4 (4_"V**", 4_"V" ) ! OK
call val4 (4_"V**", 4_"V//") ! fail
contains
subroutine val4 (x, c)
character(kind=4), intent(in) :: x ! control: pass by reference
character(kind=4), value :: c
print *, "by value(kind=4): ", c, " ", x
if (c /= x) stop 3
c = 4_"#"
if (c /= 4_"#") stop 4
end
end
This is a pre-existing issue for constant character argument (len>1) and
can be reproduced with e.g. gcc-13. It does not seem to occur with -m64.
Maybe we are giving the middle end a bad representation of the argument.