[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-fortran
Subject:    Re: Need someone with CLASS...
From:       Paul Richard Thomas <paul.richard.thomas () gmail ! com>
Date:       2016-10-25 6:53:37
Message-ID: CAGkQGi+FnLb=+8V7qfKXBkAaAD3Co-5oYx9+1P_X5nOzM5pBrA () mail ! gmail ! com
[Download RAW message or body]

Hi Steve,

That patch looks fine to me. Go for it!

Thanks

Paul

On 24 October 2016 at 23:54, Steve Kargl
<sgk@troutmask.apl.washington.edu> wrote:
> knowledge to cast an eye at this small patch for
> PR fortran/78092:
>
> Index: gcc/fortran/trans-intrinsic.c
> ===================================================================
> --- gcc/fortran/trans-intrinsic.c       (revision 241492)
> +++ gcc/fortran/trans-intrinsic.c       (working copy)
> @@ -6708,7 +6708,9 @@ gfc_conv_intrinsic_sizeof (gfc_se *se, g
>                                         TREE_OPERAND (argse.expr, 0), 0)))
>                   || GFC_DECL_CLASS (TREE_OPERAND (argse.expr, 0)))))
>         byte_size = gfc_class_vtab_size_get (TREE_OPERAND (argse.expr, 0));
> -      else if (arg->rank > 0)
> +      else if (arg->rank > 0
> +              || (arg->rank == 0
> +                  && arg->ref && arg->ref->type == REF_COMPONENT))
>         /* The scalarizer added an additional temp.  To get the class' vptr
>            one has to look at the original backend_decl.  */
>         byte_size = gfc_class_vtab_size_get (
>
> The offend code in the PR compiles and now gives
>
> % gfc7 -o z a.f90 && ./z
>  ivar2:            4
>
> So, is the patch correct.
>
> --
> Steve



-- 
The difference between genius and stupidity is; genius has its limits.

Albert Einstein
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic