This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Fix sign-extension of bignums


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


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