public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@cygnus.com>
To: egcs@cygnus.com
Subject: alpha regression on 920625-1
Date: Mon, 27 Apr 1998 00:33:00 -0000	[thread overview]
Message-ID: <19980426215614.41398@dot.cygnus.com> (raw)

   typedef struct{double x,y;}point;
   point pts[]={{1.0,2.0},{3.0,4.0},{5.0,6.0},{7.0,8.0}};
   static int va1(int nargs,...)
   {
     va_list args;
     int i;
     point pi;
     va_start(args,nargs);
     for(i=0;i<nargs;i++){
       pi=va_arg(args,point);
       if(pts[i].x!=pi.x||pts[i].y!=pi.y)abort();
     }
     va_end(args);
   }

`pi' is initially allocated to a TImode register, and when comes reload
time, we find that we must drop the register to memory.  It so happens
that the copy from varargs is done in DImode, while the comparison must
of course be done in DFmode.

The problem arose with jfc's recent mode-dependant aliasing changes.  
Because the memory block created for the TImode register is not marked
as a structure, and we have two different modes manipulating the memory,
the DFmode load gets scheduled before the DImode store.

The simplest solution is probably to change MAX_FIXED_MODE_SIZE from
TImode to prevent the struct from being mistreated.

Another is to get registers that contained structures to have
MEM_IN_STRUCT_P set out of alter_reg.  This solutiion is also
applicable to complex values, something that jfc warns about
in mode_alias_check.  A patch to do this follows.

Does this seem the correct approach?


r~



Sun Apr 26 21:29:06 1998  Richard Henderson  <rth@cygnus.com>

	* machmode.h (COMPLEX_MODE_P): New.
	* reload1.c (alter_reg): Set MEM_IN_STRUCT_P when assigning storage
	to a pseudo larger than word size.


Index: machmode.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/machmode.h,v
retrieving revision 1.2
diff -c -p -d -r1.2 machmode.h
*** machmode.h	1998/04/03 16:36:11	1.2
--- machmode.h	1998/04/27 04:28:36
*************** extern enum mode_class mode_class[];
*** 164,169 ****
--- 164,174 ----
    (GET_MODE_CLASS (MODE) == MODE_FLOAT	\
     || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)
  
+ /* Nonzero if MODE is a complex mode.  */
+ #define COMPLEX_MODE_P(MODE)			\
+   (GET_MODE_CLASS (MODE) == MODE_COMPLEX_INT	\
+    || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)
+ 
  /* Get the size in bytes of an object of mode MODE.  */
  
  extern int mode_size[];
Index: reload1.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/reload1.c,v
retrieving revision 1.19
diff -c -p -d -r1.19 reload1.c
*** reload1.c	1998/04/03 16:36:46	1.19
--- reload1.c	1998/04/27 04:28:36
*************** alter_reg (i, from_reg)
*** 2525,2530 ****
--- 2525,2537 ----
  	    adjust = inherent_size - total_size;
  
  	  RTX_UNCHANGING_P (x) = RTX_UNCHANGING_P (regno_reg_rtx[i]);
+ 
+ 	  /* ??? If this register is larger than the host native word, it
+ 	     is likely that this is a structure being held in registers,
+ 	     and so should have the /s bit set.  The same goes for complex.  */
+ 	  if (total_size > UNITS_PER_WORD
+ 	      || COMPLEX_MODE_P (GET_MODE (regno_reg_rtx[i])))
+ 	    MEM_IN_STRUCT_P (x) = 1;
  	}
        /* Reuse a stack slot if possible.  */
        else if (spill_stack_slot[from_reg] != 0

             reply	other threads:[~1998-04-27  0:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-27  0:33 Richard Henderson [this message]
1998-04-27 11:10 ` Joern Rennecke
1998-04-27 13:59   ` Richard Henderson
1998-04-28 19:14     ` Jim Wilson
1998-04-28 21:59       ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19980426215614.41398@dot.cygnus.com \
    --to=rth@cygnus.com \
    --cc=egcs@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).