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: Fix sparc segfault (Was: Re: [patch] Fix PR/14058)


> The attached patch fixes the segfault.

Thanks!

> Maybe we should add
>
> if (incoming_p)
>   return reg;

No, because of this blurb:

   Passing of floating point values is handled as follows.
   If a prototype is in scope:
     If the value is in a named argument (i.e. not a stdarg function or a
     value not part of the `...') then the value is passed in the appropriate
     fp reg.
     If the value is part of the `...' and is passed in one of the first 6
     slots then the value is passed in the appropriate int reg.
     If the value is part of the `...' and is not passed in one of the first
     6 slots then the value is passed in memory.
   If a prototype is not in scope:
     If the value is one of the first 6 arguments the value is passed in the
     appropriate integer reg and the appropriate fp reg.
     If the value is not one of the first 6 arguments the value is passed in
     the appropriate fp reg and in memory.

> to the second branch too instead of my patch. I do not know what exactly
> means the (parallel:DF [
>         (expr_list (nil)
>             (const_int 0 [0x0]))
>         (expr_list (reg:DF 44 %f12 [ f ])
>             (const_int 0 [0x0]))
>     ])
> here (why there should be that (nil)).

Excerpt from the FUNCTION_ARG section of the manual:

     The value of the expression can also be a `parallel' RTX.  This is
     used when an argument is passed in multiple locations.  The mode
     of the `parallel' should be the mode of the entire argument.  The
     `parallel' holds any number of `expr_list' pairs; each one
     describes where part of the argument is passed.  In each
     `expr_list' the first operand must be a `reg' RTX for the hard
     register in which to pass this part of the argument, and the mode
     of the register RTX indicates how large this part of the argument
     is.  The second operand of the `expr_list' is a `const_int' which
     gives the offset in bytes into the entire argument of where this
     part starts.  As a special exception the first `expr_list' in the
     `parallel' RTX may have a first operand of zero.  This indicates
     that the entire argument is also stored on the stack.


-- 
Eric Botcazou


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