Richard Kenner [Mon, 28 Jun 2004 21:37:16 +0000 (21:37 +0000)]
decl.c: Remove calls to add_decl_expr...
* decl.c: Remove calls to add_decl_expr, pushdecl, rest_of_compilation,
and rest_of_type_compilation; add arg to create_*_decl.
(annotate_decl_with_node): Deleted.
(gnat_to_gnu_entity, case E_Array_Type): Set location of fields.
* gigi.h (get_decls, block_has_vars, pushdecl): Deleted.
(get_current_block_context, gnat_pushdecl): New declarations.
(gnat_init_stmt_group): Likewise.
(create_var_decl, create_type_decl, create_subprog_decl): Add new arg.
* misc.c (LANG_HOOKS_CLEAR_BINDING_STACK): Deleted.
(LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Deleted.
(gnat_init): Call gnat_init_stmt_group.
* trans.c (global_stmt_group, gnu_elab_proc_decl): New variables.
(gnu_pending_elaboration_list): Deleted.
(mark_visited, mark_unvisited, gnat_init_stmt_group): New functions.
(gigi): Rearrange initialization calls and move some to last above.
(gnat_to_gnu): If statement and not in procedure, go into elab proc.
Delete calls to add_decl_expr; add arg to create_*_decl.
(gnat_to_gnu, case N_Loop): Recalculate side effects on COND_EXPR.
(gnat_to_gnu, case N_Subprogram_Body): Move some code to
begin_subprog_body and call it.
Don't push and pop ggc context.
(gnat_to_gnu, case N_Compilation_Unit): Rework to support elab proc.
(add_stmt): Remove handling of DECL_EXPR from here.
If not in function, mark visited.
(add_decl_expr): Put global at top level.
Check for cases of DECL_INITIAL we have to handle here.
(process_type): Add extra arg to create_type_decl.
(build_unit_elab): Rework to just gimplify.
* utils.c (pending_elaborations, elist_stack, getdecls): Deleted.
(block_has_vars, mark_visited, add_pending_elaborations): Likewise.
(get_pending_elaborations, pending_elaborations_p): Likewise.
(push_pending_elaborations, pop_pending_elaborations): Likewise.
(get_elaboration_location, insert_elaboration_list): Likewise.
(gnat_binding_level): Renamed from ada_binding_level.
(init_gnat_to_gnu): Don't clear pending_elaborations.
(global_bindings_p): Treat as global if no current_binding_level.
(set_current_block_context): New function.
(gnat_pushdecl): Renamed from pushdecl; major rework.
All callers changed.
(create_type_decl, create_var_decl, create_subprog_decl): Add new arg.
(finish_record_type): Call call pushdecl for stub decl.
(function_nesting_depth): Deleted.
(begin_subprog_body): Delete obsolete code.
* utils2.c (build_call_alloc_dealloc): Add new arg to create_var_decl.
Roger Sayle [Mon, 28 Jun 2004 20:49:37 +0000 (20:49 +0000)]
expmed.c (expand_smod_pow2): New function to expand signed remainder by a constant power of 2, such as "x % 16".
* expmed.c (expand_smod_pow2): New function to expand signed
remainder by a constant power of 2, such as "x % 16".
(expand_divmod): Call new expand_smod_pow2 when appropriate.
Minor corrections to comments, e.g. wrapping long lines.
Benjamin Kosnik [Mon, 28 Jun 2004 18:31:18 +0000 (18:31 +0000)]
safe_base.h (__gnu_debug::_Safe_sequence_base): Revert -Weffc++ changes that defined copy ctory and or assignment operator.
2004-06-28 Benjamin Kosnik <bkoz@redhat.com>
* include/debug/safe_base.h (__gnu_debug::_Safe_sequence_base):
Revert -Weffc++ changes that defined copy ctory and or assignment
operator.
* libsupc++/tinfo.cc (__upcast_result): Same.
libiberty:
* cp-demangle.h: Declare cplus_demangle_operators,
cplus_demangle_builtin_types, cplus_demangle_mangled_name, and
cplus_demangle_type as static if IN_GLIBCPP_V3.
libobjc:
* encoding.c: Rename target_flags with a #define to avoid
conflict with a prior declaration.
* exp_util.adb (Is_Possibly_Unaligned_Slice): Completely rewritten, to
deal with problem of inefficient slices on machines with strict
alignment, when the slice is a component of a composite.
* checks.adb (Apply_Array_Size_Check): Do not special case 64-bit
machines, we need the check there as well.
2004-06-28 Ed Schonberg <schonberg@gnat.com>
* exp_ch5.adb (Expand_Assign_Array): Use correct condition to
determine safe copying direction for overlapping slice assignments
when component is controlled.
* sem_ch12.adb (Instantiate_Formal_Package): Implicit operations of a
formal derived type in the actual for a formal package are visible in
the enclosing instance.
2004-06-28 Ed Schonberg <schonberg@gnat.com>
PR ada/15600
* sem_util.adb (Trace_Components): Diagnose properly an illegal
circularity involving a private type whose completion includes a
self-referential component.
(Enter_Name): Use Is_Inherited_Operation to distinguish a source
renaming or an instantiation from an implicit derived operation.
2004-06-28 Pascal Obry <obry@gnat.com>
* mlib-tgt-mingw.adb: (Library_Exists_For): Remove "lib" prefix from
DLL.
(Library_File_Name_For): Idem.
2004-06-28 Matthew Gingell <gingell@gnat.com>
* g-traceb.ads: Add explanatory note on the format of addresses
expected by addr2line.
2004-06-28 Jerome Guitton <guitton@act-europe.fr>
* Makefile.in: Force debugging information on s-tasdeb.adb,
a-except.adb and s-assert.adb needed by the debugger.
2004-06-28 Vincent Celier <celier@gnat.com>
* make.adb (Collect_Arguments_And_Compile): Change Flag1 to
Need_To_Build_Lib.
(Gnatmake): Ditto.
* mlib-prj.adb (Check_Library): Replace Flag1 with Need_To_Build_Lib
* prj.adb: Minor reformatting
(Project_Empty): Change Flag1 to Need_To_Build_Lib. Remove Flag2.
* prj.ads: Comment updates
Minor reformatting
(Project_Data): Change Flag1 to Need_To_Build_Lib.
Remove Flag2: not used.
* prj-dect.adb (Parse_Declarative_Items): Accept "null" as a
declaration.
* gnat_ugn.texi: Put a "null;" declaration in one project file example
* makegpr.adb (Compile_Link_With_Gnatmake): Put the global archives in
front of the linker options.
(Link_Foreign): Put the global archives and the libraries in front of
the linker options.
2004-06-28 Javier Miranda <miranda@gnat.com>
* rtsfind.adb: (Get_Unit_Name): Fix typo in comment
(RTU_Loaded): Code cleanup
(Set_RTU_Loaded): New procedure to register as *loaded* explicitly
withed predefined units.
* rtsfind.ads (Set_RTU_Loaded): New procedure to register as *loaded*
explicitly withed predefined units.
Fix typo in comment
* sem_ch10.adb (Analyze_Compilation_Unit): Register as *loaded*
explicitly withed predefined units.
Richard Kenner [Mon, 28 Jun 2004 12:12:51 +0000 (12:12 +0000)]
tree-sra.c (is_sra_candidate_ref): Remove second arg; all callers changed.
* tree-sra.c (is_sra_candidate_ref): Remove second arg; all callers
changed.
(is_sra_candidate_complex_ref): New function.
(scalarize_modify_expr): Call it and check for LHS also.
* tree-pretty-print.c (dump_function_declaration): New.
(dump_generic_node, case FUNCTION_TYPE): Call it.
(dump_generic_node, case RECORD_TYPE): Don't output dup semicolon.
(dump_generic_node, case DECL_EXPR): New case.
(dump_generic_node, case PLACEHOLDER_EXPR): Handle.
(print_declaration): Handle type and function declarations.
Nathan Sidwell [Mon, 28 Jun 2004 10:41:19 +0000 (10:41 +0000)]
friend.c (add_friend): Only perform access checks when context is a class.
* friend.c (add_friend): Only perform access checks when context
is a class.
* lex.c (cxx_make_type): Only create a binfo for aggregate types.
* parser.c (cp_parser_class_specifier): Disable access checks here
when parsing the body of a templated class.
* semantics.c (perform_or_defer_access_checks): Reorder to allow
NULL binfos when not checking access.
Paolo Carlini [Mon, 28 Jun 2004 09:27:18 +0000 (09:27 +0000)]
2004-06-28 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/monetary_members.cc
(moneypunct<wchar_t>::_M_initialize_moneypunct): Clean up
assignments of _M_decimal_point and _M_thousands_sep.
Gabriel Dos Reis [Sun, 27 Jun 2004 21:36:00 +0000 (21:36 +0000)]
re PR c++/14123 (odd number of parentheses in error message)
PR c++/14123
* cxx-pretty-print.c (pp_cxx_ptr_operator): Properly put
paranthesis in case of pointers to array members.
* error.c (dump_type_prefix): Likewise.
(dump_type_suffix): Maybe issue a whitespace when printing
ARRAY_TYPE.
Ulrich Weigand [Sun, 27 Jun 2004 15:31:53 +0000 (15:31 +0000)]
s390-protos.h (s390_load_got): Update prototype.
* config/s390/s390-protos.h (s390_load_got): Update prototype.
* config/s390/s390.c (struct machine_function): Add member base_reg.
(s390_decompose_address): Accept UNSPEC_LTREF. Simplify logic.
(s390_split_branches): Annotate late pool references.
(annotate_constant_pool_refs): New function.
(find_constant_pool_ref): Work on annotated pool references.
(replace_constant_pool_ref): Likewise. Use explicit base.
(replace_ltrel_base): Use explicit base.
(s390_mainpool_start): Reflect main_pool pattern change.
(s390_mainpool_finish): Use base register from main_pool.
Update calls to replace_ltrel_base and replace_constant_pool_ref.
(s390_chunkify_start): Use base_reg from struct machine_function.
(s390_chunkify_finish): Remove base_reg argument. Update calls
to replace_ltrel_base and replace_constant_pool_ref.
(s390_reorg): Don't decide upon base register. Update calls.
(s390_load_got): Remove MAYBE_DEAD handling. Do not emit insns
but return sequence instead.
(s390_emit_prologue): Decide upon base register to use. Annotate
all literal pool references. Adapt to main_pool pattern change.
Update s390_load_got call; move MAYBE_DEAD handling here.
(s390_emit_epilogue): Annotate late literal pool references.
Remove barrier before register restore instruction.
* config/s390/s390.md (UNSPEC_LTREF): New constant.
("builtin_setjmp_receiver"): Update s390_load_got call.
("main_pool"): Explicitly reference base register.
Bryce McKinlay [Sun, 27 Jun 2004 15:30:06 +0000 (15:30 +0000)]
re PR java/15715 (member interfaces are always static)
2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
PR java/15715.
* parse.y (create_interface): Set correct access modifiers for
interfaces.
* jcf-write.c (get_classfile_modifiers): New function.
(generate_classfile): Use get_classfile_modifiers, not
get_access_flags.
2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
* parse.y (register_incomplete_type): Set JDEP_ENCLOSING for "super"
dependency to current parser context, not NULL_TREE, for top-level
classes.
(jdep_resolve_class): Enable member access check for all inner
class dependencies.
Roger Sayle [Sun, 27 Jun 2004 15:23:46 +0000 (15:23 +0000)]
fold-const.c (fold): Optimize ~X|X and X|~X as -1.
* fold-const.c (fold) <BIT_IOR_EXPR>: Optimize ~X|X and X|~X as -1.
<BIT_XOR_EXPR>: Optimize ~X|X and X|~X as -1.
<BIT_AND_EXPR>: Optimize ~X&X and X&~X as 0.
<TRUTH_AND_EXPR, TRUTH_ANDIF_EXPR>: Optimize !X&&X and X&&!X as false.
<TRUTH_OR_EXPR, TRUTH_ORIF_EXPR>: Optimize !X||X and !X||X as true.
<TRUTH_XOR_EXPR>: Optimize !X^X and X^X! as true. Now that
TRUTH_XOR_EXPR is a commutative tree code, don't test whether arg0
is a constant.
* error.c (pp_template_argument_list_start): Remove.
(pp_template_argument_list_end): Likewise.
(pp_separate_with_comma): Use pp_cxx_separate_with.
(reinit_global_formatting_buffer): Remove.
(pp_non_consecutive_character): Likewise.
(dump_scope): Use pp_cxx_colon_colon.
(dump_template_parameter): Use pp_cxx_identifier,
pp_cxx_tree_identifier and pp_cxx_whitespace.
(dump_templat_bindings): Replace use of pp_string with
sequence
of pp_cxx_whitespace and pp_equal.
(dump_type): Use pp_cxx_identifier, pp_cxx_tree_identifier,
pp_cxx_colon_colon, pp_cxx_whitespace throughout. Don't set
padding here.
(dump_aggr_type): Use pp_cxx_identifier amd
pp_cxx_tree_identifier.
(dump_type_prefix): Don't set padding. Use pp_cxx_whitespace,
pp_cxx_left_parent, pp_cxx_colon_colon and pp_cxx_star
troughout.
(dump_type_suffix): Use pp_cxx_right_paren,
pp_cxx_left_bracket,
pp_cxx_right_bracket, pp_cxx_identifier throughout,
(dump_decl): Likewise.
(dump_template_decl): Likewise.
(dump_function_decl): Likewise. Set padding as appropriate.
(dump_parameters): Use pp_cxx_left_paren, pp_cxx_identifier
and
pp_cxx_right_paren.
(dump_exception_spec): Likewise.
(dump_function_name): Use pp_cxx_tree_identifier and
pp_cxx_identifier.
(dump_template_parms): Use pp_cxx_begin_template_argument_list
and
pp_cxx_end_template_argument_list.
(dump_expr): Use pp_cxx_left_paren, pp_cxx_right_paren,
pp_cxx_colon_colon, pp_cxx_identifier, pp_cxx_tree_identifier
and
pp_cxx_whitespace throughout.
(dump_binary_op): Use pp_cxx_whitespace, pp_cxx_left_paren and
pp_cxx_right_paren.
(dump_unary_op): Likewise.
(reinit_cxx_pp): New function.
(type_as_string); Use it.
(expr_as_string): Likewise.
(decl_as_string); Likewise.
(context_as_string): Likewise.
(lang_decl_name): Likewise.
(decl_to_string): Likewise.
(expr_to_string): Likewise.
(parm_to_string): Likewise.
(type_to_string): Likewise.
(args_to_string): Likewise.
(cv_to_string): Likewise.
Mark Wielaard [Sun, 27 Jun 2004 12:10:12 +0000 (12:10 +0000)]
[multiple changes]
2004-06-27 Mark Wielaard <mark@klomp.org>
* java/awt/EventQueue.java (postEvent): Throw NullPointerException
when argument is null.
2004-06-26 Mark Wielaard <mark@klomp.org>
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
(ok_clicked): Use Ljava/lang/String; not Ljava.lang.String; in JNI
GetMethodID call.
(cancel_clicked): Likewise.
Richard Kenner [Sat, 26 Jun 2004 21:30:01 +0000 (17:30 -0400)]
ada-tree.def (DECL_STMT): Deleted.
2004-06-26 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* ada-tree.def (DECL_STMT): Deleted.
* ada-tree.h (IS_ADA_STMT): Now test against STMT_STMT.
(DECL_STMT_VAR): Deleted.
* decl.c: add_decl_stmt now add_decl_expr.
* gigi.h: Likewise.
* trans.c: Likewise.
(gnat_gimplify_type_sizes, gnat_gimplify_one_sizepos): Deleted.
(gnat_to_gnu, case N_Subprogram_Body): Set cfun->function_end_locus.
(add_stmt): Only handle padded type here.
(add_stmt_with_node): Allow gnat_node to not be present.
(gnat_gimplify_stmt, case USE_STMT): Set *STMT_P to null.
(gnat_gimplify_stmt, case DECL_STMT): Deleted.
(gnat_stabilize_reference_1): If COMPONENT_REF of fat pointer,
make a SAVE_EXPR for the entire fat pointer.
* utils.c (pushdecl): Walk a DECL_EXPR in global case.
(create_index_type): Make a DECL_EXPR.
(end_subprog_body): Don't call allocate_struct_function here but
do clear cfn.
Richard Kenner [Sat, 26 Jun 2004 21:11:23 +0000 (21:11 +0000)]
c-common.c (c_safe_from_p, [...]): Deleted.
2004-06-26 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* c-common.c (c_safe_from_p, c_walk_subtrees): Deleted.
* c-common.def (DECL_STMT): Remove.
* c-common.h (DECL_STMT_DECL): Deleted.
(COMPOUNT_LITERAL_EXPR_DECL): Use DECL_EXPR_DECL.
(c_safe_from_p, c_walk_subtrees): Deleted.
* c-decl.c, c-parse.in, c-pretty-print.c: DECL_STMT now DECL_EXPR.
* c-dump.c (c_dump_tree, case DECL_STMT): Deleted.
* c-gimplify.c (gimplify_decl_stmt): Deleted.
(gimplify_compound_literal_expr): Use DECL_EXPR_DECL
and gimplify_and_add.
(c_gimplify_expr, case DECL_EXPR): New case.
(c_gimplify_expr, case DECL_STMT): Deleted.
* c-lang.c (LANG_HOOKS_SAFE_FROM_P): Likewise.
(LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Likewise.
* expr.c (safe_from_p, case 's'): New case.
* gimplify.c (gimplify_decl_expr): New function.
(gimplify_expr, case DECL_EXPR): New case.
* tree-inline.c (walk_tree): Walk into all fields of a type and
decl only if they are in a DECL_EXPR.
(mark_local_for_remap_r): Minor code cleanup.
* tree-outof-ssa.c (discover_nonconstant_array_refs_r): Add else.
* tree.c (has_cleanups, case DECL_EXPR): New case.
* tree.def (DECL_EXPR): New code.
* tree.h (DECL_EXPR_DECL): New macro.
Bryce McKinlay [Sat, 26 Jun 2004 20:40:31 +0000 (20:40 +0000)]
PR java/1207, java/16178
PR java/1207, java/16178
* jcf-parse.c (load_class): Return immediately if passed a type decl
where CLASS_FROM_SOURCE_P is set. Remove FIXME.
* parse.y (do_resolve_class): Remove checks for CLASS_FROM_SOURCE_P
before calling load_class.
(qualify_and_find): Likewise.
(find_in_imports_on_demand): Likewise.
(find_applicable_accessible_methods_list): Likewise.
Zack Weinberg [Sat, 26 Jun 2004 17:39:40 +0000 (17:39 +0000)]
re PR preprocessor/15933 (Caching of include files breaks compilation)
PR 15933
Partially revert patch of 2004-06-05.
* files.c (search_cache): Remove pfile argument. Don't check
for file that would be found by "" or <> search here...
(_cpp_find_file): ...do it here, before calling find_file_in_dir.
Do not apply directory-of-current-file correction to files
found by this check. Rearrange code slightly.
Paolo Carlini [Sat, 26 Jun 2004 08:42:38 +0000 (08:42 +0000)]
re PR libstdc++/16210 ([3.4 only] gratuitously omits "long long" I/O)
2004-06-26 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/16210
* acinclude.m4 (GLIBCXX_ENABLE_LONG_LONG): Do not check for the
availability of strto(u)ll, not used anymore in the iostreams.
* configure: Regenerate.
Andreas Tobler [Sat, 26 Jun 2004 03:44:38 +0000 (05:44 +0200)]
2004-06-26 Andreas Tobler <a.tobler@schweiz.ch>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
(init_dpi_conversion_factor): Check for int_dpi < 0 in case gtk-xft-dpi
can not calculate the right value.
(dpi_changed_cb): Likewise. Mark *pspec as unused.
Roger Sayle [Sat, 26 Jun 2004 01:43:57 +0000 (01:43 +0000)]
ifcvt.c (seq_contains_jump): Delete function.
* ifcvt.c (seq_contains_jump): Delete function.
(end_ifcvt_sequence): Replace call to seq_contains_jump with an
inline test for a jump instruction in the existing "insn" loop.
(block_fallthru): Document function.
Kelley Cook [Fri, 25 Jun 2004 23:06:47 +0000 (23:06 +0000)]
re PR other/15194 (Fastjar configure needlessly fails without long long)
2004-06-25 Kelley Cook <kcook@gcc.gnu.org>
PR other/15194
* configure.ac: Add check for long long.
* jartool.h: Check for long long before using it.
* configure: Regenerate
* config.h.in: Regenerate.
Richard Kenner [Fri, 25 Jun 2004 20:47:45 +0000 (20:47 +0000)]
gimplify.c (lookup_tmp_var): Set TREE_READONLY in is_formal case.
* gimplify.c (lookup_tmp_var): Set TREE_READONLY in is_formal case.
(build_addr_expr_with_type): Deleted.
(build_addr_expr): Deleted; callers changed to build_fold_addr_expr.
(gimplify_compound_lval): Make two passes over reference nest.
Richard Kenner [Fri, 25 Jun 2004 20:33:09 +0000 (20:33 +0000)]
tree-nested.c (build_addr): Merge real/imagpart with handled_component_p.
* tree-nested.c (build_addr): Merge real/imagpart with
handled_component_p.
(convert_nonlocal_reference, convert_local_reference): Process extra
args to COMPONENT_REF and ARRAY_REF.
* tree-outof-ssa.c (discover_nonconstant_array_refs_r): Check for
lower bound and field offset being constant.
Richard Kenner [Fri, 25 Jun 2004 19:12:02 +0000 (19:12 +0000)]
tree-inline.c (remap_type): Arrange to have just one pointer type for each type, mode, and 'can alias' value.
* tree-inline.c (remap_type): Arrange to have just one pointer type
for each type, mode, and 'can alias' value.
(setup_one_parameter): Remap type when making VAR_DECL for PARM_DECL.
(estimate_num_insns_1): Minor code reformatting.
(inline_forbidden_p_1): Likewise; add; missing return statement.
Roger Sayle [Fri, 25 Jun 2004 18:40:07 +0000 (18:40 +0000)]
re PR middle-end/15825 (if-cvt optimisation patch noce_try_sign_mask breaks apple-ppc-darwin port)
PR middle-end/15825
* ifcvt.c (unshare_ifcvt_sequence): Rename to end_ifcvt_sequence.
Use get_isns and end_sequence instead of accepting a seq argument.
Scan the instruction sequence for unrecognizable or jump insns.
(noce_try_move, noce_try_store_flag, noce_try_store_flag_constants,
noce_try_addcc, noce_try_store_flag_mask, noce_try_cmove,
noce_try_cmove_arith, noce_try_minmax, noce_try_abs,
noce_try_sign_mask): Use end_ifcvt_sequence to factor common code.