Re: [Patch, fortran] PR40196 - [F03] [F08] Type parameter inquiry (str%len, a%kind) and Complex parts (z%re, z%im)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [Patch, fortran] PR40196 - [F03] [F08] Type parameter inquiry (str%len, a%kind) and Complex parts (z%re, z%im)

Paul Richard Thomas
Hi Thomas,

I tried failing cases of that kind; or assignment to len/kind part refs and
returned correct errors. Must check where I was going wrong.

Paul from a chilly Garching-bei-Muenchen


On Sun, 28 Oct 2018, 13:38 Thomas Koenig <[hidden email] wrote:

> Hi Paul,
>
>
> >> inq would be easier to understand and unambiguous imho.
> >
> > Why? inquiry_type seems fine to me.
>
> I think Bernhard means the name of the member, i.
>
> I think it makes sense to leave as it is - gfc_ref is a
> struct that occurs a lot in complicated expressions, and the other
> members are one and two letters, too.
>
> > ....snip....
> >> Is the switch really worth it? I'd have used a plain chain of strcmp,
> >> fwiw.
> >
> > I have done it. However, I might revert in order to combine the switch
> > block where I set the typespec for the primary expression.
>
> Whatever suits you best.
>
> > I haven't added testcases for errors. Does anybody think that this is
> necessary?
>
> Might not be a bad idea to run through at least each new error message
> again.
>
> There is one illwfL test case which ICEs:
>
> $ cat b.f90
> program main
>    character(len=:), allocatable :: a
>    allocate(a,source="abc")
>    a%len = 2
>    print *,a
> end
> $ gfortran b.f90
> gimplification failed:
> (integer(kind=4)) .a <nop_expr 0x7f138ae67740
>      type <integer_type 0x7f138acd15e8 integer(kind=4) public SI
>          size <integer_cst 0x7f138acbcdb0 constant 32>
>          unit-size <integer_cst 0x7f138acbcdc8 constant 4>
>          align:32 warn_if_not_align:0 symtab:0 alias-set -1
> canonical-type 0x7f138acd15e8 precision:32 min <integer_cst
> 0x7f138acbcd68 -2147483648> max <integer_cst 0x7f138acbcd80 2147483647>
>          pointer_to_this <pointer_type 0x7f138acd89d8>>
>
>      arg:0 <var_decl 0x7f138b980ab0 .a
>          type <integer_type 0x7f138acd1738 integer(kind=8) public DI
>              size <integer_cst 0x7f138acbcb70 constant 64>
>              unit-size <integer_cst 0x7f138acbcb88 constant 8>
>              align:64 warn_if_not_align:0 symtab:0 alias-set -1
> canonical-type 0x7f138acd1738 precision:64 min <integer_cst
> 0x7f138acbcdf8 -9223372036854775808> max <integer_cst 0x7f138acbce10
> 9223372036854775807>
>              pointer_to_this <pointer_type 0x7f138ad057e0>>
>          used DI b.f90:1:0 size <integer_cst 0x7f138acbcb70 64>
> unit-size <integer_cst 0x7f138acbcb88 8>
>          align:64 warn_if_not_align:0 context <function_decl
> 0x7f138ae83200 MAIN__>
>          chain <var_decl 0x7f138b980b40 a type <pointer_type
> 0x7f138ae82540>
>              used unsigned DI b.f90:2:0 size <integer_cst 0x7f138acbcb70
> 64> unit-size <integer_cst 0x7f138acbcb88 8>
>              align:64 warn_if_not_align:0 context <function_decl
> 0x7f138ae83200 MAIN__>>>>
> b.f90:4:0:
>
>      4 |   a%len = 2
>        |
> internal compiler error: gimplification failed
> 0xb45602 gimplify_expr(tree_node**, gimple**, gimple**, bool
> (*)(tree_node*), int)
>          ../../trunk/gcc/gimplify.c:12568
>
> Regards
>
>         Thomas
>