Should PHI result and arg types match?

Aldy Hernandez aldyh@redhat.com
Fri Oct 19 16:47:00 GMT 2018


Howdy!

Are the types for PHI arguments and the corresponding result supposed to 
match?

In the backwards threader I'm seeing:

	_103 = PHI <_173(11), 0B(12)>

Where the type of _103 is cgraph_node *, and the type of _173 is 
symtab_node *.

I know one is derived from the other (struct cgraph_node : public 
symtab_node), but I would have expected a cast somewhere.

<bb 10> :
# _173 = PHI <0B(6), _172(9)>
if (_173 != 0B)
   goto <bb 11>; [70.00%]
else
   goto <bb 12>; [30.00%]

<bb 11> :
_109 = _173->type;
if (_109 == 1)
   goto <bb 13>; [34.00%]
else
   goto <bb 12>; [66.00%]

<bb 13> :
# _103 = PHI <_173(11), 0B(12)>
if (_103 != 0B)

Similarly for simpler stuff.  Is this legal?:

typedef unsigned int UDItype __attribute__ ((mode (DI)));
typedef UDItype UINT64;
UINT64 c_prov_hi;
long unsigned int z$w$5;
...
# c_prov_hi_222 = PHI <z$w$5_384(68), blah>

Thanks.
Aldy



More information about the Gcc mailing list