https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128345
Mikael Morin <mikael at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |mikael at gcc dot
gnu.org
Ever confirmed|0 |1
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2026-11-01
--- Comment #2 from Mikael Morin <mikael at gcc dot gnu.org> ---
For this function from the testcase:
> subroutine set_rank_one_key_cx ( key, value )
> complex, allocatable, intent(inout) :: key(:)
> class(*), intent(in) :: value(:)
> key = transfer( value, key )
> end subroutine
the call to the transfer intrinsic uses gfc_is_simply_contiguous on the `value'
argument in the implementation:
8851 bool simply_contiguous = gfc_is_simply_contiguous (arg->expr,
8852 false, true);
8853 argse.want_pointer = 0;
8854 /* A non-contiguous SOURCE needs packing. */
8855 if (!simply_contiguous)
8856 argse.force_tmp = 1;
8857 gfc_conv_expr_descriptor (&argse, arg->expr);
The gfc_is_simply_contiguous call used to return true before the change,
because it saw a scalar value (the class container). After the change, we now
return false, and it leads to the creation of a temporary array. We fail to
copy values to the temporary using the polymorphic copy function, and instead
use normal assignment of a void pointer value. On 64bit machines, pointers
match the size of default complex, so it works. But on 32bit machines,
pointers are half the size and it fails.