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] 2nd try: Fix PR22347


On Tue, Jul 12, 2005 at 01:26:18PM +0200, Richard Guenther wrote:
> +   /* Only optimize calls which have compatible function type attributes.  */
> +   if (targetm.comp_type_attributes (TREE_TYPE (current_function_decl),
> + 				    fntype) != 1)
> +     return;

This is wrong.  You don't know what these attributes means here.
The correct place to fix this is ix86_function_ok_for_sibcall.

> !   if (STACK_REG_P (ix86_function_value (TREE_TYPE (exp), func, false))
>         != STACK_REG_P (ix86_function_value (TREE_TYPE (DECL_RESULT (cfun->decl)),
> ! 					   cfun->decl, false)))
>       return false;

Something like

  a = ix86_function_value (TREE_TYPE (exp), func, false);
  b = ix86_function_value (TREE_TYPE (DECL_RESULT (cfun->decl)),
			   cfun->decl, false);
  if (!rtx_equal_p (a, b))
    return false;

which really should notice the difference between sse returns and
fpu returns.

Otherwise it looks good.  I think I might appreciate you check in
the target hook portion of the patch independent of the i386 
portion of the patch.



r~


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