This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tuples] dereference POINTER_PLUS_EXPR check


> now due to the transitiveness of u_t_c, we now simply need to check
> 
>   useless_type_conversion (lhs, op0)
> 
> which in your notation is lhs and rhs1.  Which is exactly what the code did
> before your patch.

...

> Why are the pointed-to types relevant at all?  Type relations for the
> pointed-to types don't necessary translate to the relations of the
> pointer types.
> For example useless_type_conversion (void *, int *) == true but
> useless_type_conversion (void, int) is certainly not true.

This is the failed testcase that prompted the patch:

(gdb) ptt lhs_type
 <pointer_type 0x2aaaaf571600
    type <integer_type 0x2aaaaf559240 character(kind=1) public unsigned string-flag QI

...

(gdb) ptt rhs1_type
 <reference_type 0x2aaaaf5e6240
    type <array_type 0x2aaaaf5e6180
        type <integer_type 0x2aaaaf559240 character(kind=1) public unsigned string-flag QI

u_t_c(lhs_type, rhs1_type) fails because it doesn't look far enough
down, but you're saying it shouldn't.  Is u_t_c wrong then?

Aldy


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]