This is the mail archive of the gcc@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: Calling convention that gets frame pointer register clobbered


On Mon, 2003-12-22 at 01:54, Etienne Lorrain wrote:
>   The code is compiling if the structure is small enough to fit in
>  a 32 bits register, not if it has to be in memory - I should have
>  said it.
> tmp.c:12: internal compiler error: in emit_move_insn, at expr.c:3159

The structure has a size larger than its alignment, so it is given
BLKmode.  We can't copy BLKmode objects into registers, which gives the
abort.

The abort is pretty easy to fix, we just disallow BLKmode objects.  We
now get a reasonable error instead of an abort.  I have attached a patch
which I have not tested yet.

Using "=S" (*ebiosinfo) means load the entire structure into the S reg. 
We can't fit a large structure into a 32-bit register, so what you are
trying to do can not be made to work.  This could not have worked in
earlier gcc versions as you claim.  Probably what happened is that we
didn't give proper errors for this in earlier gcc versions, which is a
common problem with asms.

I see in another message you explained what you are trying to do, but
this is not the way to do it.  You are trying to explain for alias
analysis purposes that a structure is written by the asm.  We don't have
any explicit way to represent that other than by using "=m"
(*ebiosinfo).  The asm syntax could perhaps be extended to do what you
want.  I am not volunteering to do that though.

2003-12-30  James E Wilson  <wilson@specifixinc.com>

	* stmt.c (expand_asm_operands): Don't pass BLKmode to force_reg.

Index: stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.340
diff -p -r1.340 stmt.c
*** stmt.c	20 Dec 2003 03:21:23 -0000	1.340
--- stmt.c	30 Dec 2003 23:25:46 -0000
*************** expand_asm_operands (tree string, tree o
*** 1703,1709 ****
  
        if (asm_operand_ok (op, constraint) <= 0)
  	{
! 	  if (allows_reg)
  	    op = force_reg (TYPE_MODE (type), op);
  	  else if (!allows_mem)
  	    warning ("asm operand %d probably doesn't match constraints",
--- 1703,1711 ----
  
        if (asm_operand_ok (op, constraint) <= 0)
  	{
! 	  /* BLKmode will trigger an abort in emit_move_insn, so we must
! 	     disallow it.  */
! 	  if (allows_reg && TYPE_MODE (type) != BLKmode)
  	    op = force_reg (TYPE_MODE (type), op);
  	  else if (!allows_mem)
  	    warning ("asm operand %d probably doesn't match constraints",
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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