https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118067

--- Comment #6 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #5)
> The problematic insn is still:
> 
> (insn 9 5 10 2 (parallel [
>             (set (reg:HI 99 [ _2 ])
>                 (lshiftrt:HI (subreg:HI (reg/v:V32HI 165 [ u ]) 0)
>                     (const_int 1 [0x1])))
>             (clobber (reg:CC 17 flags))
>         ]) "pr118067.c":10:8 1215 {*lshrhi3_1}
>      (expr_list:REG_UNUSED (reg:CC 17 flags)
>         (nil)))
> 
> But now reload tries to reload input operand with:
> 
>     Inserting insn reload before:
>   191: r337:HI=r165:V32HI#0
> 
>       Creating newreg=338, assigning class NO_REGS to secondary r338
>   191: r337:HI=r165:V32HI#0
>     Inserting the sec. move after:
>   192: r337:HI#0=r338:SI

Here, reload could spill HImode value from r165 to memory and reload it from
memory to r337. *movhi_internal pattern supports both instructions:

(define_insn "*movhi_internal"
  [(set (match_operand:HI 0 "nonimmediate_operand"
    "=r,r,r,m ,*k,*k ,r ,m ,*k ,?r,?*v,*Yv,*v,*v,jm,m")
        (match_operand:HI 1 "general_operand"
    "r ,n,m,rn,r ,*km,*k,*k,CBC,*v,r  ,C  ,*v,m ,*x,*v"))]

Please note that tuning for generic target disables direct moves from XMM to
GPR, so alternative (?r,*v) is effectively disabled. Adding -mtune=intel to
compile flags avoids the ICE.

Reply via email to