[patch] Preserve source location in folder

Eric Botcazou ebotcazou@adacore.com
Thu Mar 24 14:42:00 GMT 2011


Hi,

when fold_ternary_loc is attempting to make the tree prettier, e.g. by swapping 
the arguments of a COND_EXPR, it does:

  tem = fold_truth_not_expr (loc, arg0);

Now LOC is the location that will be put on the whole expression and there is 
no reason it should override the location of ARG0, if any, when inverting it.
The attached patch only ensures that - this gives more precise coverage info.

Bootstrapped/regtested on x86_64-suse-linux, OK for the mainline?


2011-03-24  Eric Botcazou  <ebotcazou@adacore.com>

	* fold-const.c (fold_ternary_loc): Preserve the location (if any) of
	the argument in calls to fold_truth_not_expr.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 2223 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110324/5441d5b1/attachment.bin>


More information about the Gcc-patches mailing list