[PATCH] A couple of line map fixes

Nathan Sidwell nathan@acm.org
Thu Oct 11 12:56:00 GMT 2018


I discovered a couple of line map bugs when working on streaming macro 
locations on the modules branch:

1) LINEMAPS_MACRO_LOWEST_LOCATION has an off-by-one error.  It is 
returning the lowest macro loc handed out.  MAX_SOURCE_LOCATION is the 
highest location that could be handed out.  If we've not created any 
macros, then we've not handed out MAX_SOURCE_LOCATION, and should return 
one more than that.  (The impact here is that the first macro created 
wouldn't use MAX_SOURCE_LOCATION.)

2) linemap_enter_macro allocates num_tokens * 2 locations, but only 
clears num_tokens locations.  It seems we don't always use all those 
locations, and so can have trailing garbage.

booted & tested on x86_64-linux.

Fixing thusly.

nathan

-- 
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lmap.diff
Type: text/x-patch
Size: 2224 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20181011/57bc6c60/attachment.bin>


More information about the Gcc-patches mailing list