This is the mail archive of the gcc-patches@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: [patch] Combine looses libcall notes


On Thu, 7 Apr 2005, Paul Brook wrote:
> The testcase includes the following code:
>
> return (((a % 10000)) & 0xFF) >> 8;
>
> Which results in the following RTL before combine (slightly edited):
>
> (insn 25 4 26 0 (set (reg:SI 0 r0 [ a ])
>         (reg/v:SI 102 [ a ])) 141 {*thumb_movsi_insn} (insn_list 3 (nil))
>     (expr_list:REG_DEAD (reg/v:SI 102 [ a ])
>         (insn_list:REG_LIBCALL 28 (nil))))
>
> (insn 26 25 27 0 (set (reg:SI 1 r1) (const_int 10000)
>
> (call_insn/u 27 26 28 0 (parallel [
>             (set (reg:DI 0 r0)
>                 (call (mem:SI (symbol_ref:SI ("__aeabi_uidivmod"))
>                     (const_int 0 [0x0])))
>             (use (const_int 0 [0x0]))
>             (clobber (reg:SI 14 lr))
>         ]) 226 {*call_value_insn} (insn_list 25 (insn_list 26 (nil))))))
>
> (insn 28 27 29 0 (set (reg:SI 124 [+4 ])
>         (reg:SI 1 r1 [+4 ])) 141 {*thumb_movsi_insn} (nil)
>     (expr_list:REG_DEAD (reg:SI 1 r1 [+4 ])
>         (insn_list:REG_RETVAL 25
>              (expr_list:REG_EQUAL (umod:SI (reg/v:SI 102 [ a ]])
>                     (const_int 10000 [0x2710]))
>                 (nil)))))

Curious.  If you back propagate "REG_DEAD (reg:SI 124)" into
instruction 28, you'd hope that the entire libcall would be
eliminated.  i.e. there shouldn't normally be a dangling REG_LIBCALL
note after combine, as deletion of the REG_RETVAL instruction
would normally be fatal for the REG_RETVAL.

Could you just double check that there isn't something unique about
the csl-arm-branch that's triggering this behaviour (in which case
avoiding placing notes on deleted insns is potentially just hiding
the underlying problem).  For example is __aeabi_uidivmod known to
be a "const" function in the RTL optimizers.


I was about to approve your patch (which looks reasonable in itself)
when I got to wondering why this has never been an issue for GCC
previously, and why now it only shows itself on the csl-arm-branch.

Roger
--


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