[PATCH] Introduce int_const_binop_1, obsolete notrunc parameter of int_const_binop
Richard Guenther
richard.guenther@gmail.com
Wed Jan 10 16:04:00 GMT 2007
This is the last patch before the patch that enhances VRP to produce more
anti-ranges if possible. It introduces int_const_binop_1 split out
from int_const_binop.
int_const_binop_1 takes a result type and extra output arguments for the
components of the double-int result. It also returns the overflow status from
the individual double helpers. This allows access to overflow (and overflow
due to truncating via fit_double_type) and avoids creating a tree node in
some cases.
I also took the opportunity to obsolete the notrunc parameter of
int_const_binop,
only very few callers used it. This avoids remembering non-canonical integer
constants. A followup patch can remove the unused parameter.
The patch also prepares VRP so the next patch will get smaller.
Bootstrapped and tested on x86_64-unknown-linux-gnu, compared to
yesterday there's one acats FAIL less - but I wouldn't attribute this
to this patch.
I will apply this after Roger applied the TREE_CONSTANT_OVERFLOW patch.
Thanks,
Richard.
2007-01-10 Richard Guenther <rguenther@suse.de>
* tree.h (int_const_binop_1): Export.
* fold-const.c (int_const_binop_1): New function split
out from int_const_binop.
(int_const_binop): Use int_const_binop_1, always truncate
to type precision.
* tree-vrp.c (vrp_int_const_binop): Simplify by using
int_const_binop_1.
(extract_range_from_binary_expr): Separate MIN/MAX_EXPR
handling, merge PLUS/MINUS_EXPR handling.
* tree-ssa-ccp.c (maybe_fold_offset_to_component_ref): Do
not set notrunc for int_const_binop.
(maybe_fold_stmt_indirect): Likewise.
* tree-sra.c (instantiate_missing_elements): Likewise.
(generate_element_init_1): Likewise.
* tree-cfg.c (group_case_labels): Don't needlessly build
an integer constant tree node, use int_const_binop_1 instead.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 21653 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070110/a98d8a47/attachment.bin>
More information about the Gcc-patches
mailing list