summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-12-10 09:43:14 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-12-10 09:43:14 +0000
commitcc7c7762d9ba86eb59eaea7d53a946bd13f2affe (patch)
tree377e3a187ff9554de9073cdea90feb2dc49c60ec
parent005927ac5d0090e0405b3401fbeee84251f091ff (diff)
downloadgcc-cc7c7762d9ba86eb59eaea7d53a946bd13f2affe.tar.gz
2008-12-10 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r142640 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@142641 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog.melt3
-rw-r--r--gcc/ChangeLog285
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/gcc-interface/decl.c10
-rw-r--r--gcc/ada/gcc-interface/utils.c2
-rw-r--r--gcc/builtins.c26
-rw-r--r--gcc/c-decl.c4
-rw-r--r--gcc/c-pretty-print.c8
-rw-r--r--gcc/calls.c12
-rw-r--r--gcc/cfgloopanal.c4
-rw-r--r--gcc/common.opt6
-rw-r--r--gcc/config/alpha/alpha.c19
-rw-r--r--gcc/config/dfp-bit.c2
-rw-r--r--gcc/config/i386/i386.c16
-rw-r--r--gcc/config/ia64/ia64.md12
-rw-r--r--gcc/config/m32c/m32c.h5
-rw-r--r--gcc/config/mips/mips.h76
-rw-r--r--gcc/config/mips/sync.md18
-rw-r--r--gcc/config/rs6000/darwin-ldouble.c2
-rw-r--r--gcc/config/rs6000/linux-unwind.h10
-rw-r--r--gcc/config/s390/s390.md173
-rw-r--r--gcc/cp/ChangeLog28
-rw-r--r--gcc/cp/call.c22
-rw-r--r--gcc/cp/class.c30
-rw-r--r--gcc/cp/cp-tree.h30
-rw-r--r--gcc/cp/decl.c8
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/name-lookup.c3
-rw-r--r--gcc/doc/invoke.texi32
-rw-r--r--gcc/doc/sourcebuild.texi2
-rw-r--r--gcc/doc/tm.texi3
-rw-r--r--gcc/emutls.c3
-rw-r--r--gcc/final.c5
-rw-r--r--gcc/fixed-value.c2
-rw-r--r--gcc/flags.h13
-rw-r--r--gcc/fortran/ChangeLog33
-rw-r--r--gcc/fortran/cpp.c11
-rw-r--r--gcc/fortran/cpp.h1
-rw-r--r--gcc/fortran/expr.c17
-rw-r--r--gcc/fortran/invoke.texi11
-rw-r--r--gcc/fortran/lang-specs.h34
-rw-r--r--gcc/fortran/lang.opt4
-rw-r--r--gcc/fortran/trans-expr.c17
-rw-r--r--gcc/function.c8
-rw-r--r--gcc/function.h1
-rw-r--r--gcc/genpreds.c2
-rw-r--r--gcc/gimplify.c9
-rw-r--r--gcc/graphite.c54
-rw-r--r--gcc/ipa-inline.c1
-rw-r--r--gcc/ira-build.c27
-rw-r--r--gcc/ira-color.c306
-rw-r--r--gcc/ira-conflicts.c34
-rw-r--r--gcc/ira-costs.c36
-rw-r--r--gcc/ira-emit.c9
-rw-r--r--gcc/ira-int.h10
-rw-r--r--gcc/ira-lives.c186
-rw-r--r--gcc/ira.c202
-rw-r--r--gcc/opts.c35
-rw-r--r--gcc/predict.c2
-rw-r--r--gcc/reload1.c7
-rw-r--r--gcc/stor-layout.c106
-rw-r--r--gcc/testsuite/ChangeLog103
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C18
-rw-r--r--gcc/testsuite/g++.dg/other/packed1.C2
-rw-r--r--gcc/testsuite/g++.dg/overload/defarg2.C17
-rw-r--r--gcc/testsuite/g++.dg/overload/defarg3.C15
-rw-r--r--gcc/testsuite/g++.dg/torture/type-generic-1.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr35468.c7
-rw-r--r--gcc/testsuite/gcc.dg/20020919-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/ctor1.c10
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr38084.c31
-rw-r--r--gcc/testsuite/gcc.dg/memcpy-2.c25
-rw-r--r--gcc/testsuite/gcc.dg/memset-1.c28
-rw-r--r--gcc/testsuite/gcc.dg/pr31866.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr35442.c11
-rw-r--r--gcc/testsuite/gcc.dg/pr35443.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr35468.c10
-rw-r--r--gcc/testsuite/gcc.dg/torture/type-generic-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37248-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37248-3.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr38240.c8
-rw-r--r--gcc/testsuite/gcc.target/ia64/versionid-1.c2
-rw-r--r--gcc/testsuite/gcc.target/ia64/versionid-2.c2
-rw-r--r--gcc/testsuite/gcc.target/mips/atomic-memory-1.c7
-rw-r--r--gcc/testsuite/gcc.target/mips/fix-r10000-12.c2
-rw-r--r--gcc/testsuite/gcc.target/mips/fix-r10000-6.c2
-rw-r--r--gcc/testsuite/gfortran.dg/boz_14.f901
-rw-r--r--gcc/testsuite/gfortran.dg/boz_9.f901
-rw-r--r--gcc/testsuite/gfortran.dg/default_format_denormal_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/id-3.f9021
-rw-r--r--gcc/testsuite/gfortran.dg/init_flag_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/init_flag_4.f901
-rw-r--r--gcc/testsuite/gfortran.dg/init_flag_5.f901
-rw-r--r--gcc/testsuite/gfortran.dg/integer_exponentiation_1.f901
-rw-r--r--gcc/testsuite/gfortran.dg/integer_exponentiation_5.F901
-rw-r--r--gcc/testsuite/gfortran.dg/isnan_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/isnan_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/module_nan.f902
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_42.f902
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_43.f902
-rw-r--r--gcc/testsuite/gfortran.dg/nan_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/nan_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/nan_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/nan_4.f902
-rw-r--r--gcc/testsuite/gfortran.dg/nearest_1.f901
-rw-r--r--gcc/testsuite/gfortran.dg/nearest_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/nearest_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/pr35983.f9024
-rw-r--r--gcc/testsuite/gfortran.dg/pr37243.f1
-rw-r--r--gcc/testsuite/gfortran.dg/real_const_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/transfer_simplify_2.f901
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_spacing.x2
-rw-r--r--gcc/toplev.c6
-rw-r--r--gcc/tree-optimize.c1
-rw-r--r--gcc/tree-scalar-evolution.c12
-rw-r--r--gcc/tree-ssa-ccp.c9
-rw-r--r--gcc/tree-ssa-loop-ivopts.c2
-rw-r--r--gcc/tree-ssa-structalias.c15
-rw-r--r--gcc/tree.c16
-rw-r--r--gcc/tree.h9
-rw-r--r--libgfortran/ChangeLog9
-rw-r--r--libgfortran/io/transfer.c25
124 files changed, 1883 insertions, 676 deletions
diff --git a/ChangeLog.melt b/ChangeLog.melt
index fe107f1aef9..a9b05e49b16 100644
--- a/ChangeLog.melt
+++ b/ChangeLog.melt
@@ -1,3 +1,6 @@
+2008-12-10 Basile Starynkevitch <basile@starynkevitch.net>
+ MELT branch merged with trunk r142640
+
2008-12-08 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r142553
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2b4f6fa9409..d7e876707c9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,15 +1,294 @@
+2008-12-10 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/37170
+ PR target/38448
+ * final.c (output_addr_const) <SYMBOL_REF>: Call assemble_external
+ on the associated SYMBOL_REF_DECL node, if any.
+
+2008-12-09 David Daney <ddaney@caviumnetworks.com>
+
+ * config/mips/sync.md (sync_<optab>_12): Replace
+ MIPS_SYNC_OP_12_NOT_NOP with MIPS_SYNC_OP_12_AND.
+ (sync_old_<optab>_12): Remove third paramater to
+ MIPS_SYNC_OLD_OP_12 macro, replace MIPS_SYNC_OLD_OP_12_NOT_NOP
+ with MIPS_SYNC_OLD_OP_12_AND.
+ (sync_new_<optab>_12): Replace MIPS_SYNC_NEW_OP_12_NOT_NOP
+ with MIPS_SYNC_NEW_OP_12_AND.
+ (sync_nand_12): Replace MIPS_SYNC_OP_12_NOT_NOT with
+ MIPS_SYNC_OP_12_XOR, reduce length attribute to 40.
+ (sync_old_nand_12): Remove third paramater to MIPS_SYNC_OLD_OP_12
+ macro, replace MIPS_SYNC_OLD_OP_12_NOT_NOT with
+ MIPS_SYNC_OLD_OP_12_XOR and reduce length attribute to 40.
+ (sync_new_nand_12): Replace MIPS_SYNC_NEW_OP_12_NOT_NOT with
+ MIPS_SYNC_NEW_OP_12_XOR.
+ * config/mips/mips.h (MIPS_SYNC_OP_12, MIPS_SYNC_OP_12_NOT_NOP,
+ MIPS_SYNC_OP_12_NOT_NOT,MIPS_SYNC_OLD_OP_12_NOT_NOP,
+ MIPS_SYNC_OLD_OP_12_NOT_NOT, MIPS_SYNC_NEW_OP_12,
+ MIPS_SYNC_NEW_OP_12_NOT_NOP, MIPS_SYNC_NEW_OP_12_NOT_NOT,
+ MIPS_SYNC_NAND, MIPS_SYNC_OLD_NAND, MIPS_SYNC_NEW_NAND): Rewritten
+ to implement new __sync_nand semantics.
+ (MIPS_SYNC_OLD_OP_12): Implement new __sync_nand semantics, and
+ remove third parameter.
+ (MIPS_SYNC_OLD_OP_12_NOT_NOP_REG,
+ MIPS_SYNC_OLD_OP_12_NOT_NOT_REG): Removed.
+ (MIPS_SYNC_OP_12_NOT_NOP): Renamed to MIPS_SYNC_OP_12_AND.
+ (MIPS_SYNC_OP_12_NOT_NOT): Renamed to MIPS_SYNC_OP_12_XOR.
+ (MIPS_SYNC_OLD_OP_12_NOT_NOP): Renamed to MIPS_SYNC_OLD_OP_12_AND.
+ (MIPS_SYNC_OLD_OP_12_NOT_NOT): Renamed to MIPS_SYNC_OLD_OP_12_XOR.
+ (MIPS_SYNC_NEW_OP_12_NOT_NOP): Renamed to MIPS_SYNC_NEW_OP_12_AND.
+ (MIPS_SYNC_NEW_OP_12_NOT_NOT): Renamed to MIPS_SYNC_NEW_OP_12_XOR
+
+2008-12-09 Tobias Grosser <grosser@fim.uni-passau.de>
+
+ * graphite.c (graphite_transform_loops): Always call find_transform ()
+ in ENABLE_CHECKING. So we test these code paths, even if we do not
+ generate code.
+
+2008-12-09 Tobias Grosser <grosser@fim.uni-passau.de>
+
+ * graphite.c (print_graphite_bb): Fix printing to file != dump_file.
+
+2008-12-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/38454
+ * function.h (struct function): Add always_inline_functions_inlined.
+ * ipa-inline.c (cgraph_early_inlining): Set it to true.
+ * tree-optimize.c (execute_fixup_cfg): Likewise.
+ * builtins.c (avoid_folding_inline_builtin): New function.
+ (fold_call_expr): Don't optimize always_inline builtins before
+ inlining.
+ (fold_call_stmt): Likewise.
+ (fold_builtin_call_array): Likewise. Don't call
+ fold_builtin_varargs for BUILT_IN_MD builtins.
+
+ PR tree-optimization/37416
+ * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Handle NOP_EXPR.
+
+2008-12-09 Janis Johnson <janis187@us.ibm.com>
+
+ * doc/sourcebuild.texi (Test Directives): Fix formatting.
+
+2008-12-09 Vladimir Makarov <vmakarov@redhat.com>
+
+ * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description.
+
+ * doc/invoke.texi (-fira-region): Describe new option.
+ (-fira-algorithm): Change the values.
+
+ * ira-conflicts.c (build_conflict_bit_table,
+ build_allocno_conflicts): Use ira_reg_classes_intersect_p.
+ (ira_build_conflicts): Use flag flag_ira_region instead of
+ flag_ira_algorithm. Prohibit usage of callee-saved likely spilled
+ base registers for allocnos crossing calls.
+
+ * flags.h (enum ira_algorithm): Redefine.
+ (enum ira_region): New.
+ (flag_ira_region): New.
+
+ * cfgloopanal.c (estimate_reg_pressure_cost): Use flag_ira_region
+ instead of flag_ira_algorithm.
+
+ * toplev.c (flag_ira_algorithm): Change the initial value.
+ (flag_ira_region): New.
+
+ * ira-int.h (ira_reg_classes_intersect_p,
+ ira_reg_class_super_classes): New.
+
+ * ira-color.c (update_copy_costs): Use
+ ira_reg_classes_intersect_p. Use right class to find hard reg
+ index.
+ (update_conflict_hard_regno_costs): Ditto. Add a new parameter.
+ (assign_hard_reg): Ditto. Pass additional argument to
+ update_conflict_hard_regno_costs. Do not uncoalesce for priority
+ coloring.
+ (allocno_priorities, setup_allocno_priorities,
+ allocno_priority_compare_func): Move before color_allocnos.
+ (color_allocnos): Add priority coloring. Use flag flag_ira_region
+ instead of flag_ira_algorithm.
+ (move_spill_restore): Check classes of the same reg allocno from
+ different regions.
+ (update_curr_costs): Use ira_reg_classes_intersect_p.
+ (ira_reassign_conflict_allocnos): Ditto.
+
+ * opts.c (decode_options): Always set up flag_ira. Set up
+ flag_ira_algorithm. Warn CB can not be used for architecture.
+ (common_handle_option): Modify code for -fira-algorithm. Add code
+ to process -fira-region.
+
+ * ira-lives.c (update_allocno_pressure_excess_length): Process
+ superclasses too.
+ (set_allocno_live, clear_allocno_live, mark_reg_live,
+ mark_reg_dead, process_bb_node_lives): Ditto.
+
+ * ira-emit.c (ira_emit): Fix insn codes.
+
+ * ira-build.c (propagate_allocno_info): Use flag flag_ira_region
+ instead of flag_ira_algorithm.
+ (allocno_range_compare_func): Ignore classes for priority
+ coloring.
+ (setup_min_max_conflict_allocno_ids): Ditto.
+ (ira_flattening): Use ira_reg_classes_intersect_p.
+
+ * genpreds.c (write_enum_constraint_num): Output
+ CONSTRAINT__LIMIT.
+
+ * common.opt (fira-algorithm): Modify.
+ (fira-region): New.
+
+ * ira.c (setup_class_hard_regs): Initialize.
+ (setup_cover_and_important_classes): Modify code setting class
+ related info for priority coloring.
+ (setup_class_translate): Ditto.
+ (ira_reg_classes_intersect_p, ira_reg_class_super_classes): New.
+ (setup_reg_class_intersect_union): Rename to
+ setup_reg_class_relations. Add code for setting up new variables.
+ (find_reg_class_closure): Do not check targetm.ira_cover_classes.
+ (ira): Use flag flag_ira_region instead of flag_ira_algorithm.
+
+ * ira-costs.c (common_classes): New.
+ (print_costs): Use flag flag_ira_region instead of
+ flag_ira_algorithm.
+ (find_allocno_class_costs): Ditto. Use common_classes. Translate
+ alt_class.
+ (ira_costs): Allocate/deallocate common_classes.
+
+ * config/m32c/m32.h (REG_ALLOC_ORDER): Add reg 19.
+ (REG_CLASS_CONTENTS, reg_class, REG_CLASS_NAMES): New entries for
+ R02A_REGS.
+
+ * reload1.c (choose_reload_regs): Use MODE_INT for partial ints in
+ smallest_mode_for_size.
+
+2008-12-10 Ben Elliston <bje@au.ibm.com>
+
+ * config/rs6000/linux-unwind.h (get_regs): Constify casts.
+
+2008-12-09 Jan Hubicka <jh@suse.cz>
+
+ * predict.c (estimate_bb_frequencies): Fix test if profile is present.
+
+2008-12-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/35468
+ * tree-ssa-ccp.c (fold_stmt_r): Don't fold reads from constant
+ string on LHS.
+
+2008-12-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/38445
+ * tree-ssa-structalias.c (emit_pointer_definition): Only visit
+ names once.
+ (emit_alias_warning): Adjust.
+
+2008-12-09 Andrew Haley <aph@redhat.com>
+
+ * fixed-value.c (do_fixed_add): Add comment.
+ * tree-ssa-loop-ivopts.c (iv_ca_cost): Likewise.
+ * builtins.c (fold_builtin_sqrt): Likewise.
+
+2008-12-09 Kai Tietz <kai.tietz@onevision.com>
+
+ PR/38366
+ * function.c (aggregate_value_p): Get fntype from CALL_EXPR in any
+ case.
+ * calls.c (nitialize_argument_information): Add fntype argument
+ and use it for calls.promote_function_args.
+ (expand_call): Pass fntype to aggregate_value_p if no fndecl
+ available and pass additional fntype to
+ initialize_argument_information.
+ * config/i386/i386.c (ix86_reg_parm_stack_space): Remove cfun part
+ to get function abi type.
+ (init_cumulative_args): Use for abi kind detection fntype, when no
+ fndecl is available.
+
+2008-12-09 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * config/s390/s390.md (movti, movdi_64, movdi_31,
+ *movsi_zarch, *movhi, *movqi, *mov<mode>_64, *mov<mode>_31,
+ *mov<mode>_64dfp, *mov<mode>_64, *mov<mode>_31, mov<mode>): Remove
+ Q->Q alternative.
+ (Integer->BLKmode splitter): Removed.
+
+2008-12-08 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/alpha/alpha.c (alpha_set_memflags): Process memory
+ references in full insn sequence.
+
+2008-12-09 Jason Merrill <jason@redhat.com>
+
+ * gimplify.c (gimplify_init_constructor): Revert to using < rather
+ than <= for sparseness test.
+
+ PR c++/38410
+ * gimplify.c (gimplify_init_constructor): Don't write out a static
+ copy of the CONSTRUCTOR for TREE_ADDRESSABLE types or small sparse
+ initializers.
+
+2008-12-09 Tobias Grosser <grosser@fim.uni-passau.de>
+
+ PR middle-end/38084
+ Fix testsuite/gfortran.dg/graphite/id-3.f90.
+ * graphite.c (scopdet_basic_block_info): Fix bug that found some
+ regions more than once.
+ * testsuite/gfortran.dg/graphite/id-3.f90: New.
+ * gcc/testsuite/gcc.dg/graphite/pr38084.c: New.
+
+2008-12-09 Ben Elliston <bje@au.ibm.com>
+
+ * emutls.c (__emutls_get_address): Prototype.
+ (__emutls_register_common): Likewise.
+
+ * config/dfp-bit.c (DFP_TO_INT): Remove unnecessary cast.
+
+2008-12-09 Ben Elliston <bje@au.ibm.com>
+
+ * config/rs6000/darwin-ldouble.c (fmsub): Remove unused variable, v.
+
+2008-12-08 Steve Ellcey <sje@cup.hp.com>
+
+ * config/ia64/ia64.md (UNSPECV_GOTO_RECEIVER): New constant.
+ (nonlocal_goto_receiver): New instruction.
+
+2008-12-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/35443
+ * c-pretty-print.c (pp_c_expression): Handle BIND_EXPR.
+
+ PR c/35442
+ * c-pretty-print.c (pp_c_cast_expression, pp_c_expression): Handle
+ VIEW_CONVERT_EXPR the same as CASE_CONVERT.
+
+2008-12-08 Richard Henderson <rth@redhat.com>
+
+ PR 38240
+ * tree.h (TYPE_MODE): Invoke vector_type_mode when needed.
+ (SET_TYPE_MODE): New.
+ * c-decl.c (parser_xref_tag): Use it.
+ (finish_enum): Likewise.
+ * tree.c (build_pointer_type_for_mode): Likewise.
+ (build_reference_type_for_mode, build_index_type): Likewise.
+ (build_range_type, make_vector_type): Likewise.
+ (build_common_tree_nodes_2): Likewise.
+ * stor-layout.c (compute_record_mode): Likewise.
+ (finalize_type_size, layout_type, make_fract_type): Likewise.
+ (make_accum_type, initialize_sizetypes): Likewise.
+ (vector_type_mode): New.
+ * function.c (allocate_struct_function): Call
+ invoke_set_current_function_hook before querying anything else.
+
+ * config/i386/i386.c (ix86_valid_target_attribute_inner_p): Add avx.
+
2008-12-08 Luis Machado <luisgpm@br.ibm.com>
* alias.c (find_base_term): Synch LO_SUM handling with what
find_base_value does.
2008-12-08 Andrew Haley <aph@redhat.com>
- Kamaraju Kusumanchi <raju.mailinglists@gmail.com>
+ Kamaraju Kusumanchi <raju.mailinglists@gmail.com>
* gimple.h (gimple_build_try): Fix declaration.
- * builtins.c (fold_builtin_sqrt): Don't use a conditional
- operator.
+ * builtins.c (fold_builtin_sqrt): Don't use a conditional operator.
* fixed-value.c (do_fixed_add): Likewise.
* tree-ssa-loop-ivopts.c (iv_ca_cost): Likewise.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 47043a3f39d..973af7ceb24 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20081208
+20081210
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index b2425ba92f3..166baa82dcd 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+2008-12-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR ada/38450
+ * gcc-interface/utils.c (finish_record_type): Use SET_TYPE_MODE.
+ * gcc-interface/decl.c (gnat_to_gnu_entity, make_aligning_type):
+ Likewise.
+
2008-12-05 Sebastian Pop <sebastian.pop@amd.com>
PR bootstrap/38262
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 14fcd634b61..20c5fb4686f 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -2032,7 +2032,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
corresponding fat pointer. */
TREE_TYPE (gnu_type) = TYPE_POINTER_TO (gnu_type)
= TYPE_REFERENCE_TO (gnu_type) = gnu_fat_type;
- TYPE_MODE (gnu_type) = BLKmode;
+ SET_TYPE_MODE (gnu_type, BLKmode);
TYPE_ALIGN (gnu_type) = TYPE_ALIGN (tem);
SET_TYPE_UNCONSTRAINED_ARRAY (gnu_fat_type, gnu_type);
@@ -2873,7 +2873,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
that these objects will always be placed in memory. Do the
same thing for limited record types. */
if (Is_Tagged_Type (gnat_entity) || Is_Limited_Record (gnat_entity))
- TYPE_MODE (gnu_type) = BLKmode;
+ SET_TYPE_MODE (gnu_type, BLKmode);
/* If this is a derived type, we must make the alias set of this type
the same as that of the type we are derived from. We assume here
@@ -5572,7 +5572,7 @@ make_aligning_type (tree type, unsigned int align, tree size,
= size_binop (PLUS_EXPR, size,
size_int (room + align / BITS_PER_UNIT));
- TYPE_MODE (record_type) = BLKmode;
+ SET_TYPE_MODE (record_type, BLKmode);
copy_alias_set (record_type, type);
return record_type;
@@ -5721,8 +5721,8 @@ make_packable_type (tree type, bool in_record)
/* Try harder to get a packable type if necessary, for example
in case the record itself contains a BLKmode field. */
if (in_record && TYPE_MODE (new_type) == BLKmode)
- TYPE_MODE (new_type)
- = mode_for_size_tree (TYPE_SIZE (new_type), MODE_INT, 1);
+ SET_TYPE_MODE (new_type,
+ mode_for_size_tree (TYPE_SIZE (new_type), MODE_INT, 1));
/* If neither the mode nor the size has shrunk, return the old type. */
if (TYPE_MODE (new_type) == BLKmode && new_size >= size)
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 131b2376ac7..7b52d902241 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -839,7 +839,7 @@ finish_record_type (tree record_type, tree fieldlist, int rep_level,
if (rep_level > 0)
{
TYPE_ALIGN (record_type) = MAX (BITS_PER_UNIT, TYPE_ALIGN (record_type));
- TYPE_MODE (record_type) = BLKmode;
+ SET_TYPE_MODE (record_type, BLKmode);
if (!had_size_unit)
TYPE_SIZE_UNIT (record_type) = size_zero_node;
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 63ca618a384..afb3b3fdb32 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -7681,6 +7681,8 @@ fold_builtin_sqrt (tree arg, tree type)
tree arg0 = CALL_EXPR_ARG (arg, 0);
tree tree_root;
/* The inner root was either sqrt or cbrt. */
+ /* This was a conditional expression but it triggered a bug
+ in the Solaris 8 compiler. */
REAL_VALUE_TYPE dconstroot;
if (BUILTIN_SQRT_P (fcode))
dconstroot = dconsthalf;
@@ -10795,6 +10797,22 @@ fold_builtin_varargs (tree fndecl, tree exp, bool ignore ATTRIBUTE_UNUSED)
return NULL_TREE;
}
+/* Return true if FNDECL shouldn't be folded right now.
+ If a built-in function has an inline attribute always_inline
+ wrapper, defer folding it after always_inline functions have
+ been inlined, otherwise e.g. -D_FORTIFY_SOURCE checking
+ might not be performed. */
+
+static bool
+avoid_folding_inline_builtin (tree fndecl)
+{
+ return (DECL_DECLARED_INLINE_P (fndecl)
+ && DECL_DISREGARD_INLINE_LIMITS (fndecl)
+ && cfun
+ && !cfun->always_inline_functions_inlined
+ && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fndecl)));
+}
+
/* A wrapper function for builtin folding that prevents warnings for
"statement without effect" and the like, caused by removing the
call node earlier than the warning is generated. */
@@ -10827,6 +10845,9 @@ fold_call_expr (tree exp, bool ignore)
return NULL_TREE;
}
+ if (avoid_folding_inline_builtin (fndecl))
+ return NULL_TREE;
+
/* FIXME: Don't use a list in this interface. */
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
return targetm.fold_builtin (fndecl, CALL_EXPR_ARGS (exp), ignore);
@@ -10929,6 +10950,8 @@ fold_builtin_call_array (tree type,
&& DECL_FUNCTION_CODE (fndecl2) == BUILT_IN_VA_ARG_PACK)
return build_call_array (type, fn, n, argarray);
}
+ if (avoid_folding_inline_builtin (fndecl))
+ return build_call_array (type, fn, n, argarray);
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
{
tree arglist = NULL_TREE;
@@ -10937,6 +10960,7 @@ fold_builtin_call_array (tree type,
ret = targetm.fold_builtin (fndecl, arglist, false);
if (ret)
return ret;
+ return build_call_array (type, fn, n, argarray);
}
else if (n <= MAX_ARGS_TO_FOLD_BUILTIN)
{
@@ -13645,6 +13669,8 @@ fold_call_stmt (gimple stmt, bool ignore)
{
int nargs = gimple_call_num_args (stmt);
+ if (avoid_folding_inline_builtin (fndecl))
+ return NULL_TREE;
/* FIXME: Don't use a list in this interface. */
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
{
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 6f88f626042..7f7f2b00ac7 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -5302,7 +5302,7 @@ parser_xref_tag (enum tree_code code, tree name)
{
/* Give the type a default layout like unsigned int
to avoid crashing if it does not get defined. */
- TYPE_MODE (ref) = TYPE_MODE (unsigned_type_node);
+ SET_TYPE_MODE (ref, TYPE_MODE (unsigned_type_node));
TYPE_ALIGN (ref) = TYPE_ALIGN (unsigned_type_node);
TYPE_USER_ALIGN (ref) = 0;
TYPE_UNSIGNED (ref) = 1;
@@ -5952,7 +5952,7 @@ finish_enum (tree enumtype, tree values, tree attributes)
TYPE_MAX_VALUE (tem) = TYPE_MAX_VALUE (enumtype);
TYPE_SIZE (tem) = TYPE_SIZE (enumtype);
TYPE_SIZE_UNIT (tem) = TYPE_SIZE_UNIT (enumtype);
- TYPE_MODE (tem) = TYPE_MODE (enumtype);
+ SET_TYPE_MODE (tem, TYPE_MODE (enumtype));
TYPE_PRECISION (tem) = TYPE_PRECISION (enumtype);
TYPE_ALIGN (tem) = TYPE_ALIGN (enumtype);
TYPE_USER_ALIGN (tem) = TYPE_USER_ALIGN (enumtype);
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index 0c4f025d1a9..60ef6f69ded 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -1629,6 +1629,7 @@ pp_c_cast_expression (c_pretty_printer *pp, tree e)
case FLOAT_EXPR:
case FIX_TRUNC_EXPR:
CASE_CONVERT:
+ case VIEW_CONVERT_EXPR:
pp_c_type_cast (pp, TREE_TYPE (e));
pp_c_cast_expression (pp, TREE_OPERAND (e, 0));
break;
@@ -2020,6 +2021,7 @@ pp_c_expression (c_pretty_printer *pp, tree e)
case FLOAT_EXPR:
case FIX_TRUNC_EXPR:
CASE_CONVERT:
+ case VIEW_CONVERT_EXPR:
pp_c_cast_expression (pp, e);
break;
@@ -2101,6 +2103,12 @@ pp_c_expression (c_pretty_printer *pp, tree e)
pp_postfix_expression (pp, TREE_OPERAND (e, 1));
break;
+ case BIND_EXPR:
+ /* We don't yet have a way of dumping statements in a
+ human-readable format. */
+ pp_string (pp, "({...})");
+ break;
+
default:
pp_unsupported_tree (pp, e);
break;
diff --git a/gcc/calls.c b/gcc/calls.c
index e2c4fcb8a65..03994d4ecf5 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -136,7 +136,7 @@ static int compute_argument_block_size (int, struct args_size *, tree, tree, int
static void initialize_argument_information (int, struct arg_data *,
struct args_size *, int,
tree, tree,
- tree, CUMULATIVE_ARGS *, int,
+ tree, tree, CUMULATIVE_ARGS *, int,
rtx *, int *, int *, int *,
bool *, bool);
static void compute_argument_addresses (struct arg_data *, rtx, int);
@@ -938,7 +938,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
struct args_size *args_size,
int n_named_args ATTRIBUTE_UNUSED,
tree exp, tree struct_value_addr_value,
- tree fndecl,
+ tree fndecl, tree fntype,
CUMULATIVE_ARGS *args_so_far,
int reg_parm_stack_space,
rtx *old_stack_level, int *old_pending_adj,
@@ -1119,7 +1119,9 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
mode = TYPE_MODE (type);
unsignedp = TYPE_UNSIGNED (type);
- if (targetm.calls.promote_function_args (fndecl ? TREE_TYPE (fndecl) : 0))
+ if (targetm.calls.promote_function_args (fndecl
+ ? TREE_TYPE (fndecl)
+ : fntype))
mode = promote_mode (type, mode, &unsignedp, 1);
args[i].unsignedp = unsignedp;
@@ -2088,7 +2090,7 @@ expand_call (tree exp, rtx target, int ignore)
/* Set up a place to return a structure. */
/* Cater to broken compilers. */
- if (aggregate_value_p (exp, fndecl))
+ if (aggregate_value_p (exp, (!fndecl ? fntype : fndecl)))
{
/* This call returns a big structure. */
flags &= ~(ECF_CONST | ECF_PURE | ECF_LOOPING_CONST_OR_PURE);
@@ -2245,7 +2247,7 @@ expand_call (tree exp, rtx target, int ignore)
arguments into ARGS_SIZE, etc. */
initialize_argument_information (num_actuals, args, &args_size,
n_named_args, exp,
- structure_value_addr_value, fndecl,
+ structure_value_addr_value, fndecl, fntype,
&args_so_far, reg_parm_stack_space,
&old_stack_level, &old_pending_adj,
&must_preallocate, &flags,
diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c
index d59fa2fb505..88c5e956264 100644
--- a/gcc/cfgloopanal.c
+++ b/gcc/cfgloopanal.c
@@ -396,8 +396,8 @@ estimate_reg_pressure_cost (unsigned n_new, unsigned n_old, bool speed)
one. */
cost = target_spill_cost [speed] * n_new;
- if (optimize && flag_ira && (flag_ira_algorithm == IRA_ALGORITHM_REGIONAL
- || flag_ira_algorithm == IRA_ALGORITHM_MIXED)
+ if (optimize && flag_ira && (flag_ira_region == IRA_REGION_ALL
+ || flag_ira_region == IRA_REGION_MIXED)
&& number_of_loops () <= (unsigned) IRA_MAX_LOOPS_NUM)
/* IRA regional allocation deals with high register pressure
better. So decrease the cost (to do more accurate the cost
diff --git a/gcc/common.opt b/gcc/common.opt
index 2c113dc0213..a5279131090 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -757,7 +757,11 @@ Use integrated register allocator.
fira-algorithm=
Common Joined RejectNegative
--fira-algorithm=[regional|CB|mixed] Set the used IRA algorithm
+-fira-algorithm=[CB|priority] Set the used IRA algorithm
+
+fira-region=
+Common Joined RejectNegative
+-fira-region=[one|all|mixed] Set regions for IRA
fira-coalesce
Common Report Var(flag_ira_coalesce) Init(0)
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 26feea52dda..52ae122f6ed 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -1603,18 +1603,17 @@ alpha_set_memflags_1 (rtx *xp, void *data)
return -1;
}
-/* Given INSN, which is an INSN list or the PATTERN of a single insn
- generated to perform a memory operation, look for any MEMs in either
+/* Given SEQ, which is an INSN list, look for any MEMs in either
a SET_DEST or a SET_SRC and copy the in-struct, unchanging, and
volatile flags from REF into each of the MEMs found. If REF is not
a MEM, don't do anything. */
void
-alpha_set_memflags (rtx insn, rtx ref)
+alpha_set_memflags (rtx seq, rtx ref)
{
- rtx *base_ptr;
+ rtx insn;
- if (GET_CODE (ref) != MEM)
+ if (!MEM_P (ref))
return;
/* This is only called from alpha.md, after having had something
@@ -1627,11 +1626,11 @@ alpha_set_memflags (rtx insn, rtx ref)
&& !MEM_READONLY_P (ref))
return;
- if (INSN_P (insn))
- base_ptr = &PATTERN (insn);
- else
- base_ptr = &insn;
- for_each_rtx (base_ptr, alpha_set_memflags_1, (void *) ref);
+ for (insn = seq; insn; insn = NEXT_INSN (insn))
+ if (INSN_P (insn))
+ for_each_rtx (&PATTERN (insn), alpha_set_memflags_1, (void *) ref);
+ else
+ gcc_unreachable ();
}
static rtx alpha_emit_set_const (rtx, enum machine_mode, HOST_WIDE_INT,
diff --git a/gcc/config/dfp-bit.c b/gcc/config/dfp-bit.c
index bfce851d7b9..8437491a753 100644
--- a/gcc/config/dfp-bit.c
+++ b/gcc/config/dfp-bit.c
@@ -536,7 +536,7 @@ DFP_TO_INT (DFP_C_TYPE x)
/* Rescale if the exponent is less than zero. */
decNumberToIntegralValue (&n2, &n1, &context);
/* Get a value to use for the quantize call. */
- decNumberFromString (&qval, (char *) "1.", &context);
+ decNumberFromString (&qval, "1.", &context);
/* Force the exponent to zero. */
decNumberQuantize (&n1, &n2, &qval, &context);
/* Get a string, which at this point will not include an exponent. */
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index f83ed7e14b9..12e9e5abfe9 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3408,6 +3408,7 @@ ix86_valid_target_attribute_inner_p (tree args, char *p_strings[])
IX86_ATTR_ISA ("3dnow", OPT_m3dnow),
IX86_ATTR_ISA ("abm", OPT_mabm),
IX86_ATTR_ISA ("aes", OPT_maes),
+ IX86_ATTR_ISA ("avx", OPT_mavx),
IX86_ATTR_ISA ("mmx", OPT_mmmx),
IX86_ATTR_ISA ("pclmul", OPT_mpclmul),
IX86_ATTR_ISA ("popcnt", OPT_mpopcnt),
@@ -4548,16 +4549,12 @@ ix86_must_pass_in_stack (enum machine_mode mode, const_tree type)
int
ix86_reg_parm_stack_space (const_tree fndecl)
{
- int call_abi = 0;
- /* For libcalls it is possible that there is no fndecl at hand.
- Therefore assume for this case the default abi of the target. */
- if (!fndecl)
- call_abi = (cfun ? cfun->machine->call_abi : DEFAULT_ABI);
- else if (TREE_CODE (fndecl) == FUNCTION_DECL)
+ int call_abi = SYSV_ABI;
+ if (fndecl != NULL_TREE && TREE_CODE (fndecl) == FUNCTION_DECL)
call_abi = ix86_function_abi (fndecl);
else
call_abi = ix86_function_type_abi (fndecl);
- if (call_abi == 1)
+ if (call_abi == MS_ABI)
return 32;
return 0;
}
@@ -4646,7 +4643,10 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
struct cgraph_local_info *i = fndecl ? cgraph_local_info (fndecl) : NULL;
memset (cum, 0, sizeof (*cum));
- cum->call_abi = ix86_function_type_abi (fntype);
+ if (fndecl)
+ cum->call_abi = ix86_function_abi (fndecl);
+ else
+ cum->call_abi = ix86_function_type_abi (fntype);
/* Set up the number of registers to use for passing arguments. */
cum->nregs = ix86_regparm;
if (TARGET_64BIT)
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md
index b03032dd020..b4894ab8bb7 100644
--- a/gcc/config/ia64/ia64.md
+++ b/gcc/config/ia64/ia64.md
@@ -102,6 +102,7 @@
(UNSPECV_PSAC_ALL 5) ; pred.safe_across_calls
(UNSPECV_PSAC_NORMAL 6)
(UNSPECV_SETJMP_RECEIVER 7)
+ (UNSPECV_GOTO_RECEIVER 8)
])
(include "predicates.md")
@@ -6400,6 +6401,17 @@
DONE;
})
+(define_insn_and_split "nonlocal_goto_receiver"
+ [(unspec_volatile [(const_int 0)] UNSPECV_GOTO_RECEIVER)]
+ ""
+ "#"
+ "reload_completed"
+ [(const_int 0)]
+{
+ ia64_reload_gp ();
+ DONE;
+})
+
(define_insn_and_split "builtin_setjmp_receiver"
[(unspec_volatile [(match_operand:DI 0 "" "")] UNSPECV_SETJMP_RECEIVER)]
""
diff --git a/gcc/config/m32c/m32c.h b/gcc/config/m32c/m32c.h
index 2fb636a5a30..2292a33bb5a 100644
--- a/gcc/config/m32c/m32c.h
+++ b/gcc/config/m32c/m32c.h
@@ -224,7 +224,7 @@ machine_function;
#define REG_ALLOC_ORDER { \
0, 1, 2, 3, 4, 5, /* r0..r3, a0, a1 */ \
- 12, 13, 14, 15, 16, 17, 18, /* mem0..mem7 */ \
+ 12, 13, 14, 15, 16, 17, 18, 19, /* mem0..mem7 */ \
6, 7, 8, 9, 10, 11 /* sb, fb, sp, pc, flg, ap */ }
/* How Values Fit in Registers */
@@ -270,6 +270,7 @@ machine_function;
{ 0x000001f0 }, /* PS - a0 a1 sb fp sp */\
{ 0x0000000f }, /* SI - r0r2 r1r3 a0a1 */\
{ 0x0000003f }, /* HI - r0 r1 r2 r3 a0 a1 */\
+ { 0x00000033 }, /* R02A - r0r2 a0 a1 */ \
{ 0x0000003f }, /* RA - r0..r3 a0 a1 */\
{ 0x0000007f }, /* GENERAL */\
{ 0x00000400 }, /* FLG */\
@@ -308,6 +309,7 @@ enum reg_class
PS_REGS,
SI_REGS,
HI_REGS,
+ R02A_REGS,
RA_REGS,
GENERAL_REGS,
FLG_REGS,
@@ -348,6 +350,7 @@ enum reg_class
"PS_REGS", \
"SI_REGS", \
"HI_REGS", \
+"R02A_REGS", \
"RA_REGS", \
"GENERAL_REGS", \
"FLG_REGS", \
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 6f98cd0290e..a6444b5f993 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3183,24 +3183,25 @@ while (0)
- Uses scratch register %4.
- NOT_OP are the optional instructions to do a bit-wise not
- operation in conjunction with an AND INSN to generate a sync_nand
- operation. */
-#define MIPS_SYNC_OP_12(INSN, NOT_OP) \
+ AND_OP is an instruction done after INSN to mask INSN's result
+ with the mask. For most operations, this is an AND with the
+ inclusive mask (%1). For nand operations -- where the result of
+ INSN is already correctly masked -- it instead performs a bitwise
+ not. */
+#define MIPS_SYNC_OP_12(INSN, AND_OP) \
"%(%<%[%|sync\n" \
"1:\tll\t%4,%0\n" \
"\tand\t%@,%4,%2\n" \
- NOT_OP \
"\t" INSN "\t%4,%4,%z3\n" \
- "\tand\t%4,%4,%1\n" \
+ AND_OP \
"\tor\t%@,%@,%4\n" \
"\tsc\t%@,%0\n" \
"\tbeq%?\t%@,%.,1b\n" \
"\tnop\n" \
"\tsync%-%]%>%)"
-#define MIPS_SYNC_OP_12_NOT_NOP ""
-#define MIPS_SYNC_OP_12_NOT_NOT "\tnor\t%4,%4,%.\n"
+#define MIPS_SYNC_OP_12_AND "\tand\t%4,%4,%1\n"
+#define MIPS_SYNC_OP_12_XOR "\txor\t%4,%4,%1\n"
/* Return an asm string that atomically:
@@ -3213,29 +3214,25 @@ while (0)
- Uses scratch register %5.
- NOT_OP are the optional instructions to do a bit-wise not
- operation in conjunction with an AND INSN to generate a sync_nand
- operation.
-
- REG is used in conjunction with NOT_OP and is used to select the
- register operated on by the INSN. */
-#define MIPS_SYNC_OLD_OP_12(INSN, NOT_OP, REG) \
+ AND_OP is an instruction done after INSN to mask INSN's result
+ with the mask. For most operations, this is an AND with the
+ inclusive mask (%1). For nand operations -- where the result of
+ INSN is already correctly masked -- it instead performs a bitwise
+ not. */
+#define MIPS_SYNC_OLD_OP_12(INSN, AND_OP) \
"%(%<%[%|sync\n" \
"1:\tll\t%0,%1\n" \
"\tand\t%@,%0,%3\n" \
- NOT_OP \
- "\t" INSN "\t%5," REG ",%z4\n" \
- "\tand\t%5,%5,%2\n" \
+ "\t" INSN "\t%5,%0,%z4\n" \
+ AND_OP \
"\tor\t%@,%@,%5\n" \
"\tsc\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b\n" \
"\tnop\n" \
"\tsync%-%]%>%)"
-#define MIPS_SYNC_OLD_OP_12_NOT_NOP ""
-#define MIPS_SYNC_OLD_OP_12_NOT_NOP_REG "%0"
-#define MIPS_SYNC_OLD_OP_12_NOT_NOT "\tnor\t%5,%0,%.\n"
-#define MIPS_SYNC_OLD_OP_12_NOT_NOT_REG "%5"
+#define MIPS_SYNC_OLD_OP_12_AND "\tand\t%5,%5,%2\n"
+#define MIPS_SYNC_OLD_OP_12_XOR "\txor\t%5,%5,%2\n"
/* Return an asm string that atomically:
@@ -3246,24 +3243,25 @@ while (0)
- Sets %0 to the new value of %1.
- NOT_OP are the optional instructions to do a bit-wise not
- operation in conjunction with an AND INSN to generate a sync_nand
- operation. */
-#define MIPS_SYNC_NEW_OP_12(INSN, NOT_OP) \
+ AND_OP is an instruction done after INSN to mask INSN's result
+ with the mask. For most operations, this is an AND with the
+ inclusive mask (%1). For nand operations -- where the result of
+ INSN is already correctly masked -- it instead performs a bitwise
+ not. */
+#define MIPS_SYNC_NEW_OP_12(INSN, AND_OP) \
"%(%<%[%|sync\n" \
"1:\tll\t%0,%1\n" \
"\tand\t%@,%0,%3\n" \
- NOT_OP \
"\t" INSN "\t%0,%0,%z4\n" \
- "\tand\t%0,%0,%2\n" \
+ AND_OP \
"\tor\t%@,%@,%0\n" \
"\tsc\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b\n" \
"\tnop\n" \
"\tsync%-%]%>%)"
-#define MIPS_SYNC_NEW_OP_12_NOT_NOP ""
-#define MIPS_SYNC_NEW_OP_12_NOT_NOT "\tnor\t%0,%0,%.\n"
+#define MIPS_SYNC_NEW_OP_12_AND "\tand\t%0,%0,%2\n"
+#define MIPS_SYNC_NEW_OP_12_XOR "\txor\t%0,%0,%2\n"
/* Return an asm string that atomically:
@@ -3301,7 +3299,7 @@ while (0)
/* Return an asm string that atomically:
- - Sets memory reference %0 to ~%0 AND %1.
+ - Sets memory reference %0 to ~(%0 AND %1).
SUFFIX is the suffix that should be added to "ll" and "sc"
instructions. INSN is the and instruction needed to and a register
@@ -3309,8 +3307,8 @@ while (0)
#define MIPS_SYNC_NAND(SUFFIX, INSN) \
"%(%<%[%|sync\n" \
"1:\tll" SUFFIX "\t%@,%0\n" \
- "\tnor\t%@,%@,%.\n" \
"\t" INSN "\t%@,%@,%1\n" \
+ "\tnor\t%@,%@,%.\n" \
"\tsc" SUFFIX "\t%@,%0\n" \
"\tbeq%?\t%@,%.,1b\n" \
"\tnop\n" \
@@ -3318,7 +3316,7 @@ while (0)
/* Return an asm string that atomically:
- - Sets memory reference %1 to ~%1 AND %2.
+ - Sets memory reference %1 to ~(%1 AND %2).
- Sets register %0 to the old value of memory reference %1.
@@ -3328,8 +3326,8 @@ while (0)
#define MIPS_SYNC_OLD_NAND(SUFFIX, INSN) \
"%(%<%[%|sync\n" \
"1:\tll" SUFFIX "\t%0,%1\n" \
- "\tnor\t%@,%0,%.\n" \
- "\t" INSN "\t%@,%@,%2\n" \
+ "\t" INSN "\t%@,%0,%2\n" \
+ "\tnor\t%@,%@,%.\n" \
"\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b\n" \
"\tnop\n" \
@@ -3337,7 +3335,7 @@ while (0)
/* Return an asm string that atomically:
- - Sets memory reference %1 to ~%1 AND %2.
+ - Sets memory reference %1 to ~(%1 AND %2).
- Sets register %0 to the new value of memory reference %1.
@@ -3347,11 +3345,11 @@ while (0)
#define MIPS_SYNC_NEW_NAND(SUFFIX, INSN) \
"%(%<%[%|sync\n" \
"1:\tll" SUFFIX "\t%0,%1\n" \
- "\tnor\t%0,%0,%.\n" \
- "\t" INSN "\t%@,%0,%2\n" \
+ "\t" INSN "\t%0,%0,%2\n" \
+ "\tnor\t%@,%0,%.\n" \
"\tsc" SUFFIX "\t%@,%1\n" \
"\tbeq%?\t%@,%.,1b%~\n" \
- "\t" INSN "\t%0,%0,%2\n" \
+ "\tnor\t%0,%0,%.\n" \
"\tsync%-%]%>%)"
/* Return an asm string that atomically:
diff --git a/gcc/config/mips/sync.md b/gcc/config/mips/sync.md
index 286ca369214..f053be65b22 100644
--- a/gcc/config/mips/sync.md
+++ b/gcc/config/mips/sync.md
@@ -127,7 +127,7 @@
"GENERATE_LL_SC"
{
return (mips_output_sync_loop
- (MIPS_SYNC_OP_12 ("<insn>", MIPS_SYNC_OP_12_NOT_NOP)));
+ (MIPS_SYNC_OP_12 ("<insn>", MIPS_SYNC_OP_12_AND)));
}
[(set_attr "length" "40")])
@@ -164,8 +164,7 @@
"GENERATE_LL_SC"
{
return (mips_output_sync_loop
- (MIPS_SYNC_OLD_OP_12 ("<insn>", MIPS_SYNC_OLD_OP_12_NOT_NOP,
- MIPS_SYNC_OLD_OP_12_NOT_NOP_REG)));
+ (MIPS_SYNC_OLD_OP_12 ("<insn>", MIPS_SYNC_OLD_OP_12_AND)));
}
[(set_attr "length" "40")])
@@ -207,7 +206,7 @@
"GENERATE_LL_SC"
{
return (mips_output_sync_loop
- (MIPS_SYNC_NEW_OP_12 ("<insn>", MIPS_SYNC_NEW_OP_12_NOT_NOP)));
+ (MIPS_SYNC_NEW_OP_12 ("<insn>", MIPS_SYNC_NEW_OP_12_AND)));
}
[(set_attr "length" "40")])
@@ -239,9 +238,9 @@
"GENERATE_LL_SC"
{
return (mips_output_sync_loop
- (MIPS_SYNC_OP_12 ("and", MIPS_SYNC_OP_12_NOT_NOT)));
+ (MIPS_SYNC_OP_12 ("and", MIPS_SYNC_OP_12_XOR)));
}
- [(set_attr "length" "44")])
+ [(set_attr "length" "40")])
(define_expand "sync_old_nand<mode>"
[(parallel [
@@ -274,10 +273,9 @@
"GENERATE_LL_SC"
{
return (mips_output_sync_loop
- (MIPS_SYNC_OLD_OP_12 ("and", MIPS_SYNC_OLD_OP_12_NOT_NOT,
- MIPS_SYNC_OLD_OP_12_NOT_NOT_REG)));
+ (MIPS_SYNC_OLD_OP_12 ("and", MIPS_SYNC_OLD_OP_12_XOR)));
}
- [(set_attr "length" "44")])
+ [(set_attr "length" "40")])
(define_expand "sync_new_nand<mode>"
[(parallel [
@@ -315,7 +313,7 @@
"GENERATE_LL_SC"
{
return (mips_output_sync_loop
- (MIPS_SYNC_NEW_OP_12 ("and", MIPS_SYNC_NEW_OP_12_NOT_NOT)));
+ (MIPS_SYNC_NEW_OP_12 ("and", MIPS_SYNC_NEW_OP_12_XOR)));
}
[(set_attr "length" "40")])
diff --git a/gcc/config/rs6000/darwin-ldouble.c b/gcc/config/rs6000/darwin-ldouble.c
index 15cac65c6ed..b16389c555f 100644
--- a/gcc/config/rs6000/darwin-ldouble.c
+++ b/gcc/config/rs6000/darwin-ldouble.c
@@ -387,7 +387,7 @@ fmsub (double a, double b, double c)
FP_DECL_Q(V);
FP_DECL_D(R);
double r;
- long double u, v, x, y, z;
+ long double u, x, y, z;
FP_INIT_ROUNDMODE;
FP_UNPACK_RAW_D (A, a);
diff --git a/gcc/config/rs6000/linux-unwind.h b/gcc/config/rs6000/linux-unwind.h
index 86392f4181e..defdde60e6d 100644
--- a/gcc/config/rs6000/linux-unwind.h
+++ b/gcc/config/rs6000/linux-unwind.h
@@ -162,10 +162,10 @@ get_regs (struct _Unwind_Context *context)
/* li r0, 0x0077; sc (sigreturn new) */
/* li r0, 0x6666; sc (rt_sigreturn old) */
/* li r0, 0x00AC; sc (rt_sigreturn new) */
- if (*(unsigned int *) (pc + 4) != 0x44000002)
+ if (*(const unsigned int *) (pc + 4) != 0x44000002)
return NULL;
- if (*(unsigned int *) (pc + 0) == 0x38007777
- || *(unsigned int *) (pc + 0) == 0x38000077)
+ if (*(const unsigned int *) (pc + 0) == 0x38007777
+ || *(const unsigned int *) (pc + 0) == 0x38000077)
{
struct sigframe {
char gap[SIGNAL_FRAMESIZE];
@@ -174,8 +174,8 @@ get_regs (struct _Unwind_Context *context)
} *frame = (struct sigframe *) context->cfa;
return frame->regs;
}
- else if (*(unsigned int *) (pc + 0) == 0x38006666
- || *(unsigned int *) (pc + 0) == 0x380000AC)
+ else if (*(const unsigned int *) (pc + 0) == 0x38006666
+ || *(const unsigned int *) (pc + 0) == 0x380000AC)
{
struct rt_sigframe {
char gap[SIGNAL_FRAMESIZE + 16];
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 2598039587f..1691fdba0f5 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -1081,17 +1081,16 @@
;
(define_insn "movti"
- [(set (match_operand:TI 0 "nonimmediate_operand" "=d,QS,d,o,Q")
- (match_operand:TI 1 "general_operand" "QS,d,dPRT,d,Q"))]
+ [(set (match_operand:TI 0 "nonimmediate_operand" "=d,QS,d,o")
+ (match_operand:TI 1 "general_operand" "QS,d,dPRT,d"))]
"TARGET_64BIT"
"@
lmg\t%0,%N0,%S1
stmg\t%1,%N1,%S0
#
- #
#"
- [(set_attr "op_type" "RSY,RSY,*,*,SS")
- (set_attr "type" "lm,stm,*,*,*")])
+ [(set_attr "op_type" "RSY,RSY,*,*")
+ (set_attr "type" "lm,stm,*,*")])
(define_split
[(set (match_operand:TI 0 "nonimmediate_operand" "")
@@ -1273,10 +1272,10 @@
(define_insn "*movdi_64"
[(set (match_operand:DI 0 "nonimmediate_operand"
"=d,d,d,d,d,d,d,d,f,d,d,d,d,d,
- RT,!*f,!*f,!*f,!R,!T,b,Q,d,t,Q,t,?Q")
+ RT,!*f,!*f,!*f,!R,!T,b,Q,d,t,Q,t")
(match_operand:DI 1 "general_operand"
"K,N0HD0,N1HD0,N2HD0,N3HD0,Os,N0SD0,N1SD0,d,f,L,b,d,RT,
- d,*f,R,T,*f,*f,d,K,t,d,t,Q,?Q"))]
+ d,*f,R,T,*f,*f,d,K,t,d,t,Q"))]
"TARGET_64BIT"
"@
lghi\t%0,%h1
@@ -1304,16 +1303,15 @@
#
#
stam\t%1,%N1,%S0
- lam\t%0,%N0,%S1
- #"
+ lam\t%0,%N0,%S1"
[(set_attr "op_type" "RI,RI,RI,RI,RI,RIL,RIL,RIL,RRE,RRE,RXY,RIL,RRE,RXY,
- RXY,RR,RX,RXY,RX,RXY,RIL,SIL,*,*,RS,RS,SS")
+ RXY,RR,RX,RXY,RX,RXY,RIL,SIL,*,*,RS,RS")
(set_attr "type" "*,*,*,*,*,*,*,*,floaddf,floaddf,la,larl,lr,load,store,
floaddf,floaddf,floaddf,fstoredf,fstoredf,larl,*,*,*,
- *,*,*")
+ *,*")
(set_attr "cpu_facility" "*,*,*,*,*,extimm,extimm,extimm,dfp,dfp,longdisp,
z10,*,*,*,*,*,longdisp,*,longdisp,
- z10,z10,*,*,*,*,*")
+ z10,z10,*,*,*,*")
(set_attr "z10prop" "z10_fwd_A1,
z10_fwd_E1,
z10_fwd_E1,
@@ -1339,7 +1337,6 @@
*,
*,
*,
- *,
*")
])
@@ -1378,9 +1375,9 @@
(define_insn "*movdi_31"
[(set (match_operand:DI 0 "nonimmediate_operand"
- "=d,d,Q,S,d ,o,!*f,!*f,!*f,!R,!T,Q,d")
+ "=d,d,Q,S,d ,o,!*f,!*f,!*f,!R,!T,d")
(match_operand:DI 1 "general_operand"
- " Q,S,d,d,dPRT,d, *f, R, T,*f,*f,Q,b"))]
+ " Q,S,d,d,dPRT,d, *f, R, T,*f,*f,b"))]
"!TARGET_64BIT"
"@
lm\t%0,%N0,%S1
@@ -1394,11 +1391,10 @@
ldy\t%0,%1
std\t%1,%0
stdy\t%1,%0
- #
#"
- [(set_attr "op_type" "RS,RSY,RS,RSY,*,*,RR,RX,RXY,RX,RXY,SS,*")
- (set_attr "type" "lm,lm,stm,stm,*,*,floaddf,floaddf,floaddf,fstoredf,fstoredf,*,*")
- (set_attr "cpu_facility" "*,*,*,*,*,*,*,*,*,*,*,*,z10")])
+ [(set_attr "op_type" "RS,RSY,RS,RSY,*,*,RR,RX,RXY,RX,RXY,*")
+ (set_attr "type" "lm,lm,stm,stm,*,*,floaddf,floaddf,floaddf,fstoredf,fstoredf,*")
+ (set_attr "cpu_facility" "*,*,*,*,*,*,*,*,*,*,*,z10")])
; For a load from a symbol ref we can use one of the target registers
; together with larl to load the address.
@@ -1533,9 +1529,9 @@
(define_insn "*movsi_zarch"
[(set (match_operand:SI 0 "nonimmediate_operand"
- "=d,d,d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,d,t,Q,b,Q,t,?Q")
+ "=d,d,d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,d,t,Q,b,Q,t")
(match_operand:SI 1 "general_operand"
- "K,N0HS0,N1HS0,Os,L,b,d,R,T,d,d,*f,R,T,*f,*f,t,d,t,d,K,Q,?Q"))]
+ "K,N0HS0,N1HS0,Os,L,b,d,R,T,d,d,*f,R,T,*f,*f,t,d,t,d,K,Q"))]
"TARGET_ZARCH"
"@
lhi\t%0,%h1
@@ -1559,10 +1555,9 @@
stam\t%1,%1,%S0
strl\t%1,%0
mvhi\t%0,%1
- lam\t%0,%0,%S1
- #"
+ lam\t%0,%0,%S1"
[(set_attr "op_type" "RI,RI,RI,RIL,RXY,RIL,RR,RX,RXY,RX,RXY,
- RR,RX,RXY,RX,RXY,RRE,RRE,RS,RIL,SIL,RS,SS")
+ RR,RX,RXY,RX,RXY,RRE,RRE,RS,RIL,SIL,RS")
(set_attr "type" "*,
*,
*,
@@ -1584,10 +1579,9 @@
*,
larl,
*,
- *,
*")
(set_attr "cpu_facility" "*,*,*,extimm,longdisp,z10,*,*,longdisp,*,longdisp,
- *,*,longdisp,*,longdisp,*,*,*,z10,z10,*,*")
+ *,*,longdisp,*,longdisp,*,*,*,z10,z10,*")
(set_attr "z10prop" "z10_fwd_A1,
z10_fwd_E1,
z10_fwd_E1,
@@ -1609,12 +1603,11 @@
*,
z10_rec,
z10_super,
- *,
*")])
(define_insn "*movsi_esa"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,d,t,Q,t,?Q")
- (match_operand:SI 1 "general_operand" "K,d,R,d,*f,R,*f,t,d,t,Q,?Q"))]
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,d,t,Q,t")
+ (match_operand:SI 1 "general_operand" "K,d,R,d,*f,R,*f,t,d,t,Q"))]
"!TARGET_ZARCH"
"@
lhi\t%0,%h1
@@ -1627,10 +1620,9 @@
ear\t%0,%1
sar\t%0,%1
stam\t%1,%1,%S0
- lam\t%0,%0,%S1
- #"
- [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,RRE,RRE,RS,RS,SS")
- (set_attr "type" "*,lr,load,store,floadsf,floadsf,fstoresf,*,*,*,*,*")
+ lam\t%0,%0,%S1"
+ [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,RRE,RRE,RS,RS")
+ (set_attr "type" "*,lr,load,store,floadsf,floadsf,fstoresf,*,*,*,*")
(set_attr "z10prop" "z10_fwd_A1,
z10_fr_E1,
z10_fwd_A3,
@@ -1641,7 +1633,6 @@
z10_super_E1,
z10_super,
*,
- *,
*")
])
@@ -1752,8 +1743,8 @@
})
(define_insn "*movhi"
- [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,d,R,T,b,Q,?Q")
- (match_operand:HI 1 "general_operand" " d,n,R,T,b,d,d,d,K,?Q"))]
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,d,R,T,b,Q")
+ (match_operand:HI 1 "general_operand" " d,n,R,T,b,d,d,d,K"))]
""
"@
lr\t%0,%1
@@ -1764,11 +1755,10 @@
sth\t%1,%0
sthy\t%1,%0
sthrl\t%1,%0
- mvhhi\t%0,%1
- #"
- [(set_attr "op_type" "RR,RI,RX,RXY,RIL,RX,RXY,RIL,SIL,SS")
- (set_attr "type" "lr,*,*,*,larl,store,store,store,*,*")
- (set_attr "cpu_facility" "*,*,*,*,z10,*,*,z10,z10,*")
+ mvhhi\t%0,%1"
+ [(set_attr "op_type" "RR,RI,RX,RXY,RIL,RX,RXY,RIL,SIL")
+ (set_attr "type" "lr,*,*,*,larl,store,store,store,*")
+ (set_attr "cpu_facility" "*,*,*,*,z10,*,*,z10,z10")
(set_attr "z10prop" "z10_fr_E1,
z10_fwd_A1,
z10_super_E1,
@@ -1777,8 +1767,7 @@
z10_super,
z10_rec,
z10_rec,
- z10_super,
- *")])
+ z10_super")])
(define_peephole2
[(set (match_operand:HI 0 "register_operand" "")
@@ -1813,8 +1802,8 @@
})
(define_insn "*movqi"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,T,Q,S,?Q")
- (match_operand:QI 1 "general_operand" "d,n,R,T,d,d,n,n,?Q"))]
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,T,Q,S")
+ (match_operand:QI 1 "general_operand" "d,n,R,T,d,d,n,n"))]
""
"@
lr\t%0,%1
@@ -1824,10 +1813,9 @@
stc\t%1,%0
stcy\t%1,%0
mvi\t%S0,%b1
- mviy\t%S0,%b1
- #"
- [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS")
- (set_attr "type" "lr,*,*,*,store,store,store,store,*")
+ mviy\t%S0,%b1"
+ [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY")
+ (set_attr "type" "lr,*,*,*,store,store,store,store")
(set_attr "z10prop" "z10_fr_E1,
z10_fwd_A1,
z10_super_E1,
@@ -1835,8 +1823,7 @@
z10_super,
z10_rec,
z10_super,
- z10_super,
- *")])
+ z10_super")])
(define_peephole2
[(set (match_operand:QI 0 "nonimmediate_operand" "")
@@ -1905,8 +1892,8 @@
"")
(define_insn "*mov<mode>_64"
- [(set (match_operand:TD_TF 0 "nonimmediate_operand" "=f,f,f,o, d,QS, d,o,Q")
- (match_operand:TD_TF 1 "general_operand" " G,f,o,f,QS, d,dRT,d,Q"))]
+ [(set (match_operand:TD_TF 0 "nonimmediate_operand" "=f,f,f,o, d,QS, d,o")
+ (match_operand:TD_TF 1 "general_operand" " G,f,o,f,QS, d,dRT,d"))]
"TARGET_64BIT"
"@
lzxr\t%0
@@ -1916,23 +1903,21 @@
lmg\t%0,%N0,%S1
stmg\t%1,%N1,%S0
#
- #
#"
- [(set_attr "op_type" "RRE,RRE,*,*,RSY,RSY,*,*,*")
- (set_attr "type" "fsimptf,fsimptf,*,*,lm,stm,*,*,*")])
+ [(set_attr "op_type" "RRE,RRE,*,*,RSY,RSY,*,*")
+ (set_attr "type" "fsimptf,fsimptf,*,*,lm,stm,*,*")])
(define_insn "*mov<mode>_31"
- [(set (match_operand:TD_TF 0 "nonimmediate_operand" "=f,f,f,o,Q")
- (match_operand:TD_TF 1 "general_operand" " G,f,o,f,Q"))]
+ [(set (match_operand:TD_TF 0 "nonimmediate_operand" "=f,f,f,o")
+ (match_operand:TD_TF 1 "general_operand" " G,f,o,f"))]
"!TARGET_64BIT"
"@
lzxr\t%0
lxr\t%0,%1
#
- #
#"
- [(set_attr "op_type" "RRE,RRE,*,*,*")
- (set_attr "type" "fsimptf,fsimptf,*,*,*")])
+ [(set_attr "op_type" "RRE,RRE,*,*")
+ (set_attr "type" "fsimptf,fsimptf,*,*")])
; TFmode in GPRs splitters
@@ -2023,9 +2008,9 @@
(define_insn "*mov<mode>_64dfp"
[(set (match_operand:DD_DF 0 "nonimmediate_operand"
- "=f,f,f,d,f,f,R,T,d,d,RT,?Q")
+ "=f,f,f,d,f,f,R,T,d, d,RT")
(match_operand:DD_DF 1 "general_operand"
- "G,f,d,f,R,T,f,f,d,RT,d,?Q"))]
+ " G,f,d,f,R,T,f,f,d,RT, d"))]
"TARGET_64BIT && TARGET_DFP"
"@
lzdr\t%0
@@ -2038,11 +2023,10 @@
stdy\t%1,%0
lgr\t%0,%1
lg\t%0,%1
- stg\t%1,%0
- #"
- [(set_attr "op_type" "RRE,RR,RRE,RRE,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
+ stg\t%1,%0"
+ [(set_attr "op_type" "RRE,RR,RRE,RRE,RX,RXY,RX,RXY,RRE,RXY,RXY")
(set_attr "type" "fsimpdf,floaddf,floaddf,floaddf,floaddf,floaddf,
- fstoredf,fstoredf,lr,load,store,*")
+ fstoredf,fstoredf,lr,load,store")
(set_attr "z10prop" "*,
*,
*,
@@ -2053,13 +2037,12 @@
*,
z10_fr_E1,
z10_fwd_A3,
- z10_rec,
- *")
+ z10_rec")
])
(define_insn "*mov<mode>_64"
- [(set (match_operand:DD_DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d, d,RT,?Q")
- (match_operand:DD_DF 1 "general_operand" "G,f,R,T,f,f,d,RT, d,?Q"))]
+ [(set (match_operand:DD_DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d, d,RT")
+ (match_operand:DD_DF 1 "general_operand" "G,f,R,T,f,f,d,RT, d"))]
"TARGET_64BIT"
"@
lzdr\t%0
@@ -2070,11 +2053,10 @@
stdy\t%1,%0
lgr\t%0,%1
lg\t%0,%1
- stg\t%1,%0
- #"
- [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
+ stg\t%1,%0"
+ [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RRE,RXY,RXY")
(set_attr "type" "fsimp<mode>,fload<mode>,fload<mode>,fload<mode>,
- fstore<mode>,fstore<mode>,lr,load,store,*")
+ fstore<mode>,fstore<mode>,lr,load,store")
(set_attr "z10prop" "*,
*,
*,
@@ -2083,14 +2065,13 @@
*,
z10_fr_E1,
z10_fwd_A3,
- z10_rec,
- *")])
+ z10_rec")])
(define_insn "*mov<mode>_31"
[(set (match_operand:DD_DF 0 "nonimmediate_operand"
- "=f,f,f,f,R,T,d,d,Q,S, d,o,Q")
+ "=f,f,f,f,R,T,d,d,Q,S, d,o")
(match_operand:DD_DF 1 "general_operand"
- " G,f,R,T,f,f,Q,S,d,d,dPRT,d,Q"))]
+ " G,f,R,T,f,f,Q,S,d,d,dPRT,d"))]
"!TARGET_64BIT"
"@
lzdr\t%0
@@ -2104,11 +2085,10 @@
stm\t%1,%N1,%S0
stmy\t%1,%N1,%S0
#
- #
#"
- [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RS,RSY,RS,RSY,*,*,SS")
+ [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RS,RSY,RS,RSY,*,*")
(set_attr "type" "fsimp<mode>,fload<mode>,fload<mode>,fload<mode>,
- fstore<mode>,fstore<mode>,lm,lm,stm,stm,*,*,*")])
+ fstore<mode>,fstore<mode>,lm,lm,stm,stm,*,*")])
(define_split
[(set (match_operand:DD_DF 0 "nonimmediate_operand" "")
@@ -2157,9 +2137,9 @@
(define_insn "mov<mode>"
[(set (match_operand:SD_SF 0 "nonimmediate_operand"
- "=f,f,f,f,R,T,d,d,d,R,T,?Q")
+ "=f,f,f,f,R,T,d,d,d,R,T")
(match_operand:SD_SF 1 "general_operand"
- " G,f,R,T,f,f,d,R,T,d,d,?Q"))]
+ " G,f,R,T,f,f,d,R,T,d,d"))]
""
"@
lzer\t%0
@@ -2172,11 +2152,10 @@
l\t%0,%1
ly\t%0,%1
st\t%1,%0
- sty\t%1,%0
- #"
- [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
+ sty\t%1,%0"
+ [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY")
(set_attr "type" "fsimp<mode>,fload<mode>,fload<mode>,fload<mode>,
- fstore<mode>,fstore<mode>,lr,load,load,store,store,*")
+ fstore<mode>,fstore<mode>,lr,load,load,store,store")
(set_attr "z10prop" "*,
*,
*,
@@ -2187,8 +2166,7 @@
z10_fwd_A3,
z10_fwd_A3,
z10_super,
- z10_rec,
- *")])
+ z10_rec")])
;
; movcc instruction pattern
@@ -2222,21 +2200,6 @@
"mvc\t%O0(%2,%R0),%S1"
[(set_attr "op_type" "SS")])
-(define_split
- [(set (match_operand 0 "memory_operand" "")
- (match_operand 1 "memory_operand" ""))]
- "reload_completed
- && GET_MODE (operands[0]) == GET_MODE (operands[1])
- && GET_MODE_SIZE (GET_MODE (operands[0])) > 0"
- [(parallel
- [(set (match_dup 0) (match_dup 1))
- (use (match_dup 2))])]
-{
- operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0])));
- operands[0] = adjust_address (operands[0], BLKmode, 0);
- operands[1] = adjust_address (operands[1], BLKmode, 0);
-})
-
(define_peephole2
[(parallel
[(set (match_operand:BLK 0 "memory_operand" "")
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index dab6ed0def0..9c27cd04b85 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,31 @@
+2008-12-09 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/37971
+ * class.c (resolve_address_of_overloaded_function): Check
+ accessibility of member functions unless FLAGS indicates
+ otherwise.
+ * call.c (standard_conversion): Adjust flags passed to
+ instantiate_type.
+ (convert_default_arg): Do not perform access checks.
+ * cp-tree.h (tsubst_flags_t): Add tf_no_access_control.
+
+2008-12-08 Steve Ellcey <sje@cup.hp.com>
+
+ * decl2.c (mark_used): Remove assemble_external call.
+
+2008-12-08 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/38390
+ * name-lookup.c (kept_level_p): Don't forget the case of levels
+ having using directives.
+
+2008-12-08 Richard Henderson <rth@redhat.com>
+
+ PR 38240
+ * class.c (finish_struct_bits): Use SET_TYPE_MODE.
+ * decl.c (record_unknown_type): Likewise.
+ (start_enum, finish_enum): Likewise.
+
2008-12-05 Jakub Jelinek <jakub@redhat.com>
PR c++/35336
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 273599eddfc..952e151f94b 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -706,7 +706,10 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
if ((TYPE_PTRFN_P (to) || TYPE_PTRMEMFUNC_P (to))
&& expr && type_unknown_p (expr))
{
- expr = instantiate_type (to, expr, tf_conv);
+ tsubst_flags_t tflags = tf_conv;
+ if (!(flags & LOOKUP_PROTECT))
+ tflags |= tf_no_access_control;
+ expr = instantiate_type (to, expr, tflags);
if (expr == error_mark_node)
return NULL;
from = TREE_TYPE (expr);
@@ -1360,9 +1363,8 @@ reference_binding (tree rto, tree rfrom, tree expr, bool c_cast_p, int flags)
/* Returns the implicit conversion sequence (see [over.ics]) from type
FROM to type TO. The optional expression EXPR may affect the
- conversion. FLAGS are the usual overloading flags. Only
- LOOKUP_NO_CONVERSION is significant. If C_CAST_P is true, this
- conversion is coming from a C-style cast. */
+ conversion. FLAGS are the usual overloading flags. If C_CAST_P is
+ true, this conversion is coming from a C-style cast. */
static conversion *
implicit_conversion (tree to, tree from, tree expr, bool c_cast_p,
@@ -4954,8 +4956,17 @@ convert_default_arg (tree type, tree arg, tree fn, int parmnum)
if (fn && DECL_TEMPLATE_INFO (fn))
arg = tsubst_default_argument (fn, type, arg);
- arg = break_out_target_exprs (arg);
+ /* Due to:
+
+ [dcl.fct.default]
+ The names in the expression are bound, and the semantic
+ constraints are checked, at the point where the default
+ expressions appears.
+
+ we must not perform access checks here. */
+ push_deferring_access_checks (dk_no_check);
+ arg = break_out_target_exprs (arg);
if (TREE_CODE (arg) == CONSTRUCTOR)
{
arg = digest_init (type, arg);
@@ -4978,6 +4989,7 @@ convert_default_arg (tree type, tree arg, tree fn, int parmnum)
tf_warning_or_error);
arg = convert_for_arg_passing (type, arg);
}
+ pop_deferring_access_checks();
VEC_pop (tree, default_arg_context);
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 8553139979a..805e51322e8 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1494,7 +1494,7 @@ finish_struct_bits (tree t)
DECL_MODE (TYPE_MAIN_DECL (t)) = BLKmode;
for (variants = t; variants; variants = TYPE_NEXT_VARIANT (variants))
{
- TYPE_MODE (variants) = BLKmode;
+ SET_TYPE_MODE (variants, BLKmode);
TREE_ADDRESSABLE (variants) = 1;
}
}
@@ -5923,9 +5923,13 @@ pop_lang_context (void)
control of FLAGS. Permit pointers to member function if FLAGS
permits. If TEMPLATE_ONLY, the name of the overloaded function was
a template-id, and EXPLICIT_TARGS are the explicitly provided
- template arguments. If OVERLOAD is for one or more member
- functions, then ACCESS_PATH is the base path used to reference
- those member functions. */
+ template arguments.
+
+ If OVERLOAD is for one or more member functions, then ACCESS_PATH
+ is the base path used to reference those member functions. If
+ TF_NO_ACCESS_CONTROL is not set in FLAGS, and the address is
+ resolved to a member function, access checks will be performed and
+ errors issued if appropriate. */
static tree
resolve_address_of_overloaded_function (tree target_type,
@@ -6190,14 +6194,16 @@ resolve_address_of_overloaded_function (tree target_type,
return error_mark_node;
mark_used (fn);
- /* We could not check access when this expression was originally
- created since we did not know at that time to which function
- the expression referred. */
- if (DECL_FUNCTION_MEMBER_P (fn))
- {
- gcc_assert (access_path);
- perform_or_defer_access_check (access_path, fn, fn);
- }
+ }
+
+ /* We could not check access to member functions when this
+ expression was originally created since we did not know at that
+ time to which function the expression referred. */
+ if (!(flags & tf_no_access_control)
+ && DECL_FUNCTION_MEMBER_P (fn))
+ {
+ gcc_assert (access_path);
+ perform_or_defer_access_check (access_path, fn, fn);
}
if (TYPE_PTRFN_P (target_type) || TYPE_PTRMEMFUNC_P (target_type))
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 7f33ff139b4..bf22eb4d85f 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -3560,20 +3560,22 @@ typedef enum linkage_kind {
/* Bitmask flags to control type substitution. */
typedef enum tsubst_flags_t {
- tf_none = 0, /* nothing special */
- tf_error = 1 << 0, /* give error messages */
- tf_warning = 1 << 1, /* give warnings too */
- tf_ignore_bad_quals = 1 << 2, /* ignore bad cvr qualifiers */
- tf_keep_type_decl = 1 << 3, /* retain typedef type decls
- (make_typename_type use) */
- tf_ptrmem_ok = 1 << 4, /* pointers to member ok (internal
- instantiate_type use) */
- tf_user = 1 << 5, /* found template must be a user template
- (lookup_template_class use) */
- tf_conv = 1 << 6, /* We are determining what kind of
- conversion might be permissible,
- not actually performing the
- conversion. */
+ tf_none = 0, /* nothing special */
+ tf_error = 1 << 0, /* give error messages */
+ tf_warning = 1 << 1, /* give warnings too */
+ tf_ignore_bad_quals = 1 << 2, /* ignore bad cvr qualifiers */
+ tf_keep_type_decl = 1 << 3, /* retain typedef type decls
+ (make_typename_type use) */
+ tf_ptrmem_ok = 1 << 4, /* pointers to member ok (internal
+ instantiate_type use) */
+ tf_user = 1 << 5, /* found template must be a user template
+ (lookup_template_class use) */
+ tf_conv = 1 << 6, /* We are determining what kind of
+ conversion might be permissible,
+ not actually performing the
+ conversion. */
+ tf_no_access_control = 1 << 7, /* Do not perform access checks, even
+ when issuing other errors. */
/* Convenient substitution flags combinations. */
tf_warning_or_error = tf_warning | tf_error
} tsubst_flags_t;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 70ccd323f80..e786b39c8e3 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3199,7 +3199,7 @@ record_unknown_type (tree type, const char* name)
TYPE_SIZE (type) = TYPE_SIZE (void_type_node);
TYPE_ALIGN (type) = 1;
TYPE_USER_ALIGN (type) = 0;
- TYPE_MODE (type) = TYPE_MODE (void_type_node);
+ SET_TYPE_MODE (type, TYPE_MODE (void_type_node));
}
/* A string for which we should create an IDENTIFIER_NODE at
@@ -10912,7 +10912,7 @@ start_enum (tree name, tree underlying_type, bool scoped_enum_p)
TYPE_MAX_VALUE (enumtype) = TYPE_MAX_VALUE (underlying_type);
TYPE_SIZE (enumtype) = TYPE_SIZE (underlying_type);
TYPE_SIZE_UNIT (enumtype) = TYPE_SIZE_UNIT (underlying_type);
- TYPE_MODE (enumtype) = TYPE_MODE (underlying_type);
+ SET_TYPE_MODE (enumtype, TYPE_MODE (underlying_type));
TYPE_PRECISION (enumtype) = TYPE_PRECISION (underlying_type);
TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type);
TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type);
@@ -11065,7 +11065,7 @@ finish_enum (tree enumtype)
applied to the underlying type. */
TYPE_SIZE (enumtype) = TYPE_SIZE (underlying_type);
TYPE_SIZE_UNIT (enumtype) = TYPE_SIZE_UNIT (underlying_type);
- TYPE_MODE (enumtype) = TYPE_MODE (underlying_type);
+ SET_TYPE_MODE (enumtype, TYPE_MODE (underlying_type));
TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type);
TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type);
TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (underlying_type);
@@ -11133,7 +11133,7 @@ finish_enum (tree enumtype)
TYPE_MAX_VALUE (t) = TYPE_MAX_VALUE (enumtype);
TYPE_SIZE (t) = TYPE_SIZE (enumtype);
TYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (enumtype);
- TYPE_MODE (t) = TYPE_MODE (enumtype);
+ SET_TYPE_MODE (t, TYPE_MODE (enumtype));
TYPE_PRECISION (t) = TYPE_PRECISION (enumtype);
TYPE_ALIGN (t) = TYPE_ALIGN (enumtype);
TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (enumtype);
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index da9201e8890..c8887257ece 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3849,8 +3849,6 @@ mark_used (tree decl)
note_vague_linkage_fn (decl);
}
- assemble_external (decl);
-
/* Is it a synthesized method that needs to be synthesized? */
if (TREE_CODE (decl) == FUNCTION_DECL
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 0da373ce2a6..b5d14b3b39c 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -1548,7 +1548,8 @@ kept_level_p (void)
return (current_binding_level->blocks != NULL_TREE
|| current_binding_level->keep
|| current_binding_level->kind == sk_cleanup
- || current_binding_level->names != NULL_TREE);
+ || current_binding_level->names != NULL_TREE
+ || current_binding_level->using_directives);
}
/* Returns the kind of the innermost scope. */
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index aa684197178..989e1b28cdd 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -338,7 +338,7 @@ Objective-C and Objective-C++ Dialects}.
-finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol
-fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
-fipa-type-escape -fira -fira-algorithm=@var{algorithm} @gol
--fira-coalesce -fno-ira-share-save-slots @gol
+-fira-region=@var{region} -fira-coalesce -fno-ira-share-save-slots @gol
-fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
-fivopts -fkeep-inline-functions -fkeep-static-consts @gol
-floop-block -floop-interchange -floop-strip-mine @gol
@@ -5733,17 +5733,25 @@ allocation. It is a default if @acronym{IRA} has been ported for the
target.
@item -fira-algorithm=@var{algorithm}
-Use specified algorithm for the integrated register allocator. The
-@var{algorithm} argument should be one of @code{regional}, @code{CB},
-or @code{mixed}. The second algorithm specifies Chaitin-Briggs
-coloring, the first one specifies regional coloring based on
-Chaitin-Briggs coloring, and the third one which is the default
-specifies a mix of Chaitin-Briggs and regional algorithms where loops
-with small register pressure are ignored. The first algorithm can
-give best result for machines with small size and irregular register
-set, the second one is faster and generates decent code and the
-smallest size code, and the mixed algorithm usually give the best
-results in most cases and for most architectures.
+Use specified coloring algorithm for the integrated register
+allocator. The @var{algorithm} argument should be @code{priority} or
+@code{CB}. The first algorithm specifies Chow's priority coloring,
+the second one specifies Chaitin-Briggs coloring. The second
+algorithm can be unimplemented for some architectures. If it is
+implemented, it is the default because Chaitin-Briggs coloring as a
+rule generates a better code.
+
+@item -fira-region=@var{region}
+Use specified regions for the integrated register allocator. The
+@var{region} argument should be one of @code{all}, @code{mixed}, or
+@code{one}. The first value means using all loops as register
+allocation regions, the second value which is the default means using
+all loops except for loops with small register pressure as the
+regions, and third one means using all function as a single region.
+The first value can give best result for machines with small size and
+irregular register set, the third one results in faster and generates
+decent code and the smallest size code, and the default value usually
+give the best results in most cases and for most architectures.
@item -fira-coalesce
@opindex fira-coalesce
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 672f6d178a3..3d3a52955bd 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1005,7 +1005,7 @@ the test
@item variable @var{tool_timeout} defined by the set of tests
-@item @var{gcc,,timeout} set in the target board
+@item @var{gcc},@var{timeout} set in the target board
@item 300
@end itemize
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 7dfb46b3a0d..5a76a6e5e69 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -2841,7 +2841,8 @@ options have been processed. It is then re-examined by every call to
The default implementation returns @code{IRA_COVER_CLASSES}, if defined,
otherwise there is no default implementation. You must define either this
macro or @code{IRA_COVER_CLASSES} in order to use the integrated register
-allocator for the target.
+allocator with Chaitin-Briggs coloring. If the macro is not defined,
+the only available coloring algorithm is Chow's priority coloring.
@end deftypefn
@defmac IRA_COVER_CLASSES
diff --git a/gcc/emutls.c b/gcc/emutls.c
index c3374a1c7de..fc008952979 100644
--- a/gcc/emutls.c
+++ b/gcc/emutls.c
@@ -54,6 +54,9 @@ struct __emutls_array
void **data[];
};
+void *__emutls_get_address (struct __emutls_object *);
+void __emutls_register_common (struct __emutls_object *, word, word, void *);
+
#ifdef __GTHREADS
#ifdef __GTHREAD_MUTEX_INIT
static __gthread_mutex_t emutls_mutex = __GTHREAD_MUTEX_INIT;
diff --git a/gcc/final.c b/gcc/final.c
index aceeb7cfb13..1735a73207d 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -3440,7 +3440,10 @@ output_addr_const (FILE *file, rtx x)
case SYMBOL_REF:
if (SYMBOL_REF_DECL (x))
- mark_decl_referenced (SYMBOL_REF_DECL (x));
+ {
+ mark_decl_referenced (SYMBOL_REF_DECL (x));
+ assemble_external (SYMBOL_REF_DECL (x));
+ }
#ifdef ASM_OUTPUT_SYMBOL_REF
ASM_OUTPUT_SYMBOL_REF (file, x);
#else
diff --git a/gcc/fixed-value.c b/gcc/fixed-value.c
index 26aaa023c84..d7f6413b29a 100644
--- a/gcc/fixed-value.c
+++ b/gcc/fixed-value.c
@@ -295,6 +295,8 @@ do_fixed_add (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
double_int temp;
int i_f_bits;
+ /* This was a conditional expression but it triggered a bug in the
+ Solaris 8 compiler. */
if (subtract_p)
temp = double_int_neg (b->data);
else
diff --git a/gcc/flags.h b/gcc/flags.h
index 4a209b32c12..0fff4f2acd7 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -209,13 +209,22 @@ extern int flag_dump_rtl_in_asm;
/* The algorithm used for the integrated register allocator (IRA). */
enum ira_algorithm
{
- IRA_ALGORITHM_REGIONAL,
IRA_ALGORITHM_CB,
- IRA_ALGORITHM_MIXED
+ IRA_ALGORITHM_PRIORITY
};
extern enum ira_algorithm flag_ira_algorithm;
+/* The regions used for the integrated register allocator (IRA). */
+enum ira_region
+{
+ IRA_REGION_ONE,
+ IRA_REGION_ALL,
+ IRA_REGION_MIXED
+};
+
+extern enum ira_region flag_ira_region;
+
extern unsigned int flag_ira_verbose;
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 7f53a8ee1d0..82e03c9d25c 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,36 @@
+2008-12-09 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/36376
+ PR fortran/37468
+ * lang-specs.h: Pass on -i* options to f951 to (probably) report
+ them as unknown. Duplicate gcc.c (cpp_options), but omit
+ -fpch-preprocess on -save-temps.
+
+2008-12-09 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/36457
+ * lang.opt: Added option idirafter.
+ * cpp.h (gfc_cpp_add_include_path_after): New prototype.
+ * cpp.c (gfc_cpp_handle_option): Recognize and handle OPT_dirafter.
+ (gfc_cpp_add_include_path_after): New, adds user-defined search path
+ after any other paths.
+ * invoke.texi (idirafter): New.
+ (no-range-check): Fixed entry in option-index.
+
+2008-12-09 Mikael Morin <mikael.morin@tele2.fr>
+
+ PR fortran/37469
+ * expr.c (find_array_element): Simplify array bounds.
+ Assert that both bounds are constant expressions.
+
+2008-12-09 Mikael Morin <mikael.morin@tele2.fr>
+
+ PR fortran/35983
+ * trans-expr.c (gfc_trans_subcomponent_assign):
+ Add se's pre and post blocks to current block.
+ (gfc_trans_structure_assign): Remove specific handling
+ of C_NULL_PTR and C_NULL_FUNPTR.
+
2008-12-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/38425
diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c
index 51c8e8507cf..d45d0c15b78 100644
--- a/gcc/fortran/cpp.c
+++ b/gcc/fortran/cpp.c
@@ -346,6 +346,10 @@ gfc_cpp_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED
gfc_cpp_option.working_directory = value;
break;
+ case OPT_idirafter:
+ gfc_cpp_add_include_path_after (xstrdup(arg), true);
+ break;
+
case OPT_imultilib:
gfc_cpp_option.multilib = arg;
break;
@@ -634,6 +638,13 @@ gfc_cpp_add_include_path (char *path, bool user_supplied)
}
void
+gfc_cpp_add_include_path_after (char *path, bool user_supplied)
+{
+ int cxx_aware = 0;
+ add_path (path, AFTER, cxx_aware, user_supplied);
+}
+
+void
gfc_cpp_register_include_paths (void)
{
int cxx_stdinc = 0;
diff --git a/gcc/fortran/cpp.h b/gcc/fortran/cpp.h
index db245021110..54a899f6a8e 100644
--- a/gcc/fortran/cpp.h
+++ b/gcc/fortran/cpp.h
@@ -41,6 +41,7 @@ gfc_try gfc_cpp_preprocess (const char *source_file);
void gfc_cpp_done (void);
void gfc_cpp_add_include_path (char *path, bool user_supplied);
+void gfc_cpp_add_include_path_after (char *path, bool user_supplied);
void gfc_cpp_register_include_paths (void);
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 07dfc7a08a3..4bdee7c6a8c 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -1028,6 +1028,14 @@ find_array_element (gfc_constructor *cons, gfc_array_ref *ar,
mpz_init_set_ui (span, 1);
for (i = 0; i < ar->dimen; i++)
{
+ if (gfc_reduce_init_expr (ar->as->lower[i]) == FAILURE
+ || gfc_reduce_init_expr (ar->as->upper[i]) == FAILURE)
+ {
+ t = FAILURE;
+ cons = NULL;
+ goto depart;
+ }
+
e = gfc_copy_expr (ar->start[i]);
if (e->expr_type != EXPR_CONSTANT)
{
@@ -1035,14 +1043,15 @@ find_array_element (gfc_constructor *cons, gfc_array_ref *ar,
goto depart;
}
+ gcc_assert (ar->as->upper[i]->expr_type == EXPR_CONSTANT
+ && ar->as->lower[i]->expr_type == EXPR_CONSTANT);
+
/* Check the bounds. */
if ((ar->as->upper[i]
- && ar->as->upper[i]->expr_type == EXPR_CONSTANT
&& mpz_cmp (e->value.integer,
ar->as->upper[i]->value.integer) > 0)
- || (ar->as->lower[i]->expr_type == EXPR_CONSTANT
- && mpz_cmp (e->value.integer,
- ar->as->lower[i]->value.integer) < 0))
+ || (mpz_cmp (e->value.integer,
+ ar->as->lower[i]->value.integer) < 0))
{
gfc_error ("Index in dimension %d is out of bounds "
"at %L", i + 1, &ar->c_where[i]);
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 8e47df4f684..675413cf6fd 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -446,6 +446,15 @@ but this can be inhibited with the negated form
in the command line, this option has no effect, since no @code{#line}
directives are emitted whatsoever.
+@item -idirafter @var{dir}
+@opindex @code{idirafter @var{dir}}
+@cindex preprocessing, include path
+Search @var{dir} for include files, but do it after all directories
+specified with @option{-I} and the standard system directories have
+been exhausted. @var{dir} is treated as a system include directory.
+If dir begins with @code{=}, then the @code{=} will be replaced by
+the sysroot prefix; see @option{--sysroot} and @option{-isysroot}.
+
@item -imultilib @var{dir}
@opindex @code{imultilib @var{dir}}
@cindex preprocessing, include path
@@ -977,7 +986,7 @@ variable override the default specified by @option{-fconvert}.}
@item -fno-range-check
-@opindex @code{-fno-range-check}
+@opindex @code{fno-range-check}
Disable range checking of input values during integer @code{READ} operations.
For example, GNU Fortran will give an error if an input value is
outside of the relevant range of [@code{-HUGE()}:@code{HUGE()}]. In other words,
diff --git a/gcc/fortran/lang-specs.h b/gcc/fortran/lang-specs.h
index a766162a5c8..a622dcb1a6a 100644
--- a/gcc/fortran/lang-specs.h
+++ b/gcc/fortran/lang-specs.h
@@ -20,13 +20,23 @@
/* This is the contribution to the `default_compilers' array in gcc.c
for the f95 language. */
+/* Identical to gcc.c (cpp_options), but omitting %(cpp_unique_options)
+ and -fpch-preprocess on -save-temps. */
+#define CPP_ONLY_OPTIONS "%1 %{m*} %{f*} %{g*:%{!g0:%{g*} \
+ %{!fno-working-directory:-fworking-directory}}} \
+ %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} \
+ %{O*} %{undef}"
-#define F951_CPP_OPTIONS "%{!nocpp: -cpp %g.f90 %(cpp_options)\
- %{E|M|MM:%(cpp_debug_options) -fsyntax-only} %{E}}"
-#define F951_OPTIONS "%(cc1_options) %{J*} %{!cpp: %{I*}}\
- %{!nostdinc:-fintrinsic-modules-path finclude%s}\
- %{!fsyntax-only:%(invoke_as)}"
-#define F951_SOURCE_FORM "%{!ffree-form:-ffixed-form}"
+/* Options that f951 should know about, even if not preprocessing. */
+#define CPP_FORWARD_OPTIONS "%{i*} %{I*}"
+
+#define F951_CPP_OPTIONS "%{!nocpp: -cpp %g.f90 %{E} %(cpp_unique_options) \
+ %{E|M|MM:%(cpp_debug_options) " CPP_ONLY_OPTIONS \
+ " -fsyntax-only};: " CPP_FORWARD_OPTIONS "}"
+#define F951_OPTIONS "%(cc1_options) %{J*} \
+ %{!nostdinc:-fintrinsic-modules-path finclude%s}\
+ %{!fsyntax-only:%(invoke_as)}"
+#define F951_SOURCE_FORM "%{!ffree-form:-ffixed-form}"
{".F", "@f77-cpp-input", 0, 0, 0},
@@ -36,14 +46,15 @@
{".FPP", "@f77-cpp-input", 0, 0, 0},
{"@f77-cpp-input",
"f951 %i " F951_SOURCE_FORM " " \
- F951_CPP_OPTIONS " %{!E:" F951_OPTIONS "}", 0, 0, 0},
+ F951_CPP_OPTIONS " %{!E:" F951_OPTIONS "}", 0, 0, 0},
{".f", "@f77", 0, 0, 0},
{".for", "@f77", 0, 0, 0},
{".ftn", "@f77", 0, 0, 0},
{"@f77",
"f951 %i " F951_SOURCE_FORM " \
%{E:%{!cpp:%egfortran does not support -E without -cpp}} \
- %{cpp:" F951_CPP_OPTIONS "} %{!E:" F951_OPTIONS "}", 0, 0, 0},
+ %{cpp:" F951_CPP_OPTIONS ";: " CPP_FORWARD_OPTIONS "} \
+ %{!E:" F951_OPTIONS "}", 0, 0, 0},
{".F90", "@f95-cpp-input", 0, 0, 0},
{".F95", "@f95-cpp-input", 0, 0, 0},
{".F03", "@f95-cpp-input", 0, 0, 0},
@@ -54,11 +65,14 @@
{".f95", "@f95", 0, 0, 0},
{".f03", "@f95", 0, 0, 0},
{".f08", "@f95", 0, 0, 0},
-{"@f95",
+{"@f95",
"f951 %i %{E:%{!cpp:%egfortran does not support -E without -cpp}}\
- %{cpp:" F951_CPP_OPTIONS "} %{!E:" F951_OPTIONS "}", 0, 0, 0},
+ %{cpp:" F951_CPP_OPTIONS ";: " CPP_FORWARD_OPTIONS "} \
+ %{!E:" F951_OPTIONS "}", 0, 0, 0},
+#undef CPP_ONLY_OPTIONS
+#undef CPP_FORWARD_OPTIONS
#undef F951_SOURCE_FORM
#undef F951_CPP_OPTIONS
#undef F951_OPTIONS
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 04682c19118..e49ff76ee49 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -360,6 +360,10 @@ fworking-directory
Fortran
; Documented in C
+idirafter
+Fortran Joined Separate
+; Documented in C
+
imultilib
Fortran Joined Separate
; Documented in C
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 5d3894c825d..4ecfa0839d0 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -3670,8 +3670,10 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr)
{
gfc_init_se (&se, NULL);
gfc_conv_expr (&se, expr);
+ gfc_add_block_to_block (&block, &se.pre);
gfc_add_modify (&block, dest,
fold_convert (TREE_TYPE (dest), se.expr));
+ gfc_add_block_to_block (&block, &se.post);
}
else
{
@@ -3713,21 +3715,8 @@ gfc_trans_structure_assign (tree dest, gfc_expr * expr)
{
/* Skip absent members in default initializers. */
if (!c->expr)
- continue;
+ continue;
- /* Update the type/kind of the expression if it represents either
- C_NULL_PTR or C_NULL_FUNPTR. This is done here because this may
- be the first place reached for initializing output variables that
- have components of type C_PTR/C_FUNPTR that are initialized. */
- if (c->expr->ts.type == BT_DERIVED && c->expr->ts.derived
- && c->expr->ts.derived->attr.is_iso_c)
- {
- c->expr->expr_type = EXPR_NULL;
- c->expr->ts.type = c->expr->ts.derived->ts.type;
- c->expr->ts.f90_type = c->expr->ts.derived->ts.f90_type;
- c->expr->ts.kind = c->expr->ts.derived->ts.kind;
- }
-
field = cm->backend_decl;
tmp = fold_build3 (COMPONENT_REF, TREE_TYPE (field),
dest, field, NULL_TREE);
diff --git a/gcc/function.c b/gcc/function.c
index 0320871f6a8..29fe1b0b52d 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1766,7 +1766,9 @@ aggregate_value_p (const_tree exp, const_tree fntype)
{
case CALL_EXPR:
fndecl = get_callee_fndecl (fntype);
- fntype = fndecl ? TREE_TYPE (fndecl) : 0;
+ fntype = (fndecl
+ ? TREE_TYPE (fndecl)
+ : TREE_TYPE (CALL_EXPR_FN (fntype)));
break;
case FUNCTION_DECL:
fndecl = fntype;
@@ -3987,6 +3989,8 @@ allocate_struct_function (tree fndecl, bool abstract_p)
OVERRIDE_ABI_FORMAT (fndecl);
#endif
+ invoke_set_current_function_hook (fndecl);
+
if (fndecl != NULL_TREE)
{
DECL_STRUCT_FUNCTION (fndecl) = cfun;
@@ -4012,8 +4016,6 @@ allocate_struct_function (tree fndecl, bool abstract_p)
cfun->va_list_gpr_size = VA_LIST_MAX_GPR_SIZE;
cfun->va_list_fpr_size = VA_LIST_MAX_FPR_SIZE;
}
-
- invoke_set_current_function_hook (fndecl);
}
/* This is like allocate_struct_function, but pushes a new cfun for FNDECL
diff --git a/gcc/function.h b/gcc/function.h
index 16f2324abff..68df55e1a6e 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -578,6 +578,7 @@ struct function GTY(())
unsigned int dont_save_pending_sizes_p : 1;
unsigned int after_inlining : 1;
+ unsigned int always_inline_functions_inlined : 1;
/* Fields below this point are not set for abstract functions; see
allocate_struct_function. */
diff --git a/gcc/genpreds.c b/gcc/genpreds.c
index bf53944e297..84b2e90d9e0 100644
--- a/gcc/genpreds.c
+++ b/gcc/genpreds.c
@@ -959,7 +959,7 @@ write_enum_constraint_num (void)
" CONSTRAINT__UNKNOWN = 0", stdout);
FOR_ALL_CONSTRAINTS (c)
printf (",\n CONSTRAINT_%s", c->c_name);
- puts ("\n};\n");
+ puts (",\n CONSTRAINT__LIMIT\n};\n");
}
/* Write out a function which looks at a string and determines what
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 2fea882811f..607743b73f0 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -3582,8 +3582,13 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
be dropped to memory, and then memcpy'd out. Don't do this
for sparse arrays, though, as it's more efficient to follow
the standard CONSTRUCTOR behavior of memset followed by
- individual element initialization. */
- if (valid_const_initializer && !cleared)
+ individual element initialization. Also don't do this for small
+ all-zero initializers (which aren't big enough to merit
+ clearing), and don't try to make bitwise copies of
+ TREE_ADDRESSABLE types. */
+ if (valid_const_initializer
+ && !(cleared || num_nonzero_elements == 0)
+ && !TREE_ADDRESSABLE (type))
{
HOST_WIDE_INT size = int_size_in_bytes (type);
unsigned int align;
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 8a464c19b3d..78485a2c833 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -495,7 +495,7 @@ print_graphite_bb (FILE *file, graphite_bb_p gb, int indent, int verbosity)
if (GBB_DOMAIN (gb))
{
fprintf (file, " (domain: \n");
- cloog_matrix_print (dump_file, GBB_DOMAIN (gb));
+ cloog_matrix_print (file, GBB_DOMAIN (gb));
fprintf (file, " )\n");
}
@@ -525,7 +525,7 @@ print_graphite_bb (FILE *file, graphite_bb_p gb, int indent, int verbosity)
if (GBB_CONDITIONS (gb))
{
fprintf (file, " (conditions: \n");
- dump_gbb_conditions (dump_file, gb);
+ dump_gbb_conditions (file, gb);
fprintf (file, " )\n");
}
@@ -1318,7 +1318,7 @@ scopdet_basic_block_info (basic_block bb, VEC (sd_region, heap) **scops,
case GBB_LOOP_MULT_EXIT_HEADER:
{
- /* XXX: For now we just do not join loops with multiple exits. If the
+ /* XXX: For now we just do not join loops with multiple exits. If the
exits lead to the same bb it may be possible to join the loop. */
VEC (sd_region, heap) *tmp_scops = VEC_alloc (sd_region, heap, 3);
VEC (edge, heap) *exits = get_loop_exit_edges (loop);
@@ -1326,28 +1326,27 @@ scopdet_basic_block_info (basic_block bb, VEC (sd_region, heap) **scops,
int i;
build_scops_1 (bb, &tmp_scops, loop);
-
- /* Start at all bbs dominated by a loop exit that only exists in this
- loop. */
+ /* Scan the code dominated by this loop. This means all bbs, that are
+ are dominated by a bb in this loop, but are not part of this loop.
+
+ The easiest case:
+ - The loop exit destination is dominated by the exit sources.
+
+ TODO: We miss here the more complex cases:
+ - The exit destinations are dominated by another bb inside the
+ loop.
+ - The loop dominates bbs, that are not exit destinations. */
for (i = 0; VEC_iterate (edge, exits, i, e); i++)
- if (e->src->loop_father == loop)
- {
- VEC (basic_block, heap) *dominated;
- basic_block b;
- int j;
- dominated = get_dominated_by (CDI_DOMINATORS, e->src);
- for (j = 0; VEC_iterate (basic_block, dominated, j, b); j++)
- /* Loop exit. */
- if (loop_depth (find_common_loop (loop, b->loop_father))
- < loop_depth (loop))
- {
- /* Pass loop_outer to recognize b as loop header in
- build_scops_1. */
- if (b->loop_father->header == b)
- build_scops_1 (b, &tmp_scops, loop_outer (b->loop_father));
- else
- build_scops_1 (b, &tmp_scops, b->loop_father);
- }
+ if (e->src->loop_father == loop
+ && dominated_by_p (CDI_DOMINATORS, e->dest, e->src))
+ {
+ /* Pass loop_outer to recognize e->dest as loop header in
+ build_scops_1. */
+ if (e->dest->loop_father->header == e->dest)
+ build_scops_1 (e->dest, &tmp_scops,
+ loop_outer (e->dest->loop_father));
+ else
+ build_scops_1 (e->dest, &tmp_scops, e->dest->loop_father);
}
result.next = NULL;
@@ -5238,6 +5237,13 @@ graphite_transform_loops (void)
if (graphite_apply_transformations (scop))
gloog (scop, find_transform (scop));
+#ifdef ENABLE_CHECKING
+ else
+ {
+ struct clast_stmt *stmt = find_transform (scop);
+ cloog_clast_free (stmt);
+ }
+#endif
}
/* Cleanup. */
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 662cff60b50..35ec9a60f86 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -1528,6 +1528,7 @@ cgraph_early_inlining (void)
todo = optimize_inline_calls (current_function_decl);
timevar_pop (TV_INTEGRATION);
}
+ cfun->always_inline_functions_inlined = true;
return todo;
}
diff --git a/gcc/ira-build.c b/gcc/ira-build.c
index b10aa460cef..9e47333d46e 100644
--- a/gcc/ira-build.c
+++ b/gcc/ira-build.c
@@ -1583,8 +1583,8 @@ propagate_allocno_info (void)
ira_loop_tree_node_t parent;
enum reg_class cover_class;
- if (flag_ira_algorithm != IRA_ALGORITHM_REGIONAL
- && flag_ira_algorithm != IRA_ALGORITHM_MIXED)
+ if (flag_ira_region != IRA_REGION_ALL
+ && flag_ira_region != IRA_REGION_MIXED)
return;
for (i = max_reg_num () - 1; i >= FIRST_PSEUDO_REGISTER; i--)
for (a = ira_regno_allocno_map[i];
@@ -2116,9 +2116,10 @@ setup_min_max_allocno_live_range_point (void)
}
/* Sort allocnos according to their live ranges. Allocnos with
- smaller cover class are put first. Allocnos with the same cove
- class are ordered according their start (min). Allocnos with the
- same start are ordered according their finish (max). */
+ smaller cover class are put first unless we use priority coloring.
+ Allocnos with the same cove class are ordered according their start
+ (min). Allocnos with the same start are ordered according their
+ finish (max). */
static int
allocno_range_compare_func (const void *v1p, const void *v2p)
{
@@ -2126,7 +2127,8 @@ allocno_range_compare_func (const void *v1p, const void *v2p)
ira_allocno_t a1 = *(const ira_allocno_t *) v1p;
ira_allocno_t a2 = *(const ira_allocno_t *) v2p;
- if ((diff = ALLOCNO_COVER_CLASS (a1) - ALLOCNO_COVER_CLASS (a2)) != 0)
+ if (flag_ira_algorithm != IRA_ALGORITHM_PRIORITY
+ && (diff = ALLOCNO_COVER_CLASS (a1) - ALLOCNO_COVER_CLASS (a2)) != 0)
return diff;
if ((diff = ALLOCNO_MIN (a1) - ALLOCNO_MIN (a2)) != 0)
return diff;
@@ -2161,7 +2163,7 @@ sort_conflict_id_allocno_map (void)
static void
setup_min_max_conflict_allocno_ids (void)
{
- enum reg_class cover_class;
+ int cover_class;
int i, j, min, max, start, finish, first_not_finished, filled_area_start;
int *live_range_min, *last_lived;
ira_allocno_t a;
@@ -2174,7 +2176,9 @@ setup_min_max_conflict_allocno_ids (void)
a = ira_conflict_id_allocno_map[i];
if (a == NULL)
continue;
- if (cover_class != ALLOCNO_COVER_CLASS (a))
+ if (cover_class < 0
+ || (flag_ira_algorithm != IRA_ALGORITHM_PRIORITY
+ && cover_class != (int) ALLOCNO_COVER_CLASS (a)))
{
cover_class = ALLOCNO_COVER_CLASS (a);
min = i;
@@ -2208,7 +2212,9 @@ setup_min_max_conflict_allocno_ids (void)
a = ira_conflict_id_allocno_map[i];
if (a == NULL)
continue;
- if (cover_class != ALLOCNO_COVER_CLASS (a))
+ if (cover_class < 0
+ || (flag_ira_algorithm != IRA_ALGORITHM_PRIORITY
+ && cover_class != (int) ALLOCNO_COVER_CLASS (a)))
{
cover_class = ALLOCNO_COVER_CLASS (a);
for (j = 0; j < ira_max_point; j++)
@@ -2503,7 +2509,8 @@ ira_flattening (int max_regno_before_emit, int ira_max_point_before_emit)
{
ira_allocno_t live_a = ira_allocnos[n];
- if (cover_class == ALLOCNO_COVER_CLASS (live_a)
+ if (ira_reg_classes_intersect_p
+ [cover_class][ALLOCNO_COVER_CLASS (live_a)]
/* Don't set up conflict for the allocno with itself. */
&& num != (int) n)
ira_add_allocno_conflict (a, live_a);
diff --git a/gcc/ira-color.c b/gcc/ira-color.c
index 4b9909194d6..c9cb1845fe4 100644
--- a/gcc/ira-color.c
+++ b/gcc/ira-color.c
@@ -279,7 +279,8 @@ update_copy_costs (ira_allocno_t allocno, bool decr_p)
else
gcc_unreachable ();
- if (cover_class != ALLOCNO_COVER_CLASS (another_allocno)
+ cover_class = ALLOCNO_COVER_CLASS (another_allocno);
+ if (! ira_reg_classes_intersect_p[rclass][cover_class]
|| ALLOCNO_ASSIGNED_P (another_allocno))
continue;
@@ -301,6 +302,8 @@ update_copy_costs (ira_allocno_t allocno, bool decr_p)
(&ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (another_allocno),
cover_class, 0,
ALLOCNO_CONFLICT_HARD_REG_COSTS (another_allocno));
+ i = ira_class_hard_reg_index[cover_class][hard_regno];
+ ira_assert (i >= 0);
ALLOCNO_UPDATED_HARD_REG_COSTS (another_allocno)[i] += update_cost;
ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (another_allocno)[i]
+= update_cost;
@@ -311,17 +314,19 @@ update_copy_costs (ira_allocno_t allocno, bool decr_p)
while (get_next_update_cost (&allocno, &divisor));
}
-/* This function updates COSTS (decrease if DECR_P) by conflict costs
- of the unassigned allocnos connected by copies with allocnos in
- update_cost_queue. This update increases chances to remove some
- copies. */
+/* This function updates COSTS (decrease if DECR_P) for hard_registers
+ of COVER_CLASS by conflict costs of the unassigned allocnos
+ connected by copies with allocnos in update_cost_queue. This
+ update increases chances to remove some copies. */
static void
-update_conflict_hard_regno_costs (int *costs, bool decr_p)
+update_conflict_hard_regno_costs (int *costs, enum reg_class cover_class,
+ bool decr_p)
{
int i, cost, class_size, freq, mult, div, divisor;
+ int index, hard_regno;
int *conflict_costs;
bool cont_p;
- enum reg_class cover_class;
+ enum reg_class another_cover_class;
ira_allocno_t allocno, another_allocno;
ira_copy_t cp, next_cp;
@@ -340,16 +345,17 @@ update_conflict_hard_regno_costs (int *costs, bool decr_p)
}
else
gcc_unreachable ();
- cover_class = ALLOCNO_COVER_CLASS (allocno);
- if (cover_class != ALLOCNO_COVER_CLASS (another_allocno)
+ another_cover_class = ALLOCNO_COVER_CLASS (another_allocno);
+ if (! ira_reg_classes_intersect_p[cover_class][another_cover_class]
|| ALLOCNO_ASSIGNED_P (another_allocno)
|| ALLOCNO_MAY_BE_SPILLED_P (ALLOCNO_FIRST_COALESCED_ALLOCNO
(another_allocno)))
continue;
- class_size = ira_class_hard_regs_num[cover_class];
+ class_size = ira_class_hard_regs_num[another_cover_class];
ira_allocate_and_copy_costs
(&ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (another_allocno),
- cover_class, ALLOCNO_CONFLICT_HARD_REG_COSTS (another_allocno));
+ another_cover_class,
+ ALLOCNO_CONFLICT_HARD_REG_COSTS (another_allocno));
conflict_costs
= ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (another_allocno);
if (conflict_costs == NULL)
@@ -364,13 +370,18 @@ update_conflict_hard_regno_costs (int *costs, bool decr_p)
cont_p = false;
for (i = class_size - 1; i >= 0; i--)
{
+ hard_regno = ira_class_hard_regs[another_cover_class][i];
+ ira_assert (hard_regno >= 0);
+ index = ira_class_hard_reg_index[cover_class][hard_regno];
+ if (index < 0)
+ continue;
cost = conflict_costs [i] * mult / div;
if (cost == 0)
continue;
cont_p = true;
if (decr_p)
cost = -cost;
- costs[i] += cost;
+ costs[index] += cost;
}
}
/* Probably 5 hops will be enough. */
@@ -429,11 +440,11 @@ static bool
assign_hard_reg (ira_allocno_t allocno, bool retry_p)
{
HARD_REG_SET conflicting_regs;
- int i, j, hard_regno, best_hard_regno, class_size;
+ int i, j, k, hard_regno, best_hard_regno, class_size;
int cost, mem_cost, min_cost, full_cost, min_full_cost, add_cost;
int *a_costs;
int *conflict_costs;
- enum reg_class cover_class, rclass;
+ enum reg_class cover_class, rclass, conflict_cover_class;
enum machine_mode mode;
ira_allocno_t a, conflict_allocno;
ira_allocno_conflict_iterator aci;
@@ -490,7 +501,9 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
if (retry_p || bitmap_bit_p (consideration_allocno_bitmap,
ALLOCNO_NUM (conflict_allocno)))
{
- ira_assert (cover_class == ALLOCNO_COVER_CLASS (conflict_allocno));
+ conflict_cover_class = ALLOCNO_COVER_CLASS (conflict_allocno);
+ ira_assert (ira_reg_classes_intersect_p
+ [cover_class][conflict_cover_class]);
if (allocno_coalesced_p)
{
if (bitmap_bit_p (processed_coalesced_allocno_bitmap,
@@ -501,7 +514,8 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
}
if (ALLOCNO_ASSIGNED_P (conflict_allocno))
{
- if ((hard_regno = ALLOCNO_HARD_REGNO (conflict_allocno)) >= 0)
+ if ((hard_regno = ALLOCNO_HARD_REGNO (conflict_allocno)) >= 0
+ && ira_class_hard_reg_index[cover_class][hard_regno] >= 0)
{
IOR_HARD_REG_SET
(conflicting_regs,
@@ -511,20 +525,27 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
conflicting_regs))
goto fail;
}
- continue;
}
else if (! ALLOCNO_MAY_BE_SPILLED_P (ALLOCNO_FIRST_COALESCED_ALLOCNO
(conflict_allocno)))
{
ira_allocate_and_copy_costs
(&ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (conflict_allocno),
- cover_class,
+ conflict_cover_class,
ALLOCNO_CONFLICT_HARD_REG_COSTS (conflict_allocno));
conflict_costs
= ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (conflict_allocno);
if (conflict_costs != NULL)
for (j = class_size - 1; j >= 0; j--)
- full_costs[j] -= conflict_costs[j];
+ {
+ hard_regno = ira_class_hard_regs[cover_class][j];
+ ira_assert (hard_regno >= 0);
+ k = (ira_class_hard_reg_index
+ [conflict_cover_class][hard_regno]);
+ if (k < 0)
+ continue;
+ full_costs[j] -= conflict_costs[k];
+ }
queue_update_cost (conflict_allocno, COST_HOP_DIVISOR);
}
}
@@ -533,7 +554,7 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
}
/* Take into account preferences of allocnos connected by copies to
the conflict allocnos. */
- update_conflict_hard_regno_costs (full_costs, true);
+ update_conflict_hard_regno_costs (full_costs, cover_class, true);
/* Take preferences of allocnos connected by copies into
account. */
@@ -545,7 +566,7 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
if (a == allocno)
break;
}
- update_conflict_hard_regno_costs (full_costs, false);
+ update_conflict_hard_regno_costs (full_costs, cover_class, false);
min_cost = min_full_cost = INT_MAX;
/* We don't care about giving callee saved registers to allocnos no
living through calls because call clobbered registers are
@@ -594,7 +615,8 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
best_hard_regno = -1;
}
fail:
- if (best_hard_regno < 0
+ if (flag_ira_algorithm != IRA_ALGORITHM_PRIORITY
+ && best_hard_regno < 0
&& ALLOCNO_NEXT_COALESCED_ALLOCNO (allocno) != allocno)
{
for (j = 0, a = ALLOCNO_NEXT_COALESCED_ALLOCNO (allocno);;
@@ -1605,6 +1627,10 @@ coalesce_allocnos (bool reload_p)
{
next_cp = cp->next_first_allocno_copy;
regno = ALLOCNO_REGNO (cp->second);
+ /* For priority coloring we coalesce allocnos only with
+ the same cover class not with intersected cover
+ classes as it were possible. It is done for
+ simplicity. */
if ((reload_p
|| (ALLOCNO_COVER_CLASS (cp->second) == cover_class
&& ALLOCNO_MODE (cp->second) == mode))
@@ -1659,12 +1685,72 @@ coalesce_allocnos (bool reload_p)
ira_free (sorted_copies);
}
+/* Map: allocno number -> allocno priority. */
+static int *allocno_priorities;
+
+/* Set up priorities for N allocnos in array
+ CONSIDERATION_ALLOCNOS. */
+static void
+setup_allocno_priorities (ira_allocno_t *consideration_allocnos, int n)
+{
+ int i, length, nrefs, priority, max_priority, mult;
+ ira_allocno_t a;
+
+ max_priority = 0;
+ for (i = 0; i < n; i++)
+ {
+ a = consideration_allocnos[i];
+ nrefs = ALLOCNO_NREFS (a);
+ ira_assert (nrefs >= 0);
+ mult = floor_log2 (ALLOCNO_NREFS (a)) + 1;
+ ira_assert (mult >= 0);
+ allocno_priorities[ALLOCNO_NUM (a)]
+ = priority
+ = (mult
+ * (ALLOCNO_MEMORY_COST (a) - ALLOCNO_COVER_CLASS_COST (a))
+ * ira_reg_class_nregs[ALLOCNO_COVER_CLASS (a)][ALLOCNO_MODE (a)]);
+ if (priority < 0)
+ priority = -priority;
+ if (max_priority < priority)
+ max_priority = priority;
+ }
+ mult = max_priority == 0 ? 1 : INT_MAX / max_priority;
+ for (i = 0; i < n; i++)
+ {
+ a = consideration_allocnos[i];
+ length = ALLOCNO_EXCESS_PRESSURE_POINTS_NUM (a);
+ if (length <= 0)
+ length = 1;
+ allocno_priorities[ALLOCNO_NUM (a)]
+ = allocno_priorities[ALLOCNO_NUM (a)] * mult / length;
+ }
+}
+
+/* Sort allocnos according to their priorities which are calculated
+ analogous to ones in file `global.c'. */
+static int
+allocno_priority_compare_func (const void *v1p, const void *v2p)
+{
+ ira_allocno_t a1 = *(const ira_allocno_t *) v1p;
+ ira_allocno_t a2 = *(const ira_allocno_t *) v2p;
+ int pri1, pri2;
+
+ pri1 = allocno_priorities[ALLOCNO_NUM (a1)];
+ pri2 = allocno_priorities[ALLOCNO_NUM (a2)];
+ if (pri2 - pri1)
+ return pri2 - pri1;
+
+ /* If regs are equally good, sort by allocnos, so that the results of
+ qsort leave nothing to chance. */
+ return ALLOCNO_NUM (a1) - ALLOCNO_NUM (a2);
+}
+
/* Chaitin-Briggs coloring for allocnos in COLORING_ALLOCNO_BITMAP
taking into account allocnos in CONSIDERATION_ALLOCNO_BITMAP. */
static void
color_allocnos (void)
{
- unsigned int i;
+ unsigned int i, n;
bitmap_iterator bi;
ira_allocno_t a;
@@ -1672,30 +1758,83 @@ color_allocnos (void)
processed_coalesced_allocno_bitmap = ira_allocate_bitmap ();
if (flag_ira_coalesce)
coalesce_allocnos (false);
- /* Put the allocnos into the corresponding buckets. */
- colorable_allocno_bucket = NULL;
- uncolorable_allocno_bucket = NULL;
- EXECUTE_IF_SET_IN_BITMAP (coloring_allocno_bitmap, 0, i, bi)
+ if (flag_ira_algorithm == IRA_ALGORITHM_PRIORITY)
{
- a = ira_allocnos[i];
- if (ALLOCNO_COVER_CLASS (a) == NO_REGS)
+ n = 0;
+ EXECUTE_IF_SET_IN_BITMAP (coloring_allocno_bitmap, 0, i, bi)
{
- ALLOCNO_HARD_REGNO (a) = -1;
- ALLOCNO_ASSIGNED_P (a) = true;
- ira_assert (ALLOCNO_UPDATED_HARD_REG_COSTS (a) == NULL);
- ira_assert (ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (a) == NULL);
- if (internal_flag_ira_verbose > 3 && ira_dump_file != NULL)
+ a = ira_allocnos[i];
+ if (ALLOCNO_COVER_CLASS (a) == NO_REGS)
{
- fprintf (ira_dump_file, " Spill");
- print_coalesced_allocno (a);
- fprintf (ira_dump_file, "\n");
+ ALLOCNO_HARD_REGNO (a) = -1;
+ ALLOCNO_ASSIGNED_P (a) = true;
+ ira_assert (ALLOCNO_UPDATED_HARD_REG_COSTS (a) == NULL);
+ ira_assert (ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (a) == NULL);
+ if (internal_flag_ira_verbose > 3 && ira_dump_file != NULL)
+ {
+ fprintf (ira_dump_file, " Spill");
+ print_coalesced_allocno (a);
+ fprintf (ira_dump_file, "\n");
+ }
+ continue;
}
- continue;
+ sorted_allocnos[n++] = a;
}
- put_allocno_into_bucket (a);
+ if (n != 0)
+ {
+ setup_allocno_priorities (sorted_allocnos, n);
+ qsort (sorted_allocnos, n, sizeof (ira_allocno_t),
+ allocno_priority_compare_func);
+ for (i = 0; i < n; i++)
+ {
+ a = sorted_allocnos[i];
+ if (internal_flag_ira_verbose > 3 && ira_dump_file != NULL)
+ {
+ fprintf (ira_dump_file, " ");
+ print_coalesced_allocno (a);
+ fprintf (ira_dump_file, " -- ");
+ }
+ if (assign_hard_reg (a, false))
+ {
+ if (internal_flag_ira_verbose > 3 && ira_dump_file != NULL)
+ fprintf (ira_dump_file, "assign hard reg %d\n",
+ ALLOCNO_HARD_REGNO (a));
+ }
+ else
+ {
+ if (internal_flag_ira_verbose > 3 && ira_dump_file != NULL)
+ fprintf (ira_dump_file, "assign memory\n");
+ }
+ }
+ }
+ }
+ else
+ {
+ /* Put the allocnos into the corresponding buckets. */
+ colorable_allocno_bucket = NULL;
+ uncolorable_allocno_bucket = NULL;
+ EXECUTE_IF_SET_IN_BITMAP (coloring_allocno_bitmap, 0, i, bi)
+ {
+ a = ira_allocnos[i];
+ if (ALLOCNO_COVER_CLASS (a) == NO_REGS)
+ {
+ ALLOCNO_HARD_REGNO (a) = -1;
+ ALLOCNO_ASSIGNED_P (a) = true;
+ ira_assert (ALLOCNO_UPDATED_HARD_REG_COSTS (a) == NULL);
+ ira_assert (ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (a) == NULL);
+ if (internal_flag_ira_verbose > 3 && ira_dump_file != NULL)
+ {
+ fprintf (ira_dump_file, " Spill");
+ print_coalesced_allocno (a);
+ fprintf (ira_dump_file, "\n");
+ }
+ continue;
+ }
+ put_allocno_into_bucket (a);
+ }
+ push_allocnos_to_stack ();
+ pop_allocnos_from_stack ();
}
- push_allocnos_to_stack ();
- pop_allocnos_from_stack ();
if (flag_ira_coalesce)
/* We don't need coalesced allocnos for ira_reassign_pseudos. */
EXECUTE_IF_SET_IN_BITMAP (coloring_allocno_bitmap, 0, i, bi)
@@ -1796,8 +1935,8 @@ color_pass (ira_loop_tree_node_t loop_tree_node)
/* Color all mentioned allocnos including transparent ones. */
color_allocnos ();
/* Process caps. They are processed just once. */
- if (flag_ira_algorithm == IRA_ALGORITHM_MIXED
- || flag_ira_algorithm == IRA_ALGORITHM_REGIONAL)
+ if (flag_ira_region == IRA_REGION_MIXED
+ || flag_ira_region == IRA_REGION_ALL)
EXECUTE_IF_SET_IN_BITMAP (loop_tree_node->all_allocnos, 0, j, bi)
{
a = ira_allocnos[j];
@@ -1806,9 +1945,9 @@ color_pass (ira_loop_tree_node_t loop_tree_node)
/* Remove from processing in the next loop. */
bitmap_clear_bit (consideration_allocno_bitmap, j);
rclass = ALLOCNO_COVER_CLASS (a);
- if ((flag_ira_algorithm == IRA_ALGORITHM_MIXED
- && loop_tree_node->reg_pressure[rclass]
- <= ira_available_class_regs[rclass]))
+ if (flag_ira_region == IRA_REGION_MIXED
+ && (loop_tree_node->reg_pressure[rclass]
+ <= ira_available_class_regs[rclass]))
{
mode = ALLOCNO_MODE (a);
hard_regno = ALLOCNO_HARD_REGNO (a);
@@ -1843,6 +1982,7 @@ color_pass (ira_loop_tree_node_t loop_tree_node)
mode = ALLOCNO_MODE (a);
rclass = ALLOCNO_COVER_CLASS (a);
hard_regno = ALLOCNO_HARD_REGNO (a);
+ /* Use hard register class here. ??? */
if (hard_regno >= 0)
{
index = ira_class_hard_reg_index[rclass][hard_regno];
@@ -1854,9 +1994,10 @@ color_pass (ira_loop_tree_node_t loop_tree_node)
if (subloop_allocno == NULL
|| ALLOCNO_CAP (subloop_allocno) != NULL)
continue;
+ ira_assert (ALLOCNO_COVER_CLASS (subloop_allocno) == rclass);
ira_assert (bitmap_bit_p (subloop_node->all_allocnos,
ALLOCNO_NUM (subloop_allocno)));
- if (flag_ira_algorithm == IRA_ALGORITHM_MIXED
+ if ((flag_ira_region == IRA_REGION_MIXED)
&& (loop_tree_node->reg_pressure[rclass]
<= ira_available_class_regs[rclass]))
{
@@ -2002,6 +2143,7 @@ move_spill_restore (void)
subloop_allocno = subloop_node->regno_allocno_map[regno];
if (subloop_allocno == NULL)
continue;
+ ira_assert (rclass == ALLOCNO_COVER_CLASS (subloop_allocno));
/* We have accumulated cost. To get the real cost of
allocno usage in the loop we should subtract costs of
the subloop allocnos. */
@@ -2027,6 +2169,7 @@ move_spill_restore (void)
if ((parent = loop_node->parent) != NULL
&& (parent_allocno = parent->regno_allocno_map[regno]) != NULL)
{
+ ira_assert (rclass == ALLOCNO_COVER_CLASS (parent_allocno));
exit_freq = ira_loop_edge_freq (loop_node, regno, true);
enter_freq = ira_loop_edge_freq (loop_node, regno, false);
if ((hard_regno2 = ALLOCNO_HARD_REGNO (parent_allocno)) < 0)
@@ -2094,13 +2237,15 @@ update_curr_costs (ira_allocno_t a)
}
else
gcc_unreachable ();
- if (cover_class != ALLOCNO_COVER_CLASS (another_a)
+ if (! ira_reg_classes_intersect_p[cover_class][ALLOCNO_COVER_CLASS
+ (another_a)]
|| ! ALLOCNO_ASSIGNED_P (another_a)
|| (hard_regno = ALLOCNO_HARD_REGNO (another_a)) < 0)
continue;
rclass = REGNO_REG_CLASS (hard_regno);
i = ira_class_hard_reg_index[cover_class][hard_regno];
- ira_assert (i >= 0);
+ if (i < 0)
+ continue;
cost = (cp->first == a
? ira_register_move_cost[mode][rclass][cover_class]
: ira_register_move_cost[mode][cover_class][rclass]);
@@ -2116,66 +2261,6 @@ update_curr_costs (ira_allocno_t a)
}
}
-/* Map: allocno number -> allocno priority. */
-static int *allocno_priorities;
-
-/* Set up priorities for N allocnos in array
- CONSIDERATION_ALLOCNOS. */
-static void
-setup_allocno_priorities (ira_allocno_t *consideration_allocnos, int n)
-{
- int i, length, nrefs, priority, max_priority, mult;
- ira_allocno_t a;
-
- max_priority = 0;
- for (i = 0; i < n; i++)
- {
- a = consideration_allocnos[i];
- nrefs = ALLOCNO_NREFS (a);
- ira_assert (nrefs >= 0);
- mult = floor_log2 (ALLOCNO_NREFS (a)) + 1;
- ira_assert (mult >= 0);
- allocno_priorities[ALLOCNO_NUM (a)]
- = priority
- = (mult
- * (ALLOCNO_MEMORY_COST (a) - ALLOCNO_COVER_CLASS_COST (a))
- * ira_reg_class_nregs[ALLOCNO_COVER_CLASS (a)][ALLOCNO_MODE (a)]);
- if (priority < 0)
- priority = -priority;
- if (max_priority < priority)
- max_priority = priority;
- }
- mult = max_priority == 0 ? 1 : INT_MAX / max_priority;
- for (i = 0; i < n; i++)
- {
- a = consideration_allocnos[i];
- length = ALLOCNO_EXCESS_PRESSURE_POINTS_NUM (a);
- if (length <= 0)
- length = 1;
- allocno_priorities[ALLOCNO_NUM (a)]
- = allocno_priorities[ALLOCNO_NUM (a)] * mult / length;
- }
-}
-
-/* Sort allocnos according to their priorities which are calculated
- analogous to ones in file `global.c'. */
-static int
-allocno_priority_compare_func (const void *v1p, const void *v2p)
-{
- ira_allocno_t a1 = *(const ira_allocno_t *) v1p;
- ira_allocno_t a2 = *(const ira_allocno_t *) v2p;
- int pri1, pri2;
-
- pri1 = allocno_priorities[ALLOCNO_NUM (a1)];
- pri2 = allocno_priorities[ALLOCNO_NUM (a2)];
- if (pri2 - pri1)
- return pri2 - pri1;
-
- /* If regs are equally good, sort by allocnos, so that the results of
- qsort leave nothing to chance. */
- return ALLOCNO_NUM (a1) - ALLOCNO_NUM (a2);
-}
-
/* Try to assign hard registers to the unassigned allocnos and
allocnos conflicting with them or conflicting with allocnos whose
regno >= START_REGNO. The function is called after ira_flattening,
@@ -2215,7 +2300,8 @@ ira_reassign_conflict_allocnos (int start_regno)
continue;
FOR_EACH_ALLOCNO_CONFLICT (a, conflict_a, aci)
{
- ira_assert (cover_class == ALLOCNO_COVER_CLASS (conflict_a));
+ ira_assert (ira_reg_classes_intersect_p
+ [cover_class][ALLOCNO_COVER_CLASS (conflict_a)]);
if (bitmap_bit_p (allocnos_to_color, ALLOCNO_NUM (conflict_a)))
continue;
bitmap_set_bit (allocnos_to_color, ALLOCNO_NUM (conflict_a));
diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c
index 6e7d7692b67..ff116b5da8a 100644
--- a/gcc/ira-conflicts.c
+++ b/gcc/ira-conflicts.c
@@ -114,7 +114,8 @@ build_conflict_bit_table (void)
EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, j)
{
live_a = ira_allocnos[j];
- if (cover_class == ALLOCNO_COVER_CLASS (live_a)
+ if (ira_reg_classes_intersect_p
+ [cover_class][ALLOCNO_COVER_CLASS (live_a)]
/* Don't set up conflict for the allocno with itself. */
&& num != (int) j)
{
@@ -555,8 +556,8 @@ build_allocno_conflicts (ira_allocno_t a)
ALLOCNO_MIN (a), ALLOCNO_MAX (a), i, asi)
{
another_a = ira_conflict_id_allocno_map[i];
- ira_assert (ALLOCNO_COVER_CLASS (a)
- == ALLOCNO_COVER_CLASS (another_a));
+ ira_assert (ira_reg_classes_intersect_p
+ [ALLOCNO_COVER_CLASS (a)][ALLOCNO_COVER_CLASS (another_a)]);
collected_conflict_allocnos[px++] = another_a;
}
if (ira_conflict_vector_profitable_p (a, px))
@@ -592,8 +593,8 @@ build_allocno_conflicts (ira_allocno_t a)
ALLOCNO_MIN (a), ALLOCNO_MAX (a), i, asi)
{
another_a = ira_conflict_id_allocno_map[i];
- ira_assert (ALLOCNO_COVER_CLASS (a)
- == ALLOCNO_COVER_CLASS (another_a));
+ ira_assert (ira_reg_classes_intersect_p
+ [ALLOCNO_COVER_CLASS (a)][ALLOCNO_COVER_CLASS (another_a)]);
if ((another_parent_a = ALLOCNO_CAP (another_a)) == NULL
&& (another_parent_a = (parent->regno_allocno_map
[ALLOCNO_REGNO (another_a)])) == NULL)
@@ -740,6 +741,7 @@ ira_build_conflicts (void)
{
ira_allocno_t a;
ira_allocno_iterator ai;
+ HARD_REG_SET temp_hard_reg_set;
if (optimize)
{
@@ -747,8 +749,8 @@ ira_build_conflicts (void)
build_conflicts ();
ira_traverse_loop_tree (true, ira_loop_tree_root, NULL, add_copies);
/* We need finished conflict table for the subsequent call. */
- if (flag_ira_algorithm == IRA_ALGORITHM_REGIONAL
- || flag_ira_algorithm == IRA_ALGORITHM_MIXED)
+ if (flag_ira_region == IRA_REGION_ALL
+ || flag_ira_region == IRA_REGION_MIXED)
propagate_copies ();
/* Now we can free memory for the conflict table (see function
build_allocno_conflicts for details). */
@@ -759,6 +761,14 @@ ira_build_conflicts (void)
}
ira_free (conflicts);
}
+ if (! CLASS_LIKELY_SPILLED_P (BASE_REG_CLASS))
+ CLEAR_HARD_REG_SET (temp_hard_reg_set);
+ else
+ {
+ COPY_HARD_REG_SET (temp_hard_reg_set, reg_class_contents[BASE_REG_CLASS]);
+ AND_COMPL_HARD_REG_SET (temp_hard_reg_set, ira_no_alloc_regs);
+ AND_HARD_REG_SET (temp_hard_reg_set, call_used_reg_set);
+ }
FOR_EACH_ALLOCNO (a, ai)
{
if (ALLOCNO_CALLS_CROSSED_NUM (a) == 0)
@@ -775,9 +785,15 @@ ira_build_conflicts (void)
{
IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
no_caller_save_reg_set);
+ IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
+ temp_hard_reg_set);
if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
- no_caller_save_reg_set);
+ {
+ IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
+ no_caller_save_reg_set);
+ IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
+ temp_hard_reg_set);
+ }
}
}
if (optimize && internal_flag_ira_verbose > 2 && ira_dump_file != NULL)
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index 3daeb075d34..a2df9bde9ae 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -105,6 +105,9 @@ static enum reg_class *allocno_pref;
/* Allocated buffers for allocno_pref. */
static enum reg_class *allocno_pref_buffer;
+/* Record register class of each allocno with the same regno. */
+static enum reg_class *common_classes;
+
/* Execution frequency of the current insn. */
static int frequency;
@@ -1082,8 +1085,8 @@ print_costs (FILE *f)
{
fprintf (f, " %s:%d", reg_class_names[rclass],
COSTS_OF_ALLOCNO (allocno_costs, i)->cost[k]);
- if (flag_ira_algorithm == IRA_ALGORITHM_REGIONAL
- || flag_ira_algorithm == IRA_ALGORITHM_MIXED)
+ if (flag_ira_region == IRA_REGION_ALL
+ || flag_ira_region == IRA_REGION_MIXED)
fprintf (f, ",%d", COSTS_OF_ALLOCNO (total_costs, i)->cost[k]);
}
}
@@ -1173,7 +1176,7 @@ find_allocno_class_costs (void)
int rclass, a_num, parent_a_num;
ira_loop_tree_node_t parent;
int best_cost, allocno_cost;
- enum reg_class best, alt_class, common_class;
+ enum reg_class best, alt_class;
#ifdef FORBIDDEN_INC_DEC_CLASSES
int inc_dec_p = false;
#endif
@@ -1187,8 +1190,8 @@ find_allocno_class_costs (void)
a = ALLOCNO_NEXT_REGNO_ALLOCNO (a))
{
a_num = ALLOCNO_NUM (a);
- if ((flag_ira_algorithm == IRA_ALGORITHM_REGIONAL
- || flag_ira_algorithm == IRA_ALGORITHM_MIXED)
+ if ((flag_ira_region == IRA_REGION_ALL
+ || flag_ira_region == IRA_REGION_MIXED)
&& (parent = ALLOCNO_LOOP_TREE_NODE (a)->parent) != NULL
&& (parent_a = parent->regno_allocno_map[i]) != NULL
/* There are no caps yet. */
@@ -1247,6 +1250,7 @@ find_allocno_class_costs (void)
> reg_class_size[alt_class]))
alt_class = reg_class_subunion[alt_class][rclass];
}
+ alt_class = ira_class_translate[alt_class];
if (pass == flag_expensive_optimizations)
{
if (best_cost > temp_costs->mem_cost)
@@ -1260,18 +1264,22 @@ find_allocno_class_costs (void)
i, reg_class_names[best], reg_class_names[alt_class]);
}
if (best_cost > temp_costs->mem_cost)
- common_class = NO_REGS;
+ common_classes[i] = NO_REGS;
+ else if (flag_ira_algorithm == IRA_ALGORITHM_PRIORITY)
+ /* Make the common class the biggest class of best and
+ alt_class. */
+ common_classes[i] = alt_class == NO_REGS ? best : alt_class;
else
/* Make the common class a cover class. Remember all
allocnos with the same regno should have the same cover
class. */
- common_class = ira_class_translate[best];
+ common_classes[i] = ira_class_translate[best];
for (a = ira_regno_allocno_map[i];
a != NULL;
a = ALLOCNO_NEXT_REGNO_ALLOCNO (a))
{
a_num = ALLOCNO_NUM (a);
- if (common_class == NO_REGS)
+ if (common_classes[i] == NO_REGS)
best = NO_REGS;
else
{
@@ -1283,7 +1291,7 @@ find_allocno_class_costs (void)
for (k = 0; k < cost_classes_num; k++)
{
rclass = cost_classes[k];
- if (! ira_class_subset_p[rclass][common_class])
+ if (! ira_class_subset_p[rclass][common_classes[i]])
continue;
/* Ignore classes that are too small for this
operand or invalid for an operand that was
@@ -1319,6 +1327,8 @@ find_allocno_class_costs (void)
}
ALLOCNO_COVER_CLASS_COST (a) = allocno_cost;
}
+ ira_assert (flag_ira_algorithm == IRA_ALGORITHM_PRIORITY
+ || ira_class_translate[best] == common_classes[i]);
if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL
&& (pass == 0 || allocno_pref[a_num] != best))
{
@@ -1330,7 +1340,7 @@ find_allocno_class_costs (void)
ALLOCNO_LOOP_TREE_NODE (a)->loop->num);
fprintf (ira_dump_file, ") best %s, cover %s\n",
reg_class_names[best],
- reg_class_names[ira_class_translate[best]]);
+ reg_class_names[common_classes[i]]);
}
allocno_pref[a_num] = best;
}
@@ -1439,7 +1449,7 @@ setup_allocno_cover_class_and_costs (void)
{
i = ALLOCNO_NUM (a);
mode = ALLOCNO_MODE (a);
- cover_class = ira_class_translate[allocno_pref[i]];
+ cover_class = common_classes[ALLOCNO_REGNO (a)];
ira_assert (allocno_pref[i] == NO_REGS || cover_class != NO_REGS);
ALLOCNO_MEMORY_COST (a) = COSTS_OF_ALLOCNO (allocno_costs, i)->mem_cost;
ira_set_allocno_cover_class (a, cover_class);
@@ -1572,6 +1582,9 @@ ira_costs (void)
allocno_pref_buffer
= (enum reg_class *) ira_allocate (sizeof (enum reg_class)
* ira_allocnos_num);
+ common_classes
+ = (enum reg_class *) ira_allocate (sizeof (enum reg_class)
+ * max_reg_num ());
find_allocno_class_costs ();
setup_allocno_cover_class_and_costs ();
/* Because we could process operands only as subregs, check mode of
@@ -1580,6 +1593,7 @@ ira_costs (void)
if (ira_register_move_cost[ALLOCNO_MODE (a)] == NULL
&& have_regs_of_mode[ALLOCNO_MODE (a)])
ira_init_register_move_cost (ALLOCNO_MODE (a));
+ ira_free (common_classes);
ira_free (allocno_pref_buffer);
ira_free (total_costs);
ira_free (allocno_costs);
diff --git a/gcc/ira-emit.c b/gcc/ira-emit.c
index 29f3fdf6fa7..536d6ee47f4 100644
--- a/gcc/ira-emit.c
+++ b/gcc/ira-emit.c
@@ -1025,6 +1025,7 @@ void
ira_emit (bool loops_p)
{
basic_block bb;
+ rtx insn;
edge_iterator ei;
edge e;
ira_allocno_t a;
@@ -1085,6 +1086,14 @@ ira_emit (bool loops_p)
ira_free (allocno_last_set_check);
ira_free (allocno_last_set);
commit_edge_insertions ();
+ /* Fix insn codes. It is necessary to do it before reload because
+ reload assumes initial insn codes defined. The insn codes can be
+ invalidated by CFG infrastructure for example in jump
+ redirection. */
+ FOR_EACH_BB (bb)
+ FOR_BB_INSNS_REVERSE (bb, insn)
+ if (INSN_P (insn))
+ recog_memoized (insn);
ira_free (at_bb_end);
ira_free (at_bb_start);
}
diff --git a/gcc/ira-int.h b/gcc/ira-int.h
index 5c6b355ecc8..1fc6da265e2 100644
--- a/gcc/ira-int.h
+++ b/gcc/ira-int.h
@@ -819,6 +819,16 @@ extern enum reg_class ira_class_translate[N_REG_CLASSES];
taking all hard-registers including fixed ones into account. */
extern enum reg_class ira_reg_class_intersect[N_REG_CLASSES][N_REG_CLASSES];
+/* True if the two classes (that is calculated taking only hard
+ registers available for allocation into account) are
+ intersected. */
+extern bool ira_reg_classes_intersect_p[N_REG_CLASSES][N_REG_CLASSES];
+
+/* Classes with end marker LIM_REG_CLASSES which are intersected with
+ given class (the first index). That includes given class itself.
+ This is calculated taking only hard registers available for
+ allocation into account. */
+extern enum reg_class ira_reg_class_super_classes[N_REG_CLASSES][N_REG_CLASSES];
/* The biggest important class inside of union of the two classes
(that is calculated taking only hard registers available for
allocation into account). If the both classes contain no hard
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index 83b5ec85e6f..c7868f39a54 100644
--- a/gcc/ira-lives.c
+++ b/gcc/ira-lives.c
@@ -117,18 +117,23 @@ make_regno_born (int regno)
static void
update_allocno_pressure_excess_length (ira_allocno_t a)
{
- int start;
- enum reg_class cover_class;
+ int start, i;
+ enum reg_class cover_class, cl;
allocno_live_range_t p;
cover_class = ALLOCNO_COVER_CLASS (a);
- if (high_pressure_start_point[cover_class] < 0)
- return;
- p = ALLOCNO_LIVE_RANGES (a);
- ira_assert (p != NULL);
- start = (high_pressure_start_point[cover_class] > p->start
- ? high_pressure_start_point[cover_class] : p->start);
- ALLOCNO_EXCESS_PRESSURE_POINTS_NUM (a) += curr_point - start + 1;
+ for (i = 0;
+ (cl = ira_reg_class_super_classes[cover_class][i]) != LIM_REG_CLASSES;
+ i++)
+ {
+ if (high_pressure_start_point[cl] < 0)
+ continue;
+ p = ALLOCNO_LIVE_RANGES (a);
+ ira_assert (p != NULL);
+ start = (high_pressure_start_point[cl] > p->start
+ ? high_pressure_start_point[cl] : p->start);
+ ALLOCNO_EXCESS_PRESSURE_POINTS_NUM (a) += curr_point - start + 1;
+ }
}
/* Process the death of register REGNO. This updates hard_regs_live
@@ -165,8 +170,8 @@ static int curr_reg_pressure[N_REG_CLASSES];
static void
set_allocno_live (ira_allocno_t a)
{
- int nregs;
- enum reg_class cover_class;
+ int i;
+ enum reg_class cover_class, cl;
/* Invalidate because it is referenced. */
allocno_saved_at_call[ALLOCNO_NUM (a)] = 0;
@@ -176,15 +181,17 @@ set_allocno_live (ira_allocno_t a)
IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a), hard_regs_live);
IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), hard_regs_live);
cover_class = ALLOCNO_COVER_CLASS (a);
- nregs = ira_reg_class_nregs[cover_class][ALLOCNO_MODE (a)];
- curr_reg_pressure[cover_class] += nregs;
- if (high_pressure_start_point[cover_class] < 0
- && (curr_reg_pressure[cover_class]
- > ira_available_class_regs[cover_class]))
- high_pressure_start_point[cover_class] = curr_point;
- if (curr_bb_node->reg_pressure[cover_class]
- < curr_reg_pressure[cover_class])
- curr_bb_node->reg_pressure[cover_class] = curr_reg_pressure[cover_class];
+ for (i = 0;
+ (cl = ira_reg_class_super_classes[cover_class][i]) != LIM_REG_CLASSES;
+ i++)
+ {
+ curr_reg_pressure[cl] += ira_reg_class_nregs[cl][ALLOCNO_MODE (a)];
+ if (high_pressure_start_point[cl] < 0
+ && (curr_reg_pressure[cl] > ira_available_class_regs[cl]))
+ high_pressure_start_point[cl] = curr_point;
+ if (curr_bb_node->reg_pressure[cl] < curr_reg_pressure[cl])
+ curr_bb_node->reg_pressure[cl] = curr_reg_pressure[cl];
+ }
}
/* Mark allocno A as currently not living and update current register
@@ -193,26 +200,40 @@ set_allocno_live (ira_allocno_t a)
static void
clear_allocno_live (ira_allocno_t a)
{
- unsigned int i;
- enum reg_class cover_class;
+ int i;
+ unsigned int j;
+ enum reg_class cover_class, cl;
+ bool set_p;
/* Invalidate because it is referenced. */
allocno_saved_at_call[ALLOCNO_NUM (a)] = 0;
if (sparseset_bit_p (allocnos_live, ALLOCNO_NUM (a)))
{
cover_class = ALLOCNO_COVER_CLASS (a);
- curr_reg_pressure[cover_class]
- -= ira_reg_class_nregs[cover_class][ALLOCNO_MODE (a)];
- ira_assert (curr_reg_pressure[cover_class] >= 0);
- if (high_pressure_start_point[cover_class] >= 0
- && (curr_reg_pressure[cover_class]
- <= ira_available_class_regs[cover_class]))
+ set_p = false;
+ for (i = 0;
+ (cl = ira_reg_class_super_classes[cover_class][i])
+ != LIM_REG_CLASSES;
+ i++)
{
- EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, i)
- {
- update_allocno_pressure_excess_length (ira_allocnos[i]);
- }
- high_pressure_start_point[cover_class] = -1;
+ curr_reg_pressure[cl] -= ira_reg_class_nregs[cl][ALLOCNO_MODE (a)];
+ ira_assert (curr_reg_pressure[cl] >= 0);
+ if (high_pressure_start_point[cl] >= 0
+ && curr_reg_pressure[cl] <= ira_available_class_regs[cl])
+ set_p = true;
+ }
+ if (set_p)
+ {
+ EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, j)
+ update_allocno_pressure_excess_length (ira_allocnos[j]);
+ for (i = 0;
+ (cl = ira_reg_class_super_classes[cover_class][i])
+ != LIM_REG_CLASSES;
+ i++)
+ if (high_pressure_start_point[cl] >= 0
+ && curr_reg_pressure[cl] <= ira_available_class_regs[cl])
+ high_pressure_start_point[cl] = -1;
+
}
}
sparseset_clear_bit (allocnos_live, ALLOCNO_NUM (a));
@@ -225,7 +246,7 @@ clear_allocno_live (ira_allocno_t a)
static void
mark_reg_live (rtx reg)
{
- int regno;
+ int i, regno;
gcc_assert (REG_P (reg));
regno = REGNO (reg);
@@ -249,7 +270,7 @@ mark_reg_live (rtx reg)
else if (! TEST_HARD_REG_BIT (ira_no_alloc_regs, regno))
{
int last = regno + hard_regno_nregs[regno][GET_MODE (reg)];
- enum reg_class cover_class;
+ enum reg_class cover_class, cl;
while (regno < last)
{
@@ -257,20 +278,26 @@ mark_reg_live (rtx reg)
&& ! TEST_HARD_REG_BIT (eliminable_regset, regno))
{
cover_class = ira_hard_regno_cover_class[regno];
- if (cover_class != NO_REGS)
+ for (i = 0;
+ (cl = ira_reg_class_super_classes[cover_class][i])
+ != LIM_REG_CLASSES;
+ i++)
{
- curr_reg_pressure[cover_class]++;
- if (high_pressure_start_point[cover_class] < 0
- && (curr_reg_pressure[cover_class]
- > ira_available_class_regs[cover_class]))
- high_pressure_start_point[cover_class] = curr_point;
+ curr_reg_pressure[cl]++;
+ if (high_pressure_start_point[cl] < 0
+ && (curr_reg_pressure[cl]
+ > ira_available_class_regs[cl]))
+ high_pressure_start_point[cl] = curr_point;
}
make_regno_born (regno);
- if (cover_class != NO_REGS
- && (curr_bb_node->reg_pressure[cover_class]
- < curr_reg_pressure[cover_class]))
- curr_bb_node->reg_pressure[cover_class]
- = curr_reg_pressure[cover_class];
+ for (i = 0;
+ (cl = ira_reg_class_super_classes[cover_class][i])
+ != LIM_REG_CLASSES;
+ i++)
+ {
+ if (curr_bb_node->reg_pressure[cl] < curr_reg_pressure[cl])
+ curr_bb_node->reg_pressure[cl] = curr_reg_pressure[cl];
+ }
}
regno++;
}
@@ -317,30 +344,41 @@ mark_reg_dead (rtx reg)
}
else if (! TEST_HARD_REG_BIT (ira_no_alloc_regs, regno))
{
- unsigned int i;
+ int i;
+ unsigned int j;
int last = regno + hard_regno_nregs[regno][GET_MODE (reg)];
- enum reg_class cover_class;
+ enum reg_class cover_class, cl;
+ bool set_p;
while (regno < last)
{
if (TEST_HARD_REG_BIT (hard_regs_live, regno))
{
+ set_p = false;
cover_class = ira_hard_regno_cover_class[regno];
- if (cover_class != NO_REGS)
+ for (i = 0;
+ (cl = ira_reg_class_super_classes[cover_class][i])
+ != LIM_REG_CLASSES;
+ i++)
+ {
+ curr_reg_pressure[cl]--;
+ if (high_pressure_start_point[cl] >= 0
+ && curr_reg_pressure[cl] <= ira_available_class_regs[cl])
+ set_p = true;
+ ira_assert (curr_reg_pressure[cl] >= 0);
+ }
+ if (set_p)
{
- curr_reg_pressure[cover_class]--;
- if (high_pressure_start_point[cover_class] >= 0
- && (curr_reg_pressure[cover_class]
- <= ira_available_class_regs[cover_class]))
- {
- EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, i)
- {
- update_allocno_pressure_excess_length
- (ira_allocnos[i]);
- }
- high_pressure_start_point[cover_class] = -1;
- }
- ira_assert (curr_reg_pressure[cover_class] >= 0);
+ EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, j)
+ update_allocno_pressure_excess_length (ira_allocnos[j]);
+ for (i = 0;
+ (cl = ira_reg_class_super_classes[cover_class][i])
+ != LIM_REG_CLASSES;
+ i++)
+ if (high_pressure_start_point[cl] >= 0
+ && (curr_reg_pressure[cl]
+ <= ira_available_class_regs[cl]))
+ high_pressure_start_point[cl] = -1;
}
make_regno_dead (regno);
}
@@ -807,18 +845,20 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT (hard_regs_live, i))
{
- enum reg_class cover_class;
+ enum reg_class cover_class, cl;
- cover_class = ira_hard_regno_cover_class[i];
- if (cover_class == NO_REGS)
- continue;
- curr_reg_pressure[cover_class]++;
- if (curr_bb_node->reg_pressure[cover_class]
- < curr_reg_pressure[cover_class])
- curr_bb_node->reg_pressure[cover_class]
- = curr_reg_pressure[cover_class];
- ira_assert (curr_reg_pressure[cover_class]
- <= ira_available_class_regs[cover_class]);
+ cover_class = ira_class_translate[REGNO_REG_CLASS (i)];
+ for (j = 0;
+ (cl = ira_reg_class_super_classes[cover_class][j])
+ != LIM_REG_CLASSES;
+ j++)
+ {
+ curr_reg_pressure[cl]++;
+ if (curr_bb_node->reg_pressure[cl] < curr_reg_pressure[cl])
+ curr_bb_node->reg_pressure[cl] = curr_reg_pressure[cl];
+ ira_assert (curr_reg_pressure[cl]
+ <= ira_available_class_regs[cl]);
+ }
}
EXECUTE_IF_SET_IN_BITMAP (reg_live_out, FIRST_PSEUDO_REGISTER, j, bi)
{
diff --git a/gcc/ira.c b/gcc/ira.c
index 4b6854272f1..44f7032bf31 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -434,6 +434,8 @@ setup_class_hard_regs (void)
COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
CLEAR_HARD_REG_SET (processed_hard_reg_set);
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ ira_class_hard_reg_index[cl][0] = -1;
for (n = 0, i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
#ifdef REG_ALLOC_ORDER
@@ -714,22 +716,72 @@ enum reg_class ira_important_classes[N_REG_CLASSES];
classes. */
int ira_important_class_nums[N_REG_CLASSES];
-/* Check IRA_COVER_CLASSES and sets the four global variables defined
- above. */
+/* Set the four global variables defined above. */
static void
setup_cover_and_important_classes (void)
{
- int i, j;
+ int i, j, n;
+ bool set_p, eq_p;
enum reg_class cl;
- const enum reg_class *classes;
+ const enum reg_class *cover_classes;
HARD_REG_SET temp_hard_regset2;
+ static enum reg_class classes[LIM_REG_CLASSES + 1];
+
+ if (targetm.ira_cover_classes == NULL)
+ cover_classes = NULL;
+ else
+ cover_classes = targetm.ira_cover_classes ();
+ if (cover_classes == NULL)
+ ira_assert (flag_ira_algorithm == IRA_ALGORITHM_PRIORITY);
+ else
+ {
+ for (i = 0; (cl = cover_classes[i]) != LIM_REG_CLASSES; i++)
+ classes[i] = cl;
+ classes[i] = LIM_REG_CLASSES;
+ }
+
+ if (flag_ira_algorithm == IRA_ALGORITHM_PRIORITY)
+ {
+ n = 0;
+ for (i = 0; i <= LIM_REG_CLASSES; i++)
+ {
+ if (i == NO_REGS)
+ continue;
+#ifdef CONSTRAINT__LIMIT
+ for (j = 0; j < CONSTRAINT__LIMIT; j++)
+ if ((int) regclass_for_constraint (j) == i)
+ break;
+ if (j < CONSTRAINT__LIMIT)
+ {
+ classes[n++] = i;
+ continue;
+ }
+#endif
+ COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[i]);
+ AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
+ for (j = 0; j < LIM_REG_CLASSES; j++)
+ {
+ if (i == j)
+ continue;
+ COPY_HARD_REG_SET (temp_hard_regset2, reg_class_contents[j]);
+ AND_COMPL_HARD_REG_SET (temp_hard_regset2,
+ no_unit_alloc_regs);
+ if (hard_reg_set_equal_p (temp_hard_regset,
+ temp_hard_regset2))
+ break;
+ }
+ if (j >= i)
+ classes[n++] = i;
+ }
+ classes[n] = LIM_REG_CLASSES;
+ }
- classes = targetm.ira_cover_classes ();
ira_reg_class_cover_size = 0;
for (i = 0; (cl = classes[i]) != LIM_REG_CLASSES; i++)
{
for (j = 0; j < i; j++)
- if (reg_classes_intersect_p (cl, classes[j]))
+ if (flag_ira_algorithm != IRA_ALGORITHM_PRIORITY
+ && reg_classes_intersect_p (cl, classes[j]))
gcc_unreachable ();
COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
@@ -742,22 +794,34 @@ setup_cover_and_important_classes (void)
COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
if (! hard_reg_set_empty_p (temp_hard_regset))
- for (j = 0; j < ira_reg_class_cover_size; j++)
- {
- COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
- AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
- COPY_HARD_REG_SET (temp_hard_regset2,
- reg_class_contents[ira_reg_class_cover[j]]);
- AND_COMPL_HARD_REG_SET (temp_hard_regset2, no_unit_alloc_regs);
- if (cl == ira_reg_class_cover[j]
- || (hard_reg_set_subset_p (temp_hard_regset, temp_hard_regset2)
- && ! hard_reg_set_equal_p (temp_hard_regset,
- temp_hard_regset2)))
- {
- ira_important_class_nums[cl] = ira_important_classes_num;
- ira_important_classes[ira_important_classes_num++] = cl;
- }
- }
+ {
+ set_p = eq_p = false;
+ for (j = 0; j < ira_reg_class_cover_size; j++)
+ {
+ COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
+ AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
+ COPY_HARD_REG_SET (temp_hard_regset2,
+ reg_class_contents[ira_reg_class_cover[j]]);
+ AND_COMPL_HARD_REG_SET (temp_hard_regset2, no_unit_alloc_regs);
+ if (cl == ira_reg_class_cover[j])
+ {
+ eq_p = false;
+ set_p = true;
+ break;
+ }
+ else if (hard_reg_set_equal_p (temp_hard_regset,
+ temp_hard_regset2))
+ eq_p = true;
+ else if (hard_reg_set_subset_p (temp_hard_regset,
+ temp_hard_regset2))
+ set_p = true;
+ }
+ if (set_p && ! eq_p)
+ {
+ ira_important_class_nums[cl] = ira_important_classes_num;
+ ira_important_classes[ira_important_classes_num++] = cl;
+ }
+ }
}
}
@@ -776,25 +840,44 @@ setup_class_translate (void)
for (cl = 0; cl < N_REG_CLASSES; cl++)
ira_class_translate[cl] = NO_REGS;
+
+ if (flag_ira_algorithm == IRA_ALGORITHM_PRIORITY)
+ for (cl = 0; cl < LIM_REG_CLASSES; cl++)
+ {
+ COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
+ AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
+ for (i = 0; i < ira_reg_class_cover_size; i++)
+ {
+ HARD_REG_SET temp_hard_regset2;
+
+ cover_class = ira_reg_class_cover[i];
+ COPY_HARD_REG_SET (temp_hard_regset2,
+ reg_class_contents[cover_class]);
+ AND_COMPL_HARD_REG_SET (temp_hard_regset2, no_unit_alloc_regs);
+ if (hard_reg_set_equal_p (temp_hard_regset, temp_hard_regset2))
+ ira_class_translate[cl] = cover_class;
+ }
+ }
for (i = 0; i < ira_reg_class_cover_size; i++)
{
cover_class = ira_reg_class_cover[i];
- for (cl_ptr = &alloc_reg_class_subclasses[cover_class][0];
- (cl = *cl_ptr) != LIM_REG_CLASSES;
- cl_ptr++)
- {
- if (ira_class_translate[cl] == NO_REGS)
- ira_class_translate[cl] = cover_class;
+ if (flag_ira_algorithm != IRA_ALGORITHM_PRIORITY)
+ for (cl_ptr = &alloc_reg_class_subclasses[cover_class][0];
+ (cl = *cl_ptr) != LIM_REG_CLASSES;
+ cl_ptr++)
+ {
+ if (ira_class_translate[cl] == NO_REGS)
+ ira_class_translate[cl] = cover_class;
#ifdef ENABLE_IRA_CHECKING
- else
- {
- COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
- AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
- if (! hard_reg_set_empty_p (temp_hard_regset))
- gcc_unreachable ();
- }
+ else
+ {
+ COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
+ AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
+ if (! hard_reg_set_empty_p (temp_hard_regset))
+ gcc_unreachable ();
+ }
#endif
- }
+ }
ira_class_translate[cover_class] = cover_class;
}
/* For classes which are not fully covered by a cover class (in
@@ -842,6 +925,17 @@ setup_class_translate (void)
account. */
enum reg_class ira_reg_class_intersect[N_REG_CLASSES][N_REG_CLASSES];
+/* True if the two classes (that is calculated taking only hard
+ registers available for allocation into account) are
+ intersected. */
+bool ira_reg_classes_intersect_p[N_REG_CLASSES][N_REG_CLASSES];
+
+/* Important classes with end marker LIM_REG_CLASSES which are
+ supersets with given important class (the first index). That
+ includes given class itself. This is calculated taking only hard
+ registers available for allocation into account. */
+enum reg_class ira_reg_class_super_classes[N_REG_CLASSES][N_REG_CLASSES];
+
/* The biggest important reg_class inside of union of the two
reg_classes (that is calculated taking only hard registers
available for allocation into account). If the both reg_classes
@@ -851,17 +945,23 @@ enum reg_class ira_reg_class_intersect[N_REG_CLASSES][N_REG_CLASSES];
reg_class_subunion value. */
enum reg_class ira_reg_class_union[N_REG_CLASSES][N_REG_CLASSES];
-/* Set up IRA_REG_CLASS_INTERSECT and IRA_REG_CLASS_UNION. */
+/* Set up the above reg class relations. */
static void
-setup_reg_class_intersect_union (void)
+setup_reg_class_relations (void)
{
int i, cl1, cl2, cl3;
HARD_REG_SET intersection_set, union_set, temp_set2;
+ bool important_class_p[N_REG_CLASSES];
+ memset (important_class_p, 0, sizeof (important_class_p));
+ for (i = 0; i < ira_important_classes_num; i++)
+ important_class_p[ira_important_classes[i]] = true;
for (cl1 = 0; cl1 < N_REG_CLASSES; cl1++)
{
+ ira_reg_class_super_classes[cl1][0] = LIM_REG_CLASSES;
for (cl2 = 0; cl2 < N_REG_CLASSES; cl2++)
{
+ ira_reg_classes_intersect_p[cl1][cl2] = false;
ira_reg_class_intersect[cl1][cl2] = NO_REGS;
COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl1]);
AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
@@ -882,6 +982,19 @@ setup_reg_class_intersect_union (void)
ira_reg_class_union[cl1][cl2] = reg_class_subunion[cl1][cl2];
continue;
}
+ ira_reg_classes_intersect_p[cl1][cl2]
+ = hard_reg_set_intersect_p (temp_hard_regset, temp_set2);
+ if (important_class_p[cl1] && important_class_p[cl2]
+ && hard_reg_set_subset_p (temp_hard_regset, temp_set2))
+ {
+ enum reg_class *p;
+
+ p = &ira_reg_class_super_classes[cl1][0];
+ while (*p != LIM_REG_CLASSES)
+ p++;
+ *p++ = (enum reg_class) cl2;
+ *p = LIM_REG_CLASSES;
+ }
ira_reg_class_union[cl1][cl2] = NO_REGS;
COPY_HARD_REG_SET (intersection_set, reg_class_contents[cl1]);
AND_HARD_REG_SET (intersection_set, reg_class_contents[cl2]);
@@ -966,12 +1079,9 @@ static void
find_reg_class_closure (void)
{
setup_reg_subclasses ();
- if (targetm.ira_cover_classes)
- {
- setup_cover_and_important_classes ();
- setup_class_translate ();
- setup_reg_class_intersect_union ();
- }
+ setup_cover_and_important_classes ();
+ setup_class_translate ();
+ setup_reg_class_relations ();
}
@@ -1804,8 +1914,8 @@ ira (FILE *f)
if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL)
fprintf (ira_dump_file, "Building IRA IR\n");
loops_p = ira_build (optimize
- && (flag_ira_algorithm == IRA_ALGORITHM_REGIONAL
- || flag_ira_algorithm == IRA_ALGORITHM_MIXED));
+ && (flag_ira_region == IRA_REGION_ALL
+ || flag_ira_region == IRA_REGION_MIXED));
saved_flag_ira_share_spill_slots = flag_ira_share_spill_slots;
if (too_high_register_pressure_p ())
diff --git a/gcc/opts.c b/gcc/opts.c
index a87fb498b15..42e3beeb926 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -870,9 +870,11 @@ decode_options (unsigned int argc, const char **argv)
}
}
- /* Use IRA if it is implemented for the target. */
- if (targetm.ira_cover_classes)
- flag_ira = 1;
+ flag_ira = 1;
+ /* Use priority coloring if cover classes is not defined for the
+ target. */
+ if (targetm.ira_cover_classes == NULL)
+ flag_ira_algorithm = IRA_ALGORITHM_PRIORITY;
/* -O1 optimizations. */
opt1 = (optimize >= 1);
@@ -1096,10 +1098,12 @@ decode_options (unsigned int argc, const char **argv)
if (!flag_sel_sched_pipelining)
flag_sel_sched_pipelining_outer_loops = 0;
- if (flag_ira && !targetm.ira_cover_classes)
+ if (flag_ira && !targetm.ira_cover_classes
+ && flag_ira_algorithm == IRA_ALGORITHM_CB)
{
- inform (input_location, "-fira does not work on this architecture");
- flag_ira = 0;
+ inform (input_location,
+ "-fira-algorithm=CB does not work on this architecture");
+ flag_ira_algorithm = IRA_ALGORITHM_PRIORITY;
}
/* Save the current optimization options if this is the first call. */
@@ -1976,16 +1980,25 @@ common_handle_option (size_t scode, const char *arg, int value,
break;
case OPT_fira_algorithm_:
- if (!strcmp (arg, "regional"))
- flag_ira_algorithm = IRA_ALGORITHM_REGIONAL;
- else if (!strcmp (arg, "CB"))
+ if (!strcmp (arg, "CB"))
flag_ira_algorithm = IRA_ALGORITHM_CB;
- else if (!strcmp (arg, "mixed"))
- flag_ira_algorithm = IRA_ALGORITHM_MIXED;
+ else if (!strcmp (arg, "priority"))
+ flag_ira_algorithm = IRA_ALGORITHM_PRIORITY;
else
warning (0, "unknown ira algorithm \"%s\"", arg);
break;
+ case OPT_fira_region_:
+ if (!strcmp (arg, "one"))
+ flag_ira_region = IRA_REGION_ONE;
+ else if (!strcmp (arg, "all"))
+ flag_ira_region = IRA_REGION_ALL;
+ else if (!strcmp (arg, "mixed"))
+ flag_ira_region = IRA_REGION_MIXED;
+ else
+ warning (0, "unknown ira region \"%s\"", arg);
+ break;
+
case OPT_fira_verbose_:
flag_ira_verbose = value;
break;
diff --git a/gcc/predict.c b/gcc/predict.c
index 73dbcbdc4ce..22e71ceab8d 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -2052,7 +2052,7 @@ estimate_bb_frequencies (void)
basic_block bb;
sreal freq_max;
- if (cfun->function_frequency != PROFILE_READ || !counts_to_freqs ())
+ if (profile_status != PROFILE_READ || !counts_to_freqs ())
{
static int real_values_initialized = 0;
diff --git a/gcc/reload1.c b/gcc/reload1.c
index ac1e874b124..ffde2bf94d8 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -6084,9 +6084,10 @@ choose_reload_regs (struct insn_chain *chain)
need_mode = mode;
else
need_mode
- = smallest_mode_for_size (GET_MODE_BITSIZE (mode)
- + byte * BITS_PER_UNIT,
- GET_MODE_CLASS (mode));
+ = smallest_mode_for_size
+ (GET_MODE_BITSIZE (mode) + byte * BITS_PER_UNIT,
+ GET_MODE_CLASS (mode) == MODE_PARTIAL_INT
+ ? MODE_INT : GET_MODE_CLASS (mode));
if ((GET_MODE_SIZE (GET_MODE (last_reg))
>= GET_MODE_SIZE (need_mode))
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 17654611e1a..0e7caa5450b 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -1316,7 +1316,7 @@ compute_record_mode (tree type)
However, if possible, we use a mode that fits in a register
instead, in order to allow for better optimization down the
line. */
- TYPE_MODE (type) = BLKmode;
+ SET_TYPE_MODE (type, BLKmode);
if (! host_integerp (TYPE_SIZE (type), 1))
return;
@@ -1360,9 +1360,9 @@ compute_record_mode (tree type)
if (TREE_CODE (type) == RECORD_TYPE && mode != VOIDmode
&& host_integerp (TYPE_SIZE (type), 1)
&& GET_MODE_BITSIZE (mode) == TREE_INT_CST_LOW (TYPE_SIZE (type)))
- TYPE_MODE (type) = mode;
+ SET_TYPE_MODE (type, mode);
else
- TYPE_MODE (type) = mode_for_size_tree (TYPE_SIZE (type), MODE_INT, 1);
+ SET_TYPE_MODE (type, mode_for_size_tree (TYPE_SIZE (type), MODE_INT, 1));
/* If structure's known alignment is less than what the scalar
mode would need, and it matters, then stick with BLKmode. */
@@ -1374,7 +1374,7 @@ compute_record_mode (tree type)
/* If this is the only reason this type is BLKmode, then
don't force containing types to be BLKmode. */
TYPE_NO_FORCE_BLK (type) = 1;
- TYPE_MODE (type) = BLKmode;
+ SET_TYPE_MODE (type, BLKmode);
}
}
@@ -1458,7 +1458,7 @@ finalize_type_size (tree type)
TYPE_SIZE_UNIT (variant) = size_unit;
TYPE_ALIGN (variant) = align;
TYPE_USER_ALIGN (variant) = user_align;
- TYPE_MODE (variant) = mode;
+ SET_TYPE_MODE (variant, mode);
}
}
}
@@ -1580,14 +1580,15 @@ layout_type (tree type)
&& tree_int_cst_sgn (TYPE_MIN_VALUE (type)) >= 0)
TYPE_UNSIGNED (type) = 1;
- TYPE_MODE (type) = smallest_mode_for_size (TYPE_PRECISION (type),
- MODE_INT);
+ SET_TYPE_MODE (type,
+ smallest_mode_for_size (TYPE_PRECISION (type), MODE_INT));
TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
break;
case REAL_TYPE:
- TYPE_MODE (type) = mode_for_size (TYPE_PRECISION (type), MODE_FLOAT, 0);
+ SET_TYPE_MODE (type,
+ mode_for_size (TYPE_PRECISION (type), MODE_FLOAT, 0));
TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
break;
@@ -1600,11 +1601,11 @@ layout_type (tree type)
case COMPLEX_TYPE:
TYPE_UNSIGNED (type) = TYPE_UNSIGNED (TREE_TYPE (type));
- TYPE_MODE (type)
- = mode_for_size (2 * TYPE_PRECISION (TREE_TYPE (type)),
- (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE
- ? MODE_COMPLEX_FLOAT : MODE_COMPLEX_INT),
- 0);
+ SET_TYPE_MODE (type,
+ mode_for_size (2 * TYPE_PRECISION (TREE_TYPE (type)),
+ (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE
+ ? MODE_COMPLEX_FLOAT : MODE_COMPLEX_INT),
+ 0));
TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
break;
@@ -1636,10 +1637,11 @@ layout_type (tree type)
else
mode = MIN_MODE_VECTOR_INT;
+ /* Do not check vector_mode_supported_p here. We'll do that
+ later in vector_type_mode. */
for (; mode != VOIDmode ; mode = GET_MODE_WIDER_MODE (mode))
if (GET_MODE_NUNITS (mode) == nunits
- && GET_MODE_INNER (mode) == innermode
- && targetm.vector_mode_supported_p (mode))
+ && GET_MODE_INNER (mode) == innermode)
break;
/* For integers, try mapping it to a same-sized scalar mode. */
@@ -1648,10 +1650,12 @@ layout_type (tree type)
mode = mode_for_size (nunits * GET_MODE_BITSIZE (innermode),
MODE_INT, 0);
- if (mode == VOIDmode || !have_regs_of_mode[mode])
- TYPE_MODE (type) = BLKmode;
+ if (mode == VOIDmode ||
+ (GET_MODE_CLASS (mode) == MODE_INT
+ && !have_regs_of_mode[mode]))
+ SET_TYPE_MODE (type, BLKmode);
else
- TYPE_MODE (type) = mode;
+ SET_TYPE_MODE (type, mode);
}
TYPE_SATURATING (type) = TYPE_SATURATING (TREE_TYPE (type));
@@ -1672,7 +1676,7 @@ layout_type (tree type)
/* This is an incomplete type and so doesn't have a size. */
TYPE_ALIGN (type) = 1;
TYPE_USER_ALIGN (type) = 0;
- TYPE_MODE (type) = VOIDmode;
+ SET_TYPE_MODE (type, VOIDmode);
break;
case OFFSET_TYPE:
@@ -1680,7 +1684,7 @@ layout_type (tree type)
TYPE_SIZE_UNIT (type) = size_int (POINTER_SIZE / BITS_PER_UNIT);
/* A pointer might be MODE_PARTIAL_INT,
but ptrdiff_t must be integral. */
- TYPE_MODE (type) = mode_for_size (POINTER_SIZE, MODE_INT, 0);
+ SET_TYPE_MODE (type, mode_for_size (POINTER_SIZE, MODE_INT, 0));
break;
case FUNCTION_TYPE:
@@ -1688,7 +1692,7 @@ layout_type (tree type)
/* It's hard to see what the mode and size of a function ought to
be, but we do know the alignment is FUNCTION_BOUNDARY, so
make it consistent with that. */
- TYPE_MODE (type) = mode_for_size (FUNCTION_BOUNDARY, MODE_INT, 0);
+ SET_TYPE_MODE (type, mode_for_size (FUNCTION_BOUNDARY, MODE_INT, 0));
TYPE_SIZE (type) = bitsize_int (FUNCTION_BOUNDARY);
TYPE_SIZE_UNIT (type) = size_int (FUNCTION_BOUNDARY / BITS_PER_UNIT);
break;
@@ -1696,7 +1700,6 @@ layout_type (tree type)
case POINTER_TYPE:
case REFERENCE_TYPE:
{
-
enum machine_mode mode = ((TREE_CODE (type) == REFERENCE_TYPE
&& reference_types_internal)
? Pmode : TYPE_MODE (type));
@@ -1792,7 +1795,7 @@ layout_type (tree type)
fall back on structural equality. */
SET_TYPE_STRUCTURAL_EQUALITY (type);
TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (element);
- TYPE_MODE (type) = BLKmode;
+ SET_TYPE_MODE (type, BLKmode);
if (TYPE_SIZE (type) != 0
#ifdef MEMBER_TYPE_FORCES_BLK
&& ! MEMBER_TYPE_FORCES_BLK (type, VOIDmode)
@@ -1805,17 +1808,17 @@ layout_type (tree type)
/* One-element arrays get the component type's mode. */
if (simple_cst_equal (TYPE_SIZE (type),
TYPE_SIZE (TREE_TYPE (type))))
- TYPE_MODE (type) = TYPE_MODE (TREE_TYPE (type));
+ SET_TYPE_MODE (type, TYPE_MODE (TREE_TYPE (type)));
else
- TYPE_MODE (type)
- = mode_for_size_tree (TYPE_SIZE (type), MODE_INT, 1);
+ SET_TYPE_MODE (type, mode_for_size_tree (TYPE_SIZE (type),
+ MODE_INT, 1));
if (TYPE_MODE (type) != BLKmode
&& STRICT_ALIGNMENT && TYPE_ALIGN (type) < BIGGEST_ALIGNMENT
&& TYPE_ALIGN (type) < GET_MODE_ALIGNMENT (TYPE_MODE (type)))
{
TYPE_NO_FORCE_BLK (type) = 1;
- TYPE_MODE (type) = BLKmode;
+ SET_TYPE_MODE (type, BLKmode);
}
}
/* When the element size is constant, check that it is at least as
@@ -1877,6 +1880,45 @@ layout_type (tree type)
if (AGGREGATE_TYPE_P (type))
gcc_assert (!TYPE_ALIAS_SET_KNOWN_P (type));
}
+
+/* Vector types need to re-check the target flags each time we report
+ the machine mode. We need to do this because attribute target can
+ change the result of vector_mode_supported_p and have_regs_of_mode
+ on a per-function basis. Thus the TYPE_MODE of a VECTOR_TYPE can
+ change on a per-function basis. */
+/* ??? Possibly a better solution is to run through all the types
+ referenced by a function and re-compute the TYPE_MODE once, rather
+ than make the TYPE_MODE macro call a function. */
+
+enum machine_mode
+vector_type_mode (const_tree t)
+{
+ enum machine_mode mode;
+
+ gcc_assert (TREE_CODE (t) == VECTOR_TYPE);
+
+ mode = t->type.mode;
+ if (VECTOR_MODE_P (mode)
+ && (!targetm.vector_mode_supported_p (mode)
+ || !have_regs_of_mode[mode]))
+ {
+ enum machine_mode innermode = TREE_TYPE (t)->type.mode;
+
+ /* For integers, try mapping it to a same-sized scalar mode. */
+ if (GET_MODE_CLASS (innermode) == MODE_INT)
+ {
+ mode = mode_for_size (TYPE_VECTOR_SUBPARTS (t)
+ * GET_MODE_BITSIZE (innermode), MODE_INT, 0);
+
+ if (mode != VOIDmode && have_regs_of_mode[mode])
+ return mode;
+ }
+
+ return BLKmode;
+ }
+
+ return mode;
+}
/* Create and return a type for signed integers of PRECISION bits. */
@@ -1921,10 +1963,10 @@ make_fract_type (int precision, int unsignedp, int satp)
if (unsignedp)
{
TYPE_UNSIGNED (type) = 1;
- TYPE_MODE (type) = mode_for_size (precision, MODE_UFRACT, 0);
+ SET_TYPE_MODE (type, mode_for_size (precision, MODE_UFRACT, 0));
}
else
- TYPE_MODE (type) = mode_for_size (precision, MODE_FRACT, 0);
+ SET_TYPE_MODE (type, mode_for_size (precision, MODE_FRACT, 0));
layout_type (type);
return type;
@@ -1947,10 +1989,10 @@ make_accum_type (int precision, int unsignedp, int satp)
if (unsignedp)
{
TYPE_UNSIGNED (type) = 1;
- TYPE_MODE (type) = mode_for_size (precision, MODE_UACCUM, 0);
+ SET_TYPE_MODE (type, mode_for_size (precision, MODE_UACCUM, 0));
}
else
- TYPE_MODE (type) = mode_for_size (precision, MODE_ACCUM, 0);
+ SET_TYPE_MODE (type, mode_for_size (precision, MODE_ACCUM, 0));
layout_type (type);
return type;
@@ -1965,7 +2007,7 @@ initialize_sizetypes (bool signed_p)
tree t = make_node (INTEGER_TYPE);
int precision = GET_MODE_BITSIZE (SImode);
- TYPE_MODE (t) = SImode;
+ SET_TYPE_MODE (t, SImode);
TYPE_ALIGN (t) = GET_MODE_ALIGNMENT (SImode);
TYPE_USER_ALIGN (t) = 0;
TYPE_IS_SIZETYPE (t) = 1;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 696d82a1a53..c147c4cc58e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,104 @@
+2008-12-10 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.dg/20020919-1.c: Correct target selector to alpha*-*-*.
+ * gcc.dg/pr31866.c: Ditto.
+ * gcc.dg/torture/type-generic-1.c: Add -mieee for alpha*-*-* targets.
+ * g++.dg/torture/type-generic-1.C: Ditto.
+ * gfortran.dg/boz_9.f90: Ditto.
+ * gfortran.dg/boz_14.f90: Ditto.
+ * gfortran.dg/init_flag_3.f90: Ditto.
+ * gfortran.dg/init_flag_4.f90: Ditto.
+ * gfortran.dg/init_flag_5.f90: Ditto.
+ * gfortran.dg/integer_exponentiation_1.f90: Ditto.
+ * gfortran.dg/integer_exponentiation_5.F90: Ditto.
+ * gfortran.dg/isnan_1.f90: Ditto.
+ * gfortran.dg/isnan_2.f90: Ditto.
+ * gfortran.dg/module_nan.f90: Ditto.
+ * gfortran.dg/nan_1.f90: Ditto.
+ * gfortran.dg/nan_2.f90: Ditto.
+ * gfortran.dg/nan_3.f90: Ditto.
+ * gfortran.dg/nan_4.f90: Ditto.
+ * gfortran.dg/namelist_42.f90: Ditto.
+ * gfortran.dg/namelist_43.f90: Ditto.
+ * gfortran.dg/nearest_1.f90: Ditto.
+ * gfortran.dg/nearest_2.f90: Ditto.
+ * gfortran.dg/nearest_3.f90: Ditto.
+ * gfortran.dg/pr37243.f: Ditto.
+ * gfortran.dg/real_const_3.f90: Ditto.
+ * gfortran.dg/transfer_simplify_2.f90: Ditto.
+ * gfortran.fortran-torture/execute/intrinsic_spacing.x: New file.
+
+ * gfortran.dg/default_format_denormal_1.f90: XFAIL on alpha.
+
+2008-12-09 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/37971
+ * g++.dg/overload/defarg2.C: New test.
+ * g++.dg/overload/defarg3.C: Likewise.
+
+2008-12-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/38454
+ * gcc.dg/memset-1.c: New test.
+ * gcc.dg/memcpy-2.c: New test.
+
+2008-12-09 Mikael Morin <mikael.morin@tele2.fr>
+
+ PR fortran/35983
+ * gfortran.dg/pr35983.f90: New test.
+
+2008-12-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR testsuite/38420
+ * gcc.target/i386/pr37248-2.c: Support hex dump on 32bit host.
+ * gcc.target/i386/pr37248-3.c: Likewise.
+
+2008-12-09 Steve Ellcey <sje@cup.hp.com>
+
+ PR testsuite/37326
+ * gcc.dg/tree-ssa/ssa-store-ccp-3.c: Skip on hppa*64-*-*.
+
+2008-12-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/35468
+ * gcc.dg/pr35468.c: New test.
+ * gcc.c-torture/compile/pr35468.c: New test.
+
+2008-12-08 Jason Merrill <jason@redhat.com>
+
+ PR c++/38410
+ * gcc.dg/ctor1.c: New test.
+
+2008-12-08 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/mips/fix-r10000-6.c: Add dg-message to look for
+ the note about changed semantics of NAND builtin.
+ * gcc.target/mips/fix-r10000-12.c: Ditto.
+ * gcc.target/mips/atomic-memory-1.c: Ditto.
+ (main): Correct __sync_nand_and_fetch results.
+
+2008-12-08 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/38390
+ * g++.dg/debug/dwarf2/imported-module-2.C: New test.
+
+2008-12-08 Steve Ellcey <sje@cup.hp.com>
+
+ * g++.dg/other/packed1.C: Remove ia64-hp-hpux* XFAIL.
+
+2008-12-08 Steve Ellcey <sje@cup.hp.com>
+
+ * gcc.target/ia64/versionid-1.c (dg-final): Fix syntax.
+ * gcc.target/ia64/versionid-2.c (dg-final): Ditto.
+
+2008-12-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/35443
+ * gcc.dg/pr35443.c: New test.
+
+ PR c/35442
+ * gcc.dg/pr35442.c: New test.
+
2008-12-07 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/string_comparison.adb: New test.
@@ -1837,7 +1938,7 @@
2008-09-24 Steve Ellcey <sje@cup.hp.com>
- * gcc.dg/vect/O3-vect-pr34223.c: Check vect_int_mult.
+ * gcc.dg/vect/O3-vect-pr34223.c: Check vect_int_mult.
2008-09-24 Aldy Hernandez <aldyh@redhat.com>
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C
new file mode 100644
index 00000000000..86128975b47
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C
@@ -0,0 +1,18 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin: PR debug/38390
+// { dg-do compile }
+// { dg-options "-g -dA" }
+// { dg-final { scan-assembler "DW_TAG_imported" } }
+
+namespace A
+{
+ int v;
+}
+
+int
+f ()
+{
+ using namespace A;
+ return v;
+}
+
diff --git a/gcc/testsuite/g++.dg/other/packed1.C b/gcc/testsuite/g++.dg/other/packed1.C
index 5d19eb0e2a7..b1b829b223a 100644
--- a/gcc/testsuite/g++.dg/other/packed1.C
+++ b/gcc/testsuite/g++.dg/other/packed1.C
@@ -1,4 +1,4 @@
-// { dg-do run { xfail arm-*-* sh-*-* ia64-hp-hpux* } }
+// { dg-do run { xfail arm-*-* sh-*-* } }
// NMS:2003-04-21 this fails on strict aligned architectures again,
// the patch was reverted because it broke something more important.
diff --git a/gcc/testsuite/g++.dg/overload/defarg2.C b/gcc/testsuite/g++.dg/overload/defarg2.C
new file mode 100644
index 00000000000..d8ecb2fa777
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/defarg2.C
@@ -0,0 +1,17 @@
+// PR c++/37971
+// { dg-do compile }
+
+class C {
+private:
+ static int f(int);
+ static int f(char);
+
+public:
+ static void g(int (*)(int) = f);
+};
+
+void h() {
+ /* Although C::f is inaccessible here, it is accessible in the
+ context of C::g, so there is no error. */
+ C::g();
+}
diff --git a/gcc/testsuite/g++.dg/overload/defarg3.C b/gcc/testsuite/g++.dg/overload/defarg3.C
new file mode 100644
index 00000000000..6622e430a61
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/defarg3.C
@@ -0,0 +1,15 @@
+// PR c++/37971
+// { dg-do compile }
+
+class C {
+private:
+ static int f(int); // { dg-error "private" }
+ static int f(char);
+};
+
+class D {
+public:
+ /* C::f is inaccessible, so this is an error, even if this function
+ is never called. */
+ static void g(int (*)(int) = C::f); // { dg-error "context" }
+};
diff --git a/gcc/testsuite/g++.dg/torture/type-generic-1.C b/gcc/testsuite/g++.dg/torture/type-generic-1.C
index 7db2e69d0a5..e9c17c328e7 100644
--- a/gcc/testsuite/g++.dg/torture/type-generic-1.C
+++ b/gcc/testsuite/g++.dg/torture/type-generic-1.C
@@ -2,7 +2,7 @@
without any fast-math flags. */
/* { dg-do run } */
-/* { dg-options "-mieee" { target sh*-*-* } } */
+/* { dg-options "-mieee" { target alpha*-*-* sh*-*-* } } */
/* { dg-skip-if "No Inf/NaN support" { spu-*-* } } */
#include "../../gcc.dg/tg-tests.h"
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr35468.c b/gcc/testsuite/gcc.c-torture/compile/pr35468.c
new file mode 100644
index 00000000000..16d064b6222
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr35468.c
@@ -0,0 +1,7 @@
+/* PR tree-optimization/35468 */
+
+void
+foo (void)
+{
+ *(char *) "c" = 'x';
+}
diff --git a/gcc/testsuite/gcc.dg/20020919-1.c b/gcc/testsuite/gcc.dg/20020919-1.c
index 15519bef7b4..6b8c5ba7c52 100644
--- a/gcc/testsuite/gcc.dg/20020919-1.c
+++ b/gcc/testsuite/gcc.dg/20020919-1.c
@@ -8,7 +8,7 @@
You must be this tall ---> fit two long longs in asm-declared registers
to enter this amusement. */
-/* { dg-do compile { target alpha-*-* cris-*-* crisv32-*-* i?86-*-* mmix-*-* powerpc*-*-* rs6000-*-* x86_64-*-* } } */
+/* { dg-do compile { target alpha*-*-* cris-*-* crisv32-*-* i?86-*-* mmix-*-* powerpc*-*-* rs6000-*-* x86_64-*-* } } */
/* { dg-options "-O2" } */
/* Constructed examples; input/output (same register), output, input, and
diff --git a/gcc/testsuite/gcc.dg/ctor1.c b/gcc/testsuite/gcc.dg/ctor1.c
new file mode 100644
index 00000000000..6c1cd72cc77
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ctor1.c
@@ -0,0 +1,10 @@
+/* Related to PR c++/38410.
+ We shouldn't write out a static variable for an all-zero aggregate
+ initializer. The variable named C.0 was created by
+ gimplify_init_constructor. */
+/* { dg-final { scan-assembler-not "C\\.0" } } */
+
+int main()
+{
+ int a[] = { 0,0 };
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr38084.c b/gcc/testsuite/gcc.dg/graphite/pr38084.c
new file mode 100644
index 00000000000..7193f960026
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr38084.c
@@ -0,0 +1,31 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+typedef struct {
+ unsigned int avail_out;
+ void *state;
+} stream;
+
+typedef struct {
+ stream* test;
+ int num;
+} state_in;
+
+int test_in ( stream *test, int action )
+{
+ state_in* tst;
+ if (test == ((void *)0)) return (-2);
+ if (tst == ((void *)0)) return (-2);
+ if (tst->test != test) return (-2);
+ jump_here:
+ switch (tst->num) {
+ case 1:
+ return (-1);
+ case 2:
+ if (action == 0) {
+ }
+ if (action == 1) {
+ goto jump_here;
+ }
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/memcpy-2.c b/gcc/testsuite/gcc.dg/memcpy-2.c
new file mode 100644
index 00000000000..24464abd4a9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/memcpy-2.c
@@ -0,0 +1,25 @@
+/* PR middle-end/38454 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern inline __attribute__((gnu_inline, always_inline, artificial)) void *
+memcpy (void *__restrict dest, const void *__restrict src, size_t len)
+{
+ return __builtin___memcpy_chk (dest, /* { dg-warning "will always overflow destination buffer" } */
+ src, len, __builtin_object_size (dest, 0));
+}
+
+struct S { char buf[10]; } s;
+
+void
+foo (void)
+{
+ char buf[12];
+ char *p = buf + 4;
+ struct S *q = (struct S *) p;
+ memcpy (q, &s, sizeof (s));
+}
+
+/* { dg-final { scan-assembler "__memcpy_chk" } } */
diff --git a/gcc/testsuite/gcc.dg/memset-1.c b/gcc/testsuite/gcc.dg/memset-1.c
new file mode 100644
index 00000000000..677ae91bd0e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/memset-1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void warn_memset_zero_len (void)
+__attribute__((__warning__ ("memset used with constant zero length parameter;"
+ " this could be due to transposed parameters")));
+
+extern inline __attribute__((gnu_inline, always_inline, artificial)) void *
+memset (void *dest, int ch, size_t len)
+{
+ if (__builtin_constant_p (len) && len == 0)
+ {
+ warn_memset_zero_len (); /* { dg-warning "memset used with constant zero" } */
+ return dest;
+ }
+ return __builtin_memset (dest, ch, len);
+}
+
+char buf[10];
+
+int
+main (void)
+{
+ memset (buf, sizeof (buf), 0);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr31866.c b/gcc/testsuite/gcc.dg/pr31866.c
index f1afd930318..4081c0e6ad9 100644
--- a/gcc/testsuite/gcc.dg/pr31866.c
+++ b/gcc/testsuite/gcc.dg/pr31866.c
@@ -1,5 +1,5 @@
/* PR tree-optimization/31866 */
-/* { dg-do compile { target alpha-*-* cris-*-* crisv32-*-* i?86-*-* mmix-*-* powerpc*-*-* rs6000-*-* x86_64-*-* } } */
+/* { dg-do compile { target alpha*-*-* cris-*-* crisv32-*-* i?86-*-* mmix-*-* powerpc*-*-* rs6000-*-* x86_64-*-* } } */
/* { dg-options "-O2" } */
#if defined (__alpha__)
diff --git a/gcc/testsuite/gcc.dg/pr35442.c b/gcc/testsuite/gcc.dg/pr35442.c
new file mode 100644
index 00000000000..4f1e3cc537f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr35442.c
@@ -0,0 +1,11 @@
+/* PR c/35442 */
+/* { dg-bogus "not supported by" "" { target *-*-* } 0 } */
+
+typedef char A __attribute__ ((vector_size (64)));
+typedef int B __attribute__ ((vector_size (64)));
+
+void
+foo (A a)
+{
+ ((B) a) (); /* { dg-error "is not a function" } */
+}
diff --git a/gcc/testsuite/gcc.dg/pr35443.c b/gcc/testsuite/gcc.dg/pr35443.c
new file mode 100644
index 00000000000..5dfc299e796
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr35443.c
@@ -0,0 +1,9 @@
+/* PR c/35443 */
+/* { dg-options "" } */
+/* { dg-bogus "not supported by" "" { target *-*-* } 0 } */
+
+void
+foo ()
+{
+ ({ int i; i; })(); /* { dg-error "is not a function" } */
+}
diff --git a/gcc/testsuite/gcc.dg/pr35468.c b/gcc/testsuite/gcc.dg/pr35468.c
new file mode 100644
index 00000000000..085c073070c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr35468.c
@@ -0,0 +1,10 @@
+/* PR tree-optimization/35468 */
+/* { dg-do compile }*/
+/* { dg-options "-O2 -fno-tree-dce" } */
+
+char *const f(void)
+{
+ char *const line = "/dev/ptyXX";
+ line[8] = 1;
+ return line;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/type-generic-1.c b/gcc/testsuite/gcc.dg/torture/type-generic-1.c
index 9a8e9d0048c..96b5d01e5f6 100644
--- a/gcc/testsuite/gcc.dg/torture/type-generic-1.c
+++ b/gcc/testsuite/gcc.dg/torture/type-generic-1.c
@@ -2,7 +2,7 @@
without any fast-math flags. */
/* { dg-do run } */
-/* { dg-options "-mieee" { target sh*-*-* } } */
+/* { dg-options "-mieee" { target alpha*-*-* sh*-*-* } } */
/* { dg-skip-if "No Inf/NaN support" { spu-*-* } } */
#include "../tg-tests.h"
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c
index 01eb785e1cb..1db56a17537 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-skip-if "" { *-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "" { *-*-darwin* hppa*64*-*-* } { "*" } { "" } } */
/* { dg-options "-O2 -fno-common -fdump-tree-optimized" } */
const int conststaticvariable;
diff --git a/gcc/testsuite/gcc.target/i386/pr37248-2.c b/gcc/testsuite/gcc.target/i386/pr37248-2.c
index 25fb1066fdd..ed483831a5e 100644
--- a/gcc/testsuite/gcc.target/i386/pr37248-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr37248-2.c
@@ -19,5 +19,5 @@ foo (struct S x)
return x.a && x.g && x.b && x.f && x.c && x.e;
}
-/* { dg-final { scan-tree-dump "& 3758096391\[^\n\t\]*== 3758096391" "optimized" } } */
+/* { dg-final { scan-tree-dump "& (3758096391|0x0e0000007)\[^\n\t\]*== (3758096391|0x0e0000007)" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr37248-3.c b/gcc/testsuite/gcc.target/i386/pr37248-3.c
index d5d2d98e8e8..3b320d7055d 100644
--- a/gcc/testsuite/gcc.target/i386/pr37248-3.c
+++ b/gcc/testsuite/gcc.target/i386/pr37248-3.c
@@ -21,5 +21,5 @@ foo (struct S x)
return x.a && x.i && x.b && x.h && x.c && x.g && x.e == 131;
}
-/* { dg-final { scan-tree-dump "& 3766484487\[^\n\t\]*== 3758163463" "optimized" } } */
+/* { dg-final { scan-tree-dump "& (3766484487|0x0e07ffe07)\[^\n\t\]*== (3758163463|0x0e0010607)" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr38240.c b/gcc/testsuite/gcc.target/i386/pr38240.c
new file mode 100644
index 00000000000..6a3568754b3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr38240.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+typedef float V
+ __attribute__ ((__vector_size__ (16), __may_alias__));
+
+V __attribute__((target("sse"))) f(const V *ptr) { return *ptr; }
+
+V g(const V *ptr) { return *ptr; }
diff --git a/gcc/testsuite/gcc.target/ia64/versionid-1.c b/gcc/testsuite/gcc.target/ia64/versionid-1.c
index 7a461daf90b..4ee8224a7d2 100644
--- a/gcc/testsuite/gcc.target/ia64/versionid-1.c
+++ b/gcc/testsuite/gcc.target/ia64/versionid-1.c
@@ -7,4 +7,4 @@ int bar(int i)
return (foo() + 1);
}
-/* { dg-final { scan-assembler "alias.*foo.*foo{20040821}" } } */
+/* { dg-final { scan-assembler "alias.*foo.*foo\\\{20040821\\\}" } } */
diff --git a/gcc/testsuite/gcc.target/ia64/versionid-2.c b/gcc/testsuite/gcc.target/ia64/versionid-2.c
index 5a90aed6ce3..258de09113f 100644
--- a/gcc/testsuite/gcc.target/ia64/versionid-2.c
+++ b/gcc/testsuite/gcc.target/ia64/versionid-2.c
@@ -7,4 +7,4 @@ int foo(int i)
return (1);
}
-/* { dg-final { scan-assembler "alias.*foo.*foo{20040821}" } } */
+/* { dg-final { scan-assembler "alias.*foo.*foo\\\{20040821\\\}" } } */
diff --git a/gcc/testsuite/gcc.target/mips/atomic-memory-1.c b/gcc/testsuite/gcc.target/mips/atomic-memory-1.c
index e9a95eaa4fc..b2316ee6460 100644
--- a/gcc/testsuite/gcc.target/mips/atomic-memory-1.c
+++ b/gcc/testsuite/gcc.target/mips/atomic-memory-1.c
@@ -1,4 +1,7 @@
/* { dg-do run } */
+
+/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+
extern void abort (void);
extern void exit (int);
@@ -16,9 +19,9 @@ NOMIPS16 int main ()
__sync_sub_and_fetch (&v, 0x7fff);
if (v != 34465)
abort();
- if (__sync_nand_and_fetch (&v, 0xff) != 94)
+ if (__sync_nand_and_fetch (&v, 0xff) != -162)
abort();
- if (__sync_fetch_and_add (&v, 6) != 94)
+ if (__sync_fetch_and_add (&v, 262) != -162)
abort();
if (v != 100)
abort();
diff --git a/gcc/testsuite/gcc.target/mips/fix-r10000-12.c b/gcc/testsuite/gcc.target/mips/fix-r10000-12.c
index 0381c249e45..160f9aedd3b 100644
--- a/gcc/testsuite/gcc.target/mips/fix-r10000-12.c
+++ b/gcc/testsuite/gcc.target/mips/fix-r10000-12.c
@@ -2,6 +2,8 @@
/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
+/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+
NOMIPS16 int
f1 (int *z)
{
diff --git a/gcc/testsuite/gcc.target/mips/fix-r10000-6.c b/gcc/testsuite/gcc.target/mips/fix-r10000-6.c
index 275136957c8..1f81e5bc66c 100644
--- a/gcc/testsuite/gcc.target/mips/fix-r10000-6.c
+++ b/gcc/testsuite/gcc.target/mips/fix-r10000-6.c
@@ -2,6 +2,8 @@
/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+
NOMIPS16 int
f1 (int *z)
{
diff --git a/gcc/testsuite/gfortran.dg/boz_14.f90 b/gcc/testsuite/gfortran.dg/boz_14.f90
index a6690ce9f9d..dd7e58e7c2c 100644
--- a/gcc/testsuite/gfortran.dg/boz_14.f90
+++ b/gcc/testsuite/gfortran.dg/boz_14.f90
@@ -1,4 +1,5 @@
! { dg-do run }
+! { dg-options "-mieee" { target alpha*-*-* } }
! PR fortran/36214
! For BOZ-initialization of floats, the precision used to be wrong sometimes.
diff --git a/gcc/testsuite/gfortran.dg/boz_9.f90 b/gcc/testsuite/gfortran.dg/boz_9.f90
index 1488c6dc8be..db35da0449c 100644
--- a/gcc/testsuite/gfortran.dg/boz_9.f90
+++ b/gcc/testsuite/gfortran.dg/boz_9.f90
@@ -1,5 +1,6 @@
! { dg-do run }
! { dg-options "-fno-range-check" }
+! { dg-options "-fno-range-check -mieee" { target alpha*-*-* } }
!
! PR fortran/34342
!
diff --git a/gcc/testsuite/gfortran.dg/default_format_denormal_1.f90 b/gcc/testsuite/gfortran.dg/default_format_denormal_1.f90
index 181ae9d7959..c4d6086594d 100644
--- a/gcc/testsuite/gfortran.dg/default_format_denormal_1.f90
+++ b/gcc/testsuite/gfortran.dg/default_format_denormal_1.f90
@@ -1,4 +1,4 @@
-! { dg-do run { xfail *-*-darwin[89]* *-*-freebsd* *-*-mingw* } }
+! { dg-do run { xfail alpha*-*-* *-*-darwin[89]* *-*-freebsd* *-*-mingw* } }
! Test XFAILed on these platforms because the system's printf() lacks
! proper support for denormals.
!
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-3.f90 b/gcc/testsuite/gfortran.dg/graphite/id-3.f90
new file mode 100644
index 00000000000..394bdf7ac16
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/id-3.f90
@@ -0,0 +1,21 @@
+! { dg-options "-O2 -fgraphite-identity" }
+
+subroutine gentrs (ptrst, ncls, xmin, dcls, xdont, ndon)
+do icls1 = 1, ncls
+ prec: do
+ select case (isns)
+ case (-1)
+ do icls = icls1, 1, -1
+ enddo
+ case (+1)
+ do icls = icls1, ncls
+ if (xale > rtrst (icls1, icls)) then
+ endif
+ enddo
+ end select
+ enddo prec
+enddo
+contains
+real function genuni (jsee)
+end function genuni
+end subroutine gentrs
diff --git a/gcc/testsuite/gfortran.dg/init_flag_3.f90 b/gcc/testsuite/gfortran.dg/init_flag_3.f90
index 7d6ab33cfc4..9724d39c217 100644
--- a/gcc/testsuite/gfortran.dg/init_flag_3.f90
+++ b/gcc/testsuite/gfortran.dg/init_flag_3.f90
@@ -1,6 +1,6 @@
! { dg-do run }
! { dg-options "-finit-integer=-1 -finit-logical=false -finit-real=nan" }
-! { dg-options "-mieee -finit-integer=-1 -finit-logical=false -finit-real=nan" { target sh*-*-* } }
+! { dg-options "-finit-integer=-1 -finit-logical=false -finit-real=nan -mieee" { target alpha*-*-* sh*-*-* } }
program init_flag_3
call real_test
diff --git a/gcc/testsuite/gfortran.dg/init_flag_4.f90 b/gcc/testsuite/gfortran.dg/init_flag_4.f90
index 8ec40bc8fa5..8e1265e9347 100644
--- a/gcc/testsuite/gfortran.dg/init_flag_4.f90
+++ b/gcc/testsuite/gfortran.dg/init_flag_4.f90
@@ -1,5 +1,6 @@
! { dg-do run }
! { dg-options "-finit-real=inf" }
+! { dg-options "-finit-real=inf -mieee" { target alpha*-*-* } } */
program init_flag_4
call real_test
diff --git a/gcc/testsuite/gfortran.dg/init_flag_5.f90 b/gcc/testsuite/gfortran.dg/init_flag_5.f90
index 51dbd16cfba..5531251b00f 100644
--- a/gcc/testsuite/gfortran.dg/init_flag_5.f90
+++ b/gcc/testsuite/gfortran.dg/init_flag_5.f90
@@ -1,5 +1,6 @@
! { dg-do run }
! { dg-options "-finit-real=-inf" }
+! { dg-options "-finit-real=-inf -mieee" { target alpha*-*-* } } */
program init_flag_5
call real_test
diff --git a/gcc/testsuite/gfortran.dg/integer_exponentiation_1.f90 b/gcc/testsuite/gfortran.dg/integer_exponentiation_1.f90
index bed7c6ab02a..77ef84c2e92 100644
--- a/gcc/testsuite/gfortran.dg/integer_exponentiation_1.f90
+++ b/gcc/testsuite/gfortran.dg/integer_exponentiation_1.f90
@@ -1,4 +1,5 @@
! { dg-do run }
+! { dg-options "-pedantic -mieee" { target alpha*-*-* } }
! PR 30981 - this used to go into an endless loop during execution.
program test
a = 3.0
diff --git a/gcc/testsuite/gfortran.dg/integer_exponentiation_5.F90 b/gcc/testsuite/gfortran.dg/integer_exponentiation_5.F90
index 07127c6aa4e..2fc8df35c3f 100644
--- a/gcc/testsuite/gfortran.dg/integer_exponentiation_5.F90
+++ b/gcc/testsuite/gfortran.dg/integer_exponentiation_5.F90
@@ -1,5 +1,6 @@
! { dg-do run }
! { dg-options "-fno-range-check" }
+! { dg-options "-fno-range-check -mieee" { target alpha*-*-* } } */
module mod_check
implicit none
diff --git a/gcc/testsuite/gfortran.dg/isnan_1.f90 b/gcc/testsuite/gfortran.dg/isnan_1.f90
index db8f5695cdf..3c0cce8d378 100644
--- a/gcc/testsuite/gfortran.dg/isnan_1.f90
+++ b/gcc/testsuite/gfortran.dg/isnan_1.f90
@@ -1,7 +1,7 @@
! Test for the ISNAN intrinsic
!
! { dg-do run }
-! { dg-options "-pedantic-errors -mieee" { target sh*-*-* } }
+! { dg-options "-pedantic-errors -mieee" { target alpha*-*-* sh*-*-* } }
!
implicit none
real :: x
diff --git a/gcc/testsuite/gfortran.dg/isnan_2.f90 b/gcc/testsuite/gfortran.dg/isnan_2.f90
index e16ce9de101..37b53633fa7 100644
--- a/gcc/testsuite/gfortran.dg/isnan_2.f90
+++ b/gcc/testsuite/gfortran.dg/isnan_2.f90
@@ -2,7 +2,7 @@
!
! { dg-do run }
! { dg-options "-fno-range-check" }
-! { dg-options "-fno-range-check -pedantic-errors -mieee" { target sh*-*-* } }
+! { dg-options "-fno-range-check -pedantic-errors -mieee" { target alpha*-*-* sh*-*-* } }
!
implicit none
character(len=1) :: s
diff --git a/gcc/testsuite/gfortran.dg/module_nan.f90 b/gcc/testsuite/gfortran.dg/module_nan.f90
index 956b90c49d4..52fa8a9f77d 100644
--- a/gcc/testsuite/gfortran.dg/module_nan.f90
+++ b/gcc/testsuite/gfortran.dg/module_nan.f90
@@ -1,6 +1,6 @@
! { dg-do run }
! { dg-options "-fno-range-check" }
-! { dg-options "-fno-range-check -mieee" { target sh*-*-* } }
+! { dg-options "-fno-range-check -mieee" { target alpha*-*-* sh*-*-* } }
!
! PR fortran/34318
!
diff --git a/gcc/testsuite/gfortran.dg/namelist_42.f90 b/gcc/testsuite/gfortran.dg/namelist_42.f90
index 55dd2caec5d..1aa75ab4b41 100644
--- a/gcc/testsuite/gfortran.dg/namelist_42.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_42.f90
@@ -1,5 +1,5 @@
! { dg-do run { target fd_truncate } }
-! { dg-options "-mieee" { target sh*-*-* } }
+! { dg-options "-mieee" { target alpha*-*-* sh*-*-* } }
!
! PR fortran/34427
!
diff --git a/gcc/testsuite/gfortran.dg/namelist_43.f90 b/gcc/testsuite/gfortran.dg/namelist_43.f90
index abad355b9ae..ad518dd126f 100644
--- a/gcc/testsuite/gfortran.dg/namelist_43.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_43.f90
@@ -1,5 +1,5 @@
! { dg-do run { target fd_truncate } }
-! { dg-options "-mieee" { target sh*-*-* } }
+! { dg-options "-mieee" { target alpha*-*-* sh*-*-* } }
!
! PR fortran/34427
!
diff --git a/gcc/testsuite/gfortran.dg/nan_1.f90 b/gcc/testsuite/gfortran.dg/nan_1.f90
index 0c9eb0435cf..6b7e19f8060 100644
--- a/gcc/testsuite/gfortran.dg/nan_1.f90
+++ b/gcc/testsuite/gfortran.dg/nan_1.f90
@@ -2,7 +2,7 @@
! as arguments
!
! { dg-do run }
-! { dg-options "-pedantic-errors -mieee" { target sh*-*-* } }
+! { dg-options "-pedantic-errors -mieee" { target alpha*-*-* sh*-*-* } }
!
module aux2
interface isnan
diff --git a/gcc/testsuite/gfortran.dg/nan_2.f90 b/gcc/testsuite/gfortran.dg/nan_2.f90
index 49e1c39610c..30987715f36 100644
--- a/gcc/testsuite/gfortran.dg/nan_2.f90
+++ b/gcc/testsuite/gfortran.dg/nan_2.f90
@@ -1,6 +1,6 @@
! { dg-do run }
! { dg-options "-fno-range-check -pedantic" }
-! { dg-options "-fno-range-check -pedantic -mieee" { target sh*-*-* } }
+! { dg-options "-fno-range-check -pedantic -mieee" { target alpha*-*-* sh*-*-* } }
!
! PR fortran/34333
!
diff --git a/gcc/testsuite/gfortran.dg/nan_3.f90 b/gcc/testsuite/gfortran.dg/nan_3.f90
index 957b94d214d..adc927674b9 100644
--- a/gcc/testsuite/gfortran.dg/nan_3.f90
+++ b/gcc/testsuite/gfortran.dg/nan_3.f90
@@ -1,6 +1,6 @@
! { dg-do run }
! { dg-options "-fno-range-check" }
-! { dg-options "-fno-range-check -mieee" { target sh*-*-* } }
+! { dg-options "-fno-range-check -mieee" { target alpha*-*-* sh*-*-* } }
!
! PR fortran/34319
!
diff --git a/gcc/testsuite/gfortran.dg/nan_4.f90 b/gcc/testsuite/gfortran.dg/nan_4.f90
index 771aad02fa9..7c37671efef 100644
--- a/gcc/testsuite/gfortran.dg/nan_4.f90
+++ b/gcc/testsuite/gfortran.dg/nan_4.f90
@@ -1,6 +1,6 @@
! { dg-do compile }
! { dg-options "-std=gnu" }
-! { dg-options "-std=gnu -mieee" { target sh*-*-* } }
+! { dg-options "-std=gnu -mieee" { target alpha*-*-* sh*-*-* } }
!
! PR fortran/34398.
!
diff --git a/gcc/testsuite/gfortran.dg/nearest_1.f90 b/gcc/testsuite/gfortran.dg/nearest_1.f90
index c80f3a6bc2d..64e2b8524fc 100644
--- a/gcc/testsuite/gfortran.dg/nearest_1.f90
+++ b/gcc/testsuite/gfortran.dg/nearest_1.f90
@@ -1,5 +1,6 @@
! { dg-do run }
! { dg-options "-O0 -ffloat-store" }
+! { dg-options "-O0 -ffloat-store -mieee" { target alpha*-*-* } }
! PR fortran/27021
! Original code submitted by Dominique d'Humieres
! Converted to Dejagnu for the testsuite by Steven G. Kargl
diff --git a/gcc/testsuite/gfortran.dg/nearest_2.f90 b/gcc/testsuite/gfortran.dg/nearest_2.f90
index 08c774469cc..8bb47687015 100644
--- a/gcc/testsuite/gfortran.dg/nearest_2.f90
+++ b/gcc/testsuite/gfortran.dg/nearest_2.f90
@@ -1,6 +1,6 @@
! { dg-do run }
! { dg-options "-fno-range-check" }
-! { dg-options "-fno-range-check -mieee" { target sh*-*-* } }
+! { dg-options "-fno-range-check -mieee" { target alpha*-*-* sh*-*-* } }
!
! PR fortran/34192
!
diff --git a/gcc/testsuite/gfortran.dg/nearest_3.f90 b/gcc/testsuite/gfortran.dg/nearest_3.f90
index 4262a8cb06b..3af4cfc34d2 100644
--- a/gcc/testsuite/gfortran.dg/nearest_3.f90
+++ b/gcc/testsuite/gfortran.dg/nearest_3.f90
@@ -1,5 +1,5 @@
! { dg-do run }
-! { dg-options "-pedantic-errors -mieee" { target sh*-*-* } }
+! { dg-options "-pedantic-errors -mieee" { target alpha*-*-* sh*-*-* } }
!
! PR fortran/34209
!
diff --git a/gcc/testsuite/gfortran.dg/pr35983.f90 b/gcc/testsuite/gfortran.dg/pr35983.f90
new file mode 100644
index 00000000000..5cc38550294
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr35983.f90
@@ -0,0 +1,24 @@
+! { dg-do run }
+!
+! PR fortran/35983
+! C_LOC expanded to a NULL_PTR expr if called from a structure constructor
+!
+! Contributed by François-Xavier Coudert
+
+program main
+ use ISO_C_BINDING
+ implicit none
+ type, bind(C) :: descr
+ type(C_PTR) :: address
+ end type descr
+ type(descr) :: DD
+ double precision, target :: buf(1)
+ integer (C_INTPTR_T) :: i, j
+
+ buf = (/ 0 /)
+ DD = descr(c_loc(buf))
+ i = transfer (DD%address, 0_c_intptr_t)
+ j = transfer (c_loc(buf), 0_c_intptr_t)
+ if (any((/ i,j /) == 0_c_intptr_t)) call abort
+ if (i /= j) call abort
+end program main
diff --git a/gcc/testsuite/gfortran.dg/pr37243.f b/gcc/testsuite/gfortran.dg/pr37243.f
index 143800c5e75..ba652122558 100644
--- a/gcc/testsuite/gfortran.dg/pr37243.f
+++ b/gcc/testsuite/gfortran.dg/pr37243.f
@@ -1,5 +1,6 @@
! PR rtl-optimization/37243
! { dg-do run }
+! { dg-options "-mieee" { target alpha*-*-* } }
! Check if register allocator handles IR flattening correctly.
SUBROUTINE SCHMD(V,M,N,LDV)
IMPLICIT DOUBLE PRECISION(A-H,O-Z)
diff --git a/gcc/testsuite/gfortran.dg/real_const_3.f90 b/gcc/testsuite/gfortran.dg/real_const_3.f90
index a05986fcb8f..90e82087bb4 100644
--- a/gcc/testsuite/gfortran.dg/real_const_3.f90
+++ b/gcc/testsuite/gfortran.dg/real_const_3.f90
@@ -1,6 +1,6 @@
!{ dg-do run }
!{ dg-options "-fno-range-check" }
-!{ dg-options "-fno-range-check -mieee" { target sh*-*-* } }
+!{ dg-options "-fno-range-check -mieee" { target alpha*-*-* sh*-*-* } }
! PR19310 and PR19904, allow disabling range check during compile.
! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>
program main
diff --git a/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90 b/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90
index 96bf283f036..dbad84e1ae1 100644
--- a/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90
+++ b/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90
@@ -1,5 +1,6 @@
! { dg-do run }
! { dg-options "-O2" }
+! { dg-options "-O2 -mieee" { target alpha*-*-* } }
! Tests the fix for the meta-bug PR31237 (TRANSFER intrinsic)
! Exercises gfc_simplify_transfer a random walk through types and shapes
! and compares its results with the middle-end version that operates on
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_spacing.x b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_spacing.x
new file mode 100644
index 00000000000..dad399dcb8d
--- /dev/null
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_spacing.x
@@ -0,0 +1,2 @@
+add-ieee-options
+return 0
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 90c890cb49c..15a8e255034 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -287,9 +287,11 @@ int flag_next_runtime = 0;
enum tls_model flag_tls_default = TLS_MODEL_GLOBAL_DYNAMIC;
-/* Set the default algorithm for the integrated register allocator. */
+/* Set the default region and algorithm for the integrated register
+ allocator. */
-enum ira_algorithm flag_ira_algorithm = IRA_ALGORITHM_MIXED;
+enum ira_algorithm flag_ira_algorithm = IRA_ALGORITHM_CB;
+enum ira_region flag_ira_region = IRA_REGION_MIXED;
/* Set the default value for -fira-verbose. */
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index ba3d0fcc9e0..0802e5af825 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -293,6 +293,7 @@ execute_fixup_cfg (void)
int todo = gimple_in_ssa_p (cfun) ? TODO_verify_ssa : 0;
cfun->after_inlining = true;
+ cfun->always_inline_functions_inlined = true;
if (cfun->eh)
FOR_EACH_BB (bb)
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index 51bbd4bcdcb..e3d60e98b2e 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -1229,6 +1229,18 @@ follow_ssa_edge_in_rhs (struct loop *loop, gimple stmt,
case GIMPLE_SINGLE_RHS:
return follow_ssa_edge_expr (loop, stmt, gimple_assign_rhs1 (stmt),
halting_phi, evolution_of_loop, limit);
+ case GIMPLE_UNARY_RHS:
+ if (code == NOP_EXPR)
+ {
+ /* This assignment is under the form "a_1 = (cast) rhs. */
+ t_bool res
+ = follow_ssa_edge_expr (loop, stmt, gimple_assign_rhs1 (stmt),
+ halting_phi, evolution_of_loop, limit);
+ *evolution_of_loop = chrec_convert (type, *evolution_of_loop, stmt);
+ return res;
+ }
+ /* FALLTHRU */
+
default:
return t_false;
}
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 82933f81914..0908d546f00 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -2191,6 +2191,9 @@ fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
t = maybe_fold_stmt_indirect (expr, TREE_OPERAND (expr, 0),
integer_zero_node);
+ /* Avoid folding *"abc" = 5 into 'a' = 5. */
+ if (wi->is_lhs && t && TREE_CODE (t) == INTEGER_CST)
+ t = NULL_TREE;
if (!t
&& TREE_CODE (TREE_OPERAND (expr, 0)) == ADDR_EXPR)
/* If we had a good reason for propagating the address here,
@@ -2219,8 +2222,10 @@ fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
Otherwise we'd be wasting time. */
case ARRAY_REF:
/* If we are not processing expressions found within an
- ADDR_EXPR, then we can fold constant array references. */
- if (!*inside_addr_expr_p)
+ ADDR_EXPR, then we can fold constant array references.
+ Don't fold on LHS either, to avoid folding "abc"[0] = 5
+ into 'a' = 5. */
+ if (!*inside_addr_expr_p && !wi->is_lhs)
t = fold_read_from_constant_string (expr);
else
t = NULL;
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 00594432bc0..683d7d4b5fa 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -4355,6 +4355,8 @@ iv_ca_add_use (struct ivopts_data *data, struct iv_ca *ivs,
static comp_cost
iv_ca_cost (struct iv_ca *ivs)
{
+ /* This was a conditional expression but it triggered a bug in the
+ Solaris 8 compiler. */
if (ivs->bad_uses)
return infinite_cost;
else
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 46781b82129..3d64c1cbd33 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -4704,8 +4704,9 @@ static bool have_alias_info = false;
/* Emit a note for the pointer initialization point DEF. */
static void
-emit_pointer_definition (gimple def)
+emit_pointer_definition (tree ptr, bitmap visited)
{
+ gimple def = SSA_NAME_DEF_STMT (ptr);
if (gimple_code (def) == GIMPLE_PHI)
{
use_operand_p argp;
@@ -4715,7 +4716,10 @@ emit_pointer_definition (gimple def)
{
tree arg = USE_FROM_PTR (argp);
if (TREE_CODE (arg) == SSA_NAME)
- emit_pointer_definition (SSA_NAME_DEF_STMT (arg));
+ {
+ if (bitmap_set_bit (visited, SSA_NAME_VERSION (arg)))
+ emit_pointer_definition (arg, visited);
+ }
else
inform (0, "initialized from %qE", arg);
}
@@ -4729,7 +4733,6 @@ emit_pointer_definition (gimple def)
static void
emit_alias_warning (tree ptr)
{
- gimple def = SSA_NAME_DEF_STMT (ptr);
gimple use;
imm_use_iterator ui;
unsigned warned = 0;
@@ -4777,7 +4780,11 @@ emit_alias_warning (tree ptr)
}
}
if (warned > 0)
- emit_pointer_definition (def);
+ {
+ bitmap visited = BITMAP_ALLOC (NULL);
+ emit_pointer_definition (ptr, visited);
+ BITMAP_FREE (visited);
+ }
}
/* Given a pointer variable P, fill in its points-to set, or return
diff --git a/gcc/tree.c b/gcc/tree.c
index e74b7792127..03c54cc1cb1 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5522,7 +5522,7 @@ build_pointer_type_for_mode (tree to_type, enum machine_mode mode,
t = make_node (POINTER_TYPE);
TREE_TYPE (t) = to_type;
- TYPE_MODE (t) = mode;
+ SET_TYPE_MODE (t, mode);
TYPE_REF_CAN_ALIAS_ALL (t) = can_alias_all;
TYPE_NEXT_PTR_TO (t) = TYPE_POINTER_TO (to_type);
TYPE_POINTER_TO (to_type) = t;
@@ -5586,7 +5586,7 @@ build_reference_type_for_mode (tree to_type, enum machine_mode mode,
t = make_node (REFERENCE_TYPE);
TREE_TYPE (t) = to_type;
- TYPE_MODE (t) = mode;
+ SET_TYPE_MODE (t, mode);
TYPE_REF_CAN_ALIAS_ALL (t) = can_alias_all;
TYPE_NEXT_REF_TO (t) = TYPE_REFERENCE_TO (to_type);
TYPE_REFERENCE_TO (to_type) = t;
@@ -5655,7 +5655,7 @@ build_index_type (tree maxval)
TYPE_PRECISION (itype) = TYPE_PRECISION (sizetype);
TYPE_MIN_VALUE (itype) = size_zero_node;
TYPE_MAX_VALUE (itype) = fold_convert (sizetype, maxval);
- TYPE_MODE (itype) = TYPE_MODE (sizetype);
+ SET_TYPE_MODE (itype, TYPE_MODE (sizetype));
TYPE_SIZE (itype) = TYPE_SIZE (sizetype);
TYPE_SIZE_UNIT (itype) = TYPE_SIZE_UNIT (sizetype);
TYPE_ALIGN (itype) = TYPE_ALIGN (sizetype);
@@ -5711,7 +5711,7 @@ build_range_type (tree type, tree lowval, tree highval)
TYPE_MAX_VALUE (itype) = highval ? fold_convert (type, highval) : NULL;
TYPE_PRECISION (itype) = TYPE_PRECISION (type);
- TYPE_MODE (itype) = TYPE_MODE (type);
+ SET_TYPE_MODE (itype, TYPE_MODE (type));
TYPE_SIZE (itype) = TYPE_SIZE (type);
TYPE_SIZE_UNIT (itype) = TYPE_SIZE_UNIT (type);
TYPE_ALIGN (itype) = TYPE_ALIGN (type);
@@ -7296,7 +7296,7 @@ make_vector_type (tree innertype, int nunits, enum machine_mode mode)
t = make_node (VECTOR_TYPE);
TREE_TYPE (t) = TYPE_MAIN_VARIANT (innertype);
SET_TYPE_VECTOR_SUBPARTS (t, nunits);
- TYPE_MODE (t) = mode;
+ SET_TYPE_MODE (t, mode);
TYPE_READONLY (t) = TYPE_READONLY (innertype);
TYPE_VOLATILE (t) = TYPE_VOLATILE (innertype);
@@ -7553,19 +7553,19 @@ build_common_tree_nodes_2 (int short_double)
dfloat32_type_node = make_node (REAL_TYPE);
TYPE_PRECISION (dfloat32_type_node) = DECIMAL32_TYPE_SIZE;
layout_type (dfloat32_type_node);
- TYPE_MODE (dfloat32_type_node) = SDmode;
+ SET_TYPE_MODE (dfloat32_type_node, SDmode);
dfloat32_ptr_type_node = build_pointer_type (dfloat32_type_node);
dfloat64_type_node = make_node (REAL_TYPE);
TYPE_PRECISION (dfloat64_type_node) = DECIMAL64_TYPE_SIZE;
layout_type (dfloat64_type_node);
- TYPE_MODE (dfloat64_type_node) = DDmode;
+ SET_TYPE_MODE (dfloat64_type_node, DDmode);
dfloat64_ptr_type_node = build_pointer_type (dfloat64_type_node);
dfloat128_type_node = make_node (REAL_TYPE);
TYPE_PRECISION (dfloat128_type_node) = DECIMAL128_TYPE_SIZE;
layout_type (dfloat128_type_node);
- TYPE_MODE (dfloat128_type_node) = TDmode;
+ SET_TYPE_MODE (dfloat128_type_node, TDmode);
dfloat128_ptr_type_node = build_pointer_type (dfloat128_type_node);
complex_integer_type_node = build_complex_type (integer_type_node);
diff --git a/gcc/tree.h b/gcc/tree.h
index d85918fae1f..55163b6c1b7 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2050,7 +2050,6 @@ struct tree_block GTY(())
#define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type.uid)
#define TYPE_SIZE(NODE) (TYPE_CHECK (NODE)->type.size)
#define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit)
-#define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
#define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values)
#define TYPE_DOMAIN(NODE) (ARRAY_TYPE_CHECK (NODE)->type.values)
#define TYPE_FIELDS(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.values)
@@ -2078,6 +2077,14 @@ struct tree_block GTY(())
#define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type.main_variant)
#define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type.context)
+/* Vector types need to check target flags to determine type. */
+extern enum machine_mode vector_type_mode (const_tree);
+#define TYPE_MODE(NODE) \
+ (TREE_CODE (TYPE_CHECK (NODE)) == VECTOR_TYPE \
+ ? vector_type_mode (NODE) : (NODE)->type.mode)
+#define SET_TYPE_MODE(NODE, MODE) \
+ (TYPE_CHECK (NODE)->type.mode = (MODE))
+
/* The "canonical" type for this type node, which can be used to
compare the type for equality with another type. If two types are
equal (based on the semantics of the language), then they will have
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 765bbd78b3e..dcc4867882e 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,12 @@
+2008-12-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/38430
+ * io/transfer.c (data_transfer_init): Move constraint check for REC=
+ and STREAM access into condition for other REC= constraints to simplify.
+ Comment out this constraint to avoid breaking compatibility with 4.3
+ until later. Added a TODO for above comment and this one.
+ Fix test for max pos.
+
2008-12-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/38291
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 318d2215ee2..ea63a0daffc 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -1986,15 +1986,6 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag)
return;
}
- if (dtp->u.p.current_unit->flags.access == ACCESS_STREAM
- && (cf & IOPARM_DT_HAS_REC) != 0)
- {
- generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
- "Record number not allowed for stream access "
- "data transfer");
- return;
- }
-
/* Process the ADVANCE option. */
dtp->u.p.advance_status
@@ -2141,7 +2132,7 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag)
return;
}
- if (dtp->rec >= dtp->u.p.current_unit->maxrec)
+ if (dtp->pos >= dtp->u.p.current_unit->maxrec)
{
generate_error (&dtp->common, LIBERROR_BAD_OPTION,
"POS=specifier too large");
@@ -2231,10 +2222,20 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag)
return;
}
- /* This is required to maintain compatibility between
- 4.3 and 4.4 runtime. */
+ /* TODO: This is required to maintain compatibility between
+ 4.3 and 4.4 runtime. Remove when ABI changes from 4.3 */
+
if (is_stream_io (dtp))
dtp->u.p.current_unit->strm_pos = dtp->rec;
+
+ /* TODO: Un-comment this code when ABI changes from 4.3.
+ if (dtp->u.p.current_unit->flags.access == ACCESS_STREAM)
+ {
+ generate_error (&dtp->common, LIBERROR_OPTION_CONFLICT,
+ "Record number not allowed for stream access "
+ "data transfer");
+ return;
+ } */
}