This is the mail archive of the binutils@sourceware.org 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: Commit: Microblaze: Fix building on a 32-bit host.


On 02/01/2016 03:39 AM, Nick Clifton wrote:
Hi Guys,

   I am checking in the patch below to fix building gas for the
   microblaze target on a 32-bit host:

     tc-microblaze.c:742:21: error: integer overflow in expression [-Werror=overflow]

Cheers
   Nick

gas/ChangeLog
2016-02-01  Nick Clifton  <nickc@redhat.com>

	* config/tc-microblaze.c (parse_imm): Fix compile time warning
	message extending a negative 32-bit value into a larger signed
	value on a 32-bit host.

diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
index 01341d4..5484b30 100644
--- a/gas/config/tc-microblaze.c
+++ b/gas/config/tc-microblaze.c
@@ -737,9 +737,9 @@ parse_imm (char * s, expressionS * e, offsetT min, offsetT max)
      as_fatal (_("operand must be a constant or a label"));
    else if (e->X_op == O_constant)
      {
-      /* Special case: sign extend negative 32-bit values to 64-bits.  */
+      /* Special case: sign extend negative 32-bit values to offsetT size.  */

You mention OffsetT here

        if ((e->X_add_number >> 31) == 1)
-       e->X_add_number |= -((offsetT) 1 << 31);
+       e->X_add_number |= -((addressT) (1U << 31));

but addressT here.  Should these be the same?


        if (e->X_add_number < min || e->X_add_number > max)
         {



--
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077


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