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

Re: PATCH: PR web/44775: union_match_dups failed to check NULL *ref

On 07/02/2010 01:06 AM, H.J. Lu wrote:
> Pattern is
> (define_insn "divmodhiqi3"
>   [(set (match_operand:HI 0 "register_operand" "=a")
>         (ior:HI
>           (ashift:HI
>             (zero_extend:HI
>               (mod:QI (subreg:QI
>                         (match_operand:HI 1 "register_operand" "0") 0)
>                       (match_operand:QI 2 "nonimmediate_operand" "qm")))
>             (const_int 8))
>           (zero_extend:HI
>             (div:QI (subreg:QI (match_dup 1) 0) (match_dup 2)))))
>    (use (match_dup 1))
>    (clobber (reg:CC FLAGS_REG))]
>   "idiv{b}\t%2"
>   [(set_attr "type" "idiv")
>    (set_attr "mode" "QI")])
> I added "(use (match_dup 1))" since I am not sure if upper 8bits
> in operand 1 will be touched after the whole 16bit is loaded
> and subreg:QI is used on operand 1.

Using subreg like that is pretty ugly, but I'm not sure whether that's
actually the problem.  I think you want a QImode match_operand there.
Not sure what the point of this pattern (or the HImode operands) is, it
looks like it wants to be a standard name, but as far as I can tell from
the documentation, divmod only takes one mode.

If you want to represent a HImode division producing a QImode result,
that's probably

  (truncate:QI (div:HI (match_operand:HI 1)
                       (sign_extend:HI (match_operand:QI 2))))

and now that I've checked the manual, that even appears as an example.

The use seems unnecessary.

Try to fix the pattern along these lines, and see if it works.  If it
still doesn't, what do you get from debug_df_insn?


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