🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6381

Bug in layout_type found

#6381
From: Martin Ohmacht
Date: Fri, 08 Dec 1995 00:00
38 lines
2047 bytes
Hello,

I found something that seems to be a (minor) bug:

===============================================================================
*** gcc-2.7.2/stor-layout.c	Wed Oct  4 00:15:07 1995
--- gcc-2.7.2/stor-layout.c.bug-free	Fri Dec  8 19:17:41 1995
*************** layout_type (type)
*** 853,859 ****
  		  != ((TREE_INT_CST_LOW (DECL_SIZE (field)) + bitpos - 1)
  		      / BITS_PER_WORD)
  		  /* But there is no problem if the field is entire words.  */
! 		  && TREE_INT_CST_LOW (DECL_SIZE (field)) % BITS_PER_WORD == 0)
  		goto record_lose;
  	    }
  
--- 853,859 ----
  		  != ((TREE_INT_CST_LOW (DECL_SIZE (field)) + bitpos - 1)
  		      / BITS_PER_WORD)
  		  /* But there is no problem if the field is entire words.  */
! 		  && TREE_INT_CST_LOW (DECL_SIZE (field)) % BITS_PER_WORD != 0)
  		goto record_lose;
  	    }
  
===============================================================================
The buggy version fails to assign an integer mode to a fullword field of 
a record but accepts a not aligned fullword. I think it was intended the
other way. I patched the gcc and it worked better.

Greetings,
Martin
______________________________________________________________________
Dipl.-Ing. Martin Ohmacht               Universitaet Hannover
                                        Laboratorium fuer
ohmacht@mst.uni-hannover.de             Informationstechnologie
fax:    +49-511-762-5051                Schneiderberg 32
phone:  +49-511-762-5039                D-30167 Hannover
______________________________________________________________________
Technical Details
Message-ID: <9512081822.AA28356@scoop.mst.uni-hannover.de_>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,a9ed879033224d28,start
X-Google-Attributes: gid113d02,public
From: ohmacht@scoop.mst.uni-hannover.de (Martin Ohmacht)
Subject: Bug in layout_type found
Date: 1995/12/08
Message-ID: <9512081822.AA28356@scoop.mst.uni-hannover.de_>
X-Deja-AN: 121283041
distribution: gnu
sender: daemon@cis.ohio-state.edu
organization: GNUs Not Usenet
newsgroups: gnu.gcc.bug