Hi Yuao,

sorry for not telling you earlier, but there is 

tree *gfc_trans_force_lval (block *, tree *val);

which just ensures that the tree pointed to by val is an expression a lvalue
can be taken off. I.e. if it is already a variable or the like, nothing
happens, but when not, then a temporary is created. Please have a look. Maybe
for future use, it may shorten some code.

Regards,
        Andre

PS: And when you come up with a better name, feel free to change it.


On Wed, 22 Oct 2025 00:17:04 +0800
Yuao Ma <[email protected]> wrote:

> Hi all,
> 
> This patch fixes r16-4474 regression.
> Reproduce: https://godbolt.org/z/8sqGonnza
> The problem: _gfortran_transfer_integer_write (&dt_parm.0, >- &1 -<, 4);
> 
> This approach clashed with the coarray test case where a variable is
> created and then pointed to. Following Andre's advice that taking the
> address of a constant is problematic, I've switched to using the
> variable approach. Existing test cases pass with this change.
> I've noted some instances where we currently use build_addr on the fly
> when an object is not a pointer. Now that conv_constant respects the
> want_pointer flag, we can gradually clean up these occurrences and
> avoid introducing new ones.
> Sorry for the regression. I would appreciate it if you could help
> double-test the attached patch to confirm it works as expected.
> 
> Yuao


-- 
Andre Vehreschild * Email: vehre ad gmx dot de 

Reply via email to