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]

Re: Using and clobbering hard regs in parallel


Stephen Clarke <Stephen.Clarke@st.com> writes:

> Is it valid in RTL to read a hard reg in one branch of a parallel,
> and clobber the same hard reg in another branch?
> 
> For example, when compiling for SH, I get the following instruction:
> 
> (insn 20 19 22 (parallel[ 
>             (set (reg:SI 54)
>                 (udiv:SI (reg:SI 4 r4)
>                     (reg:SI 5 r5)))
>             (clobber (reg:SI 18 t))
>             (clobber (reg:SI 17 pr))
>             (clobber (reg:SI 4 r4))
>             (use (reg:SI 55))
>         ] ) -1 (nil)
>     (expr_list:REG_EQUAL (udiv:SI (mem/f:SI (reg/f:SI 50 virtual-stack-vars) 0)
>             (mem/f:SI (plus:SI (reg/f:SI 50 virtual-stack-vars)
>                     (const_int 4 [0x4])) 0))
>         (insn_list:REG_RETVAL 17 (nil))))
> 
> where r4 is read by the set, but also clobbered in another branch
> (this instruction is part of a libcall).

Yes, what this means is that r4 holds an input at the start of the
insn but some other (unspecified) value at the end of the insn.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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