🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #344

Re: Possibly better bitfield patch for GCC 2.1

#344
From: Chip Salzenberg
Date: Wed, 08 Apr 1992 20:04
32 lines
1586 bytes
According to <caveh@csl.sri.com>:
>i reported a bug earlier today regarding gcc-2.[01] generating word
>instructions to access char-bitfields contained in a char for structures
>that were known to be long aligned.  i believe the following patch
>fixes the problem:

This patch is unnecessarily draconian.  Many machines don't care about
alignment.  How about this one instead:

Wed Apr  8 16:02:33 1992  Chip Salzenberg  (chip at animal)

	* stor-layout.c (get_best_mode): we may use word mode
	  for smaller objects iff STRICT_ALIGNMENT is false.

Index: stor-layout.c
*************** get_best_mode (bitsize, bitpos, align, l
*** 990,994 ****
      return VOIDmode;
  
!   if (SLOW_BYTE_ACCESS
        && ! volatilep
        && BITS_PER_WORD <= MIN (align, BIGGEST_ALIGNMENT)
--- 990,995 ----
      return VOIDmode;
  
!   if (!STRICT_ALIGNMENT
!       && SLOW_BYTE_ACCESS
        && ! volatilep
        && BITS_PER_WORD <= MIN (align, BIGGEST_ALIGNMENT)
-- 
Chip Salzenberg at Teltronics/TCT  <chip@tct.com>, <73717.366@compuserve.com>
      "Informix 4GL is not a 4G, and it's barely an L."  -- John Tombs
Technical Details
Message-ID: <m0lYisI-0006weC@tct.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!tct.COM!chip
References: <9204040656.AA16846@caesar.csl.sri.com>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!tct.COM!chip
From: chip@tct.COM (Chip Salzenberg)
Subject: Re: Possibly better bitfield patch for GCC 2.1
Message-ID: <m0lYisI-0006weC@tct.com>
Sender: gnulists@ai.mit.edu
Organization: TC Telemanagement, Clearwater, FL
References: <9204040656.AA16846@caesar.csl.sri.com>
Distribution: gnu
Date: Wed, 8 Apr 1992 20:04:00 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 33