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]

mem operator with unspecified width


Is it legal in RTL for a mem operator to have unspecified width?

For example, is the following a legal RTL instruction:

(insn 56 55 58 (set (reg:DI 169)
       (mem (unspec[ 
                   (reg/f:DI 168)
                   (reg:DI 167)
                   (label_ref:DI 61)
               ]  2) 0)) 193 {casesi_load_media})

The problem I have is that the following code in combine.c/nonzero_bits():

    case MEM:
#ifdef LOAD_EXTEND_OP
      /* In many, if not most, RISC machines, reading a byte from memory
	 zeros the rest of the register.  Noticing that fact saves a lot
	 of extra zero-extends.  */
      if (LOAD_EXTEND_OP (GET_MODE (x)) == ZERO_EXTEND)
	nonzero &= GET_MODE_MASK (GET_MODE (x));
#endif
      break;

treats the mem as a VOIDmode memory access, and if LOAD_EXTEND_OP(VOIDmode)
returns ZERO_EXTEND, then it's a memory access of width
0 with zeroes in all the upper bits, so combine.c will replace the
mem operator with (const_int 0).

The intention in the original RTL is that the mem operator has unspecified
width (which is resolved later) rather than VOIDmode width, so replacing
with constant zero is not what is wanted.

But in this context unspecified width is indistinguishable from VOIDmode
width, so maybe it's not possible to have a mem with unspecified width?

Steve.
-- 
Stephen Clarke, Micro Cores & Development Tools, STMicroelectronics
Phone:1-408-922-4062, Fax:1-408-895-3069, mailto:Stephen.Clarke@st.com
Mail:  STMicroelectronics, 1060 E. Brokaw Rd., San Jose, CA 95131.


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