On Wed, Aug 23, 2017 at 02:08:47PM -0400, David Malcolm wrote: > In r251239 I added a c_expr::get_location method for use by > c_parser_expr_list for building the vec<location_t> for > an expression list, rather than using the location of the first token. > > When determining whether to use the location within the tree node, > or fall back to the range in the c_expr, I used EXPR_CAN_HAVE_LOCATION, > rather than EXPR_HAS_LOCATION. This meant that any tree nodes of kinds > that *can* have a location but which erroneously had > EXPR_LOCATION (value) == UNKNOWN_LOCATION > had that value added to the vec<location_t>, leading to missing > location information when reporting on the issue > (seen with gcc.dg/Wtraditional-conversion-2.c for m68k). > > This patch addresses this in two ways: > > (a) it fixes the specific issue in this failing test case, by > setting up the location properly on the EXCESS_PRECISION_EXPR. > > (b) updating c_expr::get_location by only using the EXPR_LOCATION > if it's sane. It could be argued that this could be papering over > other "missing location" bugs, but if there are any, they are > pre-existing ones exposed by r251239, and I'd rather have this fix > in place than play whack-a-mole on any other such bugs that may > be lurking in the codebase. > > Successfully bootstrapped®rtested on x86_64-pc-linux-gnu; > I've verified the fix with --target=m68k-elf. > > OK for trunk?
Ok, thanks. Marek