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]

Re: ABI change for ports with byte-aligned functions.



I think this is wrong for Thumb code.  In this case, FUNCTION_BOUNDARY is 
16, but the bottom bit is always set to indicate that it is a Thumb 
address, not an ARM address.  We need another way to determine when to use 
the alternative ABI.

R.

> 
> This patch changes the C++ ABI for ports that have FUNCTION_BOUNDARY
> less than 16, because the previous ABI didn't work on these ports.
> It puts a comment in cp-tree.h that explains the ABI difference.
> 
> Bootstrapped & tested on i686-linux, and also tested with an
> i686-linux compiler that had FUNCTION_BOUNDARY forced to 8.
> 
> Index: gcc/cp/typeck.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
> retrieving revision 1.345
> diff -p -u -p -r1.345 typeck.c
> --- typeck.c	2001/05/02 14:38:33	1.345
> +++ typeck.c	2001/05/04 06:02:04
> @@ -2909,9 +2909,22 @@ get_member_function_from_ptrfunc (instan
>        idx = cp_build_binary_op (TRUNC_DIV_EXPR, 
>  				build1 (NOP_EXPR, vtable_index_type, e3),
>  				TYPE_SIZE_UNIT (vtable_entry_type));
> -      e1 = cp_build_binary_op (BIT_AND_EXPR,
> -			       build1 (NOP_EXPR, vtable_index_type, e3),
> -			       integer_one_node);
> +      if (FUNCTION_BOUNDARY < 16)
> +	{
> +	  tree delta;
> +	  tree pfn;
> +	  if (TREE_CODE (function) == PTRMEM_CST)
> +	    expand_ptrmemfunc_cst (function, &delta, &pfn, &e1);
> +	  else
> +	    e1 = build_component_ref (function, pfn_vflag_identifier, 
> +					 NULL_TREE, 0);
> +	}
> +      else
> +	{
> +	  e1 = cp_build_binary_op (BIT_AND_EXPR,
> +				   build1 (NOP_EXPR, vtable_index_type, e3),
> +				   integer_one_node);
> +	}
>  


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