Commit Graph

78 Commits

Author SHA1 Message Date
Jeff Law
307d19feb1 tree-vrp.c (extract_range_from_assert): Refine the result range if the variable referenced by the ASSERT_EXPR has a...
* tree-vrp.c (extract_range_from_assert): Refine the result range
	if the variable referenced by the ASSERT_EXPR has a range and
	either the tentative result range or the previous range is a 
	VR_ANTI_RANGE.

	* gcc.dg/tree-ssa/vrp25.c: New test.

From-SVN: r109968
2006-01-19 09:30:59 -07:00
Jeff Law
f9fe7aed71 tree-vrp.c (test_for_singularity): Correct test for new min limit.
* tree-vrp.c (test_for_singularity): Correct test for new
	min limit.  Use operand_equal_p rather than pointer equality
	for testing if new min/max values are equal.

	* tree-ssa-propagate.c (substitute_and_fold): Delay simplifications
	using range information until after propagation and folding.

	* gcc.c-torture/execute/930529-1.x: Use -fwrapv as test depends
	on wrapping on overflow semantics.

	* gcc.dg/tree-ssa/pr23109.c: Remove the .lim file too.

	* gcc.gc/tree-ssa/vrp23.c: New test.
	* gcc.gc/tree-ssa/vrp24.c: New test.

From-SVN: r109904
2006-01-18 12:47:16 -07:00
Eric Botcazou
cd6e7e7d59 tree-vrp.c (extract_range_from_binary_expr): Cope with vrp_int_const_binop returning non-constant nodes.
* tree-vrp.c (extract_range_from_binary_expr): Cope with
	vrp_int_const_binop returning non-constant nodes.

From-SVN: r109754
2006-01-16 16:53:48 +00:00
Kazu Hirata
9b61327b89 re PR tree-optimization/25485 (VRP misses an "if" with TRUTH_AND_EXPR statement that could be optimized away)
gcc/
	PR tree-optimization/25485
	* tree-vrp.c (extract_range_from_binary_expr): Handle cases
	where one of the operands of TRUTH_AND_EXPR and TRUTH_OR_EXPR
	is known to be false and true, respectively.

gcc/testsuite/
	PR tree-optimization/25485
	* gcc.dg/tree-ssa/pr25485.c: New.

From-SVN: r109704
2006-01-14 15:42:11 +00:00
Jeff Law
736432eedb tree-cfg.c (bsi_replace): Rename final argument from PRESERVE_EH_INFO to UPDATE_EH_INFO.
* tree-cfg.c (bsi_replace): Rename final argument from
	PRESERVE_EH_INFO to UPDATE_EH_INFO.  Fix typo in last
	change (stmt -> orig_stmt).
	* tree-eh.c (verify_eh_throw_stmt_node): New function.
	(bsi_remove): Add new argument.  Remove EH information
	if requested.
	(verify_eh_throw_table_statements): New function.
	(bsi_remove): Add new argument REMOVE_EH_INFO.  All callers
	updated.
	* tree-optimize.c (execute_free_cfg_annotations): Verify
	the EH throw statement table after removing annotations.
	* except.h (verify_eh_throw_table_statements): Prototype.
	* tree-flow.h (bsi_remove): Update prototype.
	* tree-vrp.c (remove_range_assertions): Add new argument to
	bsi_remove call.
	* tree-ssa-loop-im.c (move_computations_stmt): Likewise.
	* tree-complex.c (expand_complex_div_wide): Likewise.
	* tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges): Likewise
	* tree-tailcall.c (eliminate_tailcall): Likewise.
	* tree-ssa-dse.c (dse_optimize_stmt): Likewise.
	* tree-ssa-loop-ivopts.c (remove_statement): Likewise.
	* tree-nrv.c (tree_nrv): Likewise.
	* tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Likewise.
	* tree-if-conv.c (tree_if_convert_cond_expr): Likewise.
	(combine_blocks): Likewise.
	* tree-ssa-phiopt.c (replace_phi_edge_with_variable): Likewise.
	* tree-cfgcleanup.c (cleanup_ctrl_expr_graph): Likewise.
	(cleanup_control_flow): Likewise.
	(remove_forwarder_block): Likewise.
	* tree-ssa-pre.c (remove_dead_inserted_code): Likewise.
	* tree-sra.c (sra_replace): Likewise.
	* tree-ssa-forwprop.c (forward_propagate_into_cond): Likewise.
	(forward_propagate_single_use_vars): Likewise.
	* tree-ssa-dce.c (remove_dead_stmt): Likewise.
	* tree-inline.c (expand_call_inline): Likewise.
	* tree-vect-transform.c (vect_transform_loop): Likewise.
	* tree-outof-ssa.c (rewrite_trees): Likewise.
	* tree-cfg.c (make_goto_expr_edges): Likewise.
	(cleanup_dead_labels): Likewise.
	(tree_merge_blocks, remove_bb, disband_implicit_edges): Likewise.
	(bsi_move_before, bsi_move_after): Likewise.
	(bsi_move_to_bb_end, try_redirect_by_replacing_jump): Likewise
	(tree_redirect_edge_and_branch, tree_split_block): Likewise.

From-SVN: r109421
2006-01-06 10:50:26 -07:00
Kazu Hirata
dec2f8810b tree-vrp.c (extract_range_from_binary_expr): Use build_int_cst instead of fold_convert.
* tree-vrp.c (extract_range_from_binary_expr): Use
	build_int_cst instead of fold_convert.

From-SVN: r109078
2005-12-27 08:16:12 +00:00
Kazu Hirata
4e2d94a917 tree-vrp.c (extract_range_from_binary_expr): Clean up uses of vr0.type.
* tree-vrp.c (extract_range_from_binary_expr): Clean up uses
	of vr0.type.

From-SVN: r108935
2005-12-22 01:16:57 +00:00
Kazu Hirata
29c8f8c27b re PR tree-optimization/25382 (VRP does not get a range from BIT_AND_EXPR if the second operand is constant)
gcc/
	PR tree-optimization/25382.
	* tree-vrp.c (extract_range_from_binary_expr): Extract a range
	from BIT_AND_EXPR.

gcc/testsuite/
	PR tree-optimization/25382.
	* gcc.dg/tree-ssa/pr25382.c: New.

From-SVN: r108898
2005-12-21 05:58:02 +00:00
Richard Guenther
0d45140575 tree-vrp.c (build_assert_expr_for, [...]): Use buildN instead of build.
2005-12-02  Richard Guenther  <rguenther@suse.de>

	* tree-vrp.c (build_assert_expr_for, process_assert_insertions_for,
	simplify_cond_using_ranges): Use buildN instead of build.
	* tree-tailcall.c (adjust_accumulator_values,
	adjust_return_value): Likewise.
	* tree-sra.c (generate_one_element_ref, generate_copy_inout,
	generate_element_copy, generate_element_zero,
	generate_one_element_init): Likewise.
	* tree-ssa-forwprop.c (forward_propagate_into_cond_1): Likewise.
	* lambda-code.c (gcc_loop_to_lambda_loop, lbv_to_gcc_expression,
	lle_to_gcc_expression, lambda_loopnest_to_gcc_loopnest,
	perfect_nestify): Likewise.

From-SVN: r107894
2005-12-02 14:40:40 +00:00
Roger Sayle
87f2a9f57b tree.h (TREE_OVERFLOW): Make this flag/predicate specific to constant nodes, i.e.
* tree.h (TREE_OVERFLOW): Make this flag/predicate specific to
	constant nodes, i.e. INTEGER_CST, REAL_CST, etc...
	* tree-vrp.c (compare_values): Only check TREE_OVERFLOW for
	integer constant comparisons.

ada/
	* utils.c (max_size): Only test for TREE_OVERFLOW on INTEGER_CST
	nodes.

From-SVN: r107870
2005-12-02 04:40:05 +00:00
James A. Morrison
7ab1122a47 tree-vrp.c (compare_ranges): Return false for EQ_EXPR if VR0 is less than VR1 or vice-versa.
2005-11-19  James A. Morrison  <phython@gcc.gnu.org>

        * tree-vrp.c (compare_ranges): Return false for EQ_EXPR if VR0 is less
        than VR1 or vice-versa.

From-SVN: r107243
2005-11-20 05:33:00 +00:00
Diego Novillo
8c5285e1cb re PR tree-optimization/24840 (ICE process_assert_insertions_for, at tree-vrp.c:2807)
PR 24840
	* tree-vrp.c (infer_value_range): Return false if STMT is a
	block terminator and its basic block has no successors.

testsuite/

	PR 24840
	* gcc.dg/tree-ssa/pr24840.c: New test.

From-SVN: r106930
2005-11-14 21:59:03 -05:00
Diego Novillo
da11c5d226 re PR c++/23046 (ICE in set_value_range, at tree-vrp.c:191)
2005-11-08  James A. Morrison  <phython@gcc.gnu.org>
	    Diego Novillo  <dnovillo@redhat.com>

	PR 23046
	* tree-vrp.c (register_edge_assert_for): Do not register
	always-false predicates.

testsuite/

	PR 23046
	* g++.dg/tree-ssa/pr23046.C: New test.

From-SVN: r106656
2005-11-08 16:09:51 -05:00
Diego Novillo
db3d5328dd re PR tree-optimization/24670 (VRP ICE in compare_name_with_value)
PR 24670
	* tree-vrp.c (fix_equivalence_set): New.
	(extract_range_from_assert): Call it.


testsuite/

	PR 24670
	* gcc.dg/tree-ssa/pr24670.c: New test.

From-SVN: r106562
2005-11-06 09:51:16 -05:00
Kazu Hirata
c83eecadfd c-typeck.c, [...]: Fix comment typos.
* c-typeck.c, config/i386/netware.h, config/m32c/cond.md,
	config/ms1/ms1.h, config/rs6000/predicates.md,
	config/s390/s390.c, params.def, postreload-gcse.c,
	tree-flow-inline.h, tree-ssa-operands.c, tree-vectorizer.c,
	tree-vrp.c, tree.c: Fix comment typos.
	* doc/invoke.texi: Fix typos.

From-SVN: r106532
2005-11-05 20:24:18 +00:00
Diego Novillo
2d33a2effd re PR tree-optimization/23141 (ACATS FAIL c45651a fixed point wrong code)
PR 23141
	PR 23142
	* tree-vrp.c (vrp_meet): Fix the intersection of equivalence
	sets VR0->EQUIV and VR1->EQUIV when meeting a range and an
	anti-range.
	(vrp_visit_phi_node): Only prevent infinite iterations when
	the previous result and the new result are both VR_RANGEs.

From-SVN: r105436
2005-10-15 10:30:36 -04:00
Diego Novillo
012a7a7817 re PR tree-optimization/23445 (ICE with -O1 -ftree-vrp -fdelete-null-pointer-checks)
PR 23445
	* tree-vrp.c (extract_range_from_assert): If the new numeric
	range created out of the assertion contradicts the existing
	numeric range of the ASSERT_EXPR variable, make the new range
	varying.

testsuite/
	PR 23445
	* gcc.c-torture/compile/pr23445.c: New test.

From-SVN: r104936
2005-10-03 23:02:19 -04:00
Diego Novillo
b19bb8b044 re PR tree-optimization/24142 (VRP miscompiles unzip inflate.c)
PR 24142
	* tree-vrp.c (vrp_meet): Fix call to range_includes_zero_p in
	case of anti-ranges.

testsuite/

	PR 24142
	* gcc.c-torture/execute/pr24142.c: New test.

From-SVN: r104874
2005-10-02 16:15:55 -04:00
Diego Novillo
c83033e76c tree-vrp.c (value_inside_range, [...]): Add FIXME note regarding quirky semantics.
* tree-vrp.c (value_inside_range, range_includes_zero_p): Add
	FIXME note regarding quirky semantics.

From-SVN: r104860
2005-10-01 10:01:10 -04:00
Diego Novillo
e82d7e604b re PR tree-optimization/24141 (VRP ICE in compare_name_with_value, at tree-vrp.c:2965)
PR 24141
	* tree-vrp.c (vrp_meet): Clear VR0->EQUIV when building a
	non-null range as a last resort.

testsuite/

	PR 24141
	* gcc.c-torture/execute/pr24141.c: New test.

From-SVN: r104859
2005-10-01 10:00:09 -04:00
James A. Morrison
fde5c44c5c re PR tree-optimization/23604 (wrong code due to VRP)
PR 23604
	* tree-vrp.c (extract_range_from_assert): For !=
	assertions, only build an anti-range if LIMIT is a
	single-valued range.

testsuite/

	PR 23604
	* gcc.c-torture/execute/pr23604.c: New test.

Co-Authored-By: Diego Novillo <dnovillo@redhat.com>

From-SVN: r104858
2005-10-01 09:57:29 -04:00
Richard Guenther
f7acf1c26d ipa-pure-const.c (static_execute): Free auxiliar information.
2005-09-16  Richard Guenther  <rguenther@suse.de>

	* ipa-pure-const.c (static_execute): Free auxiliar information.
	* ipa-type-escape.c (discover_unique_type): Free temporary key.
	* tree-vrp.c (remove_range_assertions): Free blocks_visited sbitmap.

From-SVN: r104341
2005-09-16 07:54:03 +00:00
Michael Matz
fca59ed2c9 * tree-vrp.c (vrp_int_const_binop <MINUS_EXPR>): Handle 0 - -INF.
From-SVN: r104298
2005-09-15 05:03:01 +00:00
Eric Botcazou
5c9186cec3 tree-vrp.c (extract_range_from_unary_expr): Do not set the range for the result of a conversion if...
* tree-vrp.c (extract_range_from_unary_expr): Do not set the range for
	the result of a conversion if the new min and max cannot be compared.

From-SVN: r104036
2005-09-08 16:37:20 +00:00
Andrew Pinski
0c924d5c66 tree-vrp.c (extract_range_from_expr): Move the check for non nullness after the check for gimple invariant.
2005-09-08  Andrew Pinski  <pinskia@physics.uc.edu>

        * tree-vrp.c (extract_range_from_expr): Move the check for non
        nullness after the check for gimple invariant.

From-SVN: r104002
2005-09-07 13:35:19 -07:00
Andrew Pinski
87e71ff43b tree-vrp.c: Remove obsolete comment in front of vrp_initialize.
2005-08-28  Andrew Pinski  <pinskia@physics.uc.edu>

        * tree-vrp.c: Remove obsolete comment in front of vrp_initialize.

From-SVN: r103584
2005-08-28 14:08:28 -07:00
Sebastian Pop
d77704579c re PR tree-optimization/22236 (wrong code for casts and scev)
PR tree-optimization/22236
	* tree-cfg.c (print_pred_bbs, print_succ_bbs): Correctly print
	successors and predecessors.
	* tree-chrec.c (chrec_convert): Before converting, check that
	sequences don't wrap.
	* tree-data-ref.c (compute_estimated_nb_iterations): Moved ...
	(analyze_array): Extern.
	(find_data_references_in_loop): Remove call to
	compute_estimated_nb_iterations.
	* tree-data-ref.h (analyze_array): Declared.
	* tree-flow-inline.h (single_ssa_tree_operand, single_ssa_use_operand,
	single_ssa_def_operand, zero_ssa_operands): Fix documentation.
	* tree-flow.h (scev_probably_wraps_p): Declare with an extra parameter.
	* tree-scalar-evolution.c (instantiate_parameters_1): Factor entry
	condition.
	* tree-ssa-loop-ivcanon.c: Fix documentation.
	* tree-ssa-loop-ivopts.c (idx_find_step): Add a fixme note.
	* tree-ssa-loop-niter.c (compute_estimated_nb_iterations): ... here.
	(infer_loop_bounds_from_undefined): New.
	(estimate_numbers_of_iterations_loop): Use
	infer_loop_bounds_from_undefined.
	(used_in_pointer_arithmetic_p): New.
	(scev_probably_wraps_p): Pass an extra parameter.  Call
	used_in_pointer_arithmetic_p.  Check that AT_STMT is not null.
	(convert_step): Fix documentation.
	* tree-vrp.c (adjust_range_with_scev): Call instantiate_parameters.
	Use initial_condition_in_loop_num and evolution_part_in_loop_num
	instead of CHREC_LEFT and CHREC_RIGHT.  Adjust the call to
	scev_probably_wraps_p.

From-SVN: r103055
2005-08-13 17:28:43 +00:00
James A. Morrison
a5ad726923 tree-vrp.c (simplify_div_or_mod_using_range): Use build2.
2005-08-07  James A. Morrison  <phython@gcc.gnu.org>

        * tree-vrp.c (simplify_div_or_mod_using_range): Use build2.
        (test_for_singularity): Use fold_build2.

From-SVN: r102844
2005-08-08 04:43:23 +00:00
Kazu Hirata
a4d0554781 Makefile.in, [...]: Fix comment/doc typos.
* Makefile.in, cfgexpand.c, cfgloop.h, cfgloopmanip.c,
	config.gcc, ipa-cp.c, ipa-prop.c, ipa-prop.h, reg-stack.c,
	tree-ssa-structalias.c, tree-vrp.c, value-prof.c, vec.h,
	config/linux.h, config/alpha/alpha.h, config/alpha/linux.h,
	config/alpha/predicates.md, config/arc/arc.h,
	config/arm/arm.h, config/arm/ieee754-df.S,
	config/arm/ieee754-sf.S, config/bfin/bfin.c,
	config/bfin/bfin.h, config/c4x/c4x.h, config/crx/crx.c,
	config/fr30/fr30.h, config/frv/frv.h, config/h8300/h8300.h,
	config/i386/i386.h, config/ia64/ia64.c, config/ia64/ia64.h,
	config/m68hc11/m68hc11.h, config/mips/mips.c,
	config/mips/mips.h, config/mips/openbsd.h,
	config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.h,
	config/pdp11/pdp11.h, config/rs6000/linux-unwind.h,
	config/rs6000/rs6000.c, config/rs6000/rs6000.h,
	config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
	config/sparc/linux.h, config/sparc/linux64.h,
	config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h,
	doc/extend.texi, doc/gcov.texi, doc/install.texi,
	doc/invoke.texi, doc/rtl.texi, doc/tm.texi: Fix comment/doc
	typos.  Follow spelling conventions.

From-SVN: r102809
2005-08-06 13:26:35 +00:00
James A. Morrison
b17775aba4 re PR tree-optimization/23128 (VRP fails for unsigned values)
2005-08-05  James A. Morrison  <phython@gcc.gnu.org>

        PR tree-optimization/23128
        * tree-vrp.c (vrp_int_const_binop): Check if unsigned addition or
        subtraction wrap, and set TREE_OVERFLOW if they do.

From-SVN: r102800
2005-08-06 05:35:31 +00:00
James A. Morrison
08303d5bb4 re PR tree-optimization/23129 (VRP propagates division of antiranges incorrectly)
2005-08-02  James A. Morrison  <phython@gcc.gnu.org>

        PR tree-optimization/23129
        * tree-vrp.c (extract_range_from_binary_expr): Set value range to
        varying for divisions with anti-ranges.

From-SVN: r102653
2005-08-02 05:08:40 +00:00
James A. Morrison
d2f3ffba9a tree-vrp.c (compare_range_with_value): Return true or false for ~[VAL_1...
2005-07-29  James A. Morrison  <phython@gcc.gnu.org>

        * tree-vrp.c (compare_range_with_value): Return true or false
        for ~[VAL_1, VAL_2] OP VAL if VAL_1 <= VAL <= VAL_2 for NE_EXPR and
        EQ_EXPR respectively.

From-SVN: r102558
2005-07-29 15:22:07 +00:00
Volker Reichelt
206048bd41 builtins.c: Fix comment typo(s).
* builtins.c: Fix comment typo(s).
	* genautomata.c: Likewise.
	* gimplify.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.

From-SVN: r102491
2005-07-28 16:30:00 +00:00
Jeff Law
d579f20bb1 tree-vrp.c (test_for_singularity): Extracted from ...
* tree-vrp.c (test_for_singularity): Extracted from  ...
        (simplify_cond_using_ranges): Attempt to simplify a relational
        test to NE_EXPR.  Dump information when a COND_EXPR is simplified.

        * gcc.dg/tree-ssa/vrp17.c: Update expected output.
        * gcc.dg/tree-ssa/vrp18.c: New test.

From-SVN: r102489
2005-07-28 10:12:03 -06:00
James A. Morrison
ff08cbee5d re PR tree-optimization/22493 (with -fwrapv -INT_MIN is still not positive)
2005-07-27  James A. Morrison  <phython@gcc.gnu.org>

        PR tree-optimization/22493
        * tree-vrp.c (extract_range_from_unary_expr): Deal with -fwrapv and
        VR_ANTI_RANGEs properly for NEGATE_EXPRs and ABS_EXPRs.

From-SVN: r102458
2005-07-28 04:35:01 +00:00
Jeff Law
880031e1f9 tree-vrp.c (vrp_meet): Intersect the equivalency sets when meeting a VR_ANTI_RANGE with a VR_RANGE.
* tree-vrp.c (vrp_meet): Intersect the equivalency sets when
        meeting a VR_ANTI_RANGE with a VR_RANGE.  When intersecting
        equivalency sets, correctly handle the case were vr0 has an
        equivalency set, but vr1 does not.

        * gcc.c-torture/execute/pr22630.c: New test.

From-SVN: r102432
2005-07-27 10:21:48 -06:00
James A. Morrison
4db8040cd4 tree.h (tree_expr_nonzero_p): Export.
2005-07-20  James A. Morrison  <phython@gcc.gnu.org>

        * tree.h (tree_expr_nonzero_p): Export.
        * fold-const.c (tree_expr_nonzero_p): Likewise.
        Return true for CALL_EXPRs that are alloca calls.
        (fold_binary): Use omit_one_operand when checking EQ_EXPRs or NE_EXPRs
        against zero.
        * tree-flow.h (expr_computes_nonzero): Remove.
        * tree-vrp.c (expr_computes_nonzero): Remove.
        (vrp_expr_computes_nonzero): Use tree_expr_nonzero_p.
        (extract_range_from_unary_expr): Likewise.
        * tree-ssa-dom.c (record_equivalences_from_stmt): Use
        tree_expr_nonzero_p.

From-SVN: r102201
2005-07-20 20:26:11 +00:00
Steven Bosscher
3c341936db re PR tree-optimization/22230 (value range propagation error)
PR tree-optimization/22230

gcc/
	* tree-vrp.c (extract_range_from_binary_expr): Fix logics thinko in
	the computation of the four cross productions for "range op range".

testsuite/
	* gcc.dg/tree-ssa/pr22230.c: New test.

From-SVN: r102038
2005-07-14 22:54:42 +00:00
Jan Hubicka
df1f6f31f4 tree-dfa.c (dump_variable): Use default_def function.
* tree-dfa.c (dump_variable): Use default_def function.
	* tree-ssa-alias.c (dump_points_to_info): Likewise.
	* tree-ssa.c (verify_use): Likewise.
	* tree-ssanames.c (release_ssa_name): Likewise.
	* tree-tailcall.c (eliminate_tail_call): Likewise.
	(tree_optimize_tail_calls_1): Likewise.
	* tree-vrp.c (get_value_range): Likewise.

From-SVN: r101994
2005-07-13 22:35:29 +00:00
Daniel Berlin
820cc88fbd Makefile.in (TREE_H): Add treestruct.def.
2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* Makefile.in (TREE_H): Add treestruct.def.
	(c-decl.o): Add pointer-set.h
	* c-decl.c (diagnose_mismatched_decls): Don't attempt to look at
	visibility on regular DECL's.
	(merge_decls): Fix the copying of decl nodes of various types for
	the new structures.  Don't update RTL, section name, weak status,
	etc, on DECL's without RTL.
	(grokdeclarator): DECL_ARG_TYPE_AS_WRITTEN is gone.
	Don't check volatile on non-variable types.
	(store_parm_decls_oldstyle): Use pointer_set instead of DECL_WEAK
	to check whether we have seen arguments.
	* c-objc-common.c (c_tree_printer): Reverse order of tests so that
	flag is checked before field (flag is common, field is not).
	* dwarf2out.c (decl_ultimate_origin):  Only DECL's with
	TS_DECL_COMMON could have an origin.
	(add_location_or_const_value_attribute): Don't check section name
	on non-var/function decls.
	(dwarf2out_var_location): Reverse order of tests.
	* emit-rtl.c (set_reg_attrs_for_parm): DECL_CHECK is dead, replace
	with DECL_WRTL_CHECK.
	* expmed.c (make_tree): rtl is now in decl_with_rtl.
	* fold-const.c (fold_binary): Don't check weakness on
	non-var/function decls.
	(tree_expr_nonzero_p): Ditto.
	(fold_checksum_tree): Use tree_decl_extra as sizeof
	buffer.
	* ggc-page.c (extra_order_size_table): Add sizes for
	tree_decl_non_common, tree_parm_decl,  tree_var_decl, and
	tree_field_decl.
	* gimplify.c (gimplify_bind_expr): Only set
	DECL_SEEN_IN_BIND_EXPR_P on VAR_DECL.
	* integrate.c (copy_decl_for_inlining): Don't set RTL on decl's
	without RTL.
	* langhooks-def.h (LANG_HOOK_INIT_TS): New.
	* langhooks.h (init_ts). New langhook.
	* passes.c (rest_of_decl_compilation): Reverse order of tests.
	* print-tree.c (print_node): Update to only print fields that
	exist in the structures the passed decl has.
	* toplev.c (wrapup_global_declarations): Don't reset
	DECL_DEFER_OUTPUT on DECL's that don't contain it.
	* tree-browser.c (browse_tree): DECL_ARG_TYPE_AS_WRITTEN removed.
	* tree-inline.c (remap_decl): Ditto.
	* tree-outof-ssa.c (create_temp): Reverse order of tests.
	* tree-pretty-print.c (print_declaration): Don't print
	DECL_REGISTER on things that don't contain it.
	* tree-vrp.c (expr_computes_nonzero): Don't check weakness on
	non-var/function decls.
	* tree.c (tree_contains_struct): New structure.
	(init_priority_for_decl): New hashtable.
	(tree_int_map): New structure.
	(tree_int_map_eq): New function.
	(tree_int_map_marked_p): Ditto.
	(tree_int_map_hash): Ditto.
	(tree_map): Move to tree.h.
	(tree_map_eq): Externalize.
	(tree_map_hash): Ditto.
	(tree_map_marked_p): Ditto.
	(init_ttree): Set up tree_contains_struct and call langhook.
	(decl_assembler_name): Use DECL_NON_COMMON_CHECK..
	(tree_code_size): Update for new structures.
	(tree_node_structure): Update for new structures.
	(make_node_stat): Don't try to set DECL_IN_SYSTEM_HEADER on decls
	without the field.
	(copy_node_stat):  Copy init priority.
	(build_decl_stat): Ditto for visibility.
	(ts_enum_names): New.
	(tree_contains_struct_check_failed): New function.
	(decl_init_priority_lookup): Ditto.
	(decl_init_priority_insert): Ditto.
	* treestruct.def: New file.
	* tree.h (CODE_CONTAINS_STRUCT): New macro.
	(CONTAINS_STRUCT_CHECK): Ditto.
	(tree_contains_struct_check_failed): New prototype.
	(DECL_CHECK): Removed.
	(DECL_MINIMAL_CHECK): New.
	(DECL_COMMON_CHECK): Ditto.
	(DECL_WRTL_CHECK): Ditto.
	(DECL_NON_COMMON_CHECK): Ditto.
	(DECL_WITH_VIS_CHECK): Ditto.
	(VAR_OR_FUNCTION_DECL_P): Ditto
	(struct tree_decl_minimal): New structure.
	(struct tree_decl_common): Ditto.
	(struct tree_decl_with_rtl): Ditto.
	(struct tree_decl_with_vis): Ditto.
	(struct tree_decl_non_common): Ditto.
	(struct tree_field_decl): Ditto.
	(struct tree_parm_decl): Ditto.
	(struct tree_var_decl): Ditto.
	(struct tree_function_decl): Ditto.
	(struct tree_const_decl): Ditto.
	(struct tree_result_decl): Ditto.
	(union tree_node): Add new structures.
	* var-tracking.c (track_expr_p): Reverse order of tests.

	* doc/c-tree.texi: Add documentation on DECL node internal structure.


2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* utils.c (create_param_decl): DECL_ARG_TYPE_AS_WRITTEN is
	removed.

2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* Make-lang.in: Add gt-cp-lang.h.
	(cp-lang.o): Ditto.
	* class.c (create_vtable_ptr): Stop setting DECL_ASSEMBLER_NAME on
	the field.
	* config-lang.in: Add cp-lang.c to gtfiles.
	* cp-lang.c: Include hashtab.h.
	(cp_init_ts): New function.
	(LANG_HOOK_INIT_TS): Use macro.
	(decl_shadowed_for_var_lookup): New function.
	(decl_shadowed_for_var_insert): Ditto.
	* cp-tree.h (THUNK_FUNCTION_CHECK): Use decl_common.
	(NON_THUNK_FUNCTION_CHECK): Ditto.
	(DECL_NAMESPACE_ASSOCIATIONS): Use decl_non_common.
	(DECL_INIT_PRIORITY): Ditto.
	(DECL_HAS_SHADOWED_FOR_VAR_P): Ditto.
	(DECL_SHADOWED_FOR_VAR): Use hashtable.
	(SET_DECL_SHADOWED_FOR_VAR): Ditto.
	* decl.c (duplicate_decls): Update for new/updated structures.
	(poplevel): Use SET_DECL_SHADOWED_FOR_VAR.
	* decl2.c (start_static_initialization_or_destruction): Deal with
	priority.
	* pt.c (tsubst_decl): Check TS_DECL_WRTL before doing
	SET_DECL_RTL.
	* tree.c (handle_init_priority_attribute): Handle priority.

2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* objc-act.c (objc_push_parm): DECL_ARG_TYPE_AS_WRITTEN is
	removed.
	* objc-act.h (KEYWORD_ARG_NAME): Use decl_non_common.
	(KEYWORD_KEY_NAME): Use decl_minimal.
	(METHOD_SEL_NAME): Ditto..
	(METHOD_SEL_ARGS): Use decl_non_common.
	(METHOD_ADD_ARGS): Ditto.
	(METHOD_ADD_ARGS_ELLIPSIS_P): Use decl_common.
	(METHOD_DEFINITION): Ditto.
	(METHOD_ENCODING): Ditto.
	* objc-lang.c: (objc_init_ts): New function.

2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* trans-decl.c (create_function_arglist): DECL_ARG_TYPE_AS_WRITTEN
	is removed.

From-SVN: r101799
2005-07-08 23:37:11 +00:00
Jeff Law
1a5577239f tree-vrp.c (simplify_using_ranges): Kill.
* tree-vrp.c (simplify_using_ranges): Kill.
        (vrp_finalize): Remove call to simplify_using_ranges.
        (simplify_stmt_using_ranges): New function extracted from
        simplify_using_ranges.
        (simplify_div_or_mod_using_ranges): Likewise.
        (simplify_abs_using_ranges): Likewise.
        (simplify_cond_using_ranges): New function.
        * tree-flow.h (simplify_stmt_using_ranges): Prototype.
        * tree-ssa-propagate.c (substitute_and_fold): Call
        simplify_stmt_using_ranges if we have range information.

        * gcc.dg/tree-ssa/vrp17.c: New test.

From-SVN: r101685
2005-07-06 23:40:49 -06:00
Kazu Hirata
184afc230f tree-vrp.c (extract_range_from_assert): Replace fold (build (...)) with fold_build2.
* tree-vrp.c (extract_range_from_assert): Replace
	fold (build (...)) with fold_build2.

From-SVN: r101554
2005-07-03 15:06:00 +00:00
Kazu Hirata
567fb6602c re PR tree-optimization/22026 (ACATS FAIL C45331A fixed point wrong code (VRP related))
gcc/
	PR tree-optimization/22026
	* tree-vrp.c (extract_range_from_binary_expr): Drop to
	VR_VARYING if a binary expression involving VR_ANTI_RANGE is
	PLUS_EXPR, MINUS_EXPR, or unsigned MULT_EXPR.

testsuite/
	PR tree-optimization/22026
	* gcc.dg/tree-ssa/pr22026.c: New.

From-SVN: r101328
2005-06-26 03:49:20 +00:00
Kelley Cook
366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Jeff Law
9490876243 tree-optimize.c (init_tree_optimization_passes): Move copy prop pass to run just before VRP.
* tree-optimize.c (init_tree_optimization_passes): Move
        copy prop pass to run just before VRP.
        * tree-vrp.c (remove_range_assertions): Remove copies created
        by ASSERT_EXPR removal.

        * gcc.dg/tree-ssa/vrp16.c: New test.

From-SVN: r101277
2005-06-23 16:00:44 -06:00
Kazu Hirata
e57f2b4144 re PR tree-optimization/22117 (VRP thinks <ptr type> + <ptr type> is always nonnull.)
gcc/
	PR tree-optimization/22117
	* tree-vrp.c (extract_range_from_binary_expr): Compute a
	correct range when adding two pointers.

testsuite/
	PR tree-optimization/22117
	* gcc.dg/tree-ssa/pr22117.c: New.

From-SVN: r101272
2005-06-23 16:04:09 +00:00
Jeff Law
2735e93e53 tree-vrp.c (extract_range_from_unary_expr): Handle type conversions better.
* tree-vrp.c (extract_range_from_unary_expr): Handle type
        conversions better.

        * gcc.dg/tree-ssa/vrp15.c: New test.

From-SVN: r101232
2005-06-21 12:46:33 -06:00
Roger Sayle
09b2f9e8c9 fold-const.c (swap_tree_comparison): Add support for unordered floating point comparisons.
* fold-const.c (swap_tree_comparison): Add support for unordered
	floating point comparisons.
	* tree-vrp.c (opposite_comparison): Delete.
	(extract_range_from_assert): Replace calls to opposite_comparison
	with calls to swap_tree_comparison.
	(register_edge_assert_for): Likewise.
	(vrp_evaluate_conditional): Likewise.

From-SVN: r101201
2005-06-20 02:33:52 +00:00
Eric Botcazou
0d22e81f86 re PR tree-optimization/22018 (VRP miscompiles multiply)
PR tree-optimization/22018
	* tree-vrp.c (vrp_int_const_binop): Overhaul handling of overflow.

From-SVN: r101097
2005-06-16 21:25:00 +00:00
Diego Novillo
38e19e4c73 tree-vrp.c (vrp_int_const_binop): Do not handle MAX_EXPR when the result overflows.
* tree-vrp.c (vrp_int_const_binop): Do not handle MAX_EXPR
	when the result overflows.

From-SVN: r100983
2005-06-15 11:19:51 -04:00