This is the mail archive of the egcs-patches@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

assign_stack_temp_for_type BLKmode size rounding



Some comments about your change:

  1) Since align is never suppose to be less than BIGGEST_ALIGNMENT /
     BITS_PER_UNIT when mode == BLKmode I would be incline to call abort
     if it ever happens.

  2) The comments:

      /* The following slot size computation is necessary because we don't
	 know the actual size of the temporary slot until assign_stack_local
	 has performed all the frame alignment and size rounding for the
	 requested temporary.  Note that extra space added for alignment
	 can be either above or below this stack slot depending on which
	 way the frame grows.  We include the extra space if and only if it
	 is above this slot.  */
#ifdef FRAME_GROWS_DOWNWARD
      p->size = frame_offset_old - frame_offset;
#else
      p->size = size;
#endif

     seem to indicate that ->size should not include rounding done
     for alignment and (if I recall correctly) the original code
     did not (in general) include the rounding done for alignment.

Notes:

  1) Egcs bootstraps and no new testsuite regressions are evident on
     FreeBSD 3.1 x86 when configured for aout.  This patch has not
     been tried on any other platform.

ChangeLog:

Sat Feb 20 13:47:00 EST 1999  John Wehle  (john@feith.com)

	* function.c (assign_stack_temp_for_type): Abort
	if mode == Blkmode and align is less than
	BIGGEST_ALIGNMENT / BITS_PER_UNIT.
	(assign_stack_temp_for_type): Round the size parameter
	passed to assign_stack_local instead of size itself.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/function.c.ORIGINAL	Sat Feb 20 03:07:39 1999
--- gcc/function.c	Sat Feb 20 03:46:40 1999
*************** assign_stack_temp_for_type (mode, size, 
*** 970,981 ****
  	 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 = MAX (align, BIGGEST_ALIGNMENT / BITS_PER_UNIT);
! 	  size = CEIL_ROUND (size, align);
! 	}
!       p->slot = assign_stack_local (mode, size, align);
  
        p->align = align;
  
--- 970,981 ----
  	 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))
! 	abort();
!       p->slot = assign_stack_local (mode,
! 				    mode == BLKmode
! 				      ? CEIL_ROUND (size, align) : size,
! 				    align);
  
        p->align = align;
  
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------