PATCH: Fix sign-extension of bignums

Mark Mitchell mark@codesourcery.com
Wed Aug 11 03:08:00 GMT 2004


Ian Lance Taylor wrote:

>Ian Lance Taylor <ian@wasabisystems.com> writes:
>
>  
>
>>The real problem is that we've already applied the negation, and the
>>result has overflowed so that it appears to be a positive number.
>>    
>>
You're right, I got myself badly confused.  I don't understand what that 
code I was changing is doing, but I didn't have the right fix.

>Another fix might be to not resolve constant expressions as we go, and
>instead resolve them using the desired size, although that would tend
>to slow down the assembler.
>
>Neither of these sound quite right, somehow.
>  
>
Why can't we just unconditionally sign-extend the value in emit_expr, if 
X_unsigned is false?

It would seem to me that if that doesn't work, the problem is that 
something is not setting X_unsigned correctly when it should, which is 
possible, but could be fixed.

-- 
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com



More information about the Binutils mailing list