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]
Other format: [Raw text]

Re: Fix handling of negative bitpos in expand_debug_expr


On 05/05/2016 04:20 PM, Richard Sandiford wrote:
expand_debug_expr handled negative bit positions using:

             else if (bitpos < 0)
               {
                 HOST_WIDE_INT units
                   = (-bitpos + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
                 op0 = adjust_address_nv (op0, mode1, units);
                 bitpos += units * BITS_PER_UNIT;
               }

Here "units" is the negative of the (negative) byte offset, so I think
we should be offsetting OP0 by -units instead.  E.g. a bitpos of -17
would give units==3, so this code would move OP0 up by 3 bytes and set
bitpos to 7, giving a total bitpos of 31.

gcc/
	* cfgexpand.c (expand_debug_expr): Fix address offset for negative
	bitpos.

Ok.


Bernd


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