Commit Graph

165 Commits

Author SHA1 Message Date
Diego Novillo 953ff28998 [multiple changes]
2006-01-18  Richard Henderson  <rth@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* libgomp: New directory.
	* Makefile.def: Add target_module libgomp.
	* Makefile.in: Regenerate.
	* configure.in (target_libraries): Add target-libgomp.
	* configure: Regenerate.


contrib/

2006-01-18  Richard Henderson  <rth@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* gcc_update (files_and_dependencies): Add libgomp files.


gcc/

2006-01-18  Richard Henderson  <rth@redhat.com>
            Aldy Hernandez  <aldyh@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* omp-low.c: New file.
	* c-omp.c: New file.

2006-01-18  Richard Henderson  <rth@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* doc/invoke.texi: Document -fopenmp.
	* tree-dump.h (debug_function): Declare.

	* hooks.c (hook_bool_tree_bool_false): New function.
	(hook_tree_tree_null): Remove.
	(hook_tree_tree_tree_null): New.
	* hooks.h: Update to match.

	* tree-pretty-print.c (debug_tree_chain): New.
	(print_generic_expr): Handle TDF_CHAIN.
	(dump_generic_node): Handle BLOCK.
	Do not abort with incomplete SWITCH_EXPRs.
	Do not dump body of an OpenMP directive if TDF_SLIM is given.
	<case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't
	print space after directive name.
	<OMP_FOR>: Handle printing OMP_FOR_PRE_BODY.
	Handle OMP_MASTER and OMP_ORDERED.
	Handle printing of OMP_BODY just in one place, goto
	dump_omp_body in the rest of OMP_* nodes that have
	OMP_BODY.
	Don't handle clause nodes here.  Update omp statements to
	use dump_omp_clauses.
	Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION,
	OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC,
	OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF,
	GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED,
	GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE,
	GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE.
	Adjust output for GOMP_PARALLEL.
	(dump_omp_clauses): New.
	(print_declaration): Dump DECL_VALUE_EXPR.
	(op_symbol_1): Split out of op_symbol.
	(dumping_stmts): Remove.  Update all users.

	* cgraph.c (cgraph_analyze_queue): New.
	(cgraph_add_new_function): New.
	* cgraph.h (cgraph_analyze_queue): Declare.
	(cgraph_add_new_function): Declare.
	(cgraph_lower_function): Remove.

	* tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_*
	nodes.  Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS
	and TYPE_P nodes in its default clause.
	(empty_body_p): New.
	(tree_range_check_failed): New.
	(build5_stat): New.

	* tree.h (OMP_CLAUSE_REDUCTION_INIT,
	OMP_CLAUSE_REDUCTION_MERGE,
	OMP_CLAUSE_REDUCTION_PLACEHOLDER,
	OMP_CLAUSE_PRIVATE_DEBUG,
	OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY,
	OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY,
	OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND,
	OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL,
	OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR,
	OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR,
	OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT,
	OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT,
	OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC,
	OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST,
	OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE
	OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY,
	OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY,
	OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New.
	(TREE_RANGE_CHECK): New.
	(empty_body_p): Declare.
	(enum omp_clause_default_kind): New.
	(build_string_literal): Declare.
	(enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New.
	(build5_stat, build5): Declare.

	* tree-pass.h (TDF_CHAIN): Define.
	* tree-pass.h (PROP_gimple_lomp): Define.
	(pass_lower_omp): Declare.

	* diagnostic.h (debug_tree_chain): Declare.

	* builtins.c (get_builtin_sync_mode): Use 0 as last argument to
	mode_for_size.
	(expand_builtin): Handle sync BUILT_IN_*_16 builtins.
	* builtins.c (build_string_literal): Make extern.

	* gcc.c (include_spec_function): New.
	(static_spec_functions): Add it.
	(main): Move load of libgomp.spec ...
	(LINK_COMMAND_SPEC): ... here.
	(link_gomp_spec): New.
	(static_specs): Include it.
	(LINK_COMMAND_SPEC): Add link_gomp.
	(GOMP_SELF_SPECS): New.
	(driver_self_specs): Include it.
	(switch_matches): Don't mark inline.
	(main): Load libgomp.spec.

	* tree-gimple.c (is_gimple_stmt): True for OMP_MASTER,
	OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION,
	and OMP_SINGLE, OMP_FOR and OMP_PARALLEL.

	* tree-gimple.h (enum omp_parallel): Declare.
	(determine_parallel_type): Declare.
	(omp_firstprivatize_variable): Declare.
	(omp_reduction_init): Declare.
	(diagnose_omp_structured_block_errors): Declare.
	(struct walk_stmt_info): Add want_return_expr.
	(struct walk_stmt_info): Add want_bind_expr, want_locations.
	(find_omp_clause): Declare.
	(insert_field_into_struct): Declare.
	(struct walk_stmt_info): Move from tree-nested.c
	(walk_stmts): Declare.

	* c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP
	to 200505.

	* cgraphunit.c (cgraph_lower_function): Make static.
	(cgraph_finalize_pending_functions): New.
	(cgraph_finalize_function): Call it.
	(cgraph_finalize_compilation_unit): Likewise.

	* builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16,
	BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add.
	(BT_FN_UINT_UINT): New.
	(DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7,
	DEF_FUNCTION_TYPE_VAR_4): Document.
	(BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT,
	BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR,
	BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT,
	BT_FN_VOID_OMPFN_PTR_UINT_UINT,
	BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
	BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New.

	* builtins.def: Update DEF_BUILTIN comment to include COND argument.
	Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins
	into separate files.
	(DEF_GOMP_BUILTIN): New.
	(BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER,
	BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END,
	BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END,
	BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START,
	BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START,
	BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START,
	BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START,
	BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT,
	BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT,
	BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT,
	BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT,
	BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT,
	BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT,
	BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START,
	BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START,
	BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START,
	BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START,
	BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT,
	BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END,
	BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END,
	BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT,
	BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END,
	BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START,
	BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New.
	* sync-builtins.def: New file, moved from builtins.def.
	* omp-builtins.def: New file, moved from builtins.def.

	* c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine.

	* gimple-low.c (lower_function_body): Clear data.
	(lower_stmt): Do not handle COMPOUND_EXPR.
	Remove call to print_node_brief.

	* c-tree.h (c_finish_omp_clauses): New prototype.
	(C_DECL_THREADPRIVATE_P): Define.
	(lookup_name_no_remap, c_omp_remap_private): Remove
	(c_begin_omp_parallel, c_finish_omp_parallel): Update.
	(check_for_loop_decls): Update decl.
	(lookup_name_no_remap, c_omp_remap_private): Declare.
	(build_indirect_ref, build_modify_expr, pushdecl,
	pushdecl_top_level): Move to c-common.h.

	* dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp
	before the switch, but just in the 2 places that need it.

	* c-decl.c (diagnose_mismatched_decls): Do not check for
	mismatched thread-local attributes when OLDDECL is marked
	threadprivate and NEWDECL has no thread-local attributes.
	(merge_decls): Merge C_DECL_THREADPRIVATE_P.
	(c_gimple_diagnostics_recursively): Rename from
	c_warn_unused_result_recursively.  Invoke
	diagnose_omp_structured_block_errors.
	(check_for_loop_decls): Return a singular decl found.

	* langhooks.c (lhd_omp_predetermined_sharing): Return
	OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls.
	(lhd_omp_firstprivatize_type_sizes): New.
	(lhd_omp_assignment): New.
	(lhd_omp_predetermined_sharing): New.

	* langhooks.h (struct gimplify_omp_ctx): Forward declare.
	(struct lang_hooks_for_types): Add
	omp_firstprivatize_type_sizes, omp_privatize_by_reference,
	omp_predetermined_sharing, omp_disregard_value_expr,
	omp_private_debug_clause, omp_clause_default_ctor,
	omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor.

	(c_finish_omp_clauses): New.
	(c_finish_bc_stmt): Diagnose break within omp for.
	(c_begin_omp_parallel, c_finish_omp_parallel): New.
	(build_unary_op): Return error_mark after reporting
	a readonly_error.
	(build_modify_expr): Likewise.

	* gimplify.c: Include optabs.h and pointer-set.h.
	(enum gimplify_omp_var_data): Declare.
	(struct gimplify_omp_ctx): Declare.
	(struct gimplify_ctx): Add fields prev_context, combined_pre_p
	and combined_ctxp.
	(gimplify_ctxp, gimplify_omp_ctxp): New local variables.
	(push_gimplify_context, pop_gimplify_context): Allow nesting.
	(splay_tree_compare_decl_uid): New.
	(new_omp_context): New.
	(delete_omp_context): New.
	(gimple_add_tmp_var): Call omp_add_variable.
	(gimplify_bind_expr): Likewise.
	(gimplify_var_or_parm_decl): If omp_notice_variable returned
	true, disregard DECL_VALUE_EXPR on the decl if any.
	(gimplify_expr_in_ctx): New.
	(omp_firstprivatize_variable, omp_firstprivatize_type_sizes
	omp_add_variable, omp_notice_variable, omp_is_private
	gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1
	gimplify_adjust_omp_clauses, gimplify_omp_parallel
	gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p
	gimplify_omp_atomic_fetch_op, goa_stabilize_expr
	gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex
	gimplify_omp_atomic): New.
	(gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS,
	OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED,
	OMP_CRITICAL and OMP_ATOMIC.
	(gimplify_body): Verify gimplify_ctxp is empty after gimplification.

	* c-pragma.h (enum pragma_kind): Add
	PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER,
	PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR,
	PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED,
	PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR,
	PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION,
	PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE,
	PRAGMA_OMP_THREADPRIVATE.

	* tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS,
	OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED,
	OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE,
	OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE,
	OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION,
	OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE,
	OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS,
	OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT,
	OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define.

	* print-tree.c (print_node): Dump DECL_VALUE_EXPR.

	* tree-ssa-dce.c (find_control_dependence): Do not assume that
	ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR).

	* tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for
	OpenMP directives.
	(struct nesting_info): Add field_map,
	suppress_expansion, debug_var_chain.
	(create_nesting_tree): Initialize them.
	(lookup_field_for_decl): Use field_map.
	(get_nonlocal_debug_decl, get_local_debug_decl): New.
	(convert_local_omp_clauses): New.
	(finalize_nesting_tree_1): Add debug_var_chain to toplevel block.
	(walk_body): Split out of walk_function.
	(convert_nonlocal_omp_clauses, convert_local_omp_clauses): New.
	(convert_nonlocal_reference): Handle omp statements.
	(convert_local_reference): Likewise.
	(unnest_nesting_tree_1): Split out of finalize_nesting_tree_1.
	(unnest_nesting_tree): New.
	(lower_nested_functions): Call it.
	(insert_field_into_struct): Make extern.
	(struct walk_stmt_info): Move to tree-gimple.h.
	(walk_stmts): Make extern.

	* omp-builtins.def: New file.

	* tree-iterator.c (expr_only): Clarify comment.

	* c-common.h (pushdecl_top_level, pushdecl,
	build_modify_expr, build_indirect_ref,
	c_finish_omp_master, c_finish_omp_critical,
	c_finish_omp_ordered, c_finish_omp_barrier,
	c_finish_omp_atomic, c_finish_omp_flush,
	c_finish_omp_for, c_split_parallel_clauses,
	omp_clause_default_kind, c_omp_sharing_predetermined,
	c_omp_remap_decl): Declare.

	* Makefile.in (BUILTINS_DEF): Add omp-builtins.def.
	(OBJS-common): Add omp-low.o.
	(c-omp.o, omp-low.o): Add.
	(gimplify.o): Add dependency on $(OPTABS_H).
	(GTFILES): Add omp-low.c.
	(gt-stringpool.h): Add.

	* tree-cfg.c (set_bb_for_stmt): Do not update the
	block-to-labels map if we are currently expanding to RTL.
	(tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P
	checks.
	Handle IDENTIFIER_NODE.
	(tree_verify_flow_info): Do not ICE when emitting error
	messages about invalid labels.
	(dump_function_to_file): Reset CFUN before emitting the body
	of the function.
	(debug_function): New.

	* passes.c (init_optimization_passes): Schedule
	pass_lower_omp.

	* langhooks-def.h (lhd_omp_predetermined_sharing,
	lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes):
	Declare.
	(LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it.
	(LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE,
	LANG_HOOKS_OMP_PREDETERMINED_SHARING,
	LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR,
	LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE,
	LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR,
	LANG_HOOKS_OMP_CLAUSE_COPY_CTOR,
	LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP,
	LANG_HOOKS_OMP_CLAUSE_DTOR): Define.
	(LANG_HOOK_DECLS): Use them.


2006-01-18  Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
	    Richard Henderson  <rth@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* c-parser.c (pragma_omp_clause): Define.
	(c_parser_declaration_or_fndef): Document OpenMP syntax.
	(c_parser_compound_statement): Likewise.
	(c_parser_statement): Likewise.
	(c_parser_pragma): Handle omp pragmas.
	(OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
	OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define.
	(c_parser_omp_clause_name, check_no_duplicate_clause,
	c_parser_omp_variable_list,
	c_parser_omp_var_list_parens, c_parser_omp_clause_copyin,
	c_parser_omp_clause_copyprivate,
	c_parser_omp_clause_default,
	c_parser_omp_clause_firstprivate, c_parser_omp_clause_if,
	c_parser_omp_clause_lastprivate,
	c_parser_omp_clause_nowait,
	c_parser_omp_clause_num_threads,
	c_parser_omp_clause_ordered, c_parser_omp_clause_private,
	c_parser_omp_clause_reduction,
	c_parser_omp_clause_schedule, c_parser_omp_clause_shared,
	c_parser_omp_all_clauses, c_parser_omp_structured_block,
	c_parser_omp_atomic, c_parser_omp_barrier,
	c_parser_omp_critical, c_parser_omp_flush,
	c_parser_omp_for_loop, c_parser_omp_for,
	c_parser_omp_master, c_parser_omp_ordered,
	c_parser_omp_sections_scope, c_parser_omp_sections,
	c_parser_omp_parallel, c_parser_omp_single,
	c_parser_omp_construct, c_parser_omp_threadprivate): New.
	* c-pragma.c (init_pragma): Do omp pragma registration here.
	* c.opt (fopenmp): New flag.


2006-01-18  Eric Christopher  <echristo@apple.com>

	* gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif.
	* config/darwin.h (GOMP_SELF_SPECS): Define.


testsuite/

2006-01-18  Richard Henderson  <rth@redhat.com>
            Aldy Hernandez  <aldyh@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>
            Uros Bizjak  <uros@kss-loka.si>

	* testsuite/gcc.dg/gomp: New directory.

From-SVN: r109902
2006-01-18 14:21:25 -05:00
Gabriel Dos Reis 858904db9e tree-vn.c (vn_add): Use XNEW.
* tree-vn.c (vn_add): Use XNEW.
        * tree-ssa-ccp.c (ccp_initialize): Use XNEWVEC.
        (ccp_fold): Likewise.
        (fold_stmt_r): Use explicit cast to convert from void *.
        * tree-outof-ssa.c (new_temp_expr_table): Use XCNEWVEC.
        (new_temp_expr_table): Likewise.
        * gimplify.c (lookup_tmp_var): Use XNEW.
        (gimplify_asm_expr): Use explcit cast to convert from void *.
        * tree-into-ssa.c (get_ssa_name_ann): Likewise.
        (get_def_blocks_for): Use XNEW.
        (add_to_repl_tbl): Likewise.
        (mark_def_sites): Use explicit cast to convert from void *.
        (def_blocks_free): Likewise.
        (mark_def_sites_initialize_block): Likewise.
        (update_ssa): Use XNEWVEC.
        * tree-dfa.c (create_var_ann): Use GGC_NEW.
        (create_stmt_ann): Likewise.
        (create_tree_ann): Likewise.
        (referenced_var_insert): Likewise.
        (set_default_def): Likewise.
        (referenced_var_lookup_if_exists): Use explicit cast to
        * convert
        from void *.
        (referenced_var_lookup): Likewise.
        (default_def): Likewise.
        (set_default_def): Likewise.
        * tree-cfg.c (create_bb): Likewise.
        (edge_to_cases_cleanup): Likewise.
        (verify_node_sharing): Likewise.
        (record_switch_edge): Use XNEW.
        (cleanup_dead_labels): Use XCNEWVEC.
        (tree_duplicate_sese_region): Use XNEWVEC.
        * tree-scalar-evolution.c (get_instantiated_value): Likewise.
        * tree-ssa.c (verify_ssa): Use XCNEWVEC.
        (int_tree_map_eq): Use explicit cast to convert from void *.
        * libgcov.c (gcov_exit): Use explicit cast to convert from
        * void *.
        (__gcov_execl): Likewise.
        (__gcov_execlp): Likewise.
        (__gcov_execle): Likewise.
        * tree-eh.c (struct_ptr_eq): Likewise.
        (struct_ptr_hash): Likewise.
        (lookup_stmt_eh_region_fn): Likewise.
        (outside_finally_tree): Likewise.
        (find_goto_replacement): Likewise.
        (make_eh_edge): Likewise.
        (mark_eh_edge): Likewise.
        (add_stmt_to_eh_region_fn): Use GGC_NEW.
        (record_in_finally_tree): Use XNEW.
        (maybe_record_in_goto_queue): Use XRESIZEVEC.
        (lower_try_finally_copy): Use XCNEWVEC.

From-SVN: r108736
2005-12-18 01:19:20 +00:00
Diego Novillo 127203ac0c tree.c (recompute_tree_invariant_for_addr_expr): Rename from recompute_tree_invarant_for_addr_expr.
* tree.c (recompute_tree_invariant_for_addr_expr): Rename from
	recompute_tree_invarant_for_addr_expr.
	Update uses everywhere.

From-SVN: r108316
2005-12-09 14:24:28 -05:00
Richard Guenther b4257cfc1f tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build.
2005-12-02  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build.
	* tree-complex.c (update_complex_assignment, expand_complex_div_wide):
	Likewise.
	* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref,
	maybe_fold_offset_to_component_ref): Likewise.
	* tree-ssa-dom.c (thread_across_edge,
	simplify_rhs_and_lookup_avail_expr,
	find_equivalent_equality_comparison, record_equivalences_from_stmt):
	Likewise.
	* gimple-low.c (lower_function_body, lower_return_expr): Likewise.
	* tree-eh.c (do_return_redirection, honor_protect_cleanup_actions,
	lower_try_finally_switch): Likewise.
	* tree-if-conv.c (add_to_dst_predicate_list,
	replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise.
	* gimplify.c (internal_get_tmp_var, gimple_build_eh_filter,
	voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr,
	gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr,
	gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr,
	shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr,
	gimplify_init_ctor_eval, gimplify_init_constructor,
	gimplify_variable_sized_compare, gimplify_boolean_expr,
	gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr,
	gimplify_expr, gimplify_body, gimplify_function_tree,
	force_gimple_operand): Likewise.
	* tree-ssa-pre.c (create_expression_by_pieces): Likewise.
	* tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for,
	mx_register_decls): Likewise.
	* tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain,
	get_frame_field, finalize_nesting_tree_1): Likewise.
	* tree-inline.c (setup_one_parameter): Likewise.
	* tree-vect-transform.c (vectorizable_condition): Likewise.
	* tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies):
	Likewise.
	* tree-profile.c (tree_gen_edge_profiler): Likewise.
	* tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise.
	* c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise.
	* tree-chrec.h (build_polynomial_chrec): Likewise.

From-SVN: r107907
2005-12-02 17:09:40 +00:00
Jason Merrill df77f45463 re PR c++/24686 (ICE when building a variation of NMSTL)
PR c++/24686
        * gimplify.c (gimplify_cleanup_point_expr): Also save and restore
        the cleanup list.

From-SVN: r106786
2005-11-11 12:14:49 -05:00
Andrew Pinski ca0b7d18c1 re PR middle-end/23155 (Gimplification failed for union cast)
2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/23155
        * g++.dg/ext/c99struct1.C: New test.
        * gcc.dg/union-cast-1.c: New test.
        * gcc.dg/union-cast-2.c: New test.
        * gcc.dg/union-cast-3.c: New test.

2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/23155
        * gimplifier.c (gimplify_expr): Create a temporary for lvalue
        CONSTRUCTOR.

From-SVN: r106438
2005-11-03 08:15:53 -08:00
Andrew Pinski 08330ec2ad re PR middle-end/24589 (wrong code with zero sized structs on CONSTRUCTOR)
2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/24589
        * gimplify.c (gimplify_expr) <case CONSTRUCTOR>: Add the
        expressions to a statement list instead of gimplifying them.

2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/24589
        * gcc.c-torture/execute/zero-struct-2.c: New test.

From-SVN: r106436
2005-11-03 07:21:15 -08:00
Richard Henderson a9f7c5705b gimplify.c (gimplify_var_or_parm_decl): Split out from ...
* gimplify.c (gimplify_var_or_parm_decl): Split out from ...
        (gimplify_expr): ... here.
        (gimplify_compound_lval): Use it in initial scan loop.  Allow
        fb_lvalue in base expression.

From-SVN: r105458
2005-10-15 22:08:26 -07:00
Paolo Bonzini 5544530ae5 re PR c/21419 (Accepts writting to const via asm)
2005-10-05  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/21419
	PR tree-optimization/24146
	PR tree-optimization/24151

	* c-typeck.c (readonly_error): Handle USE being lv_asm.
	(build_asm_expr): Call it if outputs are read-only.
	* gimplify.c (gimplify_asm_expr): Remove former fix to PR 21419.

cp:
2005-10-05  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/21419
	PR tree-optimization/24146
	PR tree-optimization/24151

	* semantics.c (finish_asm_stmt): Call readonly_error if outputs are
	read-only.  Set ASM_VOLATILE_P for asms without outputs.

testsuite:
2005-10-05  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/21419
	PR tree-optimization/24146
	PR tree-optimization/24151

	* g++.dg/ext/asm7.C: New.
	* g++.dg/ext/asm8.C: New.
	* gcc.dg/asm-1.c: Compile on all targets.
	* gcc.dg/asm-pr24146.c: New.
	* gcc.dg/pr21419.c: Adjust error messages.

From-SVN: r104988
2005-10-05 12:17:16 +00:00
Ian Lance Taylor 0b494699b4 gimplify.c (find_single_pointer_decl_1): New static function.
* gimplify.c (find_single_pointer_decl_1): New static function.
	(find_single_pointer_decl): New static function.
	(internal_get_tmp_var): For a formal variable, set restrict base
	information if appropriate.
	* alias.c (find_base_decl): If a VAR_DECL has a restrict base,
	return it.
	* tree.h (DECL_BASED_ON_RESTRICT_P): Define.
	(DECL_GET_RESTRICT_BASE): Define.
	(SET_DECL_RESTRICT_BASE): Define.
	(decl_restrict_base_lookup): Declare.
	(decl_restrict_base_insert): Declare.
	(struct tree_decl_with_vis): Add based_on_restrict_p field.
	* tree.c (restrict_base_for_decl): New static variable.
	(init_ttree): Initialize restrict_base_for_decl.
	(copy_node_stat): Copy restrict base information.
	(decl_restrict_base_lookup): New function.
	(decl_restrict_base_insert): New function.
	(print_restrict_base_statistics): New static function.
	(dump_tree_statistics): Call print_restrict_base_statistics.

From-SVN: r104890
2005-10-03 08:43:45 +00:00
Paolo Bonzini 02eb875fcf re PR c/21419 (Accepts writting to const via asm)
gcc:
2005-09-29  Paolo Bonzini  <bonzini@gnu.org>

	PR c/21419
	* gimplify.c (gimplify_asm_expr): Raise an error if an output is
	read-only.

testsuite:
2005-09-29  Paolo Bonzini  <bonzini@gnu.org>

        PR c/21419
        * gcc.dg/pr21419.c: New test.

From-SVN: r104774
2005-09-29 14:53:39 +00:00
Richard Henderson 99db1ef0e2 c-common.c (handle_mode_attribute): When not modifying in place, create subtypes for enumerations.
* c-common.c (handle_mode_attribute): When not modifying in place,
        create subtypes for enumerations.
        (sync_resolve_return): Use TYPE_MAIN_VARIANT.
        * gimplify.c (create_tmp_from_val): Likewise.

From-SVN: r104603
2005-09-24 09:21:43 -07:00
Richard Guenther c295372571 re PR middle-end/23944 (segv in fold_indirect_ref_1 in fold-const.c:11505)
2005-09-18  Richard Guenther  <rguenther@suse.de>

	PR middle-end/23944
	* gimplify.c (fold_indirect_ref_rhs): Fix thinko in
	fallback.

	* gcc.c-torture/compile/pr23944.c: New testcase.

From-SVN: r104402
2005-09-18 14:15:19 +00:00
Olivier Hainque 816fa80a8f gimplify.c (gimplify_init_ctor_eval): Don't discard a zero-sized value if it has side-effects.
* gimplify.c (gimplify_init_ctor_eval): Don't discard a zero-sized
	value if it has side-effects.

From-SVN: r104262
2005-09-14 06:59:10 +00:00
Kazu Hirata 57b51d4d63 gimplify.c, [...]: Fix comment typos.
* gimplify.c, ipa-prop.h, varasm.c, config/vxlib.c,
	config/vxworks.h, config/crx/crx.c, config/ms1/ms1.c,
	config/ms1/ms1.md, config/rs6000/rs6000.c: Fix comment typos.
	Follow spelling conventions.
	* doc/invoke.texi: Follow spelling conventions.

From-SVN: r103925
2005-09-06 02:05:07 +00:00
Mark Mitchell a38578e1bb re PR c++/23167 (internal compiler error: in create_tmp_var)
PR c++/23167
	* gimplify.c (gimplify_expr): Handle TREE_ADDRESSABLE types when
	generating synthetic loads from volatile lvalues.

	PR c++/23167
	* g++.dg/expr/volatile1.C: New test.

From-SVN: r103782
2005-09-02 15:39:04 +00:00
Andrew Pinski 412f898605 re PR middle-end/23463 (va-arg-22.c execution fails)
2005-08-27  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/23463
        * gimplify.c (gimplify_modify_expr_rhs): Remove check for zero sized
        types.
        (gimplify_modify_expr): Check for zero sized types and gimplify the
        rhs and lhs as statements.

2005-08-27  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/23463
        * gcc.c-torture/execute/zero-struct-1.c: New test.

From-SVN: r103571
2005-08-27 14:37:53 -07:00
Jakub Jelinek 73ed17ff80 re PR middle-end/22043 (Fields not initialized for automatic structs with flexible array members)
PR tree-optimization/22043
	* tree.h (count_type_elements): Add ALLOW_FLEXARR argument.
	* expr.c (count_type_elements): Add ALLOW_FLEXARR argument.
	If ALLOW_FLEXARR, handle types ending with flexible array member.
	Pass false as second argument to recursive count_type_elements calls.
	(categorize_ctor_elements_1, mostly_zeros_p): Pass false as second
	argument to count_type_elements call.
	* tree-sra.c (decide_block_copy): Likewise.
	* gimplify.c (gimplify_init_constructor): If num_type_elements < 0
	for a constant-sized object, set cleared as well.  Pass true as
	second argument to count_type_elements call.

	* gcc.c-torture/execute/20050613-1.c: New test.

From-SVN: r103389
2005-08-23 09:28:26 +02:00
Andrew Pinski d06526b797 re PR tree-optimization/23402 (error: statement makes a memory store, but has no V_MAY_DEFS nor V_MUST_DEFS)
2005-08-16  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/23402
        * gcc.c-torture/compile/zero-strct-3.c: New test.
        * gcc.c-torture/compile/zero-strct-4.c: New test.

2005-08-16  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/23402
        * gimplify.c (zero_sized_type): New function.
        (gimplify_modify_expr_rhs): If we have a zero sized type,
        replace the statement with an empty statement.

From-SVN: r103191
2005-08-16 18:55:05 -07:00
Ian Lance Taylor cf0efa6a76 re PR c++/23337 (ICE initializing array of vectors in C++)
./	PR c++/23337
	* gimplify.c (gimplify_init_ctor_eval): If we see an element of
	vector type, don't try to construct it element by element.  Add an
	assertion that we use a FIELD_DECL when building a COMPONENT_REF.
testsuite/
	PR c++/23337
	* g++.dg/ext/vector2.C: New.

From-SVN: r103177
2005-08-16 22:07:44 +00:00
Richard Henderson 7fd6694baf re PR middle-end/23312 (ACATS ICE (32) gimplify_one_sizepos, at gimplify.c:4659)
PR middle-end/23312
        * gimplify.c (gimplify_one_sizepos): Check for INTEGER_TYPE
        before using TYPE_IS_SIZETYPE.

From-SVN: r102997
2005-08-11 10:12:30 -07:00
Richard Henderson a9c5ddf90c re PR middle-end/22439 (ICE with char VLA and __SIZE_TYPE__ argument (so no cast))
PR 22439
        * gimplify.c (gimplify_one_sizepos): Preserve the original type.

From-SVN: r102879
2005-08-08 14:38:24 -07: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
Giovanni Bajo 4038c495fc Make CONSTRUCTOR use VEC to store initializers.
* c-common.c (complete_array_type): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	* c-pretty-print.c (pp_c_initializer_list): Use pp_c_constructor_elts.
	(pp_c_constructor_elts): New function.
	* c-pretty-print.h (pp_c_constructor_elts): Declare.
	* c-typeck.c (build_function_call, build_c_cast, digest_init,
	struct constructor_stack, struct initializer_stack,
	constructor_elements, push_init_level, pop_init_level,
	add_pending_init, find_init_member, output_init_element): Update to
	cope with VEC in CONSTRUCTOR_ELTS.
	* coverage.c (build_fn_info_value, build_ctr_info_value,
	build_gcov_info): Likewise.
	* expr.c (categorize_ctor_elements_1, store_constructor,
	expand_expr_real_1): Likewise.
	* fold-const.c (fold_ternary): Likewise.
	* gimplify.c (gimplify_init_ctor_preeval, zero_sized_field_decl,
	gimplify_init_constructor, gimplify_expr): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-inline.c (copy_tree_r): Add code to duplicate a CONSTRUCTOR
	node.
	* tree-pretty-print.c (dump_generic_node): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	* tree-sra.c (generate_element_init_1): Likewise.
	* tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise.
	* tree-ssa-operands.c (get_expr_operands): Likewise.
	* tree-vect-generic.c (expand_vector_piecewise): Likewise.
	* tree-vect-transform.c (vect_get_vec_def_for_operand):
	(get_initial_def_for_reduction): Likewise.
	* tree-vn.c (set_value_handle, get_value_handle): CONSTURCTOR uses
	value handle in annotations.
	* tree.c (tree_node_kind, tree_code_size, make_node_stat,
	tree_node_structure): Add support for constr_kind.
	(build_vector_from_ctor, build_constructor_single,
	build_constructor_from_list): New functions.
	(build_constructor): Update to take a VEC instead of a TREE_LIST.
	(simple_cst_equal, iterative_hash_expr, initializer_zerop, walk_tree):
	Update to cope with VEC in CONSTRUCTOR_ELTS.
	* tree.def (CONSTRUCTOR): Make it a tcc_exceptional node.
	* tree.h (FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_CONSTRUCTOR_ELT,
	CONSTRUCTOR_APPEND_ELT): New macros.
	(struct constructor_elt, struct	tree_constructor): New data types.
	(union tree_node): Add tree_constructor field.
	* treestruct.def: Define TS_CONSTRUCTOR.
	* varasm.c (const_hash_1, compare_constant, copy_constant,
	compute_reloc_for_constant, output_addressed_constants,
	initializer_constant_valid_p, output_constant,
	array_size_for_constructor, output_constructor): Update to cope with
	VEC in CONSTRUCTOR_ELTS.
	* vec.h (VEC_empty, VEC_copy): New macros.

ada/
	Make CONSTRUCTOR use VEC to store initializers.
	* decl.c (gnat_to_gnu_entity): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	* trans.c (extract_values): Likewise.
	* utils.c (convert, remove_conversions): Likewise.
	* utils2.c (contains_save_expr_p, build_binary_op, build_unary_op,
	gnat_build_constructor): Likewise.

cp/
	Make CONSTRUCTOR use VEC to store initializers.
	* call.c (convert_default_arg): Update call to digest_init.
	* class.c (dump_class_hierarchy, dump_array): Update to cope with
	VEC in CONSTRUCTOR_ELTS.
	* cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise.
	(finish_compound_literal, digest_init): Update declaration.
	* decl.c (struct reshape_iter): New data type.
	(reshape_init_array): Rename to...
	(reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS.
	(reshape_init): Rewrite from scratch. Split parts into...
	(reshape_init_array, reshape_init_vector, reshape_init_class,
	reshape_init_r): New functions.
	(check_initializer): Update call to reshape_init. Remove obsolete
	code.
	(initialize_artificial_var, cp_complete_array_type): Update to cope
	with VEC in CONSTRUCTOR_ELTS.
	* decl2.c (grokfield): Update calls to digest_init.
	(mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS.
	* error.c (dump_expr_init_vec): New function.
	(dump_expr): Use dump_expr_init_vec.
	* init.c (build_zero_init, build_vec_init): Update to cope with VEC
	in CONSTRUCTOR_ELTS.
	(expand_default_init): Update call to digest_init.
	* parser.c  (cp_parser_postfix_expression): Use a VEC for the
	initializers.
	(cp_parser_initializer_list): Build a VEC of initializers.
	* pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC
	in CONSTRUCTOR_ELTS.
	* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer,
	ptm_initializer, class_initializer, get_pseudo_ti_init): Use
	build_constructor_from_list instead of build_constructor.
	* semantics.c (finish_compound_literal): Update call to digest_init.
	* tree.c (stabilize_init): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	* typeck.c (build_ptrmemfunc1): Likewise.
	* typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1):
	Likewise.
	(store_init_value): Use build_constructor_from_list and update call
	to digest_init.
	(digest_init): Rewrite.
	(process_init_constructor): Rewrite from scratch. Split into...
	(process_init_constructor_array, picflag_from_initializer,
	process_init_constructor_record, process_init_constructor_union):
	New functions.
	(PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE):
	New macros.
	(build_functional_cast): Use build_constructor_from_list instead of
	build_constructor.

fortran/
	Make CONSTRUCTOR use VEC to store initializers.
	* trans-array.c (gfc_build_null_descriptor,
	gfc_trans_array_constructor_value, gfc_conv_array_initializer):
	Update to cope with VEC in CONSTRUCTOR_ELTS.
	* trans-common.c (create_common): Likewise.
	* trans-expr.c (gfc_conv_structure): Likewise.
	* trans-stmt.c (gfc_trans_character_select): Use
	build_constructor_from_list instead of build_constructor.

java/
	Make CONSTRUCTOR use VEC to store initializers.
	* check-init.c (check_init): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	* class.c (make_field_value, make_method_value, get_dispatch_table,
	make_class_data, emit_symbol_table, emit_catch_table,
	emit_assertion_table): Use build_constructor_from_list instead of
	build_constructor.
	* constants.c (build_constants_constructor): Likewise.
	* java-gimplify.c (java_gimplify_new_array_init): Update to cope with
	VEC in CONSTRUCTOR_ELTS.
	* java-tree.h (START_RECORD_CONSTRUCTOR, PUSH_SUPER_VALUE,
	PUSH_FIELD_VALUE, FINISH_RECORD_CONSTRUCTOR): Create a VEC instead
	of a TREE_LIST.
	* jcf-write.c (generate_bytecode_insns): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	* parse.y (build_new_array_init): Use build_constructor_from_list
	instead of build_constructor.
	(patch_new_array_init): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	(array_constructor_check_entry): Likewise.

objc/
	Make CONSTRUCTOR use VEC to store initializers.
	* objc-act.c (objc_build_constructor): Use build_constructor_from_list
	instead of build_constructor.

testsuite/
	Make CONSTRUCTOR use VEC to store initializers.
	* g++.dg/ext/complit3.C: Check for specific error messages.
	* g++.dg/init/brace2.C: Update error message.
	* g++.dg/warn/Wbraces2.C: Likewise.

From-SVN: r102182
2005-07-20 01:19:59 +00:00
Richard Henderson af62f6f9a4 re PR tree-optimization/22278 (gcc -O2 discards cast to volatile)
PR tree-opt/22278
        * gimplify.c (gimplify_expr): Use main variant type for the temp
        destination for a discarded volatile read.
        * tree-ssa.c (tree_ssa_useless_type_conversion_1): Don't elide
        casts between non-void types that change volatility.

From-SVN: r102169
2005-07-19 13:20:40 -07: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
Jakub Jelinek 19dbbf3697 re PR middle-end/22028 (ICE after invalid struct declaration)
PR middle-end/22028
	* gimplify.c (gimplify_type_sizes): Check for type == error_mark_node
	earlier in the function.

	* gcc.dg/20050620-1.c: New test.

From-SVN: r101332
2005-06-26 07:23:48 +02:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Jason Merrill fa47911c56 re PR c++/19317 (removing a temporary return value when we cannot)
PR c++/19317
        Leave the return slot target in the MODIFY_EXPR rather than making
        it an argument, but only use it if the CALL_EXPR has a flag set.
        * tree.h (CALL_EXPR_HAS_RETURN_SLOT_ADDR): Rename to
        CALL_EXPR_RETURN_SLOT_OPT.
        * calls.c (expand_call): Adjust.
        * tree-inline.c (expand_call_inline): Adjust.
        * tree-pretty-print.c (dump_generic_node): Adjust.

        And set the flag as appropriate.
        * gimplify.c (gimplify_modify_expr_rhs): Set
        CALL_EXPR_HAS_RETURN_SLOT_ADDR where the LHS is obviously safe.
        * tree-nrv.c (execute_return_slot_opt): Set
        CALL_EXPR_HAS_RETURN_SLOT_ADDR based on escape analysis.
        * tree-pass.h: Declare pass_return_slot.
        * tree-optimize.c (init_tree_optimization_passes): Add it.

        * cp/semantics.c (simplify_aggr_init_expr): Use
        CALL_EXPR_RETURN_SLOT_OPT, not CALL_EXPR_HAS_RETURN_SLOT_ADDR.

From-SVN: r101269
2005-06-23 10:44:21 -04:00
Richard Henderson e41d82f5d7 re PR tree-optimization/20610 (Real by complex multiplications perform unnecessary operations)
PR tree-opt/20610
        * tree.h (DECL_COMPLEX_GIMPLE_REG_P): New.
        (struct tree_decl): Add gimple_reg_flag.
        * integrate.c (copy_decl_for_inlining): Copy it.
        * gimplify.c (internal_get_tmp_var): Set it.
        (gimplify_bind_expr): Likewise.
        (gimplify_function_tree): Likewise.
        (gimplify_modify_expr_complex_part): New.
        (gimplify_modify_expr): Use it.
        * tree-gimple.c (is_gimple_reg_type): Allow complex.
        (is_gimple_reg): Allow complex with DECL_COMPLEX_GIMPLE_REG_P set.

        * tree-complex.c (complex_lattice_t): New.
        (complex_lattice_values, complex_variable_components): New.
        (some_nonzerop, find_lattice_value, is_complex_reg,
        init_parameter_lattice_values, init_dont_simulate_again,
        complex_visit_stmt, complex_visit_phi, create_components,
        update_complex_components, update_parameter_components,
        update_phi_components, update_all_vops, expand_complex_move): New.
        (extract_component): Handle INDIRECT_REF, COMPONENT_REF, ARRAY_REF,
        SSA_NAME.
        (update_complex_assignment): Use update_complex_components;
        handle updates of return_expr properly.
        (expand_complex_addition): Use complex lattice values.
        (expand_complex_multiplication): Likewise.
        (expand_complex_division): Likewise.
        (expand_complex_libcall): Use update_complex_components.
        (expand_complex_comparison): Use update_stmt.
        (expand_complex_operations_1): Use expand_complex_move, retrieve
        lattice values.
        (tree_lower_complex): Compute lattice values.
        (tree_lower_complex_O0): Duplicate from tree_lower_complex.
        (pass_lower_complex_O0): Rename from pass_lower_complex.
        (pass_lower_complex, gate_no_optimization): New.
        * tree-optimize.c (init_tree_optimization_passes): Update for
        complex pass changes.
        * tree-pass.h (pass_lower_complex_O0): Declare.

From-SVN: r100793
2005-06-09 00:43:40 -07:00
Richard Guenther 2214de3042 c-typeck.c (c_finish_if_stmt): Use void_type_node as type for COND_EXPR.
2005-06-07  Richard Guenther  <rguenth@gcc.gnu.org>

	* c-typeck.c (c_finish_if_stmt): Use void_type_node as type
	for COND_EXPR.
	* gimplify.c (gimplify_cond_expr): No need to fix up the
	type of COND_EXPRs.

From-SVN: r100705
2005-06-07 10:10:22 +00:00
Daniel Berlin 833b3afe49 cfgexpand.c (expand_one_var): Use DECL_HAS_VALUE_EXPR_P.
2005-06-01  Daniel Berlin  <dberlin@dberlin.org>

	* cfgexpand.c (expand_one_var): Use DECL_HAS_VALUE_EXPR_P.
	* dwarf2out.c (loc_descriptor_from_tree_1): Ditto.
	* expr.c (expand_var): Ditto.
	* function.c (gimplify_parameters): Use SET_DECL_VALUE_EXPR too.
	* gimplify.c (gimplify_decl_expr): Ditto.
	(gimplify_expr): Ditto.
	* tree-mudflap.c (mf_decl_eligible_p): Use DECL_HAS_VALUE_EXPR_P.
	* tree.c (value_expr_for_decl): New.
	(print_value_expr_statistics): New.
	(init_ttree): Init value_expr_for_decl.
	(decl_value_expr_lookup): New.
	(decl_value_expr_insert): Ditto.
	(copy_node_stat): Copy DECL_VALUE_EXPR status.
	* tree.h (DECL_VALUE_EXPR): Use hashtable.
	(SET_DECL_VALUE_EXPR): New.
	(DECL_HAS_VALUE_EXPR_P): New.

From-SVN: r100592
2005-06-04 17:22:21 +00:00
Kazu Hirata 84c76d40cb gimplify.c (gimplify_ctx): Change the type of case_labels to VEC from VARRAY.
* gimplify.c (gimplify_ctx): Change the type of case_labels to
	VEC from VARRAY.
	(gimplify_switch_expr, gimplify_case_label_expr): Adjust uses
	of case_labels.

From-SVN: r100513
2005-06-02 20:21:54 +00:00
Daniel Berlin 292a398fb7 re PR tree-optimization/21839 (ICE for missing V_DEFS caused by salias with empty structures)
2005-06-01  Daniel Berlin  <dberlin@dberlin.org>

	Fix PR tree-optimization/21839

	* gimplify.c (zero_sized_field_decl): New function.
	(gimplify_init_ctor_eval): Use it.

From-SVN: r100477
2005-06-02 02:08:02 +00:00
Josh Conner cce7074710 re PR middle-end/21478 (Improve initialization of sparse local arrays)
PR 21478
        * gimplify.c (gimplify_init_constructor): Don't spill initializer
        to read-only memory if it's sparse.

From-SVN: r100465
2005-06-01 14:34:27 -07:00
Jakub Jelinek 8e0a600bdd re PR c/21536 (C99 array of variable length use causes segmentation fault)
PR c/21536
	PR c/20760
	* gimplify.c (gimplify_decl_expr): Call gimplify_type_sizes
	on variable sizes types if a decl is a pointer to a VLA.
	(gimplify_type_sizes): Handle POINTER_TYPE and REFERENCE_TYPE.
	Call gimplify_type_sizes on aggregate fields.  Prevent infinite
	recursion.

	* gcc.dg/20050527-1.c: New test.

From-SVN: r100443
2005-06-01 12:23:17 +02:00
Kaveh R. Ghazi 4c714dd4a6 basic-block.h, [...]: Don't include errors.h and include toplev.h if necessary.
* basic-block.h, bb-reorder.c, c-gimplify.c, config/darwin.c,
	config/rs6000/rs6000-c.c, dominance.c, gimple-low.c, gimplify.c,
	lambda-code.c, lambda-trans.c, tree-browser.c, tree-cfg.c,
	tree-chrec.c, tree-data-ref.c, tree-dfa.c, tree-eh.c,
	tree-if-conv.c, tree-into-ssa.c, tree-loop-linear.c,
	tree-mudflap.c, tree-nomudflap.c, tree-outof-ssa.c,
	tree-pretty-print.c, tree-scalar-evolution.c, tree-sra.c,
	tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c,
	tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-live.c,
	tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
	tree-ssa-propagate.c, tree-ssa-sink.c, tree-ssa-threadupdate.c,
	tree-ssa-uncprop.c, tree-ssa.c, tree-vect-analyze.c,
	tree-vect-transform.c, tree-vectorizer.c, vec.c: Don't include
	errors.h and include toplev.h if necessary.

	* rtl.c, varray.c: If we're compiling as a GENERATOR_FILE, include
	errors.h otherwise include toplev.h.

	* Makefile.in: Update dependencies.

ada:
	* misc.c: Don't include errors.h.

fortran:
	* fortran/trans-decl.c: Don't include errors.h.
	* fortran/Make-lang.in: Updates dependencies.

java:
	* java/verify-glue.c: Don't include errors.h and include toplev.h.
	* java/Make-lang.in: Updates dependencies.

treelang:
	* treelang/lex.l, treelang/parse.y: Don't include errors.h and
	include toplev.h.
	* treelang/Make-lang.in: Updates dependencies.

From-SVN: r100420
2005-06-01 02:51:18 +00:00
Richard Guenther 30d2e94365 [multiple changes]
2005-05-18  Richard Guenther  <rguenth@gcc.gnu.org>

        * tree-inline.c (copy_body_r): Manually fold *& to deal
        with ADDR_EXPRs with mismatched types for now.

2005-05-17  Richard Guenther  <rguenth@gcc.gnu.org>

        * gimplify.c (fold_indirect_ref_rhs): New function.
        (gimplify_modify_expr_rhs): Use it instead of pessimistic
        fold_indirect_ref.

2005-05-15  Richard Guenther  <rguenth@gcc.gnu.org>

        * fold-const.c (fold_indirect_ref_1): Add type argument;
        make sure the resulting expression is of this type.
        (build_fold_indirect_ref, fold_indirect_ref): Adjust callers.

From-SVN: r100267
2005-05-27 11:23:30 -06:00
Kazu Hirata 0fa2e4df47 c-common.c, [...]: Fix comment typos.
* c-common.c, c-parser.c, cfgbuild.c, cfghooks.c, cfghooks.h,
	cfgrtl.c, cgraphunit.c, ddg.c, expr.h, gcse.c, ggc-page.c,
	ggc-zone.c, gimplify.c, ipa-inline.c, longlong.h, targhooks.c,
	tree-flow-inline.h, tree-pass.h, tree-ssa-dse.c,
	tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c,
	tree-ssa-operands.c, tree-vect-analyze.c,
	tree-vect-transform.c, tree-vectorizer.c, tree.c,
	config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c,
	config/frv/frv.md, config/i386/i386.c, config/i386/sse.md,
	config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h,
	config/mcore/mcore.c, config/mips/mips.c, config/mips/mips.md,
	config/rs6000/darwin-ldouble.c, config/rs6000/rs6000.c,
	config/rs6000/rs6000.h, config/sh/sh.c, config/sh/sh.md,
	config/sh/ushmedia.h, config/sparc/sparc.c,
	config/sparc/sparc.md, config/stormy16/stormy-abi: Fix comment
	typos.  Follow spelling conventions.
	* doc/invoke.texi, doc/tm.texi, doc/tree-ssa.texi: Fix typos.
	Follow spelling conventions.

From-SVN: r100218
2005-05-26 18:15:27 +00:00
Kazu Hirata ec23484219 gimplify.c (gimplify_compound_lval): Use VEC instead of VARRAY.
* gimplify.c (gimplify_compound_lval): Use VEC instead of
	VARRAY.

From-SVN: r99083
2005-05-01 23:23:33 +00:00
Nathan Sidwell 535a42b116 builtins.c (gimplify_va_arg_expr): Reword comments to avoid 'abort'.
* builtins.c (gimplify_va_arg_expr): Reword comments to avoid
	'abort'. Use gcc_assert and gcc_unreachable as appropriate.
	* c-format.c (get_constant, decode_format_attr, get_flag_spec,
	find_char_info_specifier_index,
	find_length_info_modifier_index): Likewise.
	* c-typeck.c (composite_type, pop_init_level): Likewise.
	* combine.c (cant_combine_insn_p, try_combine): Likewise.
	* cse.c (cse_insn): Likewise
	* dominance.c (calc_dfs_tree): Likewise
	dwarf2out.c (loc_descriptor_from_tree_1,
	add_abstract_origin_attribute, force_decl_die,
	force_type_die): Likewise
	emit-rtl.c (operand_subword_force): Likewise
	explow.c (hard_function_value): Likewise
	expmed.c (store_bit_field, expand_divmod,
	emit_store_flag_force): Likewise
	expr.c (emit_move_multi_word, store_expr,
	expand_expr_real_1): Likewise
	final.c (this_is_asm_operands, shorten_branches, final_scan_insn,
	output_operand): Likewise
	flow.c (recompute_reg_usage): Likewise
	* function.c (assign_stack_temp_for_type, assign_temp,
	handle_epilogue_set): Likewise
	* genextract.c (main): Likewise
	* gimplify.c (mostly_copy_tree_r, gimplify_return_expr,
	gimplify_modify_expr_rhs, gimplify_expr): Likewise
	* haifa-sched.c (ready_lastpos, ready_remove_first, ready_element,
	ready_remove, rm_line_notes, rm_other_notes,
	schedule_block): Likewise
	mips-tfile.c (copy_object, out_of_bounds): Likewise

From-SVN: r98567
2005-04-22 16:14:55 +00:00
Zdenek Dvorak 9885da8e1b Makefile.in (LIBGCOV): Add _gcov_interval_profiler, _gcov_pow2_profiler and _gcov_one_value_profiler.
* Makefile.in (LIBGCOV): Add _gcov_interval_profiler,
	_gcov_pow2_profiler and _gcov_one_value_profiler.
	(tree-profile.o): Add GGC_H and gt-tree-profile.h dependency.
	(GTFILES): Add $(srcdir)/tree-profile.c.
	* gcov-io.h (__gcov_interval_profiler, __gcov_pow2_profiler,
	__gcov_one_value_profiler): Declare.
	* gimplify.c (force_gimple_operand): Check whether the statements
	should be produced in ssa form.
	(force_gimple_operand_bsi): New function.
	* libgcov.c (__gcov_interval_profiler, __gcov_pow2_profiler,
	__gcov_one_value_profiler): New functions.
	* rtl-profile.c (rtl_gen_pow2_profiler): Only measure whether
	the profiled value is a power of two or not.
	* tree-cfg.c (tree_block_ends_with_condjump_p): Handle empty blocks.
	* tree-flow.h (in_ssa_p): Declare.
	(force_gimple_operand_bsi): Declare.
	* tree-into-ssa.c (in_ssa_p): New variable.
	(rewrite_into_ssa): Set in_ssa_p.
	* tree-outof-ssa.c (rewrite_out_of_ssa): Set in_ssa_p.
	* tree-profile.c: Include ggc.h and gt-tree-profile.h.
	(gcov_type_node, tree_interval_profiler_fn, tree_pow2_profiler_fn,
	tree_one_value_profiler_fn): New variables.
	(tree_init_edge_profiler): Initialize the profiler function decls.
	(tree_gen_edge_profiler): Use global gcov_type_node.
	(prepare_instrumented_value): New function.
	(tree_gen_interval_profiler, tree_gen_interval_profiler,
	tree_gen_one_value_profiler): Call the library functions instead of
	creating instrumentation code.
	* tree.c (build_fn_decl): New function.
	* tree.h (build_fn_decl): Declare.
	* value-prof.c (rtl_divmod_values_to_profile,
	rtl_find_values_to_profile, rtl_mod_pow2_value_transform,
	tree_mod_pow2_value_transform, tree_find_values_to_profile):
	Do not handle may_be_other and precise values of exponents at pow2
	profiler.
	(tree_mod_subtract_transform): Reflect that value field of
	histogram has changed meaning.
	(tree_divmod_values_to_profile): Record the values correctly.
	(tree_values_to_profile): Update comment.
	* value-prof.h (struct histogram_value_t): Remove pow2 data.

From-SVN: r98555
2005-04-22 10:57:04 +00:00
Alexandre Oliva c87ac7e8f7 re PR middle-end/20739 (ICE in gimplify_addr_expr)
gcc/ChangeLog:
PR middle-end/20739
* gimplify.c (gimplify_addr_expr): Compensate for removal of
e.g. cv-qualification conversions.
gcc/testsuite/ChangeLog:
PR middle-end/20739
* gcc.dg/tree-ssa/pr20739.c: New test.

From-SVN: r98167
2005-04-15 03:09:50 +00:00
Kazu Hirata aabcd30904 cgraphunit.c, [...]: Fix comment typos.
* cgraphunit.c, dbxout.c, flow.c, gcse.c, gimplify.c,
	lambda-code.c, loop.c, machmode.def, mips-tfile.c,
	modulo-sched.c, passes.c, postreload-gcse.c, tree-eh.c,
	tree-ssa-ccp.c, varasm.c, config/frv/frv.c, config/frv/frv.h,
	config/frv/frv.md, config/i386/i386.c, config/i386/i386.h,
	config/i386/i386.md, config/rs6000/predicates.md,
	config/rs6000/rs6000.c, config/s390/fixdfdi.h,
	config/s390/s390.c, config/stormy16/stormy16.c,
	config/stormy16/stormy16.md, config/vax/vax.md: Fix comment
	typos.

From-SVN: r97362
2005-04-01 03:42:55 +00:00
Joseph Myers 0223e4f514 re PR c/17855 (modification of function struct return not diagnosed)
PR c/17855
	* gimplify.c (gimplify_expr): Create a temporary for lvalue
	COND_EXPR and CALL_EXPR.

testsuite:
	* gcc.c-torture/compile/struct-non-lval-1.c,
	gcc.c-torture/compile/struct-non-lval-2.c,
	gcc.c-torture/compile/struct-non-lval-3.c: New tests.

From-SVN: r97352
2005-04-01 00:34:44 +01:00
Joseph Myers d101034cd8 langhooks.h (truthvalue_conversion): Remove.
* langhooks.h (truthvalue_conversion): Remove.
	* langhooks-def.h (LANG_HOOKS_INITIALIZER): Remove
	LANG_HOOKS_TRUTHVALUE_CONVERSION.
	* system.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Poison.
	* gimplify.c (gimple_boolify): Don't use truthvalue_conversion.
	* c-objc-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.

ada:
	* misc.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.

cp:
	* cp-objcp-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.

fortran:
	* f95-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.

java:
	* lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.

treelang:
	* treetree.c (LANG_HOOKS_TRUTHVALUE_CONVERSION,
	tree_lang_truthvalue_conversion): Remove.
	* tree-convert.c: Don't call truthvalue_conversion.

From-SVN: r96947
2005-03-23 19:47:09 +00:00
Kazu Hirata 49d1af8985 builtins.c (fold_builtin): Take decomposed arguments of CALL_EXPR.
* builtins.c (fold_builtin): Take decomposed arguments of
	CALL_EXPR.
	* fold-const.c (fold_ternary): Update a call to fold_builtin.
	* gimplify.c (gimplify_call_expr): Likewise.
	* tree-ssa-ccp.c (ccp_fold, ccp_fold_builtin): Likewise.
	* tree.h: Update the prototype of fold_builtin.

From-SVN: r96800
2005-03-21 14:35:08 +00:00
Alexandre Oliva aff98faf41 re PR c++/20280 (ICE in create_tmp_var, at gimplify.c:368)
gcc/ChangeLog:
PR c++/20280
* gimplify.c (gimplify_cond_expr): Add fallback argument.  Use a
temporary variable of pointer type if an lvalues is required.
(gimplify_modify_expr_rhs): Request an rvalue from it.
(gimplify_expr): Pass fallback on.
gcc/testsuite/ChangeLog:
PR c++/20280
* g++.dg/tree-ssa/pr20280.C: New.

From-SVN: r96444
2005-03-14 20:02:05 +00:00
Kazu Hirata 70e2829d25 gimplify.c (gimplify_expr): Remove local variables r0 and r1.
* gimplify.c (gimplify_expr): Remove local variables r0 and
	r1.

From-SVN: r96344
2005-03-12 18:33:25 +00:00
Jakub Jelinek 372d72d917 re PR inline-asm/20314 (Bogus differ in number of alternatives error)
PR inline-asm/20314
	* gimplify.c (gimplify_asm_expr): Handle input/output constraints
	with multiple alternatives.

	* stmt.c (parse_output_constraint): Fix a typo.

	* gcc.dg/torture/pr20314-1.c: New test.
	* gcc.dg/torture/pr20314-2.c: New test.

From-SVN: r96222
2005-03-10 01:12:31 +01:00