On 2/21/24 22:00, Steve Kargl wrote:
Unfortunately, valgrind does not work on AMD FX-8350 cpu.
Do you mean valgrind does not work at all? For gcc, you need to configure --enable-valgrind-annotations to not get bogus warnings.
memleak vs ICE. I think I'll take one over the other. Probably need to free code->expr3 before the copy.
Yep.
I tried gfc_replace_expr in an earlier patch. It did not work.
- it still fails on the following code, because the traversal of the refs is incomplete / wrong: program foo implicit none complex :: cmp(3) real, pointer :: pp(:) class(*), allocatable :: uu(:) type t real :: re real :: im end type t type u type(t) :: tt(3) end type u type(u) :: cc cmp = (3.45,6.78) cc% tt% re = cmp% re cc% tt% im = cmp% im allocate (pp, source = cc% tt% im) ! ICEcc%tt%im isn't a complex-part-ref, so this seems to be a different (maybe related) issue. Does the code compile with 'source = (cc%tt%im)'? If so, perhaps, detecting a component reference and doing the simply wrapping with parentheses can be done.
Yes, that's why I tried to make up the above example. I think %re and %im are not too special, they work here pretty much like component refs elsewhere.
print *, pp allocate (uu, source = cc% tt% im) ! ICEDitto. Not to mention I know nothing about the implementation of CLASS in gfortran.
You can ignore this one for now. It works if one places parens around the source expr as for the other cases. Harald
