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]
Other format: [Raw text]

Re: How to handle subreg(mem(X)) after reload?


On Thu, 13 Jan 2005 13:24:26 -0800, James E Wilson
<wilson@specifixinc.com> wrote:

> Perhaps you have defined your own predicates, which you are using
> instead of memory_operand, and you failed to handle (subreg (mem))
> correctly in your predicates?  It is generally unwise to try to replace
> the standard predicate functions.  If you need your own predicate
> functions, they should include/exclude special cases, and then call the
> standard ones at the end to handle the rest of the cases.

Nope, I didn't change a single predicate. 

> It is hard to handle questions like this when given limited info.  It
> would help if you gave us the before reload and after reload RTL for the
> insn in question, the list of reloads generated for it (from the .greg
> file), and the patterns being matched in the md file.

Easy enough to do...

Here's the insn before reload:

(insn:HI 1795 1794 1796 0 (set:QI (subreg:QI (reg/v:SI 122 [ __x0 ]) 0)
        (const_int 0 [0x0])) 0 {*movqi_nomem} (nil)
    (nil))


And here it is after reload (with some debug thrown in for luck):

Reloads for insn # 1795
Reload 0: reload_out (QI) = (subreg:QI (reg/v:SI 122 [ __x0 ]) 0)
        W_REG, RELOAD_FOR_OUTPUT (opnum = 0)
        reload_out_reg: (subreg:QI (reg/v:SI 122 [ __x0 ]) 0)
        reload_reg_rtx: (reg:QI 0 W)

(insn:HI 1795 1794 2178 0 (set:QI (reg:QI 0 W)
        (const_int 0 [0x0])) 0 {*movqi_nomem} (nil)
    (nil))

(insn 2178 1795 2179 0 (set:QI (reg:QI 0 W)
        (reg:QI 0 W)) -1 (nil)
    (nil))

(insn 2179 2178 1796 0 (set:QI (subreg:QI (mem:SI (plus:QI (reg/f:QI 49 R20/FP)
                    (const_int 104 [0x68])) [6 __x0+0 S4 A8]) 0)
        (reg:QI 0 W)) -1 (nil)
    (nil))

2179 is the unrecognized insn. It beats me where the W <- W move came
in... in any case, I'm attaching the port which includes the md file
as well as the .c and .h files. Hopefully someone will be able to spot
the dumb thing I did to cause this problem :(

Thanks,

--Rob

Attachment: pic.tgz
Description: GNU Zip compressed data


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