On 8/31/22 4:22 AM, Kewen.Lin wrote: > on 2022/8/27 11:50, Peter Bergner via Gcc-patches wrote: >> - tree src_type = TREE_TYPE (src_ptr); >> + tree src_type = (fncode == RS6000_BIF_DISASSEMBLE_ACC) >> + ? build_pointer_type (vector_quad_type_node) >> + : build_pointer_type (vector_pair_type_node); > > Nit: it seems we can use existing ptr_vector_quad_type_node and > ptr_vector_pair_type_node? > I assume the const qualifier is fine since it's for disassembling.
That's actually what I started with, but I got some type of gimple verification error which I can't remember what it said. Let me put that back temporarily and I'll grab the error message. >> + if (TREE_TYPE (TREE_TYPE (src_ptr)) != src_type) > > This line looks unexpected, the former is type char while the latter is type > __vector_pair *. > > I guess you meant to compare the type of pointer type like: > > TREE_TYPE (TREE_TYPE (src_ptr)) != TREE_TYPE (src_type) > > or even with mode like: > > TYPE_MODE (TREE_TYPE (TREE_TYPE (src_ptr))) != TYPE_MODE (TREE_TYPE > (src_type)) Maybe? However, if that is the case, how can it be working for me? Let me throw this in the debugger and verify the types and I'll report back with what I find. >> + src_ptr = build1 (VIEW_CONVERT_EXPR, src_type, src_ptr); > > Nit: NOP_EXPR seems to be better suited here for pointer conversion. NOP_EXPR is new to me (I don't play in the middle-end that often). Let me look around at some other uses of it and I'll give it a try. Thanks! Peter