On Fri, Oct 28, 2016 at 10:52:34AM +0200, Richard Biener wrote:
> > I've already committed the original patch based on Eric's review, but
> > managed to come up with another testcase that still ICEs (one with two
> > different complex modes).  Is the following ok for trunk if it passes
> > bootstrap/regtest?
> 
> As we're dealing with memory isn't GET_MODE_SIZE the correct thing to
> use?

GET_MODE_PRECISION is what the case VIEW_CONVERT_EXPR case tests:
      /* If the input and output modes are both the same, we are done.  */
      if (mode == GET_MODE (op0))
        ;
      /* If neither mode is BLKmode, and both modes are the same size
         then we can use gen_lowpart.  */
      else if (mode != BLKmode && GET_MODE (op0) != BLKmode
               && (GET_MODE_PRECISION (mode)
                   == GET_MODE_PRECISION (GET_MODE (op0)))
               && !COMPLEX_MODE_P (GET_MODE (op0)))  
        {
          if (GET_CODE (op0) == SUBREG)
            op0 = force_reg (GET_MODE (op0), op0);
          temp = gen_lowpart_common (mode, op0);  
          if (temp)
            op0 = temp;
          else
            {
              if (!REG_P (op0) && !MEM_P (op0))
                op0 = force_reg (GET_MODE (op0), op0);
              op0 = gen_lowpart (mode, op0);
            }
        }
The CONCAT operands can be a MEM (just likely won't be both MEM or adjacent
MEM).

BTW, the VCE part could also handle 2 different complex modes.

        Jakub

Reply via email to