Hi Tobias,

well, frankly: I don't know. The atomic stuff worked most of the time I worked
on coarray things, so I am not that deep into it. I also would need to test
what happens, when the code is removed, but I am assigned on a different
project meanwhile and can not spare much time. To me this looks like casting
the atomic to a type supported by the interface to prevent gimple failure. But
as said, I would need to test your code.

Sorry for being of not more help.

Regards,
        Andre

On Mon, 27 Oct 2025 19:28:50 +0100
Tobias Burnus <[email protected]> wrote:

> Hi Andre – I have a question for you - see below.
> 
> Hi Yuao,
> 
> Yuao Ma wrote:
> 
> > email content. The newly attached patch removes the unnecessary {} and
> > reformats it.  
> 
> LGTM. Thanks.
> 
> * * *
> 
> @Andre: Can you check whether the following code can now be removed
> as unreachable?
> 
> The pointer part seems to be handled now - based on the dumps.
> Admittedly, I don't understand the comment completely as the
> check only checks for pointerness and not for being the same
> type. [Frankly, have not tried to understand the code.]
> 
> --- a/gcc/fortran/trans-intrinsic.cc
> +++ b/gcc/fortran/trans-intrinsic.cc
> @@ -12561,9 +12561,2 @@ conv_intrinsic_atomic_op (gfc_code *code)
>   
> -      if (!POINTER_TYPE_P (TREE_TYPE (value)))
> -       {
> -         tmp = gfc_create_var (TREE_TYPE (TREE_TYPE (atom)), "value");
> -         gfc_add_modify (&block, tmp, fold_convert (TREE_TYPE (tmp), value));
> -          value = gfc_build_addr_expr (NULL_TREE, tmp);
> -       }
> -
>         gfc_init_se (&argse, NULL);
> @@ -12721,11 +12714,2 @@ conv_intrinsic_atomic_ref (gfc_code *code)
>         gfc_add_block_to_block (&block, &argse.pre);
> -
> -      /* Different type, need type conversion.  */
> -      if (!POINTER_TYPE_P (TREE_TYPE (value)))
> -       {
> -         vardecl = gfc_create_var (TREE_TYPE (TREE_TYPE (atom)), "value");
> -          orig_value = value;
> -          value = gfc_build_addr_expr (NULL_TREE, vardecl);
> -       }
> -
>         tmp = build_call_expr_loc (input_location,
> gfor_fndecl_caf_atomic_ref, 7,
> 
> Thanks,
> 
> Tobias


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

Reply via email to