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: Excessive stack usage on m68k - BUG?


Kamil Iskra <iskra@icsr.agh.edu.pl> writes:

|> Now, with gcc-2.95:
|> 
|> #NO_APP
|> gcc2_compiled.:
|> ___gnu_compiled_c:
|> .text
|> 	.even
|> .globl _main
|> _main:
|> 	link a5,#-16
|> 	jbsr ___main
|> 	pea a5@(-16)
|> 	jbsr _f
|> 	moveq #0,d0
|> 	unlk a5
|> 	rts
|> 
|> Why 16 bytes?

This is a generic bug in the backend:

Thu Aug 26 16:00:17 1999  Andreas Schwab  <schwab@suse.de>

	* function.c (assign_stack_temp_for_type): Fix change of Mar 5 for
	the fact that ALIGN is measured in bits, not bytes.

Index: function.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/function.c,v
retrieving revision 1.98
diff -u -a -u -r1.98 function.c
--- function.c	1999/08/24 12:04:54	1.98
+++ function.c	1999/08/26 14:00:02
@@ -674,11 +674,12 @@
 	 So for requests which depended on the rounding of SIZE, we go ahead
 	 and round it now.  We also make sure ALIGNMENT is at least
 	 BIGGEST_ALIGNMENT.  */
-      if (mode == BLKmode && align < (BIGGEST_ALIGNMENT / BITS_PER_UNIT))
+      if (mode == BLKmode && align < BIGGEST_ALIGNMENT)
 	abort();
       p->slot = assign_stack_local (mode,
-				    mode == BLKmode
-				      ? CEIL_ROUND (size, align) : size,
+				    (mode == BLKmode
+				     ? CEIL_ROUND (size, align / BITS_PER_UNIT)
+				     : size),
 				    align);
 
       p->align = align;

-- 
Andreas Schwab                                  "And now for something
schwab@suse.de                                   completely different."
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg

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