PATCH: Fix builtins-18.c and builtins-20.c on arm-none-elf

Mark Mitchell mark@codesourcery.com
Sun Dec 28 20:14:00 GMT 2003


On Wed, 2003-12-24 at 07:22, Roger Sayle wrote:
> On Tue, 23 Dec 2003, Mark Mitchell wrote:
> > The first problem was that expand_call was not creating useful
> > REG_RETVAL notes for calls to sqrt.  It was doing like so:
> >
> >     (insn_list:REG_RETVAL 39 (expr_list:REG_EQUAL (expr_list (symbol_ref:SI ("sqrt") <function_decl 0x4037bca8 __builtin_sqrt>)
> >
> > rather than the much more useful version generated for a libcall to an
> > addition routine:
> >
> >     (insn_list:REG_RETVAL 29 (expr_list:REG_EQUAL (plus:DF (reg:DF 77)
> >                 (reg:DF 79))
> 
> 
> This REG_EQUAL note is supposed to be added by the code at the bottom of
> expand_builtin_mathfn, see just below the comment:
> 
>   /* If this is a sqrt operation and we don't care about errno, try to
>      attach a REG_EQUAL note with a SQRT rtx to the emitted libcall.
>      This allows the semantics of the libcall to be visible to the RTL
>      optimizers.  */
> 
> Perhaps it would be better to find out why this code isn't triggering.
> http://gcc.gnu.org/ml/gcc-patches/2003-07/msg02012.html

It doesn't trigger because there is no REG_RETVAL note when the code in
expand_builtin_mathfn scans backwards to find one.

-- 
Mark Mitchell <mark@codesourcery.com>
CodeSourcery, LLC



More information about the Gcc-patches mailing list