> Jan Hubicka <hubi...@ucw.cz> writes:
> 
> > Does the patch in https://gcc.gnu.org/ml/gcc-patches/2015-10/msg00902.html 
> > help?
> 
> No, it doesn't.
> 
> #0  fancy_abort (file=0x4000000003f1ce48 "../../gcc/expr.c", line=282, 
>     function=0x4000000003f1ec38 <convert_move(rtx_def*, rtx_def*, 
> int)::__FUNCTION__> "convert_move") at ../../gcc/diagnostic.c:1209
> #1  0x4000000001a816e0 in convert_move (to=0x200000000101b0a0, 
>     from=0x200000000101b088, unsignedp=1) at ../../gcc/expr.c:282
> #2  0x4000000001a87580 in convert_modes (mode=DImode, oldmode=BLKmode, 
>     x=0x200000000101b088, unsignedp=1) at ../../gcc/expr.c:736
> #3  0x4000000001a60e10 in store_field (target=0x20000000010196d8, bitsize=64, 
> Python Exception <type 'exceptions.AttributeError'> 'tuple' object has no 
> attribute 'major': 
>     bitpos=0, bitregion_start=0, bitregion_end=63, mode=DImode, exp=, 
>     alias_set=12, nontemporal=false) at ../../gcc/expr.c:6668

I see, here we dispatch to convert_mode early converting from BLKmode to SImode
      /* Unless MODE is VOIDmode or BLKmode, convert TEMP to MODE.  */
      if (mode != VOIDmode && mode != BLKmode
          && mode != TYPE_MODE (TREE_TYPE (exp)))
        temp = convert_modes (mode, TYPE_MODE (TREE_TYPE (exp)), temp, 1);
I suppose we need imilar treatment as I did in store_field:
  /* We allow move between structures of same size but different mode.
     If source is in memory and the mode differs, simply change the memory.  */
  if (GET_MODE (temp) == BLKmode && GET_MODE (target) != BLKmode)
    { 
      gcc_assert (MEM_P (temp));
      temp = adjust_address_nv (temp, GET_MODE (target), 0);
    }

I wonder if it would make sense to add this into convert_mode itself? or shall 
we do that
in the conditional above prior dispatching to convert_modes?

Honza

Reply via email to