public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* alpha regression on 920625-1
@ 1998-04-27  0:33 Richard Henderson
  1998-04-27 11:10 ` Joern Rennecke
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Henderson @ 1998-04-27  0:33 UTC (permalink / raw)
  To: egcs

   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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1998-04-28 21:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-27  0:33 alpha regression on 920625-1 Richard Henderson
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

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).