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: dwarf2 long long patch


Richard Henderson wrote:
> 
> On Wed, Jul 04, 2001 at 08:42:13PM +0100, Nathan Sidwell wrote:
> !                          ((((unsigned HOST_WIDE_INT) 1)
> !                            << (DWARF2_ADDR_SIZE * 8 - 1)) << 1) - 1,
> 
> This is equivalent to (unsigned HOST_WIDE_INT) -1.  Otherwise ok.
Looking at the definition of DWARF2_ADDR_SIZE, that 8 should be
BITS_PER_UNIT.

I don't think your invariant holds. HOST_WIDE_INT could be 64 bits and
POINTER_SIZE (which is where DWARF2_ADDR_SIZE comes from, by default),
could be 32, for instance. 

As you'll realise, there are two shifts to
avoid the ill-defined case of shifting a HOST_WIDE_INT by the number
of bits in a host wide int -- I should stick a comment in about that.

ok with that change from 8 -> BITS_PER_UNIT + comment?

nathan

-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org


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