This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

[PATCH] Fix agent expression constant sizing


A minor correction that improves bytecode efficiency slightly. Committed to trunk.

Stan

2010-03-19 Stan Shebs <stan@codesourcery.com>

* ax-general.c (ax_const_l): Fix a sizing bug.

Index: ax-general.c
===================================================================
RCS file: /cvs/src/src/gdb/ax-general.c,v
retrieving revision 1.17
diff -p -r1.17 ax-general.c
*** ax-general.c    1 Jan 2010 07:31:30 -0000    1.17
--- ax-general.c    19 Mar 2010 18:18:49 -0000
*************** ax_const_l (struct agent_expr *x, LONGES
*** 231,237 ****
      use the shortest representation.  */
   for (op = 0, size = 8; size < 64; size *= 2, op++)
     {
!       LONGEST lim = 1 << (size - 1);

       if (-lim <= l && l <= lim - 1)
         break;
--- 231,237 ----
      use the shortest representation.  */
   for (op = 0, size = 8; size < 64; size *= 2, op++)
     {
!       LONGEST lim = ((LONGEST) 1) << (size - 1);

       if (-lim <= l && l <= lim - 1)
         break;


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