This is the mail archive of the gcc@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]

subreg question


What cases of subreg are supposed to be handled exactly?

double x(float y) {
     double z;
     *((float *)&z) = y;
     return z;  }

On ppc, the rtl for the store after purge_addressof looks like:

(insn 36 12 17 (set (subreg:SF (reg/v:DF 118) 0)
         (reg:SF 121)) -1 (nil)
     (nil))

This seems to work (118 eventually gets resolved to memory) despite
an explicit statement in rtl.texi that it is invalid.  Is it really?

The original case involved Altivec vectors, which as you recall are
16 bytes:

     vector signed char v;
     int i;
     *((int *)&v) = i;

This similarly produces

(insn 217 40 43 (set (subreg:SI (reg/v:V16QI 126) 0)
         (reg/v:SI 115)) 310 {*movsi_internal1} (insn_list 4 (nil))

which is currently not handled.  There is no way to generate code for
this except by putting 126 in memory.  The subreg use here does not
seem to correspond to any of the uses described in rtl.texi, so it
seems to me it should not be generated by purge_addressof.  Is this
a reasonable approach?





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