🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1737

store_one_arg gives wrong alignment to emit_block_move

#1737
From: Rob McMahon
Date: Wed, 28 Sep 1988 19:25
37 lines
1841 bytes
GCC 1.28.

The subject says it all really.  I only noticed this by inspection, but it
looks like a bug waiting to hit someone.  store_one_arg() in expr.c calls
emit_block_move with an align argument of TYPE_ALIGN (...) which is in bits,
whereas it wants it in bytes.

Fix:

RCS file: expr.c,v
retrieving revision 1.9.1.7
diff -c -r1.9.1.7 expr.c
*** /tmp/,RCSt1a01426	Wed Sep 28 20:06:37 1988
--- expr.c	Wed Sep 28 19:36:17 1988
***************
*** 4285,4291 ****
  	   local variable or parameter.  In that case, expand_expr
  	   does not fill our suggested target.  */
  	emit_block_move (arg->stack, arg->value, ARGS_SIZE_RTX (arg->size),
! 			 TYPE_ALIGN (TREE_TYPE (pval)));
  
        /* Now, if this value wanted to be partly in registers,
  	 move the value from the stack to the registers
--- 4285,4291 ----
  	   local variable or parameter.  In that case, expand_expr
  	   does not fill our suggested target.  */
  	emit_block_move (arg->stack, arg->value, ARGS_SIZE_RTX (arg->size),
! 			 TYPE_ALIGN (TREE_TYPE (pval)) / BITS_PER_UNIT);
  
        /* Now, if this value wanted to be partly in registers,
  	 move the value from the stack to the registers

Rob
-- 
UUCP:   ...!mcvax!ukc!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv@uk.ac.warwick             ARPA:   cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
Technical Details
Message-ID: <57@titania.warwick.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!labrea!eos!ames!amdahl!uunet!axion!ist!icdoc!ukc!warwick!cudcv

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!labrea!eos!ames!amdahl!uunet!axion!ist!icdoc!ukc!warwick!cudcv
From: cudcv@warwick.ac.uk (Rob McMahon)
Newsgroups: gnu.gcc.bug
Subject: store_one_arg gives wrong alignment to emit_block_move
Message-ID: <57@titania.warwick.ac.uk>
Date: 28 Sep 88 19:25:00 GMT
Reply-To: cudcv@warwick.ac.uk (Rob McMahon)
Organization: Computing Services, Warwick University, UK
Lines: 37