PR bootstrap/12269
* simplify-rtx.c (simplify_gen_relational): Allow the cmp_mode
argument to be VOIDmode, taking the mode of the comparison from
the operands. Only call simplify_relational_operation if we
know the mode of the comparison. Honor FLOAT_STORE_FLAG_VALUE
if comparison has a floating point result. Ensure that the
result is always of the specified mode.
(simplify_replace_rtx): Simplify call to simplify_gen_relational.
(simplify_unary_operation): Ensure the correct mode and cmp_mode
are always passed to simplify_gen_relational. Simplify NOT of
comparison operator in any mode, not just BImode.
(simplify_ternary_operation): Correct tests on the return value
of simplify_relational_operation to use const_true_rtx, not
const1_rtx. Abort if it ever returns a non-constant result.
* cfgloopanal.c (count_strange_loop_iterations): Use the function
simplify_relational_operation, not simplify_gen_relational, if
we're only interested in constant comparisons and will ignore
non-constant results.
From-SVN: r71439
* fold-const.c (tree_swap_operands_p): New function to determine
the prefered ordering of operands.
(fold): Numerous clean-ups. Use tree_swap_operands_p when swapping
operands to commutative, comparison or ternary operators. Replace
uses of TREE_SET_CODE with recursive call to fold. Remove duplicate
transformation of A ? B : C into !A ? C : B.
From-SVN: r71438
PR c++/7939
* typeck.c (comptypes): Don't ICE when its first argument is
error_mark_node.
(compparms): Reverse the arguments of same_type_p.
* g++.dg/template/crash11.C: New test.
From-SVN: r71432
* c-common.c (handle_warn_unused_result_attribute): New function.
(c_common_attribute_table): Add warn_unused_result.
(c_expand_expr): Issue warning when result of inlined function
with warn_unused_result attribute is ignored.
* calls.c (expand_call): Issue warning when result of function
with warn_unused_result attribute is ignored.
* c-common.h (STMT_EXPR_WARN_UNUSED_RESULT): Define.
* expr.c (expr_wfl_stack): Define.
(expand_expr) <case EXPR_WITH_FILE_LOCATION>: If ignore,
pass const0_rtx as target. Chain locations into expr_wfl_stack.
* tree-inline.c (expand_call_inline): Set STMT_EXPR_WARN_UNUSED_RESULT
bit if inlined function has warn_unused_result attribute.
* input.h (expr_wfl_stack): Declare.
* doc/extend.texi: Document warn_unused_result attribute.
* gcc.dg/attr-warn-unused-result.c: New test.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r71424
* config/xtensa/xtensa.c (xtensa_multibss_section_type_flags): Add
ATTRIBUTE_UNUSED.
(call_insn_operand): For PIC, don't allow a direct call to a
function in a different section than the current one.
From-SVN: r71415
2003-09-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* doc/invoke.texi (Warning Options): Add missing hyphen before
"Wimport". Change "-Wno-endif-labels" to "-Wendif-labels".
Move "-Wold-style-definition" to the C-only section.
Fix the ordering of the warning options.
From-SVN: r71414
* gcse.c (remove_reachable_equiv_notes): New.
(replace_store_insn): Call it. Update antic list.
(store_killed_in_insn): Take REG_EQUAL notes into account.
(build_store_vectors, delete_store): Add parameter to
replace_store_insn call.
Co-Authored-By: Jeff Law <law@redhat.com>
From-SVN: r71412
2003-09-15 Vladimir Makarov <vmakarov@redhat.com>
* haifa-sched.c (schedule_block): Use ready_remove_first instead
of choose_ready for non-dfa insn scheduling.
From-SVN: r71403
* coverage.c (create_coverage): Do not call pushlevel/poplevel.
* langhooks-def.h (lhd_do_nothing_iii_return_null_tree): New
function.
* langhooks.c (lhd_do_nothing_iii_return_null_tree): Define it.
PR c++/3907
* class.c (maybe_note_name_used_in_class): Refine test for whether
or not we are in a class scope.
* cp-tree.h (language_function): Remove x_expanding_p.
(expanding_p): Remove.
(doing_semantic_analysis_p): Remove.
(scope_kind): Add sk_function_parms, sk_class,
sk_namespace.
(innermost_scope_kind): New method.
* call.c (cxx_type_promotes_to): Use type_decays_to.
* cp-lang.c (LANG_HOOKS_PUSHLEVEL): Redefine.
(LANG_HOOKS_POPLEVEL): Likewise.
* decl.c (cp_binding_level): Remove parm_flag, template_parms_p,
template_spec_p, namespace_p, is_for_scope, is_try_scope, and
is_catch_scope. Add kind and explicit_spec_p.
(cxx_scope_descriptor): Use a lookup table.
(find_class_binding_level): Use "kind" field in binding_level, not
the various flags.
(pop_binding_level): Likewise.
(innermost_nonclass_level): Likewise.
(toplevel_bindings_p): Likewise.
(namespace_bindings_p): Likewise.
(template_parm_scope_p): Likewise.
(innermost_scope_kind): New method.
(current_tmpl_spec_kind): Use "kind" field in binding_level, not
the various flags.
(pushlevel): Remove check for doing_semantic_analysis_p.
(begin_scope): Simplify.
(add_decl_to_level): Use "kind" field in binding_level, not
the various flags.
(push_local_binding): Likewise.
(pop_label): Remove check for doing_semantic_analysis_p.
(poplevel): Use "kind" field in binding_level, not
the various flags.
(set_block): Remove check for doing_semantic_analysis_p.
(pushlevel_class): Use "kind" field in binding_level, not
the various flags.
(poplevel_class): Likewise.
(initial_push_namespace_scope): Likewise.
(maybe_push_to_top_level): Likewise.
(set_identifier_type_value_with_scope): Likewise.
(pop_everything): Likewise.
(maybe_process_template_type_declaration): Likewise.
(pushtag): Likewise.
(pushdecl): Likewise.
(pushdecl_with_scope): Likewise.
(check_previous_goto_1): Likewise.
(define_label): Likewise.
(finish_case_label): Likewise.
(lookup_tag): Likewise.
(unqualified_namespace_lookup): Likewise.
(lookup_name_real): Likewise.
(lookup_name_current_level): Likewise.
(lookup_type_current_level): Likewise.
(record_builtin_type): Likewise.
(cp_make_fname_decl): Likewise.
(maybe_inject_for_scope_var): Likewise.
(cp_finish_decl): Remove check for doing_semantic_analysis_p.
(start_function): Use begin_scope, not pushlevel.
(finish_function): Use "kind" field in binding_level, not
the various flags.
(start_method): Use begin_scope, not pushlevel.
(make_label_decl): Do not check expanding_p.
(save_function-data): Do not set expanding_p.
(cxx_push_function_context): Do not clear expanding_p.
* semantics.c (cxx_expand_function_start): Do not set expanding_p.
PR c++/3907
* g++.dg/parse/template12.C: New test.
* g++.dg/abi/bitfield11.C: New test.
* g++.dg/abi/bitfield12.C: Likewise.
From-SVN: r71393
* class.c (layout_class_type): Make DECL_MODE match TYPE_MODE for
an bit-field whose width exceeds that of its type.
* g++.dg/abi/bitfield11.C: New test.
* g++.dg/abi/bitfield12.C: Likewise.
From-SVN: r71392
* gcc.dg/cpp/separate-1.c: Adjust line of error. Test for correct
non-expansion of functional macro name without arguments at EOL.
* gcc.dg/cpp/spacing1.c: Revert 2003-08-04's change. Likewise.
From-SVN: r71380
* function.c (STACK_BYTES): Move definition to head of file.
(assign_parms): Don't pass current_function_pretend_args_size
directly to SETUP_INCOMING_VARARGS. For partial register arguments,
round current_function_pretend_args_size up to STACK_BYTES. Skip any
excess before laying out the argument.
From-SVN: r71372
2003-09-13 Andrew Pinski <pinskia@physics.uc.edu>
PR target/12021
* config/m68k/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Remove the asserts
as they already are done in config/m68k/m68k.h.
* config/m68k/netbsd.h (TARGET_OS_CPP_BUILTINS): Likewise
From-SVN: r71369
2003-09-13 Andrew Pinski <pinskia@physics.uc.edu>
* config/rs6000/rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Remove.
(machopic_output_stub): Only generate pic base symbols when using pic
and generate them in the form L00000000$spb.
From-SVN: r71368
2003-09-13 Phil Edwards <phil@codesourcery.com>
* docs/doxygen/run_doxygen: Clear GENERATE_TAGFILE entirely
if man pages are on.
* docs/doxygen/user.cfg.in: And here.
From-SVN: r71363
2003-09-12 Ziemowit Laski <zlaski@apple.com>
* pretty-print.c (pp_construct): Use xcalloc instead of xmalloc
when allocating pp->buffer.
From-SVN: r71346