aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Belevantsev <abel@ispras.ru>2008-10-14 06:41:30 +0000
committerAndrey Belevantsev <abel@ispras.ru>2008-10-14 06:41:30 +0000
commit1a87ac46a13b07f12b882a64d39e92ee4a9d0c58 (patch)
tree5b98f37bc5970adcb4458bc92ecfde3b0df53cdb
parent551d5228f0543658200ef0ef972a4a6c11904cee (diff)
Merge with trunk rev. 141085.
* config/ia64/ia64.c (ia64_clear_sched_context): Set sc->prev_cycle_state to NULL. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/sel-sched-branch@141104 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog7
-rwxr-xr-xconfigure8
-rw-r--r--configure.ac8
-rw-r--r--gcc/ChangeLog541
-rw-r--r--gcc/ChangeLog.sel-sched6
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/alias.c46
-rw-r--r--gcc/alloc-pool.c76
-rw-r--r--gcc/auto-inc-dec.c12
-rw-r--r--gcc/basic-block.h3
-rw-r--r--gcc/builtins.c140
-rw-r--r--gcc/c-gimplify.c6
-rw-r--r--gcc/cfgcleanup.c27
-rw-r--r--gcc/cfgexpand.c54
-rw-r--r--gcc/cfglayout.c69
-rw-r--r--gcc/cfgrtl.c37
-rw-r--r--gcc/combine.c6
-rw-r--r--gcc/config.gcc5
-rw-r--r--gcc/config/arm/bpabi.h17
-rw-r--r--gcc/config/i386/cpuid.h19
-rw-r--r--gcc/config/i386/driver-i386.c467
-rw-r--r--gcc/config/i386/i386-protos.h4
-rw-r--r--gcc/config/i386/i386.c178
-rw-r--r--gcc/config/i386/i386.h5
-rw-r--r--gcc/config/i386/i386.md46
-rw-r--r--gcc/config/i386/i386.opt4
-rw-r--r--gcc/config/i386/ppro.md170
-rw-r--r--gcc/config/ia64/ia64.c5
-rw-r--r--gcc/config/mips/mips.c2
-rw-r--r--gcc/config/pa/pa.c19
-rw-r--r--gcc/config/pa/pa.md551
-rw-r--r--gcc/config/rs6000/rs6000.c39
-rw-r--r--gcc/config/rs6000/rs6000.h14
-rw-r--r--gcc/config/rs6000/rs6000.md115
-rw-r--r--gcc/config/rs6000/rs6000.opt10
-rw-r--r--gcc/config/rs6000/sysv4.h3
-rw-r--r--gcc/config/rs6000/xfpu.h26
-rw-r--r--gcc/config/rs6000/xfpu.md140
-rw-r--r--gcc/config/sh/constraints.md12
-rw-r--r--gcc/config/sh/sh.c75
-rw-r--r--gcc/config/sh/sh.h91
-rw-r--r--gcc/config/sh/sh.md113
-rw-r--r--gcc/cp/ChangeLog16
-rw-r--r--gcc/cp/cp-gimplify.c28
-rw-r--r--gcc/cp/decl.c1
-rw-r--r--gcc/cp/semantics.c8
-rw-r--r--gcc/cse.c23
-rw-r--r--gcc/dce.c18
-rw-r--r--gcc/ddg.c18
-rw-r--r--gcc/df-byte-scan.c12
-rw-r--r--gcc/df-core.c42
-rw-r--r--gcc/df-problems.c168
-rw-r--r--gcc/df-scan.c609
-rw-r--r--gcc/df.h231
-rw-r--r--gcc/doc/install.texi2
-rw-r--r--gcc/doc/invoke.texi18
-rw-r--r--gcc/dwarf2out.c77
-rw-r--r--gcc/emit-rtl.c70
-rw-r--r--gcc/emit-rtl.h3
-rw-r--r--gcc/expmed.c3
-rw-r--r--gcc/expr.c15
-rw-r--r--gcc/fortran/ChangeLog52
-rw-r--r--gcc/fortran/array.c8
-rw-r--r--gcc/fortran/dependency.c8
-rw-r--r--gcc/fortran/error.c26
-rw-r--r--gcc/fortran/expr.c110
-rw-r--r--gcc/fortran/f95-lang.c10
-rw-r--r--gcc/fortran/gfortran.h5
-rw-r--r--gcc/fortran/intrinsic.c40
-rw-r--r--gcc/fortran/module.c7
-rw-r--r--gcc/fortran/resolve.c4
-rw-r--r--gcc/fortran/simplify.c28
-rw-r--r--gcc/fortran/trans-decl.c19
-rw-r--r--gcc/fortran/trans-types.c8
-rw-r--r--gcc/fwprop.c46
-rw-r--r--gcc/gimple-low.c6
-rw-r--r--gcc/global.c12
-rw-r--r--gcc/graphite.c1
-rw-r--r--gcc/ifcvt.c4
-rw-r--r--gcc/init-regs.c4
-rw-r--r--gcc/ira-lives.c8
-rw-r--r--gcc/ira.c4
-rw-r--r--gcc/local-alloc.c2
-rw-r--r--gcc/loop-invariant.c26
-rw-r--r--gcc/loop-iv.c32
-rw-r--r--gcc/opts.c3
-rw-r--r--gcc/opts.h16
-rw-r--r--gcc/profile.c6
-rw-r--r--gcc/ra-conflict.c24
-rw-r--r--gcc/regstat.c26
-rw-r--r--gcc/reload1.c82
-rw-r--r--gcc/rtl.h1
-rw-r--r--gcc/sdbout.c23
-rw-r--r--gcc/see.c40
-rw-r--r--gcc/sel-sched-ir.c10
-rw-r--r--gcc/testsuite/ChangeLog131
-rw-r--r--gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c3
-rw-r--r--gcc/testsuite/g++.dg/expr/bitfield10.C16
-rw-r--r--gcc/testsuite/g++.dg/parse/struct-4.C13
-rw-r--r--gcc/testsuite/g++.dg/torture/pr37146-1.C83
-rw-r--r--gcc/testsuite/g++.dg/torture/pr37146-2.C67
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr35760.c7
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr37341.c35
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c35
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-1.c32
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-2.c53
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-1.c22
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-2.c39
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-3.c53
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr37616.c41
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr29609-1.c33
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr29609-2.c53
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr36690-1.c23
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr36690-2.c40
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr36690-3.c47
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr37616.c40
-rw-r--r--gcc/testsuite/gcc.dg/struct-parse-2.c13
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr37731-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr37731-2.c17
-rw-r--r--gcc/testsuite/gcc.dg/vect/ggc-pr37574.c2
-rw-r--r--gcc/testsuite/gcc.target/mips/octeon-bbit-3.c15
-rw-r--r--gcc/testsuite/gcc.target/mips/octeon-exts-2.c2
-rw-r--r--gcc/testsuite/gcc.target/mips/octeon-exts-5.c38
-rw-r--r--gcc/testsuite/gfortran.dg/arithmetic_overflow_1.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/convert_2.f9020
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr37738.f30
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_optional_char_arg_1.f901
-rw-r--r--gcc/testsuite/gfortran.dg/module_equivalence_5.f9034
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_54.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/restricted_expression_1.f9025
-rw-r--r--gcc/testsuite/gfortran.dg/restricted_expression_2.f9025
-rw-r--r--gcc/testsuite/gfortran.dg/restricted_expression_3.f9026
-rw-r--r--gcc/testsuite/gfortran.dg/used_before_typed_6.f9020
-rw-r--r--gcc/testsuite/gfortran.dg/used_types_24.f9033
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization4.adb9
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization4_pkg.adb17
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization4_pkg.ads9
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization5.adb21
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization5_pkg.ads7
-rw-r--r--gcc/testsuite/lib/gfortran-dg.exp1
-rw-r--r--gcc/tree-cfg.c27
-rw-r--r--gcc/tree-ssa-live.c6
-rw-r--r--gcc/tree-ssa-loop-ivopts.c18
-rw-r--r--gcc/tree-switch-conversion.c27
-rw-r--r--gcc/tree.h13
-rw-r--r--gcc/web.c44
-rw-r--r--libgcc/ChangeLog4
-rw-r--r--libgcc/config.host17
-rw-r--r--libgfortran/ChangeLog15
-rw-r--r--libgfortran/io/list_read.c3
-rw-r--r--libgfortran/io/transfer.c8
-rw-r--r--libiberty/ChangeLog10
-rw-r--r--libiberty/config.in6
-rwxr-xr-xlibiberty/configure367
-rw-r--r--libiberty/configure.ac1
-rw-r--r--libiberty/xstrdup.c2
-rw-r--r--libmudflap/ChangeLog5
-rw-r--r--libmudflap/testsuite/libmudflap.c++/pass66-frag.cxx17
-rw-r--r--libstdc++-v3/ChangeLog65
-rw-r--r--libstdc++-v3/include/bits/stl_iterator.h20
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h10
-rw-r--r--libstdc++-v3/include/std/ostream11
-rw-r--r--libstdc++-v3/include/std/system_error166
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_code/cons/1.cc2
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_condition/cons/1.cc49
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool.cc48
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool_neg.cc33
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/equal.cc44
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/not_equal.cc44
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/cons/1.cc3
-rw-r--r--libstdc++-v3/testsuite/20_util/reference_wrapper/24803.cc20
-rw-r--r--libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc8
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/20.cc2
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_text/02.cc2
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/regression/cw-16.cc8
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_error.h8
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_hooks.cc3
179 files changed, 5561 insertions, 2093 deletions
diff --git a/ChangeLog b/ChangeLog
index 07558feda19..887856b72d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-10-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * configure.ac (MPFR check): Bump minimum version to 2.3.0 and
+ recommended version to 2.3.2.
+
+ * configure: Regenerate.
+
2008-10-01 Mark Mitchell <mark@codesourcery.com>
* MAINTAINERS (Blanket Write Privs): Change to Global Reviewers.
diff --git a/configure b/configure
index 7ed787aaea7..d3dd5eaefed 100755
--- a/configure
+++ b/configure
@@ -4674,7 +4674,7 @@ int
main ()
{
- #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,1)
+ #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,0)
choke me
#endif
mpfr_t n;
@@ -4724,7 +4724,7 @@ int
main ()
{
- #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,0)
+ #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,2)
choke me
#endif
mpfr_t n; mpfr_init(n);
@@ -4780,7 +4780,7 @@ rm -f conftest.err conftest.$ac_objext \
CFLAGS="$saved_CFLAGS"
if test x$have_gmp != xyes; then
- { { echo "$as_me:$LINENO: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.
+ { { echo "$as_me:$LINENO: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
@@ -4788,7 +4788,7 @@ See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages." >&5
-echo "$as_me: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.
+echo "$as_me: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
diff --git a/configure.ac b/configure.ac
index aa29d534ff5..bd6afe59a25 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1267,11 +1267,11 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
if test x"$have_gmp" = xyes; then
saved_LIBS="$LIBS"
LIBS="$LIBS $gmplibs"
- dnl MPFR 2.2.1 is acceptable, but MPFR 2.3.0 is better.
+ dnl MPFR 2.3.0 is acceptable, but MPFR 2.3.2 is better.
AC_MSG_CHECKING([for correct version of mpfr.h])
AC_TRY_LINK([#include <gmp.h>
#include <mpfr.h>],[
- #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,1)
+ #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,0)
choke me
#endif
mpfr_t n;
@@ -1284,7 +1284,7 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
mpfr_subnormalize (x, t, GMP_RNDN);
], [AC_TRY_LINK([#include <gmp.h>
#include <mpfr.h>],[
- #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,0)
+ #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,2)
choke me
#endif
mpfr_t n; mpfr_init(n);
@@ -1295,7 +1295,7 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
CFLAGS="$saved_CFLAGS"
if test x$have_gmp != xyes; then
- AC_MSG_ERROR([Building GCC requires GMP 4.1+ and MPFR 2.3.0+.
+ AC_MSG_ERROR([Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e766799ad5b..8838c414483 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,509 @@
+2008-10-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c: Remove MPFR_VERSION_NUM(2,3,0) conditionals.
+ * doc/install.texi: Bump recommended MPFR to 2.3.2.
+
+2008-10-12 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ PR middle-end/37808
+ * df-scan.c (df_ref_change_reg_with_loc_1): Added test to make
+ sure that ref has valid bb.
+
+2008-10-12 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/37447
+ * Makefile.in (reload1.o): Depend on EMIT_RTL_H.
+ * alias.c (value_addr_p, stack_addr_p): Remove.
+ (nonoverlapping_memrefs_p): Remove IRA special case.
+ * emit-rtl.c (get_spill_slot_decl, set_mem_attrs_for_spill): New.
+ * emit-rtl.h (set_mem_attrs_for_spill): Declare.
+ * reload1.c (alter_reg): Use it.
+
+2008-10-12 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/driver-i386.c (detect_caches_cpuid2): Use array
+ of registers instead of eax, ebx, ecx and edx. Use for loop
+ and check register for non-zero value before the call
+ to decode_caches_intel.
+
+2008-10-11 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ PR rtl-optimization/37448
+ * df.h: (df_ref_class): New enum.
+ (DF_REF_TYPE_NAMES, df_ref_extract): Removed.
+ (struct df_ref): Replaced with union df_ref_d.
+ (df_base_ref, df_artificial_ref, df_regular_ref, df_extract_ref):
+ New members of df_ref_d union.
+ (DF_REF_REAL_REG, DF_REF_REGNO, DF_REF_REAL_LOC, DF_REF_REG,
+ DF_REF_LOC, DF_REF_BB, DF_REF_INSN_INFO, DF_REF_INSN,
+ DF_REF_CLASS, DF_REF_TYPE, DF_REF_CHAIN, DF_REF_ID, DF_REF_FLAGS,
+ DF_REF_ORDER, DF_REF_IS_ARTIFICIAL, DF_REF_NEXT_REG,
+ DF_REF_PREV_REG, DF_REF_EXTRACT_WIDTH, DF_REF_EXTRACT_OFFSET,
+ DF_REF_EXTRACT_MODE): Replaced definition to access union
+ df_ref_d.
+ (DF_MWS_REG_DEF_P, DF_MWS_REG_USE_P, DF_MWS_TYPE): New macros.
+ (df_scan_bb_info, df_bb_regno_first_def_find,
+ df_bb_regno_last_def_find, df_find_def, df_find_use,
+ df_refs_chain_dump, df_regs_chain_dump, df_ref_debug,
+ debug_df_ref, df_chain_create, df_chain_unlink, df_chain_copy,
+ df_ref_create, df_ref_remove, df_compute_accessed_bytes,
+ df_get_artificial_defs, df_get_artificial_uses, union_defs)
+ Replaced struct df_ref * with df_ref.
+ * df-scan.c (df_collection_rec, df_null_ref_rec,
+ df_ref_chain_delete_du_chain, df_ref_chain_delete, df_install_ref,
+ df_grow_ref_info, df_ref_create, df_reg_chain_unlink,
+ df_ref_compress_rec, df_ref_remove, df_ref_chain_delete_du_chain,
+ df_ref_chain_delete, df_free_collection_rec, df_insn_rescan,
+ df_reorganize_refs_by_reg_by_reg,
+ df_reorganize_refs_by_reg_by_insn, df_reorganize_refs_by_reg,
+ df_ref_change_reg_with_loc_1, df_notes_rescan, df_swap_refs,
+ df_sort_and_compress_refs, df_install_ref, df_install_refs,
+ df_ref_record, df_get_conditional_uses, df_get_call_refs,
+ df_bb_refs_record, df_exit_block_uses_collect,
+ df_record_exit_block_uses, df_reg_chain_mark,
+ df_reg_chain_verify_unmarked, df_refs_verify): Replaced struct
+ df_ref * with df_ref.
+ (df_ref_record, df_uses_record, df_ref_create_structure): Added
+ df_ref_class parameter.
+ (df_scan_problem_data): Added new pools for different types of
+ refs.
+ (df_scan_free_internal, df_scan_alloc, df_free_ref,
+ df_ref_create_structure): Processed new ref pools.
+ (df_scan_start_dump): Added counts of refs and insns.
+ (df_ref_create, df_notes_rescan, df_def_record_1, df_uses_record,
+ df_get_call_refs, df_insn_refs_collect, df_bb_refs_collect,
+ df_entry_block_defs_collect, df_exit_block_uses_collect): Added
+ code to pass df_ref_class down to ref creation functions.
+ (df_reg_chain_unlink, df_ref_remove, df_ref_change_reg_with_loc_1,
+ df_reg_chain_mark): Use macros to hide references to df_refs.
+ (df_ref_chain_change_bb): Removed.
+ (df_insn_change_bb): Remove calls to df_ref_insn_change_bb.
+ (df_ref_equal_p, df_ref_compare, df_ref_create_structure):
+ Enhanced to understand df_ref union structure.
+ * fwprop.c (local_ref_killed_between_p, use_killed_between,
+ all_uses_available_at, update_df, try_fwprop_subst,
+ forward_propagate_subreg, forward_propagate_and_simplify,
+ forward_propagate_into, fwprop, fwprop_addr): Replaced struct
+ df_ref * with df_ref.
+ (use_killed_between, all_uses_available_at): Use macros to hide
+ references to df_refs.
+ * regstat.c (regstat_bb_compute_ri,
+ regstat_bb_compute_calls_crossed): Replaced struct df_ref * with
+ df_ref.
+ * see.c (see_handle_relevant_defs, see_handle_relevant_uses,
+ see_handle_relevant_refs, see_analyze_one_def,
+ see_update_relevancy, see_propagate_extensions_to_uses): Replaced
+ struct df_ref * with df_ref.
+ * ra-conflict.c (record_one_conflict, clear_reg_in_live,
+ global_conflicts): Replaced struct df_ref * with df_ref.
+ * ddg.c (create_ddg_dep_from_intra_loop_link,
+ add_cross_iteration_register_deps, build_inter_loop_deps):
+ Replaced struct df_ref * with df_ref.
+ (create_ddg_dep_from_intra_loop_link,
+ add_cross_iteration_register_deps): Use macros to hide references
+ to df_refs.
+ * auto-inc-dec.c (find_inc, merge_in_block): Replaced struct
+ df_ref * with df_ref.
+ * df-core.c (df_bb_regno_first_def_find,
+ df_bb_regno_last_def_find, df_find_def, df_find_use,
+ df_refs_chain_dump, df_regs_chain_dump, df_ref_debug,
+ debug_df_ref): Replaced struct df_ref * with df_ref.
+ (df_mws_dump, df_ref_debug): Use macros to hide references to df_refs.
+ * cse.c (cse_extended_basic_block): Replaced struct df_ref * with
+ df_ref.
+ * web.c (union_defs, entry_register, replace_ref, web_main):
+ Replaced struct df_ref * with df_ref.
+ (union_defs, replace_ref): Use macros to hide references to df_refs.
+ * global.c (compute_regs_asm_clobbered, build_insn_chain):
+ Replaced struct df_ref * with df_ref.
+ * ifcvt.c (dead_or_predicable): Replaced struct df_ref * with df_ref.
+ * sel-sched-ir.c (maybe_downgrade_id_to_use, setup_id_reg_sets, ):
+ Replaced struct df_ref * with df_ref.
+ * ira-lives.c (mark_ref_live, def_conflicts_with_inputs_p,
+ mark_ref_dead, process_bb_node_lives): Replaced struct df_ref *
+ with df_ref.
+ * local-alloc.c (block_alloc): Replaced struct df_ref * with df_ref.
+ * df-byte-scan.c (df_compute_accessed_bytes_extract,
+ df_compute_accessed_bytes_strict_low_part,
+ df_compute_accessed_bytes_subreg, df_compute_accessed_bytes):
+ Replaced struct df_ref * with df_ref.
+ (df_compute_accessed_bytes): Use macros to hide references to df_refs.
+ * init-regs.c (initialize_uninitialized_regs): Replaced struct
+ df_ref * with df_ref.
+ * loop-invariant.c (invariant_for_use, hash_invariant_expr_1,
+ check_dependency, check_dependencies, record_uses): Replaced
+ struct df_ref * with df_ref.
+ (invariant_for_use, check_dependency): Use macros to hide
+ references to df_refs.
+ * loop-iv.c (iv_analysis_loop_init, iv_get_reaching_def,
+ get_biv_step_1, get_biv_step, record_iv, iv_analyze_def,
+ iv_analyze, biv_p): Replaced struct df_ref * with df_ref.
+ (iv_analysis_loop_init, iv_get_reaching_def): Use macros to hide
+ references to df_refs.
+ * ira.c (compute_regs_asm_clobbered): Replaced struct df_ref *
+ with df_ref.
+ * combine.c (create_log_links): Replaced struct df_ref * with df_ref.
+ * df-problems.c (df_rd_bb_local_compute_process_def,
+ df_lr_bb_local_compute, df_live_bb_local_compute, df_chain_create,
+ df_chain_unlink_1, df_chain_unlink, df_chain_copy,
+ df_chain_remove_problem, df_chain_create_bb_process_use,
+ df_chain_create_bb, df_chain_top_dump, df_chain_bottom_dump,
+ df_byte_lr_check_regs, df_byte_lr_bb_local_compute,
+ df_byte_lr_simulate_defs, df_byte_lr_simulate_uses,
+ df_byte_lr_simulate_artificial_refs_at_top,
+ df_byte_lr_simulate_artificial_refs_at_end, df_create_unused_note,
+ df_note_bb_compute, df_note_add_problem, df_simulate_defs,
+ df_simulate_uses, df_simulate_artificial_refs_at_end,
+ df_simulate_artificial_refs_at_top): Replaced struct df_ref * with
+ df_ref.
+ (df_chain_dump): Use macros to hide references to df_refs.
+ * config/mips/mips.c (r10k_simplify_address): Replaced struct
+ df_ref * with df_ref.
+ * dce.c (mark_nonreg_stores, delete_corresponding_reg_eq_notes,
+ mark_artificial_uses, mark_reg_dependencies,
+ byte_dce_process_block): Replaced struct df_ref * with df_ref.
+
+2008-10-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree.h (contains_packed_reference): Mention ARRAY_RANGE_REF in
+ head comment.
+ (array_ref_element_size): Likewise.
+ (array_ref_low_bound): Likewise.
+ (array_ref_up_bound): Likewise.
+ * expr.c (contains_packed_reference): Likewise.
+ (array_ref_element_size): Likewise.
+ (array_ref_low_bound): Likewise.
+ (array_ref_up_bound): Likewise.
+ * tree-ssa-loop-ivopts.c (idx_contains_abnormal_ssa_name_p): Deal
+ with ARRAY_RANGE_REF.
+ (idx_find_step): Likewise.
+ (idx_record_use): Likewise.
+ (strip_offset_1): Likewise.
+ (idx_remove_ssa_names): Likewise.
+
+2008-10-11 Uros Bizjak <ubizjak@gmail.com>
+ Andi Kleen <ak@linux.intel.com>
+
+ * config/i386/cpuid.h (__cpuid_count): New defines.
+ * config/i386/driver-i386.c (struct cache_desc): New structure.
+ (describe_cache): Use struct cache_desc to pass cache descriptions.
+ (detect_l2_cache): Ditto. Rename from decode_l2_cache.
+ (detect_caches_amd): Use struct cache_desc to describe caches.
+ (decode_caches_intel): Use struct cache_desc to pass cache
+ descriptions. Update descriptions to match latest (rev -032,
+ December 2007) CPUID documentation. Do not check valid bit here.
+ Check for Xeon MP value 0x49 problems.
+ (detect_caches_cpuid2): New function, split from detect_caches_intel.
+ Check valid bit before calling decode_caches_intel. Detect number
+ of times to repeat CPUID instruction.
+ (detect_caches_cpuid4): New function.
+ (detect_caches_intel): Depending on max_level, call
+ detect_caches_cpuid2 or detect_caches_cpuid4. Call detect_l2_cache
+ only when other methods fail to provide valid L2 cache description.
+
+2008-10-11 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR middle-end/37608
+ * pa.md (call, call_value): Generate an rtx for register r4 and pass
+ it to PIC call patterns.
+ (call_symref_pic): Revise pattern to expose PIC register save. Remove
+ code generation and attributes from pattern. Change peephole2 to split
+ for noreturn case. Revise split pattern for non noreturn case.
+ (call_symref_64bit, call_reg_pic, call_reg_64bit, call_val_symref_pic,
+ call_val_symref_64bit, call_val_reg_pic, call_val_reg_64bit): Likewise.
+ * pa.c (attr_length_call): Simplify extraction of call rtx. Add some
+ asserts.
+
+2008-10-11 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.md (aux_truncdfsf2): Remove TARGET_SINGLE_FLOAT.
+ (addsf3, subsf3, mulsf3 ! TARGET_POWERPC): Remove TARGET_SINGLE_FLOAT
+ and fp_type.
+ (divdf3): Reformat long line.
+
+2008-10-11 Michael J. Eager <eager@eagercon.com>
+
+ * config/rs6000/rs6000.c (rs6000_parse_fpu_option): Interpret
+ -mfpu options.
+ (rs6000_handle_option): Process -mfpu options.
+ * config/rs6000/rs6000.h: (TARGET_XILINX_FPU): New.
+ (enum fpu_type_t): New.
+ * config/rs6000/rs6000.md (attr fp_type): New. Include xfpu.md.
+ (addsf3, subsf3, mulsf3, adddf3, subdf3, muldf3, trunctfdf2): Set
+ fp_type.
+ (floatsisf2): Remove TARGET_SINGLE_FPU condition.
+ (floatdidf2): Add TARGET_SINGLE_FPU condition.
+ * config/rs6000/rs6000.opt (-mfpu): New.
+ (-mxilinx-fpu): New.
+ * config/rs6000/sysv4.h: (DRIVER_SELF_SPECS): New.
+ * config/rs6000/xfpu.h: New. Define TARGET_XILINX_FPU.
+ * config/rs6000/xfpu.md: New. Define Xilinx pipeline.
+ * gcc/config.gcc: powerpc-xilinx-eabi target: New.
+ * gcc/doc/invoke.texi (RS/6000 and PowerPC Options): Add -mfpu option.
+
+2008-10-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/35760
+ * config/rs6000/rs6000.c (rs6000_legitimize_address): Only create
+ LO_SUM on Darwin if mode has just one unit.
+
+2008-10-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR debug/37002
+ * dwarf2out.c (mem_loc_descriptor): Use DRAP for vDRAP which
+ has been optimized out.
+
+2008-10-10 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/sh/sh.h (PREFERRED_RELOAD_CLASS): Test PIC_ADDR_P
+ instead of PIC_DIRECT_ADDR_P.
+ (SECONDARY_INPUT_RELOAD_CLASS): Likewise.
+ (IS_LITERAL_OR_SYMBOLIC_S16_P, IS_LITERAL_OR_SYMBOLIC_U16_P): Delete.
+ (IS_NON_EXPLICIT_CONSTANT_P): Don't test PIC_OFFSET_P.
+ (PIC_OFFSET_P): Rename to...
+ (PCREL_SYMOFF_P): ...this.
+ (PIC_DIRECT_ADDR_P): Delete.
+ (MOVI_SHORI_BASE_OPERAND_P): Check PCREL_SYMOFF_P instead of
+ PIC_OFFSET_P.
+ (OUTPUT_ADDR_CONST_EXTRA): Don't require unspecs to have a
+ single argument. Handle UNSPEC_EXTRACT_S16, UNSPEC_EXTRACT_U16,
+ UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF.
+ * config/sh/sh.c (print_operand): Remove CONST handling.
+ (unspec_caller_rtx_p): Rewrite to use split_const and check
+ the operands of UNSPEC bases.
+ (fixup_mova): Replace (unspec [(minus A B)] UNSPEC_PIC)
+ with (unspec [A B] UNSPEC_SYMOFF).
+ (nonpic_symbol_mentioned_p): Check for UNSPEC_SYMOFF and
+ UNSPEC_PCREL_SYMOFF.
+ (sh_secondary_reload): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P.
+ * config/sh/sh.md (UNSPEC_EXTRACT_S16): New unspec.
+ (UNSPEC_EXTRACT_U16): Likewise.
+ (UNSPEC_SYMOFF): Likewise.
+ (UNSPEC_PCREL_SYMOFF): Likewise.
+ (movsi_const): Use UNSPEC_EXTRACT_*16s to extract 16-bit portions
+ of constants.
+ (movsi_const_16bit): Likewise.
+ (movdi_const, movdi_const_32bit, movdi_const_16bit): Likewise.
+ (GOTaddr2picreg): Replace (unspec [(minus A (minus B pc))] UNSPEC_PIC)
+ with (unspec [A B] UNSPEC_PCREL_SYMOFF).
+ (sym_label2reg): Replace (minus (const (unspec [A] UNSPEC_PIC)) B)
+ with (unspec [A B] UNSPEC_SYMOFF).
+ (symPLT_label2reg): Replace (minus A (minus B pc)) with
+ (unspec [A B] PCREL_UNSPEC_SYMOFF).
+ * config/sh/constraints.md (Css): Check for an UNSPEC_EXTRACT_S16.
+ (Csu): Likewise UNSPEC_EXTRACT_U16.
+ (Csy): Test PIC_ADDR_P instead of PIC_DIRECT_ADDR_P.
+ (Cpg): Update after changes to IS_NON_EXPLICIT_CONSTANT_P.
+
+2008-10-10 Stepan Kasal <skasal@redhat.com>
+
+ * gcc/doc/invoke.texi (Optimize Options): Fix typo in examples
+ for loop strip mining and loop blocking.
+
+2008-10-10 Alexandre Oliva <aoliva@redhat.com>
+
+ * fortran/trans-types.c (gfc_get_nodesc_array_type): Don't
+ vary types depending on debug info.
+
+2008-10-10 Alexandre Oliva <aoliva@redhat.com>
+
+ * c-gimplify.c (c_genericize): Don't refer to DECL_ASSEMBLER_NAME
+ before ensuring it's already computed.
+
+2008-10-09 Jakub Jelinek <jakub@redhat.com>
+
+ * rtl.h (locator_eq): New decl.
+ * cfglayout.c (locator_scope): New function.
+ (insn_scope): Use it.
+ (locator_eq): New function.
+ (fixup_reorder_chain): Search for last insn in src bb
+ that has locator set or first insn in dest bb. Use
+ locator_eq instead of == to compare locators.
+ * cfgrtl.c (cfg_layout_merge_blocks): Likewise.
+ * cfgcleanup.c (try_forward_edges): Use locator_eq instead of
+ == to compare locators.
+
+ * tree-ssa-live.c (remove_unused_locals): Mark all edge's goto_block
+ as used.
+ * gimple-low.c (lower_function_body, lower_gimple_return,
+ lower_builtin_setjmp): Set gimple_block on the newly created stmts.
+ * tree-cfg.c (make_cond_expr_edges, make_goto_expr_edges): Only set
+ goto_block on edges if goto_locus is known.
+
+ PR middle-end/37774
+ * tree.h (get_object_alignment): Declare.
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Call
+ get_object_alignment if needed.
+ * builtins.c (get_pointer_alignment): Move ADDR_EXPR operand handling
+ to ...
+ (get_object_alignment): ... here. New function. Try harder to
+ determine alignment from get_inner_reference returned offset.
+
+2008-10-08 Jakub Jelinek <jakub@redhat.com>
+
+ * graphite.c (gloog): Don't call find_unreachable_blocks
+ before delte_unreachable_blocks.
+
+ * cfgexpand.c (expand_gimple_cond): Convert also goto_block and
+ goto_locus of true_edge into RTL locator.
+
+2008-10-08 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*jcc_btdi_rex64): Clobber FLAGS_REG.
+ (*jcc_btdi_mask_rex64): Ditto.
+ (*jcc_btsi): Ditto.
+ (*jcc_btsi_mask): Ditto.
+ (*jcc_btsi_1): Ditto.
+ (*jcc_btsi_mask_1): Ditto.
+
+2008-10-08 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/bpabi.h (ARM_FUNCTION_PROFILER): Define new EABI
+ compatible profiler (__gnu_mcount_nc).
+ (SUBTARGET_FRAME_POINTER_REQUIRED): Define.
+
+2008-10-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (initial_ix86_tune_features): Add
+ X86_TUNE_USE_VECTOR_FP_CONVERTS.
+ * config/i386/i386.h (ix86_tune_indices): Likewise.
+ (TARGET_USE_VECTOR_FP_CONVERTS): New.
+
+ * config/i386/i386.md: Check TARGET_USE_VECTOR_FP_CONVERTS
+ instead of (TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC)
+ for FP to FP splitters.
+
+2008-10-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.md: Add missing gen_sse2_cvtdq2p to convert
+ splitter.
+
+2008-10-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/36635
+ PR target/37290
+ PR rtl-optimization/37341
+ * cse.c (cse_cc_succs): Add ORIG_BB argument, don't follow edges
+ to ORIG_BB, pass through ORIG_BB recursively.
+ (cse_condition_code_reg): Adjust caller.
+
+2008-10-08 Kai Tietz <kai.tietz@onevision.com>
+
+ * sdbout.c (sdbout_one_type): Treat the value type
+ CONST_DECL for enumerals.
+
+2008-10-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.md: Remove trailing white spaces.
+
+2008-10-07 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ PR rtl-optimization/37448
+ * alloc-pool.c (struct alloc_pool_descriptor) [elt_size]: New field.
+ (stuct alloc_pool_descriptor) [created, allocated, current, peak]:
+ Make unsigned long.
+ (struct output_info) [count]: Renamed total_created and made
+ unsigned long.
+ (struct output_info) [size]: Renamed total_allocated and made
+ unsigned long.
+ (create_alloc_pool, empty_alloc_pool, pool_alloc, pool_free):
+ Properly keep track of desc->size.
+ (print_statistics, dump_alloc_pool_statistics): Enhance the
+ printing of statistics to print the number of elements and to use
+ unsigned longs.
+
+2008-10-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/37576
+ * opts.h (CL_SAVE): Move up to flags range.
+ (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_TARGET,
+ CL_COMMON): Renumber.
+ (CL_MIN_OPTION_CLASS): Set to CL_PARAMS.
+ * opts.c (common_handle_option): Revert last change.
+
+2008-10-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386-protos.h (ix86_schedule): New.
+
+ * config/i386/i386.c (ix86_schedule): New.
+ (override_options): Add schedule to processor_alias_table. Set
+ ix86_schedule from the schedule field in processor_alias_table.
+ (ix86_function_specific_save): Save ix86_schedule.
+ (ix86_function_specific_restore): Restore ix86_schedule.
+
+ * config/i386/i386.md (cpu): Map to ix86_schedule instead of
+ ix86_tune. Add none and remove i386, i486, pentium4, nocona
+ and generic32.
+
+ * config/i386/i386.opt: Add schedule.
+
+ * config/i386/ppro.md: Remove generic32.
+
+2008-10-07 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c/35437
+ * expr.c (count_type_elements): Handle ERROR_MARK.
+
+2008-10-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/29609
+ PR debug/36690
+ PR debug/37616
+ * basic-block.h (struct edge_def): Add goto_block field.
+ * cfglayout.c (fixup_reorder_chain): Ensure that there is at least
+ one insn with locus corresponding to edge's goto_locus if !optimize.
+ * profile.c (branch_prob): Copy edge's goto_block.
+ * cfgrtl.c (force_nonfallthru_and_redirect): Use goto_locus for
+ emitted jumps.
+ (cfg_layout_merge_blocks): Emit a nop with edge's goto_locus
+ locator in between the merged basic blocks if !optimize and needed.
+ * cfgexpand.c (expand_gimple_cond): Convert goto_block and
+ goto_locus into RTL locator. For unconditional jump use that
+ locator for the jump insn.
+ (expand_gimple_cond): Convert goto_block and goto_locus into
+ RTL locator for all remaining edges. For unconditional jump
+ use that locator for the jump insn.
+ * cfgcleanup.c (try_forward_edges): Avoid the optimization if
+ there is more than one edge or insn locator along the forwarding
+ edges and !optimize. If there is just one, set e->goto_locus.
+ * tree-cfg.c (make_cond_expr_edges, make_goto_expr_edges): Set also
+ edge's goto_block.
+ (move_block_to_fn): Adjust edge's goto_block.
+
+2008-10-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/37731
+ * expmed.c (expand_mult): Properly check DImode constant in
+ CONST_DOUBLE.
+
+2008-10-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/37738
+ * dwarf2out.c (common_block_die_table): New variable.
+ (common_block_die_table_hash, common_block_die_table_eq): New
+ functions.
+ (gen_variable_die): Look up a DW_TAG_common_block die for a particular
+ COMMON block in the current scope rather than globally. Optimize
+ DW_OP_addr SYMBOL_REF DW_OP_plus_uconst off into
+ DW_OP_addr SYMBOL_REF+off.
+
+2008-10-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p) <VIEW_CONVERT_EXPR>:
+ Return true for non-addressable GIMPLE operands.
+
+2008-10-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/24765
+ * config/i386/i386.c (initial_ix86_tune_features): Remove
+ X86_TUNE_USE_BIT_TEST.
+ * config/i386/i386.h (ix86_tune_indices): Likewise.
+ (TARGET_USE_BIT_TEST): Removed.
+
+2008-10-07 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
+
+ * config.gcc (arm*-*-*): Add aapcs-linux to supported ABIs.
+
2008-10-06 Adam Nemet <anemet@caviumnetworks.com>
* config/mips/mips.md (mulsi3_mul3, muldi3_mul3): Merge these ...
@@ -127,8 +633,7 @@
(print_operand_address): Always use output_addr_const for
constant pool addresses.
(rs6000_output_addr_const_extra): New function.
- (create_TOC_reference): Create an UNSPEC_TOCREL instead of
- a MINUS.
+ (create_TOC_reference): Create an UNSPEC_TOCREL instead of a MINUS.
2008-10-06 Vladimir Makarov <vmakarov@redhat.com>
@@ -230,10 +735,8 @@
* config/rs6000/rs6000.c (USE_FP_FOR_ARG_P): Revert
TARGET_DOUBLE_FLOAT, TARGET_SINGLE_FLOAT.
(function_arg_advance): Condition on TARGET_DOUBLE_FLOAT,
- TARGET_SINGLE_FLOAT.
- Revert SCALAR_FLOAT_MODE_P condition.
- (function_arg): Condition on TARGET_DOUBLE_FLOAT,
- TARGET_SINGLE_FLOAT.
+ TARGET_SINGLE_FLOAT. Revert SCALAR_FLOAT_MODE_P condition.
+ (function_arg): Condition on TARGET_DOUBLE_FLOAT, TARGET_SINGLE_FLOAT.
(rs6000_function_value): Revert TARGET_DOUBLE_FLOAT,
TARGET_SINGLE_FLOAT.
@@ -273,8 +776,8 @@
(vec_promote): Define.
2008-10-01 Andrew Pinski <andrew_pinski@playstation.sony.com>
- Yukishige Shibata <shibata@rd.scei.sony.co.jp>
- Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
+ Yukishige Shibata <shibata@rd.scei.sony.co.jp>
+ Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add Cell
Altivec intrinsics.
@@ -881,8 +1384,8 @@
2008-09-22 Adam Nemet <anemet@caviumnetworks.com>
* config/mips/mips.h (ISA_HAS_BADDU): New macro.
- * config/mips/mips.md (*baddu_si_eb, *baddu_si_el,
- *baddu_di<mode>): New patterns.
+ * config/mips/mips.md (*baddu_si_eb, *baddu_si_el, *baddu_di<mode>):
+ New patterns.
2008-09-22 Richard Guenther <rguenther@suse.de>
@@ -915,8 +1418,7 @@
PR target/37528
* config/i386/t-cygming (SHLIB_LC): Remove.
(SHLIB_LINK): Don't add static objects to SHLIB_IMPLIB
- * config/i386/t-cygwin (SHLIB_LC): Specify all required
- libraries.
+ * config/i386/t-cygwin (SHLIB_LC): Specify all required libraries.
2008-09-22 Hans-Peter Nilsson <hp@axis.com>
@@ -976,8 +1478,7 @@
(SSA Operands): Rename from 'Statement Operands'.
* doc/generic.texi: New.
* doc/gimple.texi: New.
- * Makefile.in (TEXI_GCCINT_FILES): Add generic.texi and
- gimple.texi.
+ * Makefile.in (TEXI_GCCINT_FILES): Add generic.texi and gimple.texi.
* Makefile.in (TEXI_GCCINT_FILES):
* gimple.c (gimple_copy_call_skip_args): Rename from
giple_copy_call_skip_args. Update all users.
@@ -1254,8 +1755,7 @@
2008-09-18 Alexander Monakov <amonakov@ispras.ru>
PR middle-end/37499
- * sched-int.h (struct _haifa_insn_data): Remove unused field
- ref_count.
+ * sched-int.h (struct _haifa_insn_data): Remove unused field ref_count.
* sched-rgn.c (ref_counts): Remove.
(insn_referenced): New static variable.
@@ -1269,8 +1769,7 @@
* haifa-sched.c (dep_cost_1): Recognize the producer even if the
consumer is an asm. Add comment why this is important.
(choose_ready): Add comment to the "INSN_CODE (insn) >= 0 ||
- recog_memoized (insn) < 0" assert. Put ENABLE_CHECKING around
- it.
+ recog_memoized (insn) < 0" assert. Put ENABLE_CHECKING around it.
2008-09-17 Joseph Myers <joseph@codesourcery.com>
@@ -2579,10 +3078,8 @@
* ira-emit.c (change_loop): Use all_allocnos.
- * ira-build.c (create_loop_tree_nodes, finish_loop_tree_node):
- Ditto.
- (ira_create_allocno): Set up all_allocnos bit for the created
- allocno.
+ * ira-build.c (create_loop_tree_nodes, finish_loop_tree_node): Ditto.
+ (ira_create_allocno): Set up all_allocnos bit for the created allocno.
(create_cap_allocno): Remove setting mentioned_allocnos.
(create_insn_allocnos): Ditto.
(remove_unnecessary_allocnos): Use all_allocnos.
diff --git a/gcc/ChangeLog.sel-sched b/gcc/ChangeLog.sel-sched
index 9429cd47208..9de6a5ad124 100644
--- a/gcc/ChangeLog.sel-sched
+++ b/gcc/ChangeLog.sel-sched
@@ -1,5 +1,11 @@
2008-10-13 Andrey Belevantsev <abel@ispras.ru>
+ Merge with trunk rev. 141085.
+ * config/ia64/ia64.c (ia64_clear_sched_context): Set sc->prev_cycle_state
+ to NULL.
+
+2008-10-13 Andrey Belevantsev <abel@ispras.ru>
+
* config/ia64/ia64.opt (mflag_sched_control_spec): Initialize to 2.
* config/ia64/ia64.c (ia64_set_sched_flags): Fix thinko.
(ia64_reorg): Do not set mflag_sched_control_spec to 1 here...
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index b634bb402d2..5cd4d586113 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20081007
+20081013
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f067a910a26..5cb12414056 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2868,7 +2868,7 @@ reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
$(BASIC_BLOCK_H) $(RECOG_H) output.h $(FUNCTION_H) $(TOPLEV_H) $(TM_P_H) \
addresses.h except.h $(TREE_H) $(REAL_H) $(FLAGS_H) $(MACHMODE_H) \
- $(OBSTACK_H) $(DF_H) $(TARGET_H) dse.h ira.h
+ $(OBSTACK_H) $(DF_H) $(TARGET_H) $(EMIT_RTL_H) ira.h
rtlhooks.o : rtlhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
rtlhooks-def.h $(EXPR_H) $(RECOG_H)
postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
diff --git a/gcc/alias.c b/gcc/alias.c
index 113548942a2..4cadb6b2a27 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1983,34 +1983,6 @@ adjust_offset_for_component_ref (tree x, rtx offset)
return GEN_INT (ioffset);
}
-/* The function returns nonzero if X is an address containg VALUE. */
-static int
-value_addr_p (rtx x)
-{
- if (GET_CODE (x) == VALUE)
- return 1;
- if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 0)) == VALUE)
- return 1;
- return 0;
-}
-
-/* The function returns nonzero if X is a stack address. */
-static int
-stack_addr_p (rtx x)
-{
- if (x == hard_frame_pointer_rtx || x == frame_pointer_rtx
- || x == arg_pointer_rtx || x == stack_pointer_rtx)
- return 1;
- if (GET_CODE (x) == PLUS
- && (XEXP (x, 0) == hard_frame_pointer_rtx
- || XEXP (x, 0) == frame_pointer_rtx
- || XEXP (x, 0) == arg_pointer_rtx
- || XEXP (x, 0) == stack_pointer_rtx)
- && CONSTANT_P (XEXP (x, 1)))
- return 1;
- return 0;
-}
-
/* Return nonzero if we can determine the exprs corresponding to memrefs
X and Y and they do not overlap. */
@@ -2020,27 +1992,9 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y)
tree exprx = MEM_EXPR (x), expry = MEM_EXPR (y);
rtx rtlx, rtly;
rtx basex, basey;
- rtx x_addr, y_addr;
rtx moffsetx, moffsety;
HOST_WIDE_INT offsetx = 0, offsety = 0, sizex, sizey, tem;
- if (flag_ira && optimize && reload_completed)
- {
- /* We need this code for IRA because of stack slot sharing. RTL
- in decl can be different than RTL used in insns. It is a
- safe code although it can be conservative sometime. */
- x_addr = canon_rtx (get_addr (XEXP (x, 0)));
- y_addr = canon_rtx (get_addr (XEXP (y, 0)));
-
- if (value_addr_p (x_addr) || value_addr_p (y_addr))
- return 0;
-
- if (stack_addr_p (x_addr) && stack_addr_p (y_addr)
- && memrefs_conflict_p (SIZE_FOR_MODE (y), y_addr,
- SIZE_FOR_MODE (x), x_addr, 0))
- return 0;
- }
-
/* Unless both have exprs, we can't tell anything. */
if (exprx == 0 || expry == 0)
return 0;
diff --git a/gcc/alloc-pool.c b/gcc/alloc-pool.c
index 7f0dc8ce7d2..f098a84b19c 100644
--- a/gcc/alloc-pool.c
+++ b/gcc/alloc-pool.c
@@ -64,14 +64,25 @@ static ALLOC_POOL_ID_TYPE last_id;
#ifdef GATHER_STATISTICS
-/* Store information about each particular alloc_pool. */
+/* Store information about each particular alloc_pool. Note that this
+ will underestimate the amount the amount of storage used by a small amount:
+ 1) The overhead in a pool is not accounted for.
+ 2) The unallocated elements in a block are not accounted for. Note
+ that this can at worst case be one element smaller that the block
+ size for that pool. */
struct alloc_pool_descriptor
{
const char *name;
- int allocated;
- int created;
- int peak;
- int current;
+ /* Number of pools allocated. */
+ unsigned long created;
+ /* Gross allocated storage. */
+ unsigned long allocated;
+ /* Amount of currently active storage. */
+ unsigned long current;
+ /* Peak amount of storage used. */
+ unsigned long peak;
+ /* Size of element in the pool. */
+ int elt_size;
};
/* Hashtable mapping alloc_pool names to descriptors. */
@@ -150,6 +161,7 @@ create_alloc_pool (const char *name, size_t size, size_t num)
pool->name = /*xstrdup (name)*/name;
#ifdef GATHER_STATISTICS
desc = alloc_pool_descriptor (name);
+ desc->elt_size = size;
desc->created++;
#endif
pool->elt_size = size;
@@ -196,11 +208,11 @@ empty_alloc_pool (alloc_pool pool)
{
next_block = block->next;
free (block);
-#ifdef GATHER_STATISTICS
- desc->current -= pool->block_size;
-#endif
}
+#ifdef GATHER_STATISTICS
+ desc->current -= (pool->elts_allocated - pool->elts_free) * pool->elt_size;
+#endif
pool->returned_free_list = NULL;
pool->virgin_free_list = NULL;
pool->virgin_elts_remaining = 0;
@@ -242,7 +254,10 @@ pool_alloc (alloc_pool pool)
#ifdef GATHER_STATISTICS
struct alloc_pool_descriptor *desc = alloc_pool_descriptor (pool->name);
- desc->allocated+=pool->elt_size;
+ desc->allocated += pool->elt_size;
+ desc->current += pool->elt_size;
+ if (desc->peak < desc->current)
+ desc->peak = desc->current;
#endif
gcc_assert (pool);
@@ -259,11 +274,6 @@ pool_alloc (alloc_pool pool)
block = XNEWVEC (char, pool->block_size);
block_header = (alloc_pool_list) block;
block += align_eight (sizeof (struct alloc_pool_list_def));
-#ifdef GATHER_STATISTICS
- desc->current += pool->block_size;
- if (desc->peak < desc->current)
- desc->peak = desc->current;
-#endif
/* Throw it on the block list. */
block_header->next = pool->block_list;
@@ -314,6 +324,9 @@ void
pool_free (alloc_pool pool, void *ptr)
{
alloc_pool_list header;
+#ifdef GATHER_STATISTICS
+ struct alloc_pool_descriptor *desc = alloc_pool_descriptor (pool->name);
+#endif
gcc_assert (ptr);
@@ -334,6 +347,11 @@ pool_free (alloc_pool pool, void *ptr)
header->next = pool->returned_free_list;
pool->returned_free_list = header;
pool->elts_free++;
+
+#ifdef GATHER_STATISTICS
+ desc->current -= pool->elt_size;
+#endif
+
}
/* Output per-alloc_pool statistics. */
#ifdef GATHER_STATISTICS
@@ -341,8 +359,8 @@ pool_free (alloc_pool pool, void *ptr)
/* Used to accumulate statistics about alloc_pool sizes. */
struct output_info
{
- int count;
- int size;
+ unsigned long total_created;
+ unsigned long total_allocated;
};
/* Called via htab_traverse. Output alloc_pool descriptor pointed out by SLOT
@@ -355,10 +373,12 @@ print_statistics (void **slot, void *b)
if (d->allocated)
{
- fprintf (stderr, "%-21s %6d %10d %10d %10d\n", d->name,
- d->created, d->allocated, d->peak, d->current);
- i->size += d->allocated;
- i->count += d->created;
+ fprintf (stderr, "%-22s %6d %10lu %10lu(%10lu) %10lu(%10lu) %10lu(%10lu)\n", d->name,
+ d->elt_size, d->created, d->allocated, d->allocated / d->elt_size,
+ d->peak, d->peak / d->elt_size,
+ d->current, d->current / d->elt_size);
+ i->total_allocated += d->allocated;
+ i->total_created += d->created;
}
return 1;
}
@@ -374,14 +394,14 @@ dump_alloc_pool_statistics (void)
if (!alloc_pool_hash)
return;
- fprintf (stderr, "\nAlloc-pool Kind Pools Allocated Peak Leak\n");
- fprintf (stderr, "-------------------------------------------------------------\n");
- info.count = 0;
- info.size = 0;
+ fprintf (stderr, "\nAlloc-pool Kind Elt size Pools Allocated (elts) Peak (elts) Leak (elts)\n");
+ fprintf (stderr, "--------------------------------------------------------------------------------------------------------------\n");
+ info.total_created = 0;
+ info.total_allocated = 0;
htab_traverse (alloc_pool_hash, print_statistics, &info);
- fprintf (stderr, "-------------------------------------------------------------\n");
- fprintf (stderr, "%-20s %7d %10d\n",
- "Total", info.count, info.size);
- fprintf (stderr, "-------------------------------------------------------------\n");
+ fprintf (stderr, "--------------------------------------------------------------------------------------------------------------\n");
+ fprintf (stderr, "%-22s %7lu %10lu\n",
+ "Total", info.total_created, info.total_allocated);
+ fprintf (stderr, "--------------------------------------------------------------------------------------------------------------\n");
#endif
}
diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c
index 6db9c7ef1f4..16b708c9252 100644
--- a/gcc/auto-inc-dec.c
+++ b/gcc/auto-inc-dec.c
@@ -1007,7 +1007,7 @@ find_inc (bool first_try)
rtx insn;
basic_block bb = BASIC_BLOCK (BLOCK_NUM (mem_insn.insn));
rtx other_insn;
- struct df_ref **def_rec;
+ df_ref *def_rec;
/* Make sure this reg appears only once in this insn. */
if (count_occurrences (PATTERN (mem_insn.insn), mem_insn.reg0, 1) != 1)
@@ -1053,7 +1053,7 @@ find_inc (bool first_try)
assigned to by the mem insn. */
for (def_rec = DF_INSN_DEFS (mem_insn.insn); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
unsigned int regno = DF_REF_REGNO (def);
if ((regno == REGNO (inc_insn.reg0))
|| (regno == REGNO (inc_insn.reg_res)))
@@ -1454,12 +1454,12 @@ merge_in_block (int max_reg, basic_block bb)
and there is noting to update. */
if (DF_INSN_UID_GET(uid))
{
- struct df_ref **def_rec;
- struct df_ref **use_rec;
+ df_ref *def_rec;
+ df_ref *use_rec;
/* Need to update next use. */
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
reg_next_use[DF_REF_REGNO (def)] = NULL;
reg_next_inc_use[DF_REF_REGNO (def)] = NULL;
reg_next_def[DF_REF_REGNO (def)] = insn;
@@ -1467,7 +1467,7 @@ merge_in_block (int max_reg, basic_block bb)
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
reg_next_use[DF_REF_REGNO (use)] = insn;
if (insn_is_add_or_inc)
reg_next_inc_use[DF_REF_REGNO (use)] = insn;
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index 9b759b00147..f954c9ffa5d 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -129,7 +129,8 @@ struct edge_def GTY(())
/* Auxiliary info specific to a pass. */
PTR GTY ((skip (""))) aux;
- /* Location of any goto implicit in the edge, during tree-ssa. */
+ /* Location of any goto implicit in the edge and associated BLOCK. */
+ tree goto_block;
location_t goto_locus;
/* The index number corresponding to this edge in the edge vector
diff --git a/gcc/builtins.c b/gcc/builtins.c
index ea1a16d9bdd..85d61b5681c 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -231,13 +231,11 @@ static tree do_mpfr_arg2 (tree, tree, tree,
static tree do_mpfr_arg3 (tree, tree, tree, tree,
int (*)(mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr, mp_rnd_t));
static tree do_mpfr_sincos (tree, tree, tree);
-#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
static tree do_mpfr_bessel_n (tree, tree, tree,
int (*)(mpfr_ptr, long, mpfr_srcptr, mp_rnd_t),
const REAL_VALUE_TYPE *, bool);
static tree do_mpfr_remquo (tree, tree, tree);
static tree do_mpfr_lgamma_r (tree, tree, tree);
-#endif
/* Return true if NODE should be considered for inline expansion regardless
of the optimization level. This means whenever a function is invoked with
@@ -253,6 +251,82 @@ static bool called_as_built_in (tree node)
return false;
}
+/* Return the alignment in bits of EXP, an object.
+ Don't return more than MAX_ALIGN no matter what, ALIGN is the inital
+ guessed alignment e.g. from type alignment. */
+
+int
+get_object_alignment (tree exp, unsigned int align, unsigned int max_align)
+{
+ unsigned int inner;
+
+ inner = max_align;
+ if (handled_component_p (exp))
+ {
+ HOST_WIDE_INT bitsize, bitpos;
+ tree offset;
+ enum machine_mode mode;
+ int unsignedp, volatilep;
+
+ exp = get_inner_reference (exp, &bitsize, &bitpos, &offset,
+ &mode, &unsignedp, &volatilep, true);
+ if (bitpos)
+ inner = MIN (inner, (unsigned) (bitpos & -bitpos));
+ while (offset)
+ {
+ tree next_offset;
+
+ if (TREE_CODE (offset) == PLUS_EXPR)
+ {
+ next_offset = TREE_OPERAND (offset, 0);
+ offset = TREE_OPERAND (offset, 1);
+ }
+ else
+ next_offset = NULL;
+ if (host_integerp (offset, 1))
+ {
+ /* Any overflow in calculating offset_bits won't change
+ the alignment. */
+ unsigned offset_bits
+ = ((unsigned) tree_low_cst (offset, 1) * BITS_PER_UNIT);
+
+ if (offset_bits)
+ inner = MIN (inner, (offset_bits & -offset_bits));
+ }
+ else if (TREE_CODE (offset) == MULT_EXPR
+ && host_integerp (TREE_OPERAND (offset, 1), 1))
+ {
+ /* Any overflow in calculating offset_factor won't change
+ the alignment. */
+ unsigned offset_factor
+ = ((unsigned) tree_low_cst (TREE_OPERAND (offset, 1), 1)
+ * BITS_PER_UNIT);
+
+ if (offset_factor)
+ inner = MIN (inner, (offset_factor & -offset_factor));
+ }
+ else
+ {
+ inner = MIN (inner, BITS_PER_UNIT);
+ break;
+ }
+ offset = next_offset;
+ }
+ }
+ if (DECL_P (exp))
+ align = MIN (inner, DECL_ALIGN (exp));
+#ifdef CONSTANT_ALIGNMENT
+ else if (CONSTANT_CLASS_P (exp))
+ align = MIN (inner, (unsigned)CONSTANT_ALIGNMENT (exp, align));
+#endif
+ else if (TREE_CODE (exp) == VIEW_CONVERT_EXPR
+ || TREE_CODE (exp) == INDIRECT_REF)
+ align = MIN (TYPE_ALIGN (TREE_TYPE (exp)), inner);
+ else
+ align = MIN (align, inner);
+ return MIN (align, max_align);
+}
+
/* Return the alignment in bits of EXP, a pointer valued expression.
But don't return more than MAX_ALIGN no matter what.
The alignment returned is, by default, the alignment of the thing that
@@ -306,59 +380,7 @@ get_pointer_alignment (tree exp, unsigned int max_align)
case ADDR_EXPR:
/* See what we are pointing at and look at its alignment. */
- exp = TREE_OPERAND (exp, 0);
- inner = max_align;
- if (handled_component_p (exp))
- {
- HOST_WIDE_INT bitsize, bitpos;
- tree offset;
- enum machine_mode mode;
- int unsignedp, volatilep;
-
- exp = get_inner_reference (exp, &bitsize, &bitpos, &offset,
- &mode, &unsignedp, &volatilep, true);
- if (bitpos)
- inner = MIN (inner, (unsigned) (bitpos & -bitpos));
- if (offset && TREE_CODE (offset) == PLUS_EXPR
- && host_integerp (TREE_OPERAND (offset, 1), 1))
- {
- /* Any overflow in calculating offset_bits won't change
- the alignment. */
- unsigned offset_bits
- = ((unsigned) tree_low_cst (TREE_OPERAND (offset, 1), 1)
- * BITS_PER_UNIT);
-
- if (offset_bits)
- inner = MIN (inner, (offset_bits & -offset_bits));
- offset = TREE_OPERAND (offset, 0);
- }
- if (offset && TREE_CODE (offset) == MULT_EXPR
- && host_integerp (TREE_OPERAND (offset, 1), 1))
- {
- /* Any overflow in calculating offset_factor won't change
- the alignment. */
- unsigned offset_factor
- = ((unsigned) tree_low_cst (TREE_OPERAND (offset, 1), 1)
- * BITS_PER_UNIT);
-
- if (offset_factor)
- inner = MIN (inner, (offset_factor & -offset_factor));
- }
- else if (offset)
- inner = MIN (inner, BITS_PER_UNIT);
- }
- if (DECL_P (exp))
- align = MIN (inner, DECL_ALIGN (exp));
-#ifdef CONSTANT_ALIGNMENT
- else if (CONSTANT_CLASS_P (exp))
- align = MIN (inner, (unsigned)CONSTANT_ALIGNMENT (exp, align));
-#endif
- else if (TREE_CODE (exp) == VIEW_CONVERT_EXPR
- || TREE_CODE (exp) == INDIRECT_REF)
- align = MIN (TYPE_ALIGN (TREE_TYPE (exp)), inner);
- else
- align = MIN (align, inner);
- return MIN (align, max_align);
+ return get_object_alignment (TREE_OPERAND (exp, 0), align, max_align);
default:
return align;
@@ -10116,7 +10138,6 @@ fold_builtin_1 (tree fndecl, tree arg0, bool ignore)
&dconstm1, NULL, false);
break;
-#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
CASE_FLT_FN (BUILT_IN_J0):
if (validate_arg (arg0, REAL_TYPE))
return do_mpfr_arg1 (arg0, type, mpfr_j0,
@@ -10140,7 +10161,6 @@ fold_builtin_1 (tree fndecl, tree arg0, bool ignore)
return do_mpfr_arg1 (arg0, type, mpfr_y1,
&dconst0, NULL, false);
break;
-#endif
CASE_FLT_FN (BUILT_IN_NAN):
case BUILT_IN_NAND32:
@@ -10256,7 +10276,6 @@ fold_builtin_2 (tree fndecl, tree arg0, tree arg1, bool ignore)
switch (fcode)
{
-#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
CASE_FLT_FN (BUILT_IN_JN):
if (validate_arg (arg0, INTEGER_TYPE)
&& validate_arg (arg1, REAL_TYPE))
@@ -10283,7 +10302,6 @@ fold_builtin_2 (tree fndecl, tree arg0, tree arg1, bool ignore)
&& validate_arg(arg1, POINTER_TYPE))
return do_mpfr_lgamma_r (arg0, arg1, type);
break;
-#endif
CASE_FLT_FN (BUILT_IN_ATAN2):
if (validate_arg (arg0, REAL_TYPE)
@@ -10440,14 +10458,12 @@ fold_builtin_3 (tree fndecl, tree arg0, tree arg1, tree arg2, bool ignore)
return do_mpfr_arg3 (arg0, arg1, arg2, type, mpfr_fma);
break;
-#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
CASE_FLT_FN (BUILT_IN_REMQUO):
if (validate_arg (arg0, REAL_TYPE)
&& validate_arg(arg1, REAL_TYPE)
&& validate_arg(arg2, POINTER_TYPE))
return do_mpfr_remquo (arg0, arg1, arg2);
break;
-#endif
case BUILT_IN_MEMSET:
return fold_builtin_memset (arg0, arg1, arg2, type, ignore);
@@ -13058,7 +13074,6 @@ do_mpfr_sincos (tree arg, tree arg_sinp, tree arg_cosp)
return result;
}
-#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
/* If argument ARG1 is an INTEGER_CST and ARG2 is a REAL_CST, call the
two-argument mpfr order N Bessel function FUNC on them and return
the resulting value as a tree with type TYPE. The mpfr precision
@@ -13243,7 +13258,6 @@ do_mpfr_lgamma_r (tree arg, tree arg_sg, tree type)
return result;
}
-#endif
/* FIXME tuples.
The functions below provide an alternate interface for folding
diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c
index 342848acd29..5b309343361 100644
--- a/gcc/c-gimplify.c
+++ b/gcc/c-gimplify.c
@@ -2,7 +2,8 @@
by the C-based front ends. The structure of gimplified, or
language-independent, trees is dictated by the grammar described in this
file.
- Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008
+ Free Software Foundation, Inc.
Lowering of expressions contributed by Sebastian Pop <s.pop@laposte.net>
Re-written to support lowering of whole function trees, documentation
and miscellaneous cleanups by Diego Novillo <dnovillo@redhat.com>
@@ -87,7 +88,8 @@ c_genericize (tree fndecl)
fprintf (dump_orig, "\n;; Function %s",
lang_hooks.decl_printable_name (fndecl, 2));
fprintf (dump_orig, " (%s)\n",
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)));
+ (!DECL_ASSEMBLER_NAME_SET_P (fndecl) ? "null"
+ : IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl))));
fprintf (dump_orig, ";; enabled by -%s\n", dump_flag_name (TDI_original));
fprintf (dump_orig, "\n");
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index a778e28e386..190bde66848 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -429,7 +429,7 @@ try_forward_edges (int mode, basic_block b)
for (ei = ei_start (b->succs); (e = ei_safe_edge (ei)); )
{
basic_block target, first;
- int counter;
+ int counter, goto_locus;
bool threaded = false;
int nthreaded_edges = 0;
bool may_thread = first_pass | df_get_bb_dirty (b);
@@ -447,6 +447,7 @@ try_forward_edges (int mode, basic_block b)
target = first = e->dest;
counter = NUM_FIXED_BLOCKS;
+ goto_locus = e->goto_locus;
/* If we are partitioning hot/cold basic_blocks, we don't want to mess
up jumps that cross between hot/cold sections.
@@ -476,6 +477,28 @@ try_forward_edges (int mode, basic_block b)
new_target = single_succ (target);
if (target == new_target)
counter = n_basic_blocks;
+ else if (!optimize)
+ {
+ /* When not optimizing, ensure that edges or forwarder
+ blocks with different locus are not optimized out. */
+ int locus = single_succ_edge (target)->goto_locus;
+
+ if (locus && goto_locus && !locator_eq (locus, goto_locus))
+ counter = n_basic_blocks;
+ else if (locus)
+ goto_locus = locus;
+
+ if (INSN_P (BB_END (target)))
+ {
+ locus = INSN_LOCATOR (BB_END (target));
+
+ if (locus && goto_locus
+ && !locator_eq (locus, goto_locus))
+ counter = n_basic_blocks;
+ else if (locus)
+ goto_locus = locus;
+ }
+ }
}
/* Allow to thread only over one edge at time to simplify updating
@@ -539,6 +562,8 @@ try_forward_edges (int mode, basic_block b)
int edge_frequency;
int n = 0;
+ e->goto_locus = goto_locus;
+
/* Don't force if target is exit block. */
if (threaded && target != EXIT_BLOCK_PTR)
{
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 06111cc85df..6eaec30c98f 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1666,7 +1666,12 @@ expand_gimple_cond (basic_block bb, gimple stmt)
add_reg_br_prob_note (last, true_edge->probability);
maybe_dump_rtl_for_gimple_stmt (stmt, last);
if (true_edge->goto_locus)
- set_curr_insn_source_location (true_edge->goto_locus);
+ {
+ set_curr_insn_source_location (true_edge->goto_locus);
+ set_curr_insn_block (true_edge->goto_block);
+ true_edge->goto_locus = curr_insn_locator ();
+ }
+ true_edge->goto_block = NULL;
false_edge->flags |= EDGE_FALLTHRU;
ggc_free (pred);
return NULL;
@@ -1677,7 +1682,12 @@ expand_gimple_cond (basic_block bb, gimple stmt)
add_reg_br_prob_note (last, false_edge->probability);
maybe_dump_rtl_for_gimple_stmt (stmt, last);
if (false_edge->goto_locus)
- set_curr_insn_source_location (false_edge->goto_locus);
+ {
+ set_curr_insn_source_location (false_edge->goto_locus);
+ set_curr_insn_block (false_edge->goto_block);
+ false_edge->goto_locus = curr_insn_locator ();
+ }
+ false_edge->goto_block = NULL;
true_edge->flags |= EDGE_FALLTHRU;
ggc_free (pred);
return NULL;
@@ -1686,6 +1696,13 @@ expand_gimple_cond (basic_block bb, gimple stmt)
jumpif (pred, label_rtx_for_bb (true_edge->dest));
add_reg_br_prob_note (last, true_edge->probability);
last = get_last_insn ();
+ if (false_edge->goto_locus)
+ {
+ set_curr_insn_source_location (false_edge->goto_locus);
+ set_curr_insn_block (false_edge->goto_block);
+ false_edge->goto_locus = curr_insn_locator ();
+ }
+ false_edge->goto_block = NULL;
emit_jump (label_rtx_for_bb (false_edge->dest));
BB_END (bb) = last;
@@ -1708,8 +1725,13 @@ expand_gimple_cond (basic_block bb, gimple stmt)
maybe_dump_rtl_for_gimple_stmt (stmt, last2);
- if (false_edge->goto_locus)
- set_curr_insn_source_location (false_edge->goto_locus);
+ if (true_edge->goto_locus)
+ {
+ set_curr_insn_source_location (true_edge->goto_locus);
+ set_curr_insn_block (true_edge->goto_block);
+ true_edge->goto_locus = curr_insn_locator ();
+ }
+ true_edge->goto_block = NULL;
ggc_free (pred);
return new_bb;
@@ -1962,19 +1984,21 @@ expand_gimple_basic_block (basic_block bb)
}
}
- /* Expand implicit goto. */
+ /* Expand implicit goto and convert goto_locus. */
FOR_EACH_EDGE (e, ei, bb->succs)
{
- if (e->flags & EDGE_FALLTHRU)
- break;
- }
-
- if (e && e->dest != bb->next_bb)
- {
- emit_jump (label_rtx_for_bb (e->dest));
- if (e->goto_locus)
- set_curr_insn_source_location (e->goto_locus);
- e->flags &= ~EDGE_FALLTHRU;
+ if (e->goto_locus && e->goto_block)
+ {
+ set_curr_insn_source_location (e->goto_locus);
+ set_curr_insn_block (e->goto_block);
+ e->goto_locus = curr_insn_locator ();
+ }
+ e->goto_block = NULL;
+ if ((e->flags & EDGE_FALLTHRU) && e->dest != bb->next_bb)
+ {
+ emit_jump (label_rtx_for_bb (e->dest));
+ e->flags &= ~EDGE_FALLTHRU;
+ }
}
do_pending_stack_adjust ();
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index b4ca49f4324..05e355d411f 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -448,13 +448,12 @@ change_scope (rtx orig_insn, tree s1, tree s2)
}
}
-/* Return lexical scope block insn belong to. */
+/* Return lexical scope block locator belongs to. */
static tree
-insn_scope (const_rtx insn)
+locator_scope (int loc)
{
int max = VEC_length (int, block_locators_locs);
int min = 0;
- int loc = INSN_LOCATOR (insn);
/* When block_locators_locs was initialized, the pro- and epilogue
insns didn't exist yet and can therefore not be found this way.
@@ -488,6 +487,13 @@ insn_scope (const_rtx insn)
return VEC_index (tree, block_locators_blocks, min);
}
+/* Return lexical scope block insn belongs to. */
+static tree
+insn_scope (const_rtx insn)
+{
+ return locator_scope (INSN_LOCATOR (insn));
+}
+
/* Return line number of the statement specified by the locator. */
static location_t
locator_location (int loc)
@@ -551,6 +557,17 @@ insn_file (const_rtx insn)
return locator_file (INSN_LOCATOR (insn));
}
+/* Return true if LOC1 and LOC2 locators have the same location and scope. */
+bool
+locator_eq (int loc1, int loc2)
+{
+ if (loc1 == loc2)
+ return true;
+ if (locator_location (loc1) != locator_location (loc2))
+ return false;
+ return locator_scope (loc1) == locator_scope (loc2);
+}
+
/* Rebuild all the NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes based
on the scope tree and the newly reordered instructions. */
@@ -887,6 +904,52 @@ fixup_reorder_chain (void)
if (e && !can_fallthru (e->src, e->dest))
force_nonfallthru (e);
}
+
+ /* Ensure goto_locus from edges has some instructions with that locus
+ in RTL. */
+ if (!optimize)
+ FOR_EACH_BB (bb)
+ {
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (e->goto_locus && !(e->flags & EDGE_ABNORMAL))
+ {
+ basic_block nb;
+ rtx end;
+
+ insn = BB_END (e->src);
+ end = PREV_INSN (BB_HEAD (e->src));
+ while (insn != end
+ && (!INSN_P (insn) || INSN_LOCATOR (insn) == 0))
+ insn = PREV_INSN (insn);
+ if (insn != end
+ && locator_eq (INSN_LOCATOR (insn), (int) e->goto_locus))
+ continue;
+ if (simplejump_p (BB_END (e->src))
+ && INSN_LOCATOR (BB_END (e->src)) == 0)
+ {
+ INSN_LOCATOR (BB_END (e->src)) = e->goto_locus;
+ continue;
+ }
+ if (e->dest != EXIT_BLOCK_PTR)
+ {
+ insn = BB_HEAD (e->dest);
+ end = NEXT_INSN (BB_END (e->dest));
+ while (insn != end && !INSN_P (insn))
+ insn = NEXT_INSN (insn);
+ if (insn != end && INSN_LOCATOR (insn)
+ && locator_eq (INSN_LOCATOR (insn), (int) e->goto_locus))
+ continue;
+ }
+ nb = split_edge (e);
+ if (!INSN_P (BB_END (nb)))
+ BB_END (nb) = emit_insn_after_noloc (gen_nop (), BB_END (nb),
+ nb);
+ INSN_LOCATOR (BB_END (nb)) = e->goto_locus;
+ }
+ }
}
/* Perform sanity checks on the insn chain.
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index f9e3e17e1a7..a7dc5076865 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -1009,6 +1009,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target)
rtx note;
edge new_edge;
int abnormal_edge_flags = 0;
+ int loc;
/* In the case the last instruction is conditional jump to the next
instruction, first redirect the jump itself and then continue
@@ -1127,11 +1128,15 @@ force_nonfallthru_and_redirect (edge e, basic_block target)
else
jump_block = e->src;
+ if (e->goto_locus && e->goto_block == NULL)
+ loc = e->goto_locus;
+ else
+ loc = 0;
e->flags &= ~EDGE_FALLTHRU;
if (target == EXIT_BLOCK_PTR)
{
#ifdef HAVE_return
- emit_jump_insn_after_noloc (gen_return (), BB_END (jump_block));
+ emit_jump_insn_after_setloc (gen_return (), BB_END (jump_block), loc);
#else
gcc_unreachable ();
#endif
@@ -1139,7 +1144,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target)
else
{
rtx label = block_label (target);
- emit_jump_insn_after_noloc (gen_jump (label), BB_END (jump_block));
+ emit_jump_insn_after_setloc (gen_jump (label), BB_END (jump_block), loc);
JUMP_LABEL (BB_END (jump_block)) = label;
LABEL_NUSES (label)++;
}
@@ -2606,6 +2611,34 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
try_redirect_by_replacing_jump (EDGE_SUCC (a, 0), b, true);
gcc_assert (!JUMP_P (BB_END (a)));
+ /* When not optimizing and the edge is the only place in RTL which holds
+ some unique locus, emit a nop with that locus in between. */
+ if (!optimize && EDGE_SUCC (a, 0)->goto_locus)
+ {
+ rtx insn = BB_END (a), end = PREV_INSN (BB_HEAD (a));
+ int goto_locus = EDGE_SUCC (a, 0)->goto_locus;
+
+ while (insn != end && (!INSN_P (insn) || INSN_LOCATOR (insn) == 0))
+ insn = PREV_INSN (insn);
+ if (insn != end && locator_eq (INSN_LOCATOR (insn), goto_locus))
+ goto_locus = 0;
+ else
+ {
+ insn = BB_HEAD (b);
+ end = NEXT_INSN (BB_END (b));
+ while (insn != end && !INSN_P (insn))
+ insn = NEXT_INSN (insn);
+ if (insn != end && INSN_LOCATOR (insn) != 0
+ && locator_eq (INSN_LOCATOR (insn), goto_locus))
+ goto_locus = 0;
+ }
+ if (goto_locus)
+ {
+ BB_END (a) = emit_insn_after_noloc (gen_nop (), BB_END (a), a);
+ INSN_LOCATOR (BB_END (a)) = goto_locus;
+ }
+ }
+
/* Possible line number notes should appear in between. */
if (b->il.rtl->header)
{
diff --git a/gcc/combine.c b/gcc/combine.c
index 5358cfb7980..5821301d72c 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -900,7 +900,7 @@ create_log_links (void)
{
basic_block bb;
rtx *next_use, insn;
- struct df_ref **def_vec, **use_vec;
+ df_ref *def_vec, *use_vec;
next_use = XCNEWVEC (rtx, max_reg_num ());
@@ -925,7 +925,7 @@ create_log_links (void)
for (def_vec = DF_INSN_DEFS (insn); *def_vec; def_vec++)
{
- struct df_ref *def = *def_vec;
+ df_ref def = *def_vec;
int regno = DF_REF_REGNO (def);
rtx use_insn;
@@ -979,7 +979,7 @@ create_log_links (void)
for (use_vec = DF_INSN_USES (insn); *use_vec; use_vec++)
{
- struct df_ref *use = *use_vec;
+ df_ref use = *use_vec;
int regno = DF_REF_REGNO (use);
/* Do not consider the usage of the stack pointer
diff --git a/gcc/config.gcc b/gcc/config.gcc
index e3d170aad95..8844539b74b 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1899,6 +1899,11 @@ powerpcle-*-eabi*)
tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
extra_options="${extra_options} rs6000/sysv4.opt"
;;
+powerpc-xilinx-eabi*)
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/singlefp.h rs6000/xfpu.h"
+ extra_options="${extra_options} rs6000/sysv4.opt"
+ tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm"
+ ;;
rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*)
tm_file="${tm_file} rs6000/aix.h rs6000/aix41.h rs6000/xcoff.h"
tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-newas"
diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h
index 38be1da261a..c8cdc3db087 100644
--- a/gcc/config/arm/bpabi.h
+++ b/gcc/config/arm/bpabi.h
@@ -147,3 +147,20 @@
#undef FINI_SECTION_ASM_OP
#define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP
#define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP
+
+/* The legacy _mcount implementation assumes r11 points to a
+ 4-word APCS frame. This is generally not true for EABI targets,
+ particularly not in Thumb mode. We assume the mcount
+ implementation does not require a counter variable (No Counter).
+ Note that __gnu_mcount_nc will be entered with a misaligned stack.
+ This is OK because it uses a special calling convention anyway. */
+
+#undef ARM_FUNCTION_PROFILER
+#define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
+{ \
+ fprintf (STREAM, "\tpush\t{lr}\n"); \
+ fprintf (STREAM, "\tbl\t__gnu_mcount_nc\n"); \
+}
+
+#undef SUBTARGET_FRAME_POINTER_REQUIRED
+#define SUBTARGET_FRAME_POINTER_REQUIRED 0
diff --git a/gcc/config/i386/cpuid.h b/gcc/config/i386/cpuid.h
index 90a28137afb..69d25a2fe1d 100644
--- a/gcc/config/i386/cpuid.h
+++ b/gcc/config/i386/cpuid.h
@@ -74,6 +74,13 @@
"xchg{l}\t{%%}ebx, %1\n\t" \
: "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
: "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("xchg{l}\t{%%}ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchg{l}\t{%%}ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
#else
/* Host GCCs older than 3.0 weren't supporting Intel asm syntax
nor alternatives in i386 code. */
@@ -83,12 +90,24 @@
"xchgl\t%%ebx, %1\n\t" \
: "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
: "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("xchgl\t%%ebx, %1\n\t" \
+ "cpuid\n\t" \
+ "xchgl\t%%ebx, %1\n\t" \
+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
#endif
#else
#define __cpuid(level, a, b, c, d) \
__asm__ ("cpuid\n\t" \
: "=a" (a), "=b" (b), "=c" (c), "=d" (d) \
: "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("cpuid\n\t" \
+ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
#endif
/* Return highest supported input value for cpuid instruction. ext can
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 013fe93b631..29b040598c5 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -1,5 +1,5 @@
/* Subroutines for the gcc driver.
- Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,34 +28,45 @@ const char *host_detect_local_cpu (int argc, const char **argv);
#ifdef __GNUC__
#include "cpuid.h"
-/* Returns parameters that describe L1_ASSOC associative cache of size
- L1_SIZEKB with lines of size L1_LINE. */
+struct cache_desc
+{
+ unsigned sizekb;
+ unsigned assoc;
+ unsigned line;
+};
+
+/* Returns command line parameters that describe size and
+ cache line size of the processor caches. */
static char *
-describe_cache (unsigned l1_sizekb, unsigned l1_line,
- unsigned l1_assoc ATTRIBUTE_UNUSED, unsigned l2_sizekb)
+describe_cache (struct cache_desc level1, struct cache_desc level2)
{
char size[100], line[100], size2[100];
- /* At the moment, gcc middle-end does not use the information about the
- associativity of the cache. */
+ /* At the moment, gcc does not use the information
+ about the associativity of the cache. */
+
+ sprintf (size, "--param l1-cache-size=%u", level1.sizekb);
+ sprintf (line, "--param l1-cache-line-size=%u", level1.line);
- sprintf (size, "--param l1-cache-size=%u", l1_sizekb);
- sprintf (line, "--param l1-cache-line-size=%u", l1_line);
- sprintf (size2, "--param l2-cache-size=%u", l2_sizekb);
+ sprintf (size2, "--param l2-cache-size=%u", level2.sizekb);
return concat (size, " ", line, " ", size2, " ", NULL);
}
+/* Detect L2 cache parameters using CPUID extended function 0x80000006. */
+
static void
-decode_l2_cache (unsigned *l2_size, unsigned *l2_line, unsigned *l2_assoc)
+detect_l2_cache (struct cache_desc *level2)
{
- unsigned eax, ebx, ecx, edx, assoc;
+ unsigned eax, ebx, ecx, edx;
+ unsigned assoc;
__cpuid (0x80000006, eax, ebx, ecx, edx);
- *l2_size = (ecx >> 16) & 0xffff;
- *l2_line = ecx & 0xff;
+ level2->sizekb = (ecx >> 16) & 0xffff;
+ level2->line = ecx & 0xff;
+
assoc = (ecx >> 12) & 0xf;
if (assoc == 6)
assoc = 8;
@@ -65,7 +76,8 @@ decode_l2_cache (unsigned *l2_size, unsigned *l2_line, unsigned *l2_assoc)
assoc = 32 + (assoc - 0xa) * 16;
else if (assoc >= 0xd && assoc <= 0xe)
assoc = 96 + (assoc - 0xd) * 32;
- *l2_assoc = assoc;
+
+ level2->assoc = assoc;
}
/* Returns the description of caches for an AMD processor. */
@@ -74,243 +86,251 @@ static const char *
detect_caches_amd (unsigned max_ext_level)
{
unsigned eax, ebx, ecx, edx;
- unsigned l1_sizekb, l1_line, l1_assoc;
- unsigned l2_sizekb = 0, l2_line = 0, l2_assoc = 0;
+
+ struct cache_desc level1, level2 = {0, 0, 0};
if (max_ext_level < 0x80000005)
return "";
__cpuid (0x80000005, eax, ebx, ecx, edx);
- l1_line = ecx & 0xff;
- l1_sizekb = (ecx >> 24) & 0xff;
- l1_assoc = (ecx >> 16) & 0xff;
+ level1.sizekb = (ecx >> 24) & 0xff;
+ level1.assoc = (ecx >> 16) & 0xff;
+ level1.line = ecx & 0xff;
if (max_ext_level >= 0x80000006)
- decode_l2_cache (&l2_sizekb, &l2_line, &l2_assoc);
+ detect_l2_cache (&level2);
- return describe_cache (l1_sizekb, l1_line, l1_assoc, l2_sizekb);
+ return describe_cache (level1, level2);
}
-/* Stores the size of the L1/2 cache and cache line, and the associativity
- of the cache according to REG to L1_SIZEKB, L1_LINE, L1_ASSOC and
- L2_SIZEKB. */
+/* Decodes the size, the associativity and the cache line size of
+ L1/L2 caches of an Intel processor. Values are based on
+ "Intel Processor Identification and the CPUID Instruction"
+ [Application Note 485], revision -032, December 2007. */
static void
-decode_caches_intel (unsigned reg, unsigned *l1_sizekb, unsigned *l1_line,
- unsigned *l1_assoc, unsigned *l2_sizekb,
- unsigned *l2_line, unsigned *l2_assoc)
+decode_caches_intel (unsigned reg, bool xeon_mp,
+ struct cache_desc *level1, struct cache_desc *level2)
{
- unsigned i, val;
+ int i;
+
+ for (i = 24; i >= 0; i -= 8)
+ switch ((reg >> i) & 0xff)
+ {
+ case 0x0a:
+ level1->sizekb = 8; level1->assoc = 2; level1->line = 32;
+ break;
+ case 0x0c:
+ level1->sizekb = 16; level1->assoc = 4; level1->line = 32;
+ break;
+ case 0x2c:
+ level1->sizekb = 32; level1->assoc = 8; level1->line = 64;
+ break;
+ case 0x39:
+ level2->sizekb = 128; level2->assoc = 4; level2->line = 64;
+ break;
+ case 0x3a:
+ level2->sizekb = 192; level2->assoc = 6; level2->line = 64;
+ break;
+ case 0x3b:
+ level2->sizekb = 128; level2->assoc = 2; level2->line = 64;
+ break;
+ case 0x3c:
+ level2->sizekb = 256; level2->assoc = 4; level2->line = 64;
+ break;
+ case 0x3d:
+ level2->sizekb = 384; level2->assoc = 6; level2->line = 64;
+ break;
+ case 0x3e:
+ level2->sizekb = 512; level2->assoc = 4; level2->line = 64;
+ break;
+ case 0x41:
+ level2->sizekb = 128; level2->assoc = 4; level2->line = 32;
+ break;
+ case 0x42:
+ level2->sizekb = 256; level2->assoc = 4; level2->line = 32;
+ break;
+ case 0x43:
+ level2->sizekb = 512; level2->assoc = 4; level2->line = 32;
+ break;
+ case 0x44:
+ level2->sizekb = 1024; level2->assoc = 4; level2->line = 32;
+ break;
+ case 0x45:
+ level2->sizekb = 2048; level2->assoc = 4; level2->line = 32;
+ break;
+ case 0x49:
+ if (xeon_mp)
+ break;
+ level2->sizekb = 4096; level2->assoc = 16; level2->line = 64;
+ break;
+ case 0x4e:
+ level2->sizekb = 6144; level2->assoc = 24; level2->line = 64;
+ break;
+ case 0x60:
+ level1->sizekb = 16; level1->assoc = 8; level1->line = 64;
+ break;
+ case 0x66:
+ level1->sizekb = 8; level1->assoc = 4; level1->line = 64;
+ break;
+ case 0x67:
+ level1->sizekb = 16; level1->assoc = 4; level1->line = 64;
+ break;
+ case 0x68:
+ level1->sizekb = 32; level1->assoc = 4; level1->line = 64;
+ break;
+ case 0x78:
+ level2->sizekb = 1024; level2->assoc = 4; level2->line = 64;
+ break;
+ case 0x79:
+ level2->sizekb = 128; level2->assoc = 8; level2->line = 64;
+ break;
+ case 0x7a:
+ level2->sizekb = 256; level2->assoc = 8; level2->line = 64;
+ break;
+ case 0x7b:
+ level2->sizekb = 512; level2->assoc = 8; level2->line = 64;
+ break;
+ case 0x7c:
+ level2->sizekb = 1024; level2->assoc = 8; level2->line = 64;
+ break;
+ case 0x7d:
+ level2->sizekb = 2048; level2->assoc = 8; level2->line = 64;
+ break;
+ case 0x7f:
+ level2->sizekb = 512; level2->assoc = 2; level2->line = 64;
+ break;
+ case 0x82:
+ level2->sizekb = 256; level2->assoc = 8; level2->line = 32;
+ break;
+ case 0x83:
+ level2->sizekb = 512; level2->assoc = 8; level2->line = 32;
+ break;
+ case 0x84:
+ level2->sizekb = 1024; level2->assoc = 8; level2->line = 32;
+ break;
+ case 0x85:
+ level2->sizekb = 2048; level2->assoc = 8; level2->line = 32;
+ break;
+ case 0x86:
+ level2->sizekb = 512; level2->assoc = 4; level2->line = 64;
+ break;
+ case 0x87:
+ level2->sizekb = 1024; level2->assoc = 8; level2->line = 64;
+
+ default:
+ break;
+ }
+}
- if (((reg >> 31) & 1) != 0)
- return;
+/* Detect cache parameters using CPUID function 2. */
- for (i = 0; i < 4; i++)
+static void
+detect_caches_cpuid2 (bool xeon_mp,
+ struct cache_desc *level1, struct cache_desc *level2)
+{
+ unsigned regs[4];
+ int nreps, i;
+
+ __cpuid (2, regs[0], regs[1], regs[2], regs[3]);
+
+ nreps = regs[0] & 0x0f;
+ regs[0] &= ~0x0f;
+
+ while (--nreps >= 0)
{
- val = reg & 0xff;
- reg >>= 8;
+ for (i = 0; i < 4; i++)
+ if (regs[i] && !((regs[i] >> 31) & 1))
+ decode_caches_intel (regs[i], xeon_mp, level1, level2);
- switch (val)
- {
- case 0xa:
- *l1_sizekb = 8;
- *l1_line = 32;
- *l1_assoc = 2;
- break;
- case 0xc:
- *l1_sizekb = 16;
- *l1_line = 32;
- *l1_assoc = 4;
- break;
- case 0x2c:
- *l1_sizekb = 32;
- *l1_line = 64;
- *l1_assoc = 8;
- break;
- case 0x39:
- *l2_sizekb = 128;
- *l2_line = 64;
- *l2_assoc = 4;
- break;
- case 0x3a:
- *l2_sizekb = 192;
- *l2_line = 64;
- *l2_assoc = 6;
- break;
- case 0x3b:
- *l2_sizekb = 128;
- *l2_line = 64;
- *l2_assoc = 2;
- break;
- case 0x3c:
- *l2_sizekb = 256;
- *l2_line = 64;
- *l2_assoc = 4;
- break;
- case 0x3d:
- *l2_sizekb = 384;
- *l2_line = 64;
- *l2_assoc = 6;
- break;
- case 0x3e:
- *l2_sizekb = 512;
- *l2_line = 64;
- *l2_assoc = 4;
- break;
- case 0x41:
- *l2_sizekb = 128;
- *l2_line = 32;
- *l2_assoc = 4;
- break;
- case 0x42:
- *l2_sizekb = 256;
- *l2_line = 32;
- *l2_assoc = 4;
- break;
- case 0x43:
- *l2_sizekb = 512;
- *l2_line = 32;
- *l2_assoc = 4;
- break;
- case 0x44:
- *l2_sizekb = 1024;
- *l2_line = 32;
- *l2_assoc = 4;
- break;
- case 0x45:
- *l2_sizekb = 2048;
- *l2_line = 32;
- *l2_assoc = 4;
- break;
- case 0x49:
- *l2_sizekb = 4096;
- *l2_line = 64;
- *l2_assoc = 16;
- break;
- case 0x60:
- *l1_sizekb = 16;
- *l1_line = 64;
- *l1_assoc = 8;
- break;
- case 0x66:
- *l1_sizekb = 8;
- *l1_line = 64;
- *l1_assoc = 4;
- break;
- case 0x67:
- *l1_sizekb = 16;
- *l1_line = 64;
- *l1_assoc = 4;
- break;
- case 0x68:
- *l1_sizekb = 32;
- *l1_line = 64;
- *l1_assoc = 4;
- break;
- case 0x78:
- *l2_sizekb = 1024;
- *l2_line = 64;
- *l2_assoc = 4;
- break;
- case 0x79:
- *l2_sizekb = 128;
- *l2_line = 64;
- *l2_assoc = 8;
- break;
- case 0x7a:
- *l2_sizekb = 256;
- *l2_line = 64;
- *l2_assoc = 8;
- break;
- case 0x7b:
- *l2_sizekb = 512;
- *l2_line = 64;
- *l2_assoc = 8;
- break;
- case 0x7c:
- *l2_sizekb = 1024;
- *l2_line = 64;
- *l2_assoc = 8;
- break;
- case 0x7d:
- *l2_sizekb = 2048;
- *l2_line = 64;
- *l2_assoc = 8;
- break;
- case 0x7f:
- *l2_sizekb = 512;
- *l2_line = 64;
- *l2_assoc = 2;
- break;
- case 0x82:
- *l2_sizekb = 256;
- *l2_line = 32;
- *l2_assoc = 8;
- break;
- case 0x83:
- *l2_sizekb = 512;
- *l2_line = 32;
- *l2_assoc = 8;
- break;
- case 0x84:
- *l2_sizekb = 1024;
- *l2_line = 32;
- *l2_assoc = 8;
- break;
- case 0x85:
- *l2_sizekb = 2048;
- *l2_line = 32;
- *l2_assoc = 8;
- break;
- case 0x86:
- *l2_sizekb = 512;
- *l2_line = 64;
- *l2_assoc = 4;
- break;
- case 0x87:
- *l2_sizekb = 1024;
- *l2_line = 64;
- *l2_assoc = 8;
- break;
+ if (nreps)
+ __cpuid (2, regs[0], regs[1], regs[2], regs[3]);
+ }
+}
+
+/* Detect cache parameters using CPUID function 4. This
+ method doesn't require hardcoded tables. */
+enum cache_type
+{
+ CACHE_END = 0,
+ CACHE_DATA = 1,
+ CACHE_INST = 2,
+ CACHE_UNIFIED = 3
+};
+
+static void
+detect_caches_cpuid4 (struct cache_desc *level1, struct cache_desc *level2)
+{
+ struct cache_desc *cache;
+
+ unsigned eax, ebx, ecx, edx;
+ int count;
+
+ for (count = 0;; count++)
+ {
+ __cpuid_count(4, count, eax, ebx, ecx, edx);
+ switch (eax & 0x1f)
+ {
+ case CACHE_END:
+ return;
+ case CACHE_DATA:
+ case CACHE_UNIFIED:
+ {
+ switch ((eax >> 5) & 0x07)
+ {
+ case 1:
+ cache = level1;
+ break;
+ case 2:
+ cache = level2;
+ break;
+ default:
+ cache = NULL;
+ }
+
+ if (cache)
+ {
+ unsigned sets = ecx + 1;
+ unsigned part = ((ebx >> 12) & 0x03ff) + 1;
+
+ cache->assoc = ((ebx >> 22) & 0x03ff) + 1;
+ cache->line = (ebx & 0x0fff) + 1;
+
+ cache->sizekb = (cache->assoc * part
+ * cache->line * sets) / 1024;
+ }
+ }
default:
break;
}
}
}
-/* Returns the description of caches for an intel processor. */
+/* Returns the description of caches for an Intel processor. */
static const char *
-detect_caches_intel (unsigned max_level, unsigned max_ext_level)
+detect_caches_intel (bool xeon_mp, unsigned max_level, unsigned max_ext_level)
{
- unsigned eax, ebx, ecx, edx;
- unsigned l1_sizekb = 0, l1_line = 0, assoc = 0;
- unsigned l2_sizekb = 0, l2_line = 0, l2_assoc = 0;
+ struct cache_desc level1 = {0, 0, 0}, level2 = {0, 0, 0};
- if (max_level < 2)
+ if (max_level >= 4)
+ detect_caches_cpuid4 (&level1, &level2);
+ else if (max_level >= 2)
+ detect_caches_cpuid2 (xeon_mp, &level1, &level2);
+ else
return "";
- __cpuid (2, eax, ebx, ecx, edx);
-
- decode_caches_intel (eax, &l1_sizekb, &l1_line, &assoc,
- &l2_sizekb, &l2_line, &l2_assoc);
- decode_caches_intel (ebx, &l1_sizekb, &l1_line, &assoc,
- &l2_sizekb, &l2_line, &l2_assoc);
- decode_caches_intel (ecx, &l1_sizekb, &l1_line, &assoc,
- &l2_sizekb, &l2_line, &l2_assoc);
- decode_caches_intel (edx, &l1_sizekb, &l1_line, &assoc,
- &l2_sizekb, &l2_line, &l2_assoc);
-
- if (!l1_sizekb)
+ if (level1.sizekb == 0)
return "";
- /* Newer Intel CPUs are equipped with AMD style L2 cache info */
- if (max_ext_level >= 0x80000006)
- decode_l2_cache (&l2_sizekb, &l2_line, &l2_assoc);
+ /* Intel CPUs are equipped with AMD style L2 cache info. Try this
+ method if other methods fail to provide L2 cache parameters. */
+ if (level2.sizekb == 0 && max_ext_level >= 0x80000006)
+ detect_l2_cache (&level2);
- return describe_cache (l1_sizekb, l1_line, assoc, l2_sizekb);
+ return describe_cache (level1, level2);
}
/* This will be called by the spec parser in gcc.c when it sees
@@ -334,11 +354,12 @@ const char *host_detect_local_cpu (int argc, const char **argv)
const char *cache = "";
const char *options = "";
- unsigned int eax, ebx, ecx, edx;
+ unsigned int eax, ebx, ecx, edx;
unsigned int max_level, ext_level;
+
unsigned int vendor;
- unsigned int family;
+ unsigned int model, family;
unsigned int has_sse3, has_ssse3, has_cmpxchg16b;
unsigned int has_cmpxchg8b, has_cmov, has_mmx, has_sse, has_sse2;
@@ -364,6 +385,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)
__cpuid (1, eax, ebx, ecx, edx);
/* We don't care for extended family. */
+ model = (eax >> 4) & 0x0f;
family = (eax >> 8) & 0x0f;
has_sse3 = ecx & bit_SSE3;
@@ -396,7 +418,10 @@ const char *host_detect_local_cpu (int argc, const char **argv)
if (vendor == *(const unsigned int*) "Auth")
cache = detect_caches_amd (ext_level);
else if (vendor == *(const unsigned int*) "Genu")
- cache = detect_caches_intel (max_level, ext_level);
+ {
+ bool xeon_mp = (family == 15 && model == 6);
+ cache = detect_caches_intel (xeon_mp, max_level, ext_level);
+ }
}
if (vendor == *(const unsigned int*) "Auth")
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index de024581e80..1abd11dead7 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -272,3 +272,7 @@ extern enum rtx_code ix86_fp_compare_code_to_integer (enum rtx_code);
extern rtx construct_plt_address (rtx);
#endif
extern int asm_preferred_eh_data_format (int, int);
+
+#ifdef HAVE_ATTR_cpu
+extern enum attr_cpu ix86_schedule;
+#endif
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index dab83415477..a3d4951fafe 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1229,9 +1229,6 @@ static unsigned int initial_ix86_tune_features[X86_TUNE_LAST] = {
/* X86_TUNE_ZERO_EXTEND_WITH_AND */
m_486 | m_PENT,
- /* X86_TUNE_USE_BIT_TEST */
- m_386,
-
/* X86_TUNE_UNROLL_STRLEN */
m_486 | m_PENT | m_PPRO | m_AMD_MULTIPLE | m_K6 | m_CORE2 | m_GENERIC,
@@ -1437,6 +1434,10 @@ static unsigned int initial_ix86_tune_features[X86_TUNE_LAST] = {
replacement is long decoded, so this split helps here as well. */
m_K6,
+ /* X86_TUNE_USE_VECTOR_FP_CONVERTS: Prefer vector packed SSE conversion
+ from FP to FP. */
+ m_AMDFAM10 | m_GENERIC,
+
/* X86_TUNE_USE_VECTOR_CONVERTS: Prefer vector packed SSE conversion
from integer to FP. */
m_AMDFAM10,
@@ -1693,6 +1694,9 @@ enum tls_dialect ix86_tls_dialect = TLS_DIALECT_GNU;
enum fpmath_unit ix86_fpmath;
/* Which cpu are we scheduling for. */
+enum attr_cpu ix86_schedule;
+
+/* Which cpu are we optimizing for. */
enum processor_type ix86_tune;
/* Which instruction set architecture to use. */
@@ -2490,93 +2494,89 @@ override_options (bool main_args_p)
{
const char *const name; /* processor name or nickname. */
const enum processor_type processor;
+ const enum attr_cpu schedule;
const unsigned /*enum pta_flags*/ flags;
}
const processor_alias_table[] =
{
- {"i386", PROCESSOR_I386, 0},
- {"i486", PROCESSOR_I486, 0},
- {"i586", PROCESSOR_PENTIUM, 0},
- {"pentium", PROCESSOR_PENTIUM, 0},
- {"pentium-mmx", PROCESSOR_PENTIUM, PTA_MMX},
- {"winchip-c6", PROCESSOR_I486, PTA_MMX},
- {"winchip2", PROCESSOR_I486, PTA_MMX | PTA_3DNOW},
- {"c3", PROCESSOR_I486, PTA_MMX | PTA_3DNOW},
- {"c3-2", PROCESSOR_PENTIUMPRO, PTA_MMX | PTA_SSE},
- {"i686", PROCESSOR_PENTIUMPRO, 0},
- {"pentiumpro", PROCESSOR_PENTIUMPRO, 0},
- {"pentium2", PROCESSOR_PENTIUMPRO, PTA_MMX},
- {"pentium3", PROCESSOR_PENTIUMPRO, PTA_MMX | PTA_SSE},
- {"pentium3m", PROCESSOR_PENTIUMPRO, PTA_MMX | PTA_SSE},
- {"pentium-m", PROCESSOR_PENTIUMPRO, PTA_MMX | PTA_SSE | PTA_SSE2},
- {"pentium4", PROCESSOR_PENTIUM4, PTA_MMX |PTA_SSE | PTA_SSE2},
- {"pentium4m", PROCESSOR_PENTIUM4, PTA_MMX | PTA_SSE | PTA_SSE2},
- {"prescott", PROCESSOR_NOCONA, PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3},
- {"nocona", PROCESSOR_NOCONA, (PTA_64BIT
- | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_CX16 | PTA_NO_SAHF)},
- {"core2", PROCESSOR_CORE2, (PTA_64BIT
- | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_SSSE3
- | PTA_CX16)},
- {"geode", PROCESSOR_GEODE, (PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- |PTA_PREFETCH_SSE)},
- {"k6", PROCESSOR_K6, PTA_MMX},
- {"k6-2", PROCESSOR_K6, PTA_MMX | PTA_3DNOW},
- {"k6-3", PROCESSOR_K6, PTA_MMX | PTA_3DNOW},
- {"athlon", PROCESSOR_ATHLON, (PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_PREFETCH_SSE)},
- {"athlon-tbird", PROCESSOR_ATHLON, (PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_PREFETCH_SSE)},
- {"athlon-4", PROCESSOR_ATHLON, (PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_SSE)},
- {"athlon-xp", PROCESSOR_ATHLON, (PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_SSE)},
- {"athlon-mp", PROCESSOR_ATHLON, (PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_SSE)},
- {"x86-64", PROCESSOR_K8, (PTA_64BIT
- | PTA_MMX | PTA_SSE | PTA_SSE2
- | PTA_NO_SAHF)},
- {"k8", PROCESSOR_K8, (PTA_64BIT
- | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_SSE | PTA_SSE2
- | PTA_NO_SAHF)},
- {"k8-sse3", PROCESSOR_K8, (PTA_64BIT
- | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_NO_SAHF)},
- {"opteron", PROCESSOR_K8, (PTA_64BIT
- | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_SSE | PTA_SSE2
- | PTA_NO_SAHF)},
- {"opteron-sse3", PROCESSOR_K8, (PTA_64BIT
- | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_NO_SAHF)},
- {"athlon64", PROCESSOR_K8, (PTA_64BIT
- | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_SSE | PTA_SSE2
- | PTA_NO_SAHF)},
- {"athlon64-sse3", PROCESSOR_K8, (PTA_64BIT
- | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_NO_SAHF)},
- {"athlon-fx", PROCESSOR_K8, (PTA_64BIT
- | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_SSE | PTA_SSE2
- | PTA_NO_SAHF)},
- {"amdfam10", PROCESSOR_AMDFAM10, (PTA_64BIT
- | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_SSE4A
- | PTA_CX16 | PTA_ABM)},
- {"barcelona", PROCESSOR_AMDFAM10, (PTA_64BIT
- | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A
- | PTA_SSE | PTA_SSE2 | PTA_SSE3
- | PTA_SSE4A
- | PTA_CX16 | PTA_ABM)},
- {"generic32", PROCESSOR_GENERIC32, 0 /* flags are only used for -march switch. */ },
- {"generic64", PROCESSOR_GENERIC64, PTA_64BIT /* flags are only used for -march switch. */ },
+ {"i386", PROCESSOR_I386, CPU_NONE, 0},
+ {"i486", PROCESSOR_I486, CPU_NONE, 0},
+ {"i586", PROCESSOR_PENTIUM, CPU_PENTIUM, 0},
+ {"pentium", PROCESSOR_PENTIUM, CPU_PENTIUM, 0},
+ {"pentium-mmx", PROCESSOR_PENTIUM, CPU_PENTIUM, PTA_MMX},
+ {"winchip-c6", PROCESSOR_I486, CPU_NONE, PTA_MMX},
+ {"winchip2", PROCESSOR_I486, CPU_NONE, PTA_MMX | PTA_3DNOW},
+ {"c3", PROCESSOR_I486, CPU_NONE, PTA_MMX | PTA_3DNOW},
+ {"c3-2", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO, PTA_MMX | PTA_SSE},
+ {"i686", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO, 0},
+ {"pentiumpro", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO, 0},
+ {"pentium2", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO, PTA_MMX},
+ {"pentium3", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO,
+ PTA_MMX | PTA_SSE},
+ {"pentium3m", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO,
+ PTA_MMX | PTA_SSE},
+ {"pentium-m", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO,
+ PTA_MMX | PTA_SSE | PTA_SSE2},
+ {"pentium4", PROCESSOR_PENTIUM4, CPU_NONE,
+ PTA_MMX |PTA_SSE | PTA_SSE2},
+ {"pentium4m", PROCESSOR_PENTIUM4, CPU_NONE,
+ PTA_MMX | PTA_SSE | PTA_SSE2},
+ {"prescott", PROCESSOR_NOCONA, CPU_NONE,
+ PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3},
+ {"nocona", PROCESSOR_NOCONA, CPU_NONE,
+ PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
+ | PTA_CX16 | PTA_NO_SAHF},
+ {"core2", PROCESSOR_CORE2, CPU_CORE2,
+ PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
+ | PTA_SSSE3 | PTA_CX16},
+ {"geode", PROCESSOR_GEODE, CPU_GEODE,
+ PTA_MMX | PTA_3DNOW | PTA_3DNOW_A |PTA_PREFETCH_SSE},
+ {"k6", PROCESSOR_K6, CPU_K6, PTA_MMX},
+ {"k6-2", PROCESSOR_K6, CPU_K6, PTA_MMX | PTA_3DNOW},
+ {"k6-3", PROCESSOR_K6, CPU_K6, PTA_MMX | PTA_3DNOW},
+ {"athlon", PROCESSOR_ATHLON, CPU_ATHLON,
+ PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_PREFETCH_SSE},
+ {"athlon-tbird", PROCESSOR_ATHLON, CPU_ATHLON,
+ PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_PREFETCH_SSE},
+ {"athlon-4", PROCESSOR_ATHLON, CPU_ATHLON,
+ PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE},
+ {"athlon-xp", PROCESSOR_ATHLON, CPU_ATHLON,
+ PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE},
+ {"athlon-mp", PROCESSOR_ATHLON, CPU_ATHLON,
+ PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE},
+ {"x86-64", PROCESSOR_K8, CPU_K8,
+ PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_NO_SAHF},
+ {"k8", PROCESSOR_K8, CPU_K8,
+ PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
+ | PTA_SSE2 | PTA_NO_SAHF},
+ {"k8-sse3", PROCESSOR_K8, CPU_K8,
+ PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
+ | PTA_SSE2 | PTA_SSE3 | PTA_NO_SAHF},
+ {"opteron", PROCESSOR_K8, CPU_K8,
+ PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
+ | PTA_SSE2 | PTA_NO_SAHF},
+ {"opteron-sse3", PROCESSOR_K8, CPU_K8,
+ PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
+ | PTA_SSE2 | PTA_SSE3 | PTA_NO_SAHF},
+ {"athlon64", PROCESSOR_K8, CPU_K8,
+ PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
+ | PTA_SSE2 | PTA_NO_SAHF},
+ {"athlon64-sse3", PROCESSOR_K8, CPU_K8,
+ PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
+ | PTA_SSE2 | PTA_SSE3 | PTA_NO_SAHF},
+ {"athlon-fx", PROCESSOR_K8, CPU_K8,
+ PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
+ | PTA_SSE2 | PTA_NO_SAHF},
+ {"amdfam10", PROCESSOR_AMDFAM10, CPU_AMDFAM10,
+ PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
+ | PTA_SSE2 | PTA_SSE3 | PTA_SSE4A | PTA_CX16 | PTA_ABM},
+ {"barcelona", PROCESSOR_AMDFAM10, PROCESSOR_AMDFAM10,
+ PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE
+ | PTA_SSE2 | PTA_SSE3 | PTA_SSE4A | PTA_CX16 | PTA_ABM},
+ {"generic32", PROCESSOR_GENERIC32, CPU_PENTIUMPRO,
+ 0 /* flags are only used for -march switch. */ },
+ {"generic64", PROCESSOR_GENERIC64, CPU_GENERIC64,
+ PTA_64BIT /* flags are only used for -march switch. */ },
};
int const pta_size = ARRAY_SIZE (processor_alias_table);
@@ -2766,6 +2766,7 @@ override_options (bool main_args_p)
for (i = 0; i < pta_size; i++)
if (! strcmp (ix86_arch_string, processor_alias_table[i].name))
{
+ ix86_schedule = processor_alias_table[i].schedule;
ix86_arch = processor_alias_table[i].processor;
/* Default cpu tuning to the architecture. */
ix86_tune = ix86_arch;
@@ -2848,6 +2849,7 @@ override_options (bool main_args_p)
for (i = 0; i < pta_size; i++)
if (! strcmp (ix86_tune_string, processor_alias_table[i].name))
{
+ ix86_schedule = processor_alias_table[i].schedule;
ix86_tune = processor_alias_table[i].processor;
if (TARGET_64BIT && !(processor_alias_table[i].flags & PTA_64BIT))
{
@@ -2858,6 +2860,7 @@ override_options (bool main_args_p)
if (! strcmp (ix86_tune_string,
processor_alias_table[i].name))
break;
+ ix86_schedule = processor_alias_table[i].schedule;
ix86_tune = processor_alias_table[i].processor;
}
else
@@ -3276,11 +3279,13 @@ static void
ix86_function_specific_save (struct cl_target_option *ptr)
{
gcc_assert (IN_RANGE (ix86_arch, 0, 255));
+ gcc_assert (IN_RANGE (ix86_schedule, 0, 255));
gcc_assert (IN_RANGE (ix86_tune, 0, 255));
gcc_assert (IN_RANGE (ix86_fpmath, 0, 255));
gcc_assert (IN_RANGE (ix86_branch_cost, 0, 255));
ptr->arch = ix86_arch;
+ ptr->schedule = ix86_schedule;
ptr->tune = ix86_tune;
ptr->fpmath = ix86_fpmath;
ptr->branch_cost = ix86_branch_cost;
@@ -3301,6 +3306,7 @@ ix86_function_specific_restore (struct cl_target_option *ptr)
int i;
ix86_arch = ptr->arch;
+ ix86_schedule = ptr->schedule;
ix86_tune = ptr->tune;
ix86_fpmath = ptr->fpmath;
ix86_branch_cost = ptr->branch_cost;
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 3af68e9a8a6..32f793b1cf7 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -237,7 +237,6 @@ enum ix86_tune_indices {
X86_TUNE_USE_LEAVE,
X86_TUNE_PUSH_MEMORY,
X86_TUNE_ZERO_EXTEND_WITH_AND,
- X86_TUNE_USE_BIT_TEST,
X86_TUNE_UNROLL_STRLEN,
X86_TUNE_DEEP_BRANCH_PREDICTION,
X86_TUNE_BRANCH_PREDICTION_HINTS,
@@ -293,6 +292,7 @@ enum ix86_tune_indices {
X86_TUNE_MOVE_M1_VIA_OR,
X86_TUNE_NOT_UNPAIRABLE,
X86_TUNE_NOT_VECTORMODE,
+ X86_TUNE_USE_VECTOR_FP_CONVERTS,
X86_TUNE_USE_VECTOR_CONVERTS,
X86_TUNE_FUSE_CMP_AND_BRANCH,
@@ -305,7 +305,6 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST];
#define TARGET_PUSH_MEMORY ix86_tune_features[X86_TUNE_PUSH_MEMORY]
#define TARGET_ZERO_EXTEND_WITH_AND \
ix86_tune_features[X86_TUNE_ZERO_EXTEND_WITH_AND]
-#define TARGET_USE_BIT_TEST ix86_tune_features[X86_TUNE_USE_BIT_TEST]
#define TARGET_UNROLL_STRLEN ix86_tune_features[X86_TUNE_UNROLL_STRLEN]
#define TARGET_DEEP_BRANCH_PREDICTION \
ix86_tune_features[X86_TUNE_DEEP_BRANCH_PREDICTION]
@@ -377,6 +376,8 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST];
#define TARGET_MOVE_M1_VIA_OR ix86_tune_features[X86_TUNE_MOVE_M1_VIA_OR]
#define TARGET_NOT_UNPAIRABLE ix86_tune_features[X86_TUNE_NOT_UNPAIRABLE]
#define TARGET_NOT_VECTORMODE ix86_tune_features[X86_TUNE_NOT_VECTORMODE]
+#define TARGET_USE_VECTOR_FP_CONVERTS \
+ ix86_tune_features[X86_TUNE_USE_VECTOR_FP_CONVERTS]
#define TARGET_USE_VECTOR_CONVERTS \
ix86_tune_features[X86_TUNE_USE_VECTOR_CONVERTS]
#define TARGET_FUSE_CMP_AND_BRANCH \
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 728c9673702..9d1a01a8e69 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -296,11 +296,10 @@
;; "reload_completed && TARGET_64BIT".
-;; Processor type. This attribute must exactly match the processor_type
-;; enumeration in i386.h.
-(define_attr "cpu" "i386,i486,pentium,pentiumpro,geode,k6,athlon,pentium4,k8,
- nocona,core2,generic32,generic64,amdfam10"
- (const (symbol_ref "ix86_tune")))
+;; Processor type.
+(define_attr "cpu" "none,pentium,pentiumpro,geode,k6,athlon,k8,core2,
+ generic64,amdfam10"
+ (const (symbol_ref "ix86_schedule")))
;; A basic instruction type. Refinements due to arguments to be
;; provided in other attributes.
@@ -2560,14 +2559,14 @@
to stack may result in unaligned memory access. */
if (misaligned_operand (operands[0], TImode)
|| misaligned_operand (operands[1], TImode))
- {
+ {
if (get_attr_mode (insn) == MODE_V4SF)
return "%vmovups\t{%1, %0|%0, %1}";
else
return "%vmovdqu\t{%1, %0|%0, %1}";
}
else
- {
+ {
if (get_attr_mode (insn) == MODE_V4SF)
return "%vmovaps\t{%1, %0|%0, %1}";
else
@@ -2611,14 +2610,14 @@
to stack may result in unaligned memory access. */
if (misaligned_operand (operands[0], TImode)
|| misaligned_operand (operands[1], TImode))
- {
+ {
if (get_attr_mode (insn) == MODE_V4SF)
return "%vmovups\t{%1, %0|%0, %1}";
else
return "%vmovdqu\t{%1, %0|%0, %1}";
}
else
- {
+ {
if (get_attr_mode (insn) == MODE_V4SF)
return "%vmovaps\t{%1, %0|%0, %1}";
else
@@ -4217,7 +4216,7 @@
[(set (match_operand:DF 0 "register_operand" "")
(float_extend:DF
(match_operand:SF 1 "nonimmediate_operand" "")))]
- "(TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC)
+ "TARGET_USE_VECTOR_FP_CONVERTS
&& optimize_insn_for_speed_p ()
&& reload_completed && SSE_REG_P (operands[0])"
[(set (match_dup 2)
@@ -4357,7 +4356,7 @@
[(set (match_operand:SF 0 "register_operand" "")
(float_truncate:SF
(match_operand:DF 1 "nonimmediate_operand" "")))]
- "(TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC)
+ "TARGET_USE_VECTOR_FP_CONVERTS
&& optimize_insn_for_speed_p ()
&& reload_completed && SSE_REG_P (operands[0])"
[(set (match_dup 2)
@@ -5151,8 +5150,8 @@
/* Avoid store forwarding (partial memory) stall penalty
by passing DImode value through XMM registers. */
- if (<SSEMODEI24:MODE>mode == DImode && !TARGET_64BIT
- && TARGET_80387 && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES
+ if (<SSEMODEI24:MODE>mode == DImode && !TARGET_64BIT
+ && TARGET_80387 && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES
&& optimize_function_for_speed_p (cfun))
{
emit_insn (gen_floatdi<X87MODEF:mode>2_i387_with_xmm (operands[0],
@@ -5392,6 +5391,9 @@
operands[4] = simplify_gen_subreg (V4SImode, operands[1], SImode, 0);
else
gcc_unreachable ();
+ emit_insn
+ (gen_sse2_cvtdq2p<ssemodefsuffix> (operands[3], operands[4]));
+ DONE;
})
(define_split
@@ -14332,7 +14334,8 @@
(match_operand:QI 2 "register_operand" "r")))
(const_int 0)])
(label_ref (match_operand 3 "" ""))
- (pc)))]
+ (pc)))
+ (clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && (TARGET_USE_BT || optimize_function_for_size_p (cfun))"
"#"
"&& 1"
@@ -14364,7 +14367,8 @@
(match_operand:SI 2 "register_operand" "r")
(match_operand:SI 3 "const_int_operand" "n")))])
(label_ref (match_operand 4 "" ""))
- (pc)))]
+ (pc)))
+ (clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && (TARGET_USE_BT || optimize_function_for_size_p (cfun))
&& (INTVAL (operands[3]) & 0x3f) == 0x3f"
"#"
@@ -14396,7 +14400,8 @@
(match_operand:QI 2 "register_operand" "r")))
(const_int 0)])
(label_ref (match_operand 3 "" ""))
- (pc)))]
+ (pc)))
+ (clobber (reg:CC FLAGS_REG))]
"TARGET_USE_BT || optimize_function_for_size_p (cfun)"
"#"
"&& 1"
@@ -14428,7 +14433,8 @@
(match_operand:SI 2 "register_operand" "r")
(match_operand:SI 3 "const_int_operand" "n")))])
(label_ref (match_operand 4 "" ""))
- (pc)))]
+ (pc)))
+ (clobber (reg:CC FLAGS_REG))]
"(TARGET_USE_BT || optimize_function_for_size_p (cfun))
&& (INTVAL (operands[3]) & 0x1f) == 0x1f"
"#"
@@ -14456,7 +14462,8 @@
(const_int 1))
(const_int 0)])
(label_ref (match_operand 3 "" ""))
- (pc)))]
+ (pc)))
+ (clobber (reg:CC FLAGS_REG))]
"TARGET_USE_BT || optimize_function_for_size_p (cfun)"
"#"
"&& 1"
@@ -14492,7 +14499,8 @@
(const_int 1))
(const_int 0)])
(label_ref (match_operand 4 "" ""))
- (pc)))]
+ (pc)))
+ (clobber (reg:CC FLAGS_REG))]
"(TARGET_USE_BT || optimize_function_for_size_p (cfun))
&& (INTVAL (operands[3]) & 0x1f) == 0x1f"
"#"
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index 406727139c8..2881ea255ad 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -31,6 +31,10 @@ unsigned char tune
TargetSave
unsigned char fpmath
+;; CPU schedule model
+TargetSave
+unsigned char schedule
+
;; branch cost
TargetSave
unsigned char branch_cost
diff --git a/gcc/config/i386/ppro.md b/gcc/config/i386/ppro.md
index b971e51089e..81c0746ea1e 100644
--- a/gcc/config/i386/ppro.md
+++ b/gcc/config/i386/ppro.md
@@ -135,25 +135,25 @@
;; on decoder 0, and say that it takes a little while before the result
;; is available.
(define_insn_reservation "ppro_complex_insn" 6
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(eq_attr "type" "other,multi,call,callv,str"))
"decoder0")
;; imov with memory operands does not use the integer units.
(define_insn_reservation "ppro_imov" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "imov")))
"decodern,(p0|p1)")
(define_insn_reservation "ppro_imov_load" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(eq_attr "type" "imov")))
"decodern,p2")
(define_insn_reservation "ppro_imov_store" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "store")
(eq_attr "type" "imov")))
"decoder0,p4+p3")
@@ -161,20 +161,20 @@
;; imovx always decodes to one uop, and also doesn't use the integer
;; units if it has memory operands.
(define_insn_reservation "ppro_imovx" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "imovx")))
"decodern,(p0|p1)")
(define_insn_reservation "ppro_imovx_load" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(eq_attr "type" "imovx")))
"decodern,p2")
;; lea executes on port 0 with latency one and throughput 1.
(define_insn_reservation "ppro_lea" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "lea")))
"decodern,p0")
@@ -183,13 +183,13 @@
;; The load and store units need to be reserved when memory operands
;; are involved.
(define_insn_reservation "ppro_shift_rotate" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "ishift,ishift1,rotate,rotate1")))
"decodern,p0")
(define_insn_reservation "ppro_shift_rotate_mem" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "!none")
(eq_attr "type" "ishift,ishift1,rotate,rotate1")))
"decoder0,p2+p0,p4+p3")
@@ -213,32 +213,32 @@
;; results because we can assume these instructions can decode on all
;; decoders.
(define_insn_reservation "ppro_branch" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "ibr")))
"decodern,p1")
;; ??? Indirect branches probably have worse latency than this.
(define_insn_reservation "ppro_indirect_branch" 6
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "!none")
(eq_attr "type" "ibr")))
"decoder0,p2+p1")
(define_insn_reservation "ppro_leave" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(eq_attr "type" "leave"))
"decoder0,p2+(p0|p1),(p0|p1)")
;; imul has throughput one, but latency 4, and can only execute on port 0.
(define_insn_reservation "ppro_imul" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "imul")))
"decodern,p0")
(define_insn_reservation "ppro_imul_mem" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "!none")
(eq_attr "type" "imul")))
"decoder0,p2+p0")
@@ -247,42 +247,42 @@
;; QI, HI, and SI have issue latency 12, 21, and 37, respectively.
;; These issue latencies are modelled via the ppro_div automaton.
(define_insn_reservation "ppro_idiv_QI" 19
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "QI")
(eq_attr "type" "idiv"))))
"decoder0,(p0+idiv)*2,(p0|p1)+idiv,idiv*9")
(define_insn_reservation "ppro_idiv_QI_load" 19
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "QI")
(eq_attr "type" "idiv"))))
"decoder0,p2+p0+idiv,p0+idiv,(p0|p1)+idiv,idiv*9")
(define_insn_reservation "ppro_idiv_HI" 23
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "HI")
(eq_attr "type" "idiv"))))
"decoder0,(p0+idiv)*3,(p0|p1)+idiv,idiv*17")
(define_insn_reservation "ppro_idiv_HI_load" 23
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "HI")
(eq_attr "type" "idiv"))))
"decoder0,p2+p0+idiv,p0+idiv,(p0|p1)+idiv,idiv*18")
(define_insn_reservation "ppro_idiv_SI" 39
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "SI")
(eq_attr "type" "idiv"))))
"decoder0,(p0+idiv)*3,(p0|p1)+idiv,idiv*33")
(define_insn_reservation "ppro_idiv_SI_load" 39
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "SI")
(eq_attr "type" "idiv"))))
@@ -293,85 +293,85 @@
;; has throughput "1/cycle (align with FADD)". What do they
;; mean and how can we model that?
(define_insn_reservation "ppro_fop" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none,unknown")
(eq_attr "type" "fop")))
"decodern,p0")
(define_insn_reservation "ppro_fop_load" 5
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(eq_attr "type" "fop")))
"decoder0,p2+p0,p0")
(define_insn_reservation "ppro_fop_store" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "store")
(eq_attr "type" "fop")))
"decoder0,p0,p0,p0+p4+p3")
(define_insn_reservation "ppro_fop_both" 5
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "both")
(eq_attr "type" "fop")))
"decoder0,p2+p0,p0+p4+p3")
(define_insn_reservation "ppro_fsgn" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(eq_attr "type" "fsgn"))
"decodern,p0")
(define_insn_reservation "ppro_fistp" 5
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(eq_attr "type" "fistp"))
"decoder0,p0*2,p4+p3")
(define_insn_reservation "ppro_fcmov" 2
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(eq_attr "type" "fcmov"))
"decoder0,p0*2")
(define_insn_reservation "ppro_fcmp" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "fcmp")))
"decodern,p0")
(define_insn_reservation "ppro_fcmp_load" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(eq_attr "type" "fcmp")))
"decoder0,p2+p0")
(define_insn_reservation "ppro_fmov" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "fmov")))
"decodern,p0")
(define_insn_reservation "ppro_fmov_load" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "!XF")
(eq_attr "type" "fmov"))))
"decodern,p2")
(define_insn_reservation "ppro_fmov_XF_load" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "XF")
(eq_attr "type" "fmov"))))
"decoder0,(p2+p0)*2")
(define_insn_reservation "ppro_fmov_store" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "store")
(and (eq_attr "mode" "!XF")
(eq_attr "type" "fmov"))))
"decodern,p0")
(define_insn_reservation "ppro_fmov_XF_store" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "store")
(and (eq_attr "mode" "XF")
(eq_attr "type" "fmov"))))
@@ -380,13 +380,13 @@
;; fmul executes on port 0 with latency 5. It has issue latency 2,
;; but we don't model this.
(define_insn_reservation "ppro_fmul" 5
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "fmul")))
"decoder0,p0*2")
(define_insn_reservation "ppro_fmul_load" 6
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(eq_attr "type" "fmul")))
"decoder0,p2+p0,p0")
@@ -397,42 +397,42 @@
;; that. Throughput is equal to latency - 1, which we model using the
;; ppro_div automaton.
(define_insn_reservation "ppro_fdiv_SF" 18
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "SF")
(eq_attr "type" "fdiv,fpspc"))))
"decodern,p0+fdiv,fdiv*16")
(define_insn_reservation "ppro_fdiv_SF_load" 19
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "SF")
(eq_attr "type" "fdiv,fpspc"))))
"decoder0,p2+p0+fdiv,fdiv*16")
(define_insn_reservation "ppro_fdiv_DF" 32
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "DF")
(eq_attr "type" "fdiv,fpspc"))))
"decodern,p0+fdiv,fdiv*30")
(define_insn_reservation "ppro_fdiv_DF_load" 33
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "DF")
(eq_attr "type" "fdiv,fpspc"))))
"decoder0,p2+p0+fdiv,fdiv*30")
(define_insn_reservation "ppro_fdiv_XF" 38
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "XF")
(eq_attr "type" "fdiv,fpspc"))))
"decodern,p0+fdiv,fdiv*36")
(define_insn_reservation "ppro_fdiv_XF_load" 39
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "XF")
(eq_attr "type" "fdiv,fpspc"))))
@@ -450,31 +450,31 @@
;; so they behave as "simple" instructions that need no special modelling.
;; We only have to model mmxshft and mmxmul.
(define_insn_reservation "ppro_mmx_shft" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "mmxshft")))
"decodern,p1")
(define_insn_reservation "ppro_mmx_shft_load" 2
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "mmxshft")))
"decoder0,p2+p1")
(define_insn_reservation "ppro_mmx_mul" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "mmxmul")))
"decodern,p0")
(define_insn_reservation "ppro_mmx_mul_load" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(eq_attr "type" "mmxmul")))
"decoder0,p2+p0")
(define_insn_reservation "ppro_sse_mmxcvt" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "mode" "DI")
(eq_attr "type" "mmxcvt")))
"decodern,p1")
@@ -482,7 +482,7 @@
;; FIXME: These are Pentium III only, but we cannot tell here if
;; we're generating code for PentiumPro/Pentium II or Pentium III
;; (define_insn_reservation "ppro_sse_mmxshft" 2
-;; (and (eq_attr "cpu" "pentiumpro,generic32")
+;; (and (eq_attr "cpu" "pentiumpro")
;; (and (eq_attr "mode" "DI")
;; (eq_attr "type" "mmxshft")))
;; "decodern,p0")
@@ -493,69 +493,69 @@
;; The sfence instruction.
(define_insn_reservation "ppro_sse_sfence" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "unknown")
(eq_attr "type" "sse")))
"decoder0,p4+p3")
;; FIXME: This reservation is all wrong when we're scheduling sqrtss.
(define_insn_reservation "ppro_sse_SF" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "mode" "SF")
(eq_attr "type" "sse")))
"decodern,p0")
(define_insn_reservation "ppro_sse_add_SF" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "SF")
(eq_attr "type" "sseadd"))))
"decodern,p1")
(define_insn_reservation "ppro_sse_add_SF_load" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "SF")
(eq_attr "type" "sseadd"))))
"decoder0,p2+p1")
(define_insn_reservation "ppro_sse_cmp_SF" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "SF")
(eq_attr "type" "ssecmp"))))
"decoder0,p1")
(define_insn_reservation "ppro_sse_cmp_SF_load" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "SF")
(eq_attr "type" "ssecmp"))))
"decoder0,p2+p1")
(define_insn_reservation "ppro_sse_comi_SF" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "SF")
(eq_attr "type" "ssecomi"))))
"decodern,p0")
(define_insn_reservation "ppro_sse_comi_SF_load" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "SF")
(eq_attr "type" "ssecomi"))))
"decoder0,p2+p0")
(define_insn_reservation "ppro_sse_mul_SF" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "SF")
(eq_attr "type" "ssemul"))))
"decodern,p0")
(define_insn_reservation "ppro_sse_mul_SF_load" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "SF")
(eq_attr "type" "ssemul"))))
@@ -563,109 +563,109 @@
;; FIXME: ssediv doesn't close p0 for 17 cycles, surely???
(define_insn_reservation "ppro_sse_div_SF" 18
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "SF")
(eq_attr "type" "ssediv"))))
"decoder0,p0*17")
(define_insn_reservation "ppro_sse_div_SF_load" 18
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "SF")
(eq_attr "type" "ssediv"))))
"decoder0,(p2+p0),p0*16")
(define_insn_reservation "ppro_sse_icvt_SF" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "mode" "SF")
(eq_attr "type" "sseicvt")))
"decoder0,(p2+p1)*2")
(define_insn_reservation "ppro_sse_icvt_SI" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "mode" "SI")
(eq_attr "type" "sseicvt")))
"decoder0,(p2+p1)")
(define_insn_reservation "ppro_sse_mov_SF" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "SF")
(eq_attr "type" "ssemov"))))
"decoder0,(p0|p1)")
(define_insn_reservation "ppro_sse_mov_SF_load" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "SF")
(eq_attr "type" "ssemov"))))
"decoder0,p2+(p0|p1)")
(define_insn_reservation "ppro_sse_mov_SF_store" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "store")
(and (eq_attr "mode" "SF")
(eq_attr "type" "ssemov"))))
"decoder0,p4+p3")
(define_insn_reservation "ppro_sse_V4SF" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "sse")))
"decoder0,p1*2")
(define_insn_reservation "ppro_sse_add_V4SF" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "sseadd"))))
"decoder0,p1*2")
(define_insn_reservation "ppro_sse_add_V4SF_load" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "sseadd"))))
"decoder0,(p2+p1)*2")
(define_insn_reservation "ppro_sse_cmp_V4SF" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "ssecmp"))))
"decoder0,p1*2")
(define_insn_reservation "ppro_sse_cmp_V4SF_load" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "ssecmp"))))
"decoder0,(p2+p1)*2")
(define_insn_reservation "ppro_sse_cvt_V4SF" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none,unknown")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "ssecvt"))))
"decoder0,p1*2")
(define_insn_reservation "ppro_sse_cvt_V4SF_other" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "!none,unknown")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "ssecmp"))))
"decoder0,p1,p4+p3")
(define_insn_reservation "ppro_sse_mul_V4SF" 5
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "ssemul"))))
"decoder0,p0*2")
(define_insn_reservation "ppro_sse_mul_V4SF_load" 5
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "ssemul"))))
@@ -673,49 +673,49 @@
;; FIXME: p0 really closed this long???
(define_insn_reservation "ppro_sse_div_V4SF" 48
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "ssediv"))))
"decoder0,p0*34")
(define_insn_reservation "ppro_sse_div_V4SF_load" 48
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "ssediv"))))
"decoder0,(p2+p0)*2,p0*32")
(define_insn_reservation "ppro_sse_log_V4SF" 2
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "sselog,sselog1"))))
"decodern,p1")
(define_insn_reservation "ppro_sse_log_V4SF_load" 2
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "sselog,sselog1"))))
"decoder0,(p2+p1)")
(define_insn_reservation "ppro_sse_mov_V4SF" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "ssemov"))))
"decoder0,(p0|p1)*2")
(define_insn_reservation "ppro_sse_mov_V4SF_load" 2
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "ssemov"))))
"decoder0,p2*2")
(define_insn_reservation "ppro_sse_mov_V4SF_store" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "store")
(and (eq_attr "mode" "V4SF")
(eq_attr "type" "ssemov"))))
@@ -729,7 +729,7 @@
;; reg-reg instructions produce 1 uop so they can be decoded on any of
;; the three decoders.
(define_insn_reservation "ppro_insn" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "none,unknown")
(eq_attr "type" "alu,alu1,negnot,incdec,icmp,test,setcc,icmov,push,pop,fxch,sseiadd,sseishft,sseimul,mmx,mmxadd,mmxcmp")))
"decodern,(p0|p1)")
@@ -737,13 +737,13 @@
;; read-modify and register-memory instructions have 2 or three uops,
;; so they have to be decoded on decoder0.
(define_insn_reservation "ppro_insn_load" 3
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "load")
(eq_attr "type" "alu,alu1,negnot,incdec,icmp,test,setcc,icmov,push,pop,fxch,sseiadd,sseishft,sseimul,mmx,mmxadd,mmxcmp")))
"decoder0,p2+(p0|p1)")
(define_insn_reservation "ppro_insn_store" 1
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "store")
(eq_attr "type" "alu,alu1,negnot,incdec,icmp,test,setcc,icmov,push,pop,fxch,sseiadd,sseishft,sseimul,mmx,mmxadd,mmxcmp")))
"decoder0,(p0|p1),p4+p3")
@@ -751,7 +751,7 @@
;; read-modify-store instructions produce 4 uops so they have to be
;; decoded on decoder0 as well.
(define_insn_reservation "ppro_insn_both" 4
- (and (eq_attr "cpu" "pentiumpro,generic32")
+ (and (eq_attr "cpu" "pentiumpro")
(and (eq_attr "memory" "both")
(eq_attr "type" "alu,alu1,negnot,incdec,icmp,test,setcc,icmov,push,pop,fxch,sseiadd,sseishft,sseimul,mmx,mmxadd,mmxcmp")))
"decoder0,p2+(p0|p1),p4+p3")
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index d093ae34ec7..34a37d200e7 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -7046,7 +7046,10 @@ ia64_set_sched_context (void *_sc)
static void
ia64_clear_sched_context (void *_sc)
{
- free (((ia64_sched_context_t) _sc)->prev_cycle_state);
+ ia64_sched_context_t sc = (ia64_sched_context_t) _sc;
+
+ free (sc->prev_cycle_state);
+ sc->prev_cycle_state = NULL;
}
/* Frees the _SC scheduling context. */
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 597f1edd567..8508f61fe2c 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -12105,7 +12105,7 @@ static rtx
r10k_simplify_address (rtx x, rtx insn)
{
rtx newx, op0, op1, set, def_insn, note;
- struct df_ref *use, *def;
+ df_ref use, def;
struct df_link *defs;
newx = NULL_RTX;
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 652eba526db..3d3c96dc087 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -7377,12 +7377,14 @@ int
attr_length_call (rtx insn, int sibcall)
{
int local_call;
- rtx call_dest;
+ rtx call, call_dest;
tree call_decl;
int length = 0;
rtx pat = PATTERN (insn);
unsigned long distance = -1;
+ gcc_assert (GET_CODE (insn) == CALL_INSN);
+
if (INSN_ADDRESSES_SET_P ())
{
unsigned long total;
@@ -7393,12 +7395,17 @@ attr_length_call (rtx insn, int sibcall)
distance = -1;
}
- /* Determine if this is a local call. */
- if (GET_CODE (XVECEXP (pat, 0, 0)) == CALL)
- call_dest = XEXP (XEXP (XVECEXP (pat, 0, 0), 0), 0);
- else
- call_dest = XEXP (XEXP (XEXP (XVECEXP (pat, 0, 0), 1), 0), 0);
+ gcc_assert (GET_CODE (pat) == PARALLEL);
+ /* Get the call rtx. */
+ call = XVECEXP (pat, 0, 0);
+ if (GET_CODE (call) == SET)
+ call = SET_SRC (call);
+
+ gcc_assert (GET_CODE (call) == CALL);
+
+ /* Determine if this is a local call. */
+ call_dest = XEXP (XEXP (call, 0), 0);
call_decl = SYMBOL_REF_DECL (call_dest);
local_call = call_decl && targetm.binds_local_p (call_decl);
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index b50ab4cb6e3..b845182d592 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -7669,19 +7669,20 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
need to have a use of the PIC register in the return pattern and
the final save/restore operation is not needed.
- I elected to just clobber %r4 in the PIC patterns and use it instead
+ I elected to just use register %r4 in the PIC patterns instead
of trying to force hppa_pic_save_rtx () to a callee saved register.
This might have required a new register class and constraint. It
was also simpler to just handle the restore from a register than a
generic pseudo. */
if (TARGET_64BIT)
{
+ rtx r4 = gen_rtx_REG (word_mode, 4);
if (GET_CODE (op) == SYMBOL_REF)
- call_insn = emit_call_insn (gen_call_symref_64bit (op, nb));
+ call_insn = emit_call_insn (gen_call_symref_64bit (op, nb, r4));
else
{
op = force_reg (word_mode, op);
- call_insn = emit_call_insn (gen_call_reg_64bit (op, nb));
+ call_insn = emit_call_insn (gen_call_reg_64bit (op, nb, r4));
}
}
else
@@ -7689,17 +7690,22 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
if (GET_CODE (op) == SYMBOL_REF)
{
if (flag_pic)
- call_insn = emit_call_insn (gen_call_symref_pic (op, nb));
+ {
+ rtx r4 = gen_rtx_REG (word_mode, 4);
+ call_insn = emit_call_insn (gen_call_symref_pic (op, nb, r4));
+ }
else
call_insn = emit_call_insn (gen_call_symref (op, nb));
}
else
{
rtx tmpreg = gen_rtx_REG (word_mode, 22);
-
emit_move_insn (tmpreg, force_reg (word_mode, op));
if (flag_pic)
- call_insn = emit_call_insn (gen_call_reg_pic (nb));
+ {
+ rtx r4 = gen_rtx_REG (word_mode, 4);
+ call_insn = emit_call_insn (gen_call_reg_pic (nb, r4));
+ }
else
call_insn = emit_call_insn (gen_call_reg (nb));
}
@@ -7754,69 +7760,64 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
(set (attr "length") (symbol_ref "attr_length_call (insn, 0)"))])
(define_insn "call_symref_pic"
- [(call (mem:SI (match_operand 0 "call_operand_address" ""))
+ [(set (match_operand:SI 2 "register_operand" "=&r") (reg:SI 19))
+ (call (mem:SI (match_operand 0 "call_operand_address" ""))
(match_operand 1 "" "i"))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
- (clobber (reg:SI 4))
+ (use (match_dup 2))
(use (reg:SI 19))
(use (const_int 0))]
"!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
- "*
-{
- output_arg_descriptor (insn);
- return output_call (insn, operands[0], 0);
-}"
- [(set_attr "type" "call")
- (set (attr "length")
- (plus (symbol_ref "attr_length_call (insn, 0)")
- (symbol_ref "attr_length_save_restore_dltp (insn)")))])
-
-;; Split out the PIC register save and restore after reload. This is
-;; done only if the function returns. As the split is done after reload,
-;; there are some situations in which we unnecessarily save and restore
-;; %r4. This happens when there is a single call and the PIC register
-;; is "dead" after the call. This isn't easy to fix as the usage of
-;; the PIC register isn't completely determined until the reload pass.
+ "#")
+
+;; Split out the PIC register save and restore after reload. As the
+;; split is done after reload, there are some situations in which we
+;; unnecessarily save and restore %r4. This happens when there is a
+;; single call and the PIC register is not used after the call.
+;;
+;; The split has to be done since call_from_call_insn () can't handle
+;; the pattern as is. Noreturn calls are special because they have to
+;; terminate the basic block. The split has to contain more than one
+;; insn.
(define_split
- [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
+ [(parallel [(set (match_operand:SI 2 "register_operand" "") (reg:SI 19))
+ (call (mem:SI (match_operand 0 "call_operand_address" ""))
(match_operand 1 "" ""))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
- (clobber (reg:SI 4))
+ (use (match_dup 2))
(use (reg:SI 19))
(use (const_int 0))])]
- "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT
- && reload_completed
- && !find_reg_note (insn, REG_NORETURN, NULL_RTX)"
- [(set (reg:SI 4) (reg:SI 19))
+ "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed
+ && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
+ [(set (match_dup 2) (reg:SI 19))
(parallel [(call (mem:SI (match_dup 0))
(match_dup 1))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
(use (reg:SI 19))
- (use (const_int 0))])
- (set (reg:SI 19) (reg:SI 4))]
+ (use (const_int 0))])]
"")
-;; Remove the clobber of register 4 when optimizing. This has to be
-;; done with a peephole optimization rather than a split because the
-;; split sequence for a call must be longer than one instruction.
-(define_peephole2
- [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
+(define_split
+ [(parallel [(set (match_operand:SI 2 "register_operand" "") (reg:SI 19))
+ (call (mem:SI (match_operand 0 "call_operand_address" ""))
(match_operand 1 "" ""))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
- (clobber (reg:SI 4))
+ (use (match_dup 2))
(use (reg:SI 19))
(use (const_int 0))])]
"!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed"
- [(parallel [(call (mem:SI (match_dup 0))
+ [(set (match_dup 2) (reg:SI 19))
+ (parallel [(call (mem:SI (match_dup 0))
(match_dup 1))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
(use (reg:SI 19))
- (use (const_int 0))])]
+ (use (const_int 0))])
+ (set (reg:SI 19) (match_dup 2))]
"")
(define_insn "*call_symref_pic_post_reload"
@@ -7838,74 +7839,69 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
;; This pattern is split if it is necessary to save and restore the
;; PIC register.
(define_insn "call_symref_64bit"
- [(call (mem:SI (match_operand 0 "call_operand_address" ""))
+ [(set (match_operand:DI 2 "register_operand" "=&r") (reg:DI 27))
+ (call (mem:SI (match_operand 0 "call_operand_address" ""))
(match_operand 1 "" "i"))
(clobber (reg:DI 1))
(clobber (reg:DI 2))
- (clobber (reg:DI 4))
+ (use (match_dup 2))
(use (reg:DI 27))
(use (reg:DI 29))
(use (const_int 0))]
"TARGET_64BIT"
- "*
-{
- output_arg_descriptor (insn);
- return output_call (insn, operands[0], 0);
-}"
- [(set_attr "type" "call")
- (set (attr "length")
- (plus (symbol_ref "attr_length_call (insn, 0)")
- (symbol_ref "attr_length_save_restore_dltp (insn)")))])
-
-;; Split out the PIC register save and restore after reload. This is
-;; done only if the function returns. As the split is done after reload,
-;; there are some situations in which we unnecessarily save and restore
-;; %r4. This happens when there is a single call and the PIC register
-;; is "dead" after the call. This isn't easy to fix as the usage of
-;; the PIC register isn't completely determined until the reload pass.
+ "#")
+
+;; Split out the PIC register save and restore after reload. As the
+;; split is done after reload, there are some situations in which we
+;; unnecessarily save and restore %r4. This happens when there is a
+;; single call and the PIC register is not used after the call.
+;;
+;; The split has to be done since call_from_call_insn () can't handle
+;; the pattern as is. Noreturn calls are special because they have to
+;; terminate the basic block. The split has to contain more than one
+;; insn.
(define_split
- [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
+ [(parallel [(set (match_operand:DI 2 "register_operand" "") (reg:DI 27))
+ (call (mem:SI (match_operand 0 "call_operand_address" ""))
(match_operand 1 "" ""))
(clobber (reg:DI 1))
(clobber (reg:DI 2))
- (clobber (reg:DI 4))
+ (use (match_dup 2))
(use (reg:DI 27))
(use (reg:DI 29))
(use (const_int 0))])]
- "TARGET_64BIT
- && reload_completed
- && !find_reg_note (insn, REG_NORETURN, NULL_RTX)"
- [(set (reg:DI 4) (reg:DI 27))
+ "TARGET_64BIT && reload_completed
+ && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
+ [(set (match_dup 2) (reg:DI 27))
(parallel [(call (mem:SI (match_dup 0))
(match_dup 1))
(clobber (reg:DI 1))
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
- (use (const_int 0))])
- (set (reg:DI 27) (reg:DI 4))]
+ (use (const_int 0))])]
"")
-;; Remove the clobber of register 4 when optimizing. This has to be
-;; done with a peephole optimization rather than a split because the
-;; split sequence for a call must be longer than one instruction.
-(define_peephole2
- [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
+(define_split
+ [(parallel [(set (match_operand:DI 2 "register_operand" "") (reg:DI 27))
+ (call (mem:SI (match_operand 0 "call_operand_address" ""))
(match_operand 1 "" ""))
(clobber (reg:DI 1))
(clobber (reg:DI 2))
- (clobber (reg:DI 4))
+ (use (match_dup 2))
(use (reg:DI 27))
(use (reg:DI 29))
(use (const_int 0))])]
"TARGET_64BIT && reload_completed"
- [(parallel [(call (mem:SI (match_dup 0))
+ [(set (match_dup 2) (reg:DI 27))
+ (parallel [(call (mem:SI (match_dup 0))
(match_dup 1))
(clobber (reg:DI 1))
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
- (use (const_int 0))])]
+ (use (const_int 0))])
+ (set (reg:DI 27) (match_dup 2))]
"")
(define_insn "*call_symref_64bit_post_reload"
@@ -7942,68 +7938,64 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
;; This pattern is split if it is necessary to save and restore the
;; PIC register.
(define_insn "call_reg_pic"
- [(call (mem:SI (reg:SI 22))
+ [(set (match_operand:SI 1 "register_operand" "=&r") (reg:SI 19))
+ (call (mem:SI (reg:SI 22))
(match_operand 0 "" "i"))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
- (clobber (reg:SI 4))
+ (use (match_dup 1))
(use (reg:SI 19))
(use (const_int 1))]
"!TARGET_64BIT"
- "*
-{
- return output_indirect_call (insn, gen_rtx_REG (word_mode, 22));
-}"
- [(set_attr "type" "dyncall")
- (set (attr "length")
- (plus (symbol_ref "attr_length_indirect_call (insn)")
- (symbol_ref "attr_length_save_restore_dltp (insn)")))])
-
-;; Split out the PIC register save and restore after reload. This is
-;; done only if the function returns. As the split is done after reload,
-;; there are some situations in which we unnecessarily save and restore
-;; %r4. This happens when there is a single call and the PIC register
-;; is "dead" after the call. This isn't easy to fix as the usage of
-;; the PIC register isn't completely determined until the reload pass.
+ "#")
+
+;; Split out the PIC register save and restore after reload. As the
+;; split is done after reload, there are some situations in which we
+;; unnecessarily save and restore %r4. This happens when there is a
+;; single call and the PIC register is not used after the call.
+;;
+;; The split has to be done since call_from_call_insn () can't handle
+;; the pattern as is. Noreturn calls are special because they have to
+;; terminate the basic block. The split has to contain more than one
+;; insn.
(define_split
- [(parallel [(call (mem:SI (reg:SI 22))
+ [(parallel [(set (match_operand:SI 1 "register_operand" "") (reg:SI 19))
+ (call (mem:SI (reg:SI 22))
(match_operand 0 "" ""))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
- (clobber (reg:SI 4))
+ (use (match_dup 1))
(use (reg:SI 19))
(use (const_int 1))])]
- "!TARGET_64BIT
- && reload_completed
- && !find_reg_note (insn, REG_NORETURN, NULL_RTX)"
- [(set (reg:SI 4) (reg:SI 19))
+ "!TARGET_64BIT && reload_completed
+ && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
+ [(set (match_dup 1) (reg:SI 19))
(parallel [(call (mem:SI (reg:SI 22))
(match_dup 0))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
(use (reg:SI 19))
- (use (const_int 1))])
- (set (reg:SI 19) (reg:SI 4))]
+ (use (const_int 1))])]
"")
-;; Remove the clobber of register 4 when optimizing. This has to be
-;; done with a peephole optimization rather than a split because the
-;; split sequence for a call must be longer than one instruction.
-(define_peephole2
- [(parallel [(call (mem:SI (reg:SI 22))
+(define_split
+ [(parallel [(set (match_operand:SI 1 "register_operand" "") (reg:SI 19))
+ (call (mem:SI (reg:SI 22))
(match_operand 0 "" ""))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
- (clobber (reg:SI 4))
+ (use (match_dup 1))
(use (reg:SI 19))
(use (const_int 1))])]
"!TARGET_64BIT && reload_completed"
- [(parallel [(call (mem:SI (reg:SI 22))
+ [(set (match_dup 1) (reg:SI 19))
+ (parallel [(call (mem:SI (reg:SI 22))
(match_dup 0))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
(use (reg:SI 19))
- (use (const_int 1))])]
+ (use (const_int 1))])
+ (set (reg:SI 19) (match_dup 1))]
"")
(define_insn "*call_reg_pic_post_reload"
@@ -8024,73 +8016,75 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
;; This pattern is split if it is necessary to save and restore the
;; PIC register.
(define_insn "call_reg_64bit"
- [(call (mem:SI (match_operand:DI 0 "register_operand" "r"))
+ [(set (match_operand:DI 2 "register_operand" "=&r") (reg:DI 27))
+ (call (mem:SI (match_operand:DI 0 "register_operand" "r"))
(match_operand 1 "" "i"))
+ (clobber (reg:DI 1))
(clobber (reg:DI 2))
- (clobber (reg:DI 4))
+ (use (match_dup 2))
(use (reg:DI 27))
(use (reg:DI 29))
(use (const_int 1))]
"TARGET_64BIT"
- "*
-{
- return output_indirect_call (insn, operands[0]);
-}"
- [(set_attr "type" "dyncall")
- (set (attr "length")
- (plus (symbol_ref "attr_length_indirect_call (insn)")
- (symbol_ref "attr_length_save_restore_dltp (insn)")))])
-
-;; Split out the PIC register save and restore after reload. This is
-;; done only if the function returns. As the split is done after reload,
-;; there are some situations in which we unnecessarily save and restore
-;; %r4. This happens when there is a single call and the PIC register
-;; is "dead" after the call. This isn't easy to fix as the usage of
-;; the PIC register isn't completely determined until the reload pass.
+ "#")
+
+;; Split out the PIC register save and restore after reload. As the
+;; split is done after reload, there are some situations in which we
+;; unnecessarily save and restore %r4. This happens when there is a
+;; single call and the PIC register is not used after the call.
+;;
+;; The split has to be done since call_from_call_insn () can't handle
+;; the pattern as is. Noreturn calls are special because they have to
+;; terminate the basic block. The split has to contain more than one
+;; insn.
(define_split
- [(parallel [(call (mem:SI (match_operand 0 "register_operand" ""))
+ [(parallel [(set (match_operand:DI 2 "register_operand" "") (reg:DI 27))
+ (call (mem:SI (match_operand 0 "register_operand" ""))
(match_operand 1 "" ""))
+ (clobber (reg:DI 1))
(clobber (reg:DI 2))
- (clobber (reg:DI 4))
+ (use (match_dup 2))
(use (reg:DI 27))
(use (reg:DI 29))
(use (const_int 1))])]
- "TARGET_64BIT
- && reload_completed
- && !find_reg_note (insn, REG_NORETURN, NULL_RTX)"
- [(set (reg:DI 4) (reg:DI 27))
+ "TARGET_64BIT && reload_completed
+ && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
+ [(set (match_dup 2) (reg:DI 27))
(parallel [(call (mem:SI (match_dup 0))
(match_dup 1))
+ (clobber (reg:DI 1))
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
- (use (const_int 1))])
- (set (reg:DI 27) (reg:DI 4))]
+ (use (const_int 1))])]
"")
-;; Remove the clobber of register 4 when optimizing. This has to be
-;; done with a peephole optimization rather than a split because the
-;; split sequence for a call must be longer than one instruction.
-(define_peephole2
- [(parallel [(call (mem:SI (match_operand 0 "register_operand" ""))
+(define_split
+ [(parallel [(set (match_operand:DI 2 "register_operand" "") (reg:DI 27))
+ (call (mem:SI (match_operand 0 "register_operand" ""))
(match_operand 1 "" ""))
+ (clobber (reg:DI 1))
(clobber (reg:DI 2))
- (clobber (reg:DI 4))
+ (use (match_dup 2))
(use (reg:DI 27))
(use (reg:DI 29))
(use (const_int 1))])]
"TARGET_64BIT && reload_completed"
- [(parallel [(call (mem:SI (match_dup 0))
+ [(set (match_dup 2) (reg:DI 27))
+ (parallel [(call (mem:SI (match_dup 0))
(match_dup 1))
+ (clobber (reg:DI 1))
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
- (use (const_int 1))])]
+ (use (const_int 1))])
+ (set (reg:DI 27) (match_dup 2))]
"")
(define_insn "*call_reg_64bit_post_reload"
[(call (mem:SI (match_operand:DI 0 "register_operand" "r"))
(match_operand 1 "" "i"))
+ (clobber (reg:DI 1))
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
@@ -8168,19 +8162,22 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
need to have a use of the PIC register in the return pattern and
the final save/restore operation is not needed.
- I elected to just clobber %r4 in the PIC patterns and use it instead
+ I elected to just use register %r4 in the PIC patterns instead
of trying to force hppa_pic_save_rtx () to a callee saved register.
This might have required a new register class and constraint. It
was also simpler to just handle the restore from a register than a
generic pseudo. */
if (TARGET_64BIT)
{
+ rtx r4 = gen_rtx_REG (word_mode, 4);
if (GET_CODE (op) == SYMBOL_REF)
- call_insn = emit_call_insn (gen_call_val_symref_64bit (dst, op, nb));
+ call_insn
+ = emit_call_insn (gen_call_val_symref_64bit (dst, op, nb, r4));
else
{
op = force_reg (word_mode, op);
- call_insn = emit_call_insn (gen_call_val_reg_64bit (dst, op, nb));
+ call_insn
+ = emit_call_insn (gen_call_val_reg_64bit (dst, op, nb, r4));
}
}
else
@@ -8188,17 +8185,23 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
if (GET_CODE (op) == SYMBOL_REF)
{
if (flag_pic)
- call_insn = emit_call_insn (gen_call_val_symref_pic (dst, op, nb));
+ {
+ rtx r4 = gen_rtx_REG (word_mode, 4);
+ call_insn
+ = emit_call_insn (gen_call_val_symref_pic (dst, op, nb, r4));
+ }
else
call_insn = emit_call_insn (gen_call_val_symref (dst, op, nb));
}
else
{
rtx tmpreg = gen_rtx_REG (word_mode, 22);
-
emit_move_insn (tmpreg, force_reg (word_mode, op));
if (flag_pic)
- call_insn = emit_call_insn (gen_call_val_reg_pic (dst, nb));
+ {
+ rtx r4 = gen_rtx_REG (word_mode, 4);
+ call_insn = emit_call_insn (gen_call_val_reg_pic (dst, nb, r4));
+ }
else
call_insn = emit_call_insn (gen_call_val_reg (dst, nb));
}
@@ -8224,74 +8227,69 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
(set (attr "length") (symbol_ref "attr_length_call (insn, 0)"))])
(define_insn "call_val_symref_pic"
- [(set (match_operand 0 "" "")
+ [(set (match_operand:SI 3 "register_operand" "=&r") (reg:SI 19))
+ (set (match_operand 0 "" "")
(call (mem:SI (match_operand 1 "call_operand_address" ""))
(match_operand 2 "" "i")))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
- (clobber (reg:SI 4))
+ (use (match_dup 3))
(use (reg:SI 19))
(use (const_int 0))]
"!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
- "*
-{
- output_arg_descriptor (insn);
- return output_call (insn, operands[1], 0);
-}"
- [(set_attr "type" "call")
- (set (attr "length")
- (plus (symbol_ref "attr_length_call (insn, 0)")
- (symbol_ref "attr_length_save_restore_dltp (insn)")))])
-
-;; Split out the PIC register save and restore after reload. This is
-;; done only if the function returns. As the split is done after reload,
-;; there are some situations in which we unnecessarily save and restore
-;; %r4. This happens when there is a single call and the PIC register
-;; is "dead" after the call. This isn't easy to fix as the usage of
-;; the PIC register isn't completely determined until the reload pass.
+ "#")
+
+;; Split out the PIC register save and restore after reload. As the
+;; split is done after reload, there are some situations in which we
+;; unnecessarily save and restore %r4. This happens when there is a
+;; single call and the PIC register is not used after the call.
+;;
+;; The split has to be done since call_from_call_insn () can't handle
+;; the pattern as is. Noreturn calls are special because they have to
+;; terminate the basic block. The split has to contain more than one
+;; insn.
(define_split
- [(parallel [(set (match_operand 0 "" "")
+ [(parallel [(set (match_operand:SI 3 "register_operand" "") (reg:SI 19))
+ (set (match_operand 0 "" "")
(call (mem:SI (match_operand 1 "call_operand_address" ""))
(match_operand 2 "" "")))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
- (clobber (reg:SI 4))
+ (use (match_dup 3))
(use (reg:SI 19))
(use (const_int 0))])]
- "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT
- && reload_completed
- && !find_reg_note (insn, REG_NORETURN, NULL_RTX)"
- [(set (reg:SI 4) (reg:SI 19))
+ "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed
+ && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
+ [(set (match_dup 3) (reg:SI 19))
(parallel [(set (match_dup 0)
(call (mem:SI (match_dup 1))
(match_dup 2)))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
(use (reg:SI 19))
- (use (const_int 0))])
- (set (reg:SI 19) (reg:SI 4))]
+ (use (const_int 0))])]
"")
-;; Remove the clobber of register 4 when optimizing. This has to be
-;; done with a peephole optimization rather than a split because the
-;; split sequence for a call must be longer than one instruction.
-(define_peephole2
- [(parallel [(set (match_operand 0 "" "")
+(define_split
+ [(parallel [(set (match_operand:SI 3 "register_operand" "") (reg:SI 19))
+ (set (match_operand 0 "" "")
(call (mem:SI (match_operand 1 "call_operand_address" ""))
(match_operand 2 "" "")))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
- (clobber (reg:SI 4))
+ (use (match_dup 3))
(use (reg:SI 19))
(use (const_int 0))])]
"!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed"
- [(parallel [(set (match_dup 0)
+ [(set (match_dup 3) (reg:SI 19))
+ (parallel [(set (match_dup 0)
(call (mem:SI (match_dup 1))
(match_dup 2)))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
(use (reg:SI 19))
- (use (const_int 0))])]
+ (use (const_int 0))])
+ (set (reg:SI 19) (match_dup 3))]
"")
(define_insn "*call_val_symref_pic_post_reload"
@@ -8314,46 +8312,42 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
;; This pattern is split if it is necessary to save and restore the
;; PIC register.
(define_insn "call_val_symref_64bit"
- [(set (match_operand 0 "" "")
+ [(set (match_operand:DI 3 "register_operand" "=&r") (reg:DI 27))
+ (set (match_operand 0 "" "")
(call (mem:SI (match_operand 1 "call_operand_address" ""))
(match_operand 2 "" "i")))
(clobber (reg:DI 1))
(clobber (reg:DI 2))
- (clobber (reg:DI 4))
+ (use (match_dup 3))
(use (reg:DI 27))
(use (reg:DI 29))
(use (const_int 0))]
"TARGET_64BIT"
- "*
-{
- output_arg_descriptor (insn);
- return output_call (insn, operands[1], 0);
-}"
- [(set_attr "type" "call")
- (set (attr "length")
- (plus (symbol_ref "attr_length_call (insn, 0)")
- (symbol_ref "attr_length_save_restore_dltp (insn)")))])
-
-;; Split out the PIC register save and restore after reload. This is
-;; done only if the function returns. As the split is done after reload,
-;; there are some situations in which we unnecessarily save and restore
-;; %r4. This happens when there is a single call and the PIC register
-;; is "dead" after the call. This isn't easy to fix as the usage of
-;; the PIC register isn't completely determined until the reload pass.
+ "#")
+
+;; Split out the PIC register save and restore after reload. As the
+;; split is done after reload, there are some situations in which we
+;; unnecessarily save and restore %r4. This happens when there is a
+;; single call and the PIC register is not used after the call.
+;;
+;; The split has to be done since call_from_call_insn () can't handle
+;; the pattern as is. Noreturn calls are special because they have to
+;; terminate the basic block. The split has to contain more than one
+;; insn.
(define_split
- [(parallel [(set (match_operand 0 "" "")
+ [(parallel [(set (match_operand:DI 3 "register_operand" "") (reg:DI 27))
+ (set (match_operand 0 "" "")
(call (mem:SI (match_operand 1 "call_operand_address" ""))
(match_operand 2 "" "")))
(clobber (reg:DI 1))
(clobber (reg:DI 2))
- (clobber (reg:DI 4))
+ (use (match_dup 3))
(use (reg:DI 27))
(use (reg:DI 29))
(use (const_int 0))])]
- "TARGET_64BIT
- && reload_completed
- && !find_reg_note (insn, REG_NORETURN, NULL_RTX)"
- [(set (reg:DI 4) (reg:DI 27))
+ "TARGET_64BIT && reload_completed
+ && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
+ [(set (match_dup 3) (reg:DI 27))
(parallel [(set (match_dup 0)
(call (mem:SI (match_dup 1))
(match_dup 2)))
@@ -8361,32 +8355,31 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
- (use (const_int 0))])
- (set (reg:DI 27) (reg:DI 4))]
+ (use (const_int 0))])]
"")
-;; Remove the clobber of register 4 when optimizing. This has to be
-;; done with a peephole optimization rather than a split because the
-;; split sequence for a call must be longer than one instruction.
-(define_peephole2
- [(parallel [(set (match_operand 0 "" "")
+(define_split
+ [(parallel [(set (match_operand:DI 3 "register_operand" "") (reg:DI 27))
+ (set (match_operand 0 "" "")
(call (mem:SI (match_operand 1 "call_operand_address" ""))
(match_operand 2 "" "")))
(clobber (reg:DI 1))
(clobber (reg:DI 2))
- (clobber (reg:DI 4))
+ (use (match_dup 3))
(use (reg:DI 27))
(use (reg:DI 29))
(use (const_int 0))])]
"TARGET_64BIT && reload_completed"
- [(parallel [(set (match_dup 0)
+ [(set (match_dup 3) (reg:DI 27))
+ (parallel [(set (match_dup 0)
(call (mem:SI (match_dup 1))
(match_dup 2)))
(clobber (reg:DI 1))
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
- (use (const_int 0))])]
+ (use (const_int 0))])
+ (set (reg:DI 27) (match_dup 3))]
"")
(define_insn "*call_val_symref_64bit_post_reload"
@@ -8425,73 +8418,69 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
;; This pattern is split if it is necessary to save and restore the
;; PIC register.
(define_insn "call_val_reg_pic"
- [(set (match_operand 0 "" "")
+ [(set (match_operand:SI 2 "register_operand" "=&r") (reg:SI 19))
+ (set (match_operand 0 "" "")
(call (mem:SI (reg:SI 22))
(match_operand 1 "" "i")))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
- (clobber (reg:SI 4))
+ (use (match_dup 2))
(use (reg:SI 19))
(use (const_int 1))]
"!TARGET_64BIT"
- "*
-{
- return output_indirect_call (insn, gen_rtx_REG (word_mode, 22));
-}"
- [(set_attr "type" "dyncall")
- (set (attr "length")
- (plus (symbol_ref "attr_length_indirect_call (insn)")
- (symbol_ref "attr_length_save_restore_dltp (insn)")))])
-
-;; Split out the PIC register save and restore after reload. This is
-;; done only if the function returns. As the split is done after reload,
-;; there are some situations in which we unnecessarily save and restore
-;; %r4. This happens when there is a single call and the PIC register
-;; is "dead" after the call. This isn't easy to fix as the usage of
-;; the PIC register isn't completely determined until the reload pass.
+ "#")
+
+;; Split out the PIC register save and restore after reload. As the
+;; split is done after reload, there are some situations in which we
+;; unnecessarily save and restore %r4. This happens when there is a
+;; single call and the PIC register is not used after the call.
+;;
+;; The split has to be done since call_from_call_insn () can't handle
+;; the pattern as is. Noreturn calls are special because they have to
+;; terminate the basic block. The split has to contain more than one
+;; insn.
(define_split
- [(parallel [(set (match_operand 0 "" "")
+ [(parallel [(set (match_operand:SI 2 "register_operand" "") (reg:SI 19))
+ (set (match_operand 0 "" "")
(call (mem:SI (reg:SI 22))
(match_operand 1 "" "")))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
- (clobber (reg:SI 4))
+ (use (match_dup 2))
(use (reg:SI 19))
(use (const_int 1))])]
- "!TARGET_64BIT
- && reload_completed
- && !find_reg_note (insn, REG_NORETURN, NULL_RTX)"
- [(set (reg:SI 4) (reg:SI 19))
+ "!TARGET_64BIT && reload_completed
+ && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
+ [(set (match_dup 2) (reg:SI 19))
(parallel [(set (match_dup 0)
(call (mem:SI (reg:SI 22))
(match_dup 1)))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
(use (reg:SI 19))
- (use (const_int 1))])
- (set (reg:SI 19) (reg:SI 4))]
+ (use (const_int 1))])]
"")
-;; Remove the clobber of register 4 when optimizing. This has to be
-;; done with a peephole optimization rather than a split because the
-;; split sequence for a call must be longer than one instruction.
-(define_peephole2
- [(parallel [(set (match_operand 0 "" "")
+(define_split
+ [(parallel [(set (match_operand:SI 2 "register_operand" "") (reg:SI 19))
+ (set (match_operand 0 "" "")
(call (mem:SI (reg:SI 22))
(match_operand 1 "" "")))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
- (clobber (reg:SI 4))
+ (use (match_dup 2))
(use (reg:SI 19))
(use (const_int 1))])]
"!TARGET_64BIT && reload_completed"
- [(parallel [(set (match_dup 0)
+ [(set (match_dup 2) (reg:SI 19))
+ (parallel [(set (match_dup 0)
(call (mem:SI (reg:SI 22))
(match_dup 1)))
(clobber (reg:SI 1))
(clobber (reg:SI 2))
(use (reg:SI 19))
- (use (const_int 1))])]
+ (use (const_int 1))])
+ (set (reg:SI 19) (match_dup 2))]
"")
(define_insn "*call_val_reg_pic_post_reload"
@@ -8513,79 +8502,81 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
;; This pattern is split if it is necessary to save and restore the
;; PIC register.
(define_insn "call_val_reg_64bit"
- [(set (match_operand 0 "" "")
+ [(set (match_operand:DI 3 "register_operand" "=&r") (reg:DI 27))
+ (set (match_operand 0 "" "")
(call (mem:SI (match_operand:DI 1 "register_operand" "r"))
(match_operand 2 "" "i")))
+ (clobber (reg:DI 1))
(clobber (reg:DI 2))
- (clobber (reg:DI 4))
+ (use (match_dup 3))
(use (reg:DI 27))
(use (reg:DI 29))
(use (const_int 1))]
"TARGET_64BIT"
- "*
-{
- return output_indirect_call (insn, operands[1]);
-}"
- [(set_attr "type" "dyncall")
- (set (attr "length")
- (plus (symbol_ref "attr_length_indirect_call (insn)")
- (symbol_ref "attr_length_save_restore_dltp (insn)")))])
-
-;; Split out the PIC register save and restore after reload. This is
-;; done only if the function returns. As the split is done after reload,
-;; there are some situations in which we unnecessarily save and restore
-;; %r4. This happens when there is a single call and the PIC register
-;; is "dead" after the call. This isn't easy to fix as the usage of
-;; the PIC register isn't completely determined until the reload pass.
+ "#")
+
+;; Split out the PIC register save and restore after reload. As the
+;; split is done after reload, there are some situations in which we
+;; unnecessarily save and restore %r4. This happens when there is a
+;; single call and the PIC register is not used after the call.
+;;
+;; The split has to be done since call_from_call_insn () can't handle
+;; the pattern as is. Noreturn calls are special because they have to
+;; terminate the basic block. The split has to contain more than one
+;; insn.
(define_split
- [(parallel [(set (match_operand 0 "" "")
+ [(parallel [(set (match_operand:DI 3 "register_operand" "") (reg:DI 27))
+ (set (match_operand 0 "" "")
(call (mem:SI (match_operand:DI 1 "register_operand" ""))
(match_operand 2 "" "")))
+ (clobber (reg:DI 1))
(clobber (reg:DI 2))
- (clobber (reg:DI 4))
+ (use (match_dup 3))
(use (reg:DI 27))
(use (reg:DI 29))
(use (const_int 1))])]
- "TARGET_64BIT
- && reload_completed
- && !find_reg_note (insn, REG_NORETURN, NULL_RTX)"
- [(set (reg:DI 4) (reg:DI 27))
+ "TARGET_64BIT && reload_completed
+ && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
+ [(set (match_dup 3) (reg:DI 27))
(parallel [(set (match_dup 0)
(call (mem:SI (match_dup 1))
(match_dup 2)))
+ (clobber (reg:DI 1))
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
- (use (const_int 1))])
- (set (reg:DI 27) (reg:DI 4))]
+ (use (const_int 1))])]
"")
-;; Remove the clobber of register 4 when optimizing. This has to be
-;; done with a peephole optimization rather than a split because the
-;; split sequence for a call must be longer than one instruction.
-(define_peephole2
- [(parallel [(set (match_operand 0 "" "")
+(define_split
+ [(parallel [(set (match_operand:DI 3 "register_operand" "") (reg:DI 27))
+ (set (match_operand 0 "" "")
(call (mem:SI (match_operand:DI 1 "register_operand" ""))
(match_operand 2 "" "")))
+ (clobber (reg:DI 1))
(clobber (reg:DI 2))
- (clobber (reg:DI 4))
+ (use (match_dup 3))
(use (reg:DI 27))
(use (reg:DI 29))
(use (const_int 1))])]
"TARGET_64BIT && reload_completed"
- [(parallel [(set (match_dup 0)
+ [(set (match_dup 3) (reg:DI 27))
+ (parallel [(set (match_dup 0)
(call (mem:SI (match_dup 1))
(match_dup 2)))
+ (clobber (reg:DI 1))
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
- (use (const_int 1))])]
+ (use (const_int 1))])
+ (set (reg:DI 27) (match_dup 3))]
"")
(define_insn "*call_val_reg_64bit_post_reload"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:DI 1 "register_operand" "r"))
(match_operand 2 "" "i")))
+ (clobber (reg:DI 1))
(clobber (reg:DI 2))
(use (reg:DI 27))
(use (reg:DI 29))
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 9f48b611e6f..49828de96e4 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -2199,11 +2199,25 @@ optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
flag_section_anchors = 2;
}
+static enum fpu_type_t
+rs6000_parse_fpu_option (const char *option)
+{
+ if (!strcmp("none", option)) return FPU_NONE;
+ if (!strcmp("sp_lite", option)) return FPU_SF_LITE;
+ if (!strcmp("dp_lite", option)) return FPU_DF_LITE;
+ if (!strcmp("sp_full", option)) return FPU_SF_FULL;
+ if (!strcmp("dp_full", option)) return FPU_DF_FULL;
+ error("unknown value %s for -mfpu", option);
+ return FPU_NONE;
+}
+
/* Implement TARGET_HANDLE_OPTION. */
static bool
rs6000_handle_option (size_t code, const char *arg, int value)
{
+ enum fpu_type_t fpu_type = FPU_NONE;
+
switch (code)
{
case OPT_mno_power:
@@ -2523,6 +2537,30 @@ rs6000_handle_option (size_t code, const char *arg, int value)
/* -msoft_float implies -mnosingle-float and -mnodouble-float. */
rs6000_single_float = rs6000_double_float = 0;
break;
+
+ case OPT_mfpu_:
+ fpu_type = rs6000_parse_fpu_option(arg);
+ if (fpu_type != FPU_NONE)
+ /* If -mfpu is not none, then turn off SOFT_FLOAT, turn on HARD_FLOAT. */
+ {
+ target_flags &= ~MASK_SOFT_FLOAT;
+ target_flags_explicit |= MASK_SOFT_FLOAT;
+ rs6000_xilinx_fpu = 1;
+ if (fpu_type == FPU_SF_LITE || fpu_type == FPU_SF_FULL)
+ rs6000_single_float = 1;
+ if (fpu_type == FPU_DF_LITE || fpu_type == FPU_DF_FULL)
+ rs6000_single_float = rs6000_double_float = 1;
+ if (fpu_type == FPU_SF_LITE || fpu_type == FPU_DF_LITE)
+ rs6000_simple_fpu = 1;
+ }
+ else
+ {
+ /* -mfpu=none is equivalent to -msoft-float */
+ target_flags |= MASK_SOFT_FLOAT;
+ target_flags_explicit |= MASK_SOFT_FLOAT;
+ rs6000_single_float = rs6000_double_float = 0;
+ }
+ break;
}
return true;
}
@@ -3860,6 +3898,7 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
&& GET_CODE (x) != CONST_INT
&& GET_CODE (x) != CONST_DOUBLE
&& CONSTANT_P (x)
+ && GET_MODE_NUNITS (mode) == 1
&& ((TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT)
|| (mode != DFmode && mode != DDmode))
&& mode != DImode
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 39fc0f6c9b6..de212cd9c05 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -305,6 +305,7 @@ enum processor_type
#define TARGET_DOUBLE_FLOAT 1
#define TARGET_SINGLE_FPU 0
#define TARGET_SIMPLE_FPU 0
+#define TARGET_XILINX_FPU 0
extern enum processor_type rs6000_cpu;
@@ -321,6 +322,18 @@ extern enum processor_type rs6000_cpu;
#define PROCESSOR_DEFAULT PROCESSOR_RIOS1
#define PROCESSOR_DEFAULT64 PROCESSOR_RS64A
+/* FP processor type. */
+enum fpu_type_t
+{
+ FPU_NONE, /* No FPU */
+ FPU_SF_LITE, /* Limited Single Precision FPU */
+ FPU_DF_LITE, /* Limited Double Precision FPU */
+ FPU_SF_FULL, /* Full Single Precision FPU */
+ FPU_DF_FULL /* Full Double Single Precision FPU */
+};
+
+extern enum fpu_type_t fpu_type;
+
/* Specify the dialect of assembler to use. New mnemonics is dialect one
and the old mnemonics are dialect zero. */
#define ASSEMBLER_DIALECT (TARGET_NEW_MNEMONICS ? 1 : 0)
@@ -393,6 +406,7 @@ extern int rs6000_float_gprs;
extern int rs6000_alignment_flags;
extern const char *rs6000_sched_insert_nops_str;
extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
+extern int rs6000_xilinx_fpu;
/* Alignment options for fields in structures for sub-targets following
AIX-like ABI.
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 044b11765e9..3078cb33db0 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -119,6 +119,9 @@
(define_attr "type" "integer,two,three,load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,store,store_ux,store_u,fpload,fpload_ux,fpload_u,fpstore,fpstore_ux,fpstore_u,vecload,vecstore,imul,imul2,imul3,lmul,idiv,ldiv,insert_word,branch,cmp,fast_compare,compare,var_delayed_compare,delayed_compare,imul_compare,lmul_compare,fpcompare,cr_logical,delayed_cr,mfcr,mfcrf,mtcr,mfjmpr,mtjmpr,fp,fpsimple,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg,brinc,vecsimple,veccomplex,vecdiv,veccmp,veccmpsimple,vecperm,vecfloat,vecfdiv,isync,sync,load_l,store_c,shift,trap,insert_dword,var_shift_rotate,cntlz,exts,mffgpr,mftgpr"
(const_string "integer"))
+;; Define floating point instruction sub-types for use with Xfpu.md
+(define_attr "fp_type" "fp_default,fp_addsub_s,fp_addsub_d,fp_mul_s,fp_mul_d,fp_div_s,fp_div_d,fp_maddsub_s,fp_maddsub_d,fp_sqrt_s,fp_sqrt_d" (const_string "fp_default"))
+
;; Length (in bytes).
; '(pc)' in the following doesn't include the instruction itself; it is
; calculated as if the instruction had zero size.
@@ -174,6 +177,7 @@
(include "power5.md")
(include "power6.md")
(include "cell.md")
+(include "xfpu.md")
(include "predicates.md")
(include "constraints.md")
@@ -5099,7 +5103,7 @@
(define_insn "aux_truncdfsf2"
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(unspec:SF [(match_operand:SF 1 "gpc_reg_operand" "f")] UNSPEC_FRSP))]
- "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT"
+ "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
"frsp %0,%1"
[(set_attr "type" "fp")])
@@ -5147,15 +5151,16 @@
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(plus:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
(match_operand:SF 2 "gpc_reg_operand" "f")))]
-"TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT"
+ "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT"
"fadds %0,%1,%2"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_addsub_s")])
(define_insn ""
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(plus:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
(match_operand:SF 2 "gpc_reg_operand" "f")))]
- "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT"
+ "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
"{fa|fadd} %0,%1,%2"
[(set_attr "type" "fp")])
@@ -5172,13 +5177,14 @@
(match_operand:SF 2 "gpc_reg_operand" "f")))]
"TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT"
"fsubs %0,%1,%2"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_addsub_s")])
(define_insn ""
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(minus:SF (match_operand:SF 1 "gpc_reg_operand" "f")
(match_operand:SF 2 "gpc_reg_operand" "f")))]
- "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT"
+ "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
"{fs|fsub} %0,%1,%2"
[(set_attr "type" "fp")])
@@ -5195,13 +5201,14 @@
(match_operand:SF 2 "gpc_reg_operand" "f")))]
"TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT"
"fmuls %0,%1,%2"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_mul_s")])
(define_insn ""
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
(match_operand:SF 2 "gpc_reg_operand" "f")))]
- "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT"
+ "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
"{fm|fmul} %0,%1,%2"
[(set_attr "type" "dmul")])
@@ -5254,18 +5261,18 @@
(plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
(match_operand:SF 2 "gpc_reg_operand" "f"))
(match_operand:SF 3 "gpc_reg_operand" "f")))]
- "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS
+ "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS
&& TARGET_SINGLE_FLOAT && TARGET_FUSED_MADD"
"fmadds %0,%1,%2,%3"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_maddsub_s")])
(define_insn ""
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
(match_operand:SF 2 "gpc_reg_operand" "f"))
(match_operand:SF 3 "gpc_reg_operand" "f")))]
- "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_SINGLE_FLOAT && TARGET_FUSED_MADD"
+ "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
"{fma|fmadd} %0,%1,%2,%3"
[(set_attr "type" "dmul")])
@@ -5274,18 +5281,18 @@
(minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
(match_operand:SF 2 "gpc_reg_operand" "f"))
(match_operand:SF 3 "gpc_reg_operand" "f")))]
- "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS
+ "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS
&& TARGET_SINGLE_FLOAT && TARGET_FUSED_MADD"
"fmsubs %0,%1,%2,%3"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_maddsub_s")])
(define_insn ""
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
(match_operand:SF 2 "gpc_reg_operand" "f"))
(match_operand:SF 3 "gpc_reg_operand" "f")))]
- "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_SINGLE_FLOAT && TARGET_FUSED_MADD"
+ "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
"{fms|fmsub} %0,%1,%2,%3"
[(set_attr "type" "dmul")])
@@ -5297,7 +5304,8 @@
"TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
&& TARGET_SINGLE_FLOAT && HONOR_SIGNED_ZEROS (SFmode)"
"fnmadds %0,%1,%2,%3"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_maddsub_s")])
(define_insn ""
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
@@ -5307,15 +5315,15 @@
"TARGET_POWERPC && TARGET_SINGLE_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
&& ! HONOR_SIGNED_ZEROS (SFmode)"
"fnmadds %0,%1,%2,%3"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_maddsub_s")])
(define_insn ""
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(neg:SF (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
(match_operand:SF 2 "gpc_reg_operand" "f"))
(match_operand:SF 3 "gpc_reg_operand" "f"))))]
- "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_SINGLE_FLOAT && TARGET_FUSED_MADD"
+ "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
"{fnma|fnmadd} %0,%1,%2,%3"
[(set_attr "type" "dmul")])
@@ -5325,7 +5333,7 @@
(match_operand:SF 2 "gpc_reg_operand" "f"))
(match_operand:SF 3 "gpc_reg_operand" "f")))]
"! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
- && TARGET_SINGLE_FLOAT && ! HONOR_SIGNED_ZEROS (SFmode)"
+ && ! HONOR_SIGNED_ZEROS (SFmode)"
"{fnma|fnmadd} %0,%1,%2,%3"
[(set_attr "type" "dmul")])
@@ -5337,7 +5345,8 @@
"TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
&& TARGET_SINGLE_FLOAT && HONOR_SIGNED_ZEROS (SFmode)"
"fnmsubs %0,%1,%2,%3"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_maddsub_s")])
(define_insn ""
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
@@ -5347,15 +5356,15 @@
"TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
&& TARGET_SINGLE_FLOAT && ! HONOR_SIGNED_ZEROS (SFmode)"
"fnmsubs %0,%1,%2,%3"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_maddsub_s")])
(define_insn ""
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(neg:SF (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
(match_operand:SF 2 "gpc_reg_operand" "f"))
(match_operand:SF 3 "gpc_reg_operand" "f"))))]
- "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_SINGLE_FLOAT && TARGET_FUSED_MADD"
+ "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
"{fnms|fnmsub} %0,%1,%2,%3"
[(set_attr "type" "dmul")])
@@ -5365,22 +5374,22 @@
(mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
(match_operand:SF 2 "gpc_reg_operand" "f"))))]
"! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
- && TARGET_SINGLE_FLOAT && ! HONOR_SIGNED_ZEROS (SFmode)"
+ && ! HONOR_SIGNED_ZEROS (SFmode)"
"{fnms|fnmsub} %0,%1,%2,%3"
[(set_attr "type" "dmul")])
(define_expand "sqrtsf2"
[(set (match_operand:SF 0 "gpc_reg_operand" "")
(sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "")))]
- "(TARGET_PPC_GPOPT || TARGET_POWER2)
- && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT
+ "(TARGET_PPC_GPOPT || TARGET_POWER2 || TARGET_XILINX_FPU)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_SINGLE_FLOAT
&& !TARGET_SIMPLE_FPU"
"")
(define_insn ""
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
- "TARGET_PPC_GPOPT && TARGET_HARD_FLOAT
+ "(TARGET_PPC_GPOPT || TARGET_XILINX_FPU) && TARGET_HARD_FLOAT
&& TARGET_FPRS && TARGET_SINGLE_FLOAT && !TARGET_SIMPLE_FPU"
"fsqrts %0,%1"
[(set_attr "type" "ssqrt")])
@@ -5614,7 +5623,8 @@
(match_operand:DF 2 "gpc_reg_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT"
"{fa|fadd} %0,%1,%2"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_addsub_d")])
(define_expand "subdf3"
[(set (match_operand:DF 0 "gpc_reg_operand" "")
@@ -5629,7 +5639,8 @@
(match_operand:DF 2 "gpc_reg_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT"
"{fs|fsub} %0,%1,%2"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_addsub_d")])
(define_expand "muldf3"
[(set (match_operand:DF 0 "gpc_reg_operand" "")
@@ -5644,13 +5655,16 @@
(match_operand:DF 2 "gpc_reg_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT"
"{fm|fmul} %0,%1,%2"
- [(set_attr "type" "dmul")])
+ [(set_attr "type" "dmul")
+ (set_attr "fp_type" "fp_mul_d")])
(define_expand "divdf3"
[(set (match_operand:DF 0 "gpc_reg_operand" "")
(div:DF (match_operand:DF 1 "gpc_reg_operand" "")
(match_operand:DF 2 "gpc_reg_operand" "")))]
- "TARGET_HARD_FLOAT && ((TARGET_FPRS && TARGET_DOUBLE_FLOAT) || TARGET_E500_DOUBLE) && !TARGET_SIMPLE_FPU"
+ "TARGET_HARD_FLOAT
+ && ((TARGET_FPRS && TARGET_DOUBLE_FLOAT) || TARGET_E500_DOUBLE)
+ && !TARGET_SIMPLE_FPU"
"")
(define_insn "*divdf3_fpr"
@@ -5687,7 +5701,8 @@
(match_operand:DF 3 "gpc_reg_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD && TARGET_DOUBLE_FLOAT"
"{fma|fmadd} %0,%1,%2,%3"
- [(set_attr "type" "dmul")])
+ [(set_attr "type" "dmul")
+ (set_attr "fp_type" "fp_maddsub_d")])
(define_insn ""
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
@@ -5696,7 +5711,8 @@
(match_operand:DF 3 "gpc_reg_operand" "f")))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD && TARGET_DOUBLE_FLOAT"
"{fms|fmsub} %0,%1,%2,%3"
- [(set_attr "type" "dmul")])
+ [(set_attr "type" "dmul")
+ (set_attr "fp_type" "fp_maddsub_d")])
(define_insn ""
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
@@ -5706,7 +5722,8 @@
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD && TARGET_DOUBLE_FLOAT
&& HONOR_SIGNED_ZEROS (DFmode)"
"{fnma|fnmadd} %0,%1,%2,%3"
- [(set_attr "type" "dmul")])
+ [(set_attr "type" "dmul")
+ (set_attr "fp_type" "fp_maddsub_d")])
(define_insn ""
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
@@ -5716,7 +5733,8 @@
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD && TARGET_DOUBLE_FLOAT
&& ! HONOR_SIGNED_ZEROS (DFmode)"
"{fnma|fnmadd} %0,%1,%2,%3"
- [(set_attr "type" "dmul")])
+ [(set_attr "type" "dmul")
+ (set_attr "fp_type" "fp_maddsub_d")])
(define_insn ""
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
@@ -5726,7 +5744,8 @@
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD && TARGET_DOUBLE_FLOAT
&& HONOR_SIGNED_ZEROS (DFmode)"
"{fnms|fnmsub} %0,%1,%2,%3"
- [(set_attr "type" "dmul")])
+ [(set_attr "type" "dmul")
+ (set_attr "fp_type" "fp_maddsub_d")])
(define_insn ""
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
@@ -5736,7 +5755,8 @@
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD && TARGET_DOUBLE_FLOAT
&& ! HONOR_SIGNED_ZEROS (DFmode)"
"{fnms|fnmsub} %0,%1,%2,%3"
- [(set_attr "type" "dmul")])
+ [(set_attr "type" "dmul")
+ (set_attr "fp_type" "fp_maddsub_d")])
(define_insn "sqrtdf2"
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
@@ -5826,10 +5846,10 @@
"")
(define_expand "fix_truncsfsi2"
- [(set (match_operand:SI 0 "gpc_reg_operand" "")
- (fix:SI (match_operand:SF 1 "gpc_reg_operand" "")))]
- "TARGET_HARD_FLOAT && !TARGET_FPRS && TARGET_SINGLE_FLOAT"
- "")
+ [(set (match_operand:SI 0 "gpc_reg_operand" "")
+ (fix:SI (match_operand:SF 1 "gpc_reg_operand" "")))]
+ "TARGET_HARD_FLOAT && !TARGET_FPRS && TARGET_SINGLE_FLOAT"
+ "")
; For each of these conversions, there is a define_expand, a define_insn
; with a '#' template, and a define_split (with C code). The idea is
@@ -6140,20 +6160,20 @@
(define_expand "floatsisf2"
[(set (match_operand:SF 0 "gpc_reg_operand" "")
(float:SF (match_operand:SI 1 "gpc_reg_operand" "")))]
- "TARGET_HARD_FLOAT && (!TARGET_FPRS || TARGET_SINGLE_FPU)"
+ "TARGET_HARD_FLOAT && !TARGET_FPRS"
"")
(define_insn "floatdidf2"
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
(float:DF (match_operand:DI 1 "gpc_reg_operand" "!f#r")))]
- "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT"
+ "(TARGET_POWERPC64 || TARGET_XILINX_FPU) && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_FPRS"
"fcfid %0,%1"
[(set_attr "type" "fp")])
(define_insn "fix_truncdfdi2"
[(set (match_operand:DI 0 "gpc_reg_operand" "=!f#r")
(fix:DI (match_operand:DF 1 "gpc_reg_operand" "f")))]
- "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT"
+ "(TARGET_POWERPC64 || TARGET_XILINX_FPU) && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_FPRS"
"fctidz %0,%1"
[(set_attr "type" "fp")])
@@ -8722,7 +8742,8 @@
&& TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
&& TARGET_LONG_DOUBLE_128"
"fadd %0,%1,%L1"
- [(set_attr "type" "fp")])
+ [(set_attr "type" "fp")
+ (set_attr "fp_type" "fp_addsub_d")])
(define_expand "trunctfsf2"
[(set (match_operand:SF 0 "gpc_reg_operand" "")
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index c036aeca441..a7fb83a8af4 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -272,3 +272,13 @@ Double-precision floating point unit
msimple-fpu
Target RejectNegative Var(rs6000_simple_fpu)
Floating point unit does not support divide & sqrt
+
+mfpu=
+Target RejectNegative Joined
+-mfpu= Specify FP (sp, dp, sp-lite, dp-lite) (implies -mxilinx-fpu)
+
+mxilinx-fpu
+Target Var(rs6000_xilinx_fpu)
+Specify Xilinx FPU.
+
+
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index b94de3bbbf4..8e309803cd9 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -729,6 +729,9 @@ extern int fixuplabelno;
#define LINK_OS_DEFAULT_SPEC ""
+#define DRIVER_SELF_SPECS "%{mfpu=none: %<mfpu=* \
+ %<msingle-float %<mdouble-float}"
+
/* Override rs6000.h definition. */
#undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
diff --git a/gcc/config/rs6000/xfpu.h b/gcc/config/rs6000/xfpu.h
new file mode 100644
index 00000000000..af631163634
--- /dev/null
+++ b/gcc/config/rs6000/xfpu.h
@@ -0,0 +1,26 @@
+/* Definitions for Xilinx PowerPC 405/440 APU.
+
+ Copyright (C) 2008 Free Software Foundation, Inc.
+ Contributed by Michael Eager (eager@eagercon.com)
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+
+/* Undefine definitions from rs6000.h. */
+#undef TARGET_XILINX_FPU
+
+#define TARGET_XILINX_FPU (rs6000_xilinx_fpu)
diff --git a/gcc/config/rs6000/xfpu.md b/gcc/config/rs6000/xfpu.md
new file mode 100644
index 00000000000..25c449a515a
--- /dev/null
+++ b/gcc/config/rs6000/xfpu.md
@@ -0,0 +1,140 @@
+;; Scheduling description for the Xilinx PowerPC 405 APU Floating Point Unit.
+;; Copyright (C) 2008 Free Software Foundation, Inc.
+;; Contributed by Michael Eager (eager@eagercon.com).
+;;
+;; This file is part of GCC.
+;;
+;; GCC is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+;;
+;; GCC is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+;;----------------------------------------------------
+;; Xilinx APU FPU Pipeline Description
+;;
+;; - attr 'type' and 'fp_type' should definitely
+;; be cleaned up at some point in the future.
+;; ddiv,sdiv,dmul,smul etc are quite confusing.
+;; Should use consistent fp* attrs. 'fp_type'
+;; should also go away, leaving us only with 'fp'
+;;
+;;----------------------------------------------------
+
+;; -------------------------------------------------------------------------
+;; Latencies
+;; Latest latency figures (all in FCB cycles). PowerPC to FPU frequency ratio
+;; assumed to be 1/2. (most common deployment)
+;; Add 2 PPC cycles for (register file access + wb) and 2 PPC cycles
+;; for issue (from PPC)
+;; SP DP
+;; Loads: 4 6
+;; Stores: 1 2 (from availability of data)
+;; Move/Abs/Neg: 1 1
+;; Add/Subtract: 5 7
+;; Multiply: 4 11
+;; Multiply-add: 10 19
+;; Convert (any): 4 6
+;; Divide/Sqrt: 27 56
+;; Compares: 1 2
+;;
+;; bypasses needed for forwarding capability of the FPU.
+;; Add this at some future time.
+;; -------------------------------------------------------------------------
+(define_automaton "Xfpu")
+(define_cpu_unit "Xfpu_issue,Xfpu_addsub,Xfpu_mul,Xfpu_div,Xfpu_sqrt" "Xfpu")
+
+
+(define_insn_reservation "fp-default" 2
+ (and (and
+ (eq_attr "type" "fp")
+ (eq_attr "fp_type" "fp_default"))
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*2")
+
+(define_insn_reservation "fp-compare" 6
+ (and (eq_attr "type" "fpcompare") ;; Inconsistent naming
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*2,Xfpu_addsub")
+
+(define_insn_reservation "fp-addsub-s" 14
+ (and (and
+ (eq_attr "type" "fp")
+ (eq_attr "fp_type" "fp_addsub_s"))
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*2,Xfpu_addsub")
+
+(define_insn_reservation "fp-addsub-d" 18
+ (and (and
+ (eq_attr "type" "fp")
+ (eq_attr "fp_type" "fp_addsub_d"))
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*2,Xfpu_addsub")
+
+(define_insn_reservation "fp-mul-s" 12
+ (and (and
+ (eq_attr "type" "fp")
+ (eq_attr "fp_type" "fp_mul_s"))
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*2,Xfpu_mul")
+
+(define_insn_reservation "fp-mul-d" 16 ;; Actually 28. Long latencies are killing the automaton formation. Need to figure out why.
+ (and (and
+ (eq_attr "type" "fp")
+ (eq_attr "fp_type" "fp_mul_d"))
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*2,Xfpu_mul")
+
+(define_insn_reservation "fp-div-s" 24 ;; Actually 34
+ (and (eq_attr "type" "sdiv") ;; Inconsistent attr naming
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*2,Xfpu_div*10") ;; Unpipelined
+
+(define_insn_reservation "fp-div-d" 34 ;; Actually 116
+ (and (eq_attr "type" "ddiv")
+ (eq_attr "cpu" "ppc405")) ;; Inconsistent attr naming
+ "Xfpu_issue*2,Xfpu_div*10") ;; Unpipelined
+
+(define_insn_reservation "fp-maddsub-s" 24
+ (and (and
+ (eq_attr "type" "fp")
+ (eq_attr "fp_type" "fp_maddsub_s"))
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*2,Xfpu_mul,nothing*7,Xfpu_addsub")
+
+(define_insn_reservation "fp-maddsub-d" 34 ;; Actually 42
+ (and (and
+ (eq_attr "type" "dmul") ;; Inconsistent attr naming
+ (eq_attr "fp_type" "fp_maddsub_d"))
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*2,Xfpu_mul,nothing*7,Xfpu_addsub")
+
+(define_insn_reservation "fp-load" 10 ;; FIXME. Is double/single precision the same ?
+ (and (eq_attr "type" "fpload, fpload_ux, fpload_u")
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*10")
+
+(define_insn_reservation "fp-store" 4
+ (and (eq_attr "type" "fpstore, fpstore_ux, fpstore_u")
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*4")
+
+(define_insn_reservation "fp-sqrt-s" 24 ;; Actually 56
+ (and (eq_attr "type" "ssqrt")
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*2,Xfpu_sqrt*10") ;; Unpipelined
+
+
+(define_insn_reservation "fp-sqrt-d" 34 ;; Actually 116
+ (and (eq_attr "type" "dsqrt")
+ (eq_attr "cpu" "ppc405"))
+ "Xfpu_issue*2,Xfpu_sqrt*10") ;; Unpipelined
+
diff --git a/gcc/config/sh/constraints.md b/gcc/config/sh/constraints.md
index 2caa1d53a3e..6b374d1b070 100644
--- a/gcc/config/sh/constraints.md
+++ b/gcc/config/sh/constraints.md
@@ -27,7 +27,7 @@
;; Csy: label or symbol
;; Cpg: non-explicit constants that can be directly loaded into a general
;; purpose register in PIC code. like 's' except we don't allow
-;; PIC_DIRECT_ADDR_P
+;; PIC_ADDR_P
;; IJKLMNOP: CONT_INT constants
;; Ixx: signed xx bit
;; J16: 0xffffffff00000000 | 0x00000000ffffffff
@@ -186,17 +186,19 @@
(define_constraint "Css"
"A signed 16-bit constant, literal or symbolic."
(and (match_code "const")
- (match_test "IS_LITERAL_OR_SYMBOLIC_S16_P (XEXP (op, 0))")))
+ (match_test "GET_CODE (XEXP (op, 0)) == UNSPEC")
+ (match_test "XINT (XEXP (op, 0), 1) == UNSPEC_EXTRACT_S16")))
(define_constraint "Csu"
"An unsigned 16-bit constant, literal or symbolic."
(and (match_code "const")
- (match_test "IS_LITERAL_OR_SYMBOLIC_U16_P (XEXP (op, 0))")))
+ (match_test "GET_CODE (XEXP (op, 0)) == UNSPEC")
+ (match_test "XINT (XEXP (op, 0), 1) == UNSPEC_EXTRACT_U16")))
(define_constraint "Csy"
"A label or a symbol."
(ior (match_test "NON_PIC_REFERENCE_P (op)")
- (match_test "PIC_DIRECT_ADDR_P (op)")))
+ (match_test "PIC_ADDR_P (op)")))
(define_constraint "Z"
"A zero in any shape or form."
@@ -213,7 +215,7 @@
(define_constraint "Cpg"
"A non-explicit constant that can be loaded directly into a general
purpose register. This is like 's' except we don't allow
- PIC_DIRECT_ADDR_P."
+ PIC_ADDR_P."
(match_test "IS_NON_EXPLICIT_CONSTANT_P (op)"))
(define_constraint "Pso"
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 533d28c53a8..7c0bdd4a72f 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -1031,45 +1031,6 @@ print_operand (FILE *stream, rtx x, int code)
output_address (XEXP (x, 0));
break;
- case CONST:
- if (TARGET_SHMEDIA
- && (GET_CODE (XEXP (x, 0)) == SIGN_EXTEND
- || GET_CODE (XEXP (x, 0)) == ZERO_EXTEND)
- && (GET_MODE (XEXP (x, 0)) == DImode
- || GET_MODE (XEXP (x, 0)) == SImode)
- && GET_CODE (XEXP (XEXP (x, 0), 0)) == TRUNCATE
- && GET_MODE (XEXP (XEXP (x, 0), 0)) == HImode)
- {
- rtx val = XEXP (XEXP (XEXP (x, 0), 0), 0);
- rtx val2 = val;
- bool nested_expr = false;
-
- fputc ('(', stream);
- if (GET_CODE (val) == ASHIFTRT)
- {
- fputc ('(', stream);
- val2 = XEXP (val, 0);
- }
- if (GET_CODE (val2) == CONST
- || GET_RTX_CLASS (GET_CODE (val2)) != RTX_OBJ)
- {
- fputc ('(', stream);
- nested_expr = true;
- }
- output_addr_const (stream, val2);
- if (nested_expr)
- fputc (')', stream);
- if (GET_CODE (val) == ASHIFTRT)
- {
- fputs (" >> ", stream);
- output_addr_const (stream, XEXP (val, 1));
- fputc (')', stream);
- }
- fputs (" & 65535)", stream);
- break;
- }
-
- /* Fall through. */
default:
if (TARGET_SH1)
fputc ('#', stream);
@@ -2191,22 +2152,18 @@ sh_file_start (void)
static bool
unspec_caller_rtx_p (rtx pat)
{
- switch (GET_CODE (pat))
+ rtx base, offset;
+ int i;
+
+ split_const (pat, &base, &offset);
+ if (GET_CODE (base) == UNSPEC)
{
- case CONST:
- return unspec_caller_rtx_p (XEXP (pat, 0));
- case PLUS:
- case MINUS:
- if (unspec_caller_rtx_p (XEXP (pat, 0)))
+ if (XINT (base, 1) == UNSPEC_CALLER)
return true;
- return unspec_caller_rtx_p (XEXP (pat, 1));
- case UNSPEC:
- if (XINT (pat, 1) == UNSPEC_CALLER)
- return true;
- default:
- break;
+ for (i = 0; i < XVECLEN (base, 0); i++)
+ if (unspec_caller_rtx_p (XVECEXP (base, 0, i)))
+ return true;
}
-
return false;
}
@@ -3830,7 +3787,7 @@ fixup_mova (rtx mova)
{
rtx worker = mova;
rtx lab = gen_label_rtx ();
- rtx wpat, wpat0, wpat1, wsrc, diff;
+ rtx wpat, wpat0, wpat1, wsrc, target, base, diff;
do
{
@@ -3849,9 +3806,9 @@ fixup_mova (rtx mova)
XEXP (XVECEXP (wsrc, 0, 2), 0), lab,
XEXP (wpat1, 0)));
INSN_CODE (worker) = -1;
- diff = gen_rtx_MINUS (Pmode, XVECEXP (SET_SRC (PATTERN (mova)), 0, 0),
- gen_rtx_LABEL_REF (Pmode, lab));
- diff = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, diff), UNSPEC_PIC);
+ target = XVECEXP (SET_SRC (PATTERN (mova)), 0, 0);
+ base = gen_rtx_LABEL_REF (Pmode, lab);
+ diff = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, target, base), UNSPEC_SYMOFF);
SET_SRC (PATTERN (mova)) = gen_rtx_CONST (Pmode, diff);
INSN_CODE (mova) = -1;
}
@@ -8853,7 +8810,9 @@ nonpic_symbol_mentioned_p (rtx x)
|| XINT (x, 1) == UNSPEC_GOTPLT
|| XINT (x, 1) == UNSPEC_GOTTPOFF
|| XINT (x, 1) == UNSPEC_DTPOFF
- || XINT (x, 1) == UNSPEC_PLT))
+ || XINT (x, 1) == UNSPEC_PLT
+ || XINT (x, 1) == UNSPEC_SYMOFF
+ || XINT (x, 1) == UNSPEC_PCREL_SYMOFF))
return 0;
fmt = GET_RTX_FORMAT (GET_CODE (x));
@@ -11224,7 +11183,7 @@ sh_secondary_reload (bool in_p, rtx x, enum reg_class rclass,
return NO_REGS;
}
if (TARGET_SHMEDIA && rclass == GENERAL_REGS
- && (GET_CODE (x) == LABEL_REF || PIC_DIRECT_ADDR_P (x)))
+ && (GET_CODE (x) == LABEL_REF || PIC_ADDR_P (x)))
return TARGET_REGS;
} /* end of input-only processing. */
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 55238aff1d3..8b9ec86ceef 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1588,7 +1588,7 @@ extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
((CLASS) == NO_REGS && TARGET_SHMEDIA \
&& (GET_CODE (X) == CONST_DOUBLE \
|| GET_CODE (X) == SYMBOL_REF \
- || PIC_DIRECT_ADDR_P (X)) \
+ || PIC_ADDR_P (X)) \
? GENERAL_REGS \
: (CLASS)) \
@@ -1661,7 +1661,7 @@ extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
&& TARGET_SHMEDIA && inqhi_operand ((X), (MODE))) \
? GENERAL_REGS \
: (TARGET_SHMEDIA && (CLASS) == GENERAL_REGS \
- && (GET_CODE (X) == LABEL_REF || PIC_DIRECT_ADDR_P (X))) \
+ && (GET_CODE (X) == LABEL_REF || PIC_ADDR_P (X))) \
? TARGET_REGS \
: SECONDARY_INOUT_RELOAD_CLASS((CLASS),(MODE),(X), NO_REGS))
#endif
@@ -2288,37 +2288,13 @@ struct sh_args {
&& GET_CODE (XEXP (XEXP ((OP), 0), 0)) == LABEL_REF \
&& GET_CODE (XEXP (XEXP ((OP), 0), 1)) == CONST_INT))
-#define IS_LITERAL_OR_SYMBOLIC_S16_P(OP) \
- (GET_CODE ((OP)) == SIGN_EXTEND \
- && (GET_MODE ((OP)) == DImode \
- || GET_MODE ((OP)) == SImode) \
- && GET_CODE (XEXP ((OP), 0)) == TRUNCATE \
- && GET_MODE (XEXP ((OP), 0)) == HImode \
- && (MOVI_SHORI_BASE_OPERAND_P (XEXP (XEXP ((OP), 0), 0)) \
- || (GET_CODE (XEXP (XEXP ((OP), 0), 0)) == ASHIFTRT \
- && (MOVI_SHORI_BASE_OPERAND_P \
- (XEXP (XEXP (XEXP ((OP), 0), 0), 0))) \
- && GET_CODE (XEXP (XEXP (XEXP ((OP), 0), 0), 1)) == CONST_INT)))
-
-#define IS_LITERAL_OR_SYMBOLIC_U16_P(OP) \
- (GET_CODE ((OP)) == ZERO_EXTEND \
- && (GET_MODE ((OP)) == DImode \
- || GET_MODE ((OP)) == SImode) \
- && GET_CODE (XEXP ((OP), 0)) == TRUNCATE \
- && GET_MODE (XEXP ((OP), 0)) == HImode \
- && (MOVI_SHORI_BASE_OPERAND_P (XEXP (XEXP ((OP), 0), 0)) \
- || (GET_CODE (XEXP (XEXP ((OP), 0), 0)) == ASHIFTRT \
- && (MOVI_SHORI_BASE_OPERAND_P \
- (XEXP (XEXP (XEXP ((OP), 0), 0), 0))) \
- && GET_CODE (XEXP (XEXP (XEXP ((OP), 0), 0), 1)) == CONST_INT)))
-
#define IS_NON_EXPLICIT_CONSTANT_P(OP) \
(CONSTANT_P (OP) \
&& GET_CODE (OP) != CONST_INT \
&& GET_CODE (OP) != CONST_DOUBLE \
&& (!flag_pic \
|| (LEGITIMATE_PIC_OPERAND_P (OP) \
- && (! PIC_ADDR_P (OP) || PIC_OFFSET_P (OP)) \
+ && !PIC_ADDR_P (OP) \
&& GET_CODE (OP) != LABEL_REF)))
/* Check whether OP is a datalabel unspec. */
@@ -2350,13 +2326,10 @@ struct sh_args {
(GET_CODE (OP) == CONST && GET_CODE (XEXP ((OP), 0)) == UNSPEC \
&& XINT (XEXP ((OP), 0), 1) == UNSPEC_PIC)
-#define PIC_OFFSET_P(OP) \
- (PIC_ADDR_P (OP) \
- && GET_CODE (XVECEXP (XEXP ((OP), 0), 0, 0)) == MINUS \
- && reg_mentioned_p (pc_rtx, XEXP (XVECEXP (XEXP ((OP), 0), 0, 0), 1)))
-
-#define PIC_DIRECT_ADDR_P(OP) \
- (PIC_ADDR_P (OP) && GET_CODE (XVECEXP (XEXP ((OP), 0), 0, 0)) != MINUS)
+#define PCREL_SYMOFF_P(OP) \
+ (GET_CODE (OP) == CONST \
+ && GET_CODE (XEXP ((OP), 0)) == UNSPEC \
+ && XINT (XEXP ((OP), 0), 1) == UNSPEC_PCREL_SYMOFF)
#define NON_PIC_REFERENCE_P(OP) \
(GET_CODE (OP) == LABEL_REF || GET_CODE (OP) == SYMBOL_REF \
@@ -2377,7 +2350,7 @@ struct sh_args {
#define MOVI_SHORI_BASE_OPERAND_P(OP) \
(flag_pic \
? (GOT_ENTRY_P (OP) || GOTPLT_ENTRY_P (OP) || GOTOFF_P (OP) \
- || PIC_OFFSET_P (OP)) \
+ || PCREL_SYMOFF_P (OP)) \
: NON_PIC_REFERENCE_P (OP))
/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
@@ -3106,7 +3079,7 @@ struct sh_args {
constants. Used for PIC-specific UNSPECs. */
#define OUTPUT_ADDR_CONST_EXTRA(STREAM, X, FAIL) \
do \
- if (GET_CODE (X) == UNSPEC && XVECLEN ((X), 0) == 1) \
+ if (GET_CODE (X) == UNSPEC) \
{ \
switch (XINT ((X), 1)) \
{ \
@@ -3155,6 +3128,52 @@ struct sh_args {
assemble_name ((STREAM), name); \
} \
break; \
+ case UNSPEC_EXTRACT_S16: \
+ case UNSPEC_EXTRACT_U16: \
+ { \
+ rtx val, shift; \
+ \
+ val = XVECEXP (X, 0, 0); \
+ shift = XVECEXP (X, 0, 1); \
+ fputc ('(', STREAM); \
+ if (shift != const0_rtx) \
+ fputc ('(', STREAM); \
+ if (GET_CODE (val) == CONST \
+ || GET_RTX_CLASS (GET_CODE (val)) != RTX_OBJ) \
+ { \
+ fputc ('(', STREAM); \
+ output_addr_const (STREAM, val); \
+ fputc (')', STREAM); \
+ } \
+ else \
+ output_addr_const (STREAM, val); \
+ if (shift != const0_rtx) \
+ { \
+ fputs (" >> ", STREAM); \
+ output_addr_const (STREAM, shift); \
+ fputc (')', STREAM); \
+ } \
+ fputs (" & 65535)", STREAM); \
+ } \
+ break; \
+ case UNSPEC_SYMOFF: \
+ output_addr_const (STREAM, XVECEXP (X, 0, 0)); \
+ fputc ('-', STREAM); \
+ if (GET_CODE (XVECEXP (X, 0, 1)) == CONST) \
+ { \
+ fputc ('(', STREAM); \
+ output_addr_const (STREAM, XVECEXP (X, 0, 1)); \
+ fputc (')', STREAM); \
+ } \
+ else \
+ output_addr_const (STREAM, XVECEXP (X, 0, 1)); \
+ break; \
+ case UNSPEC_PCREL_SYMOFF: \
+ output_addr_const (STREAM, XVECEXP (X, 0, 0)); \
+ fputs ("-(", STREAM); \
+ output_addr_const (STREAM, XVECEXP (X, 0, 1)); \
+ fputs ("-.)", STREAM); \
+ break; \
default: \
goto FAIL; \
} \
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 53242aaf856..68bb197c070 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -153,6 +153,17 @@
(UNSPEC_SP_TEST 41)
(UNSPEC_MOVUA 42)
+ ;; (unspec [VAL SHIFT] UNSPEC_EXTRACT_S16) computes (short) (VAL >> SHIFT).
+ ;; UNSPEC_EXTRACT_U16 is the unsigned equivalent.
+ (UNSPEC_EXTRACT_S16 43)
+ (UNSPEC_EXTRACT_U16 44)
+
+ ;; (unspec [TARGET ANCHOR] UNSPEC_SYMOFF) == TARGET - ANCHOR.
+ (UNSPEC_SYMOFF 45)
+
+ ;; (unspec [OFFSET ANCHOR] UNSPEC_PCREL_SYMOFF) == OFFSET - (ANCHOR - .).
+ (UNSPEC_PCREL_SYMOFF 46)
+
;; These are used with unspec_volatile.
(UNSPECV_BLOCKAGE 0)
(UNSPECV_ALIGN 1)
@@ -5134,16 +5145,12 @@ label:
(define_expand "movsi_const"
[(set (match_operand:SI 0 "arith_reg_operand" "=r")
- (const:SI (sign_extend:SI
- (truncate:HI
- (ashiftrt:SI
- (match_operand:DI 1 "immediate_operand" "s")
- (const_int 16))))))
+ (const:SI (unspec:SI [(match_operand:DI 1 "immediate_operand" "s")
+ (const_int 16)] UNSPEC_EXTRACT_S16)))
(set (match_dup 0)
(ior:SI (ashift:SI (match_dup 0) (const_int 16))
- (const:SI
- (zero_extend:SI
- (truncate:HI (match_dup 1))))))]
+ (const:SI (unspec:SI [(match_dup 1)
+ (const_int 0)] UNSPEC_EXTRACT_U16))))]
"TARGET_SHMEDIA && reload_completed
&& MOVI_SHORI_BASE_OPERAND_P (operands[1])"
"
@@ -5169,9 +5176,8 @@ label:
(define_expand "movsi_const_16bit"
[(set (match_operand:SI 0 "arith_reg_operand" "=r")
- (const:SI (sign_extend:SI
- (truncate:HI
- (match_operand:DI 1 "immediate_operand" "s")))))]
+ (const:SI (unspec:SI [(match_operand:DI 1 "immediate_operand" "s")
+ (const_int 0)] UNSPEC_EXTRACT_S16)))]
"TARGET_SHMEDIA && flag_pic && reload_completed
&& GET_CODE (operands[1]) == SYMBOL_REF"
"")
@@ -5588,33 +5594,20 @@ label:
(define_expand "movdi_const"
[(set (match_operand:DI 0 "arith_reg_operand" "=r")
- (const:DI (sign_extend:DI
- (truncate:HI
- (ashiftrt:DI
- (match_operand:DI 1 "immediate_operand" "s")
- (const_int 48))))))
+ (const:DI (unspec:DI [(match_operand:DI 1 "immediate_operand" "s")
+ (const_int 48)] UNSPEC_EXTRACT_S16)))
(set (match_dup 0)
(ior:DI (ashift:DI (match_dup 0) (const_int 16))
- (const:DI
- (zero_extend:DI
- (truncate:HI
- (ashiftrt:SI
- (match_dup 1)
- (const_int 32)))))))
+ (const:DI (unspec:DI [(match_dup 1)
+ (const_int 32)] UNSPEC_EXTRACT_U16))))
(set (match_dup 0)
(ior:DI (ashift:DI (match_dup 0) (const_int 16))
- (const:DI
- (zero_extend:DI
- (truncate:HI
- (ashiftrt:SI
- (match_dup 1)
- (const_int 16)))))))
+ (const:DI (unspec:DI [(match_dup 1)
+ (const_int 16)] UNSPEC_EXTRACT_U16))))
(set (match_dup 0)
(ior:DI (ashift:DI (match_dup 0) (const_int 16))
- (const:DI
- (zero_extend:DI
- (truncate:HI
- (match_dup 1))))))]
+ (const:DI (unspec:DI [(match_dup 1)
+ (const_int 0)] UNSPEC_EXTRACT_U16))))]
"TARGET_SHMEDIA64 && reload_completed
&& MOVI_SHORI_BASE_OPERAND_P (operands[1])"
"
@@ -5624,17 +5617,12 @@ label:
(define_expand "movdi_const_32bit"
[(set (match_operand:DI 0 "arith_reg_operand" "=r")
- (const:DI (sign_extend:DI
- (truncate:HI
- (ashiftrt:DI
- (match_operand:DI 1 "immediate_operand" "s")
- (const_int 16))))))
+ (const:DI (unspec:DI [(match_operand:DI 1 "immediate_operand" "s")
+ (const_int 16)] UNSPEC_EXTRACT_S16)))
(set (match_dup 0)
(ior:DI (ashift:DI (match_dup 0) (const_int 16))
- (const:DI
- (zero_extend:DI
- (truncate:HI
- (match_dup 1))))))]
+ (const:DI (unspec:DI [(match_dup 1)
+ (const_int 0)] UNSPEC_EXTRACT_U16))))]
"TARGET_SHMEDIA32 && reload_completed
&& MOVI_SHORI_BASE_OPERAND_P (operands[1])"
"
@@ -5644,9 +5632,8 @@ label:
(define_expand "movdi_const_16bit"
[(set (match_operand:DI 0 "arith_reg_operand" "=r")
- (const:DI (sign_extend:DI
- (truncate:HI
- (match_operand:DI 1 "immediate_operand" "s")))))]
+ (const:DI (unspec:DI [(match_operand:DI 1 "immediate_operand" "s")
+ (const_int 0)] UNSPEC_EXTRACT_S16)))]
"TARGET_SHMEDIA && flag_pic && reload_completed
&& GET_CODE (operands[1]) == SYMBOL_REF"
"")
@@ -8724,16 +8711,9 @@ label:
rtx insn, equiv;
equiv = operands[1];
- operands[1] = gen_rtx_MINUS (Pmode,
- operands[1],
- gen_rtx_CONST
- (Pmode,
- gen_rtx_MINUS (Pmode,
- gen_rtx_CONST (Pmode,
- lab),
- pc_rtx)));
- operands[1] = gen_sym2PIC (operands[1]);
- PUT_MODE (operands[1], Pmode);
+ operands[1] = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, operands[1], lab),
+ UNSPEC_PCREL_SYMOFF);
+ operands[1] = gen_rtx_CONST (Pmode, operands[1]);
if (Pmode == SImode)
{
@@ -8819,13 +8799,10 @@ label:
(define_expand "sym_label2reg"
[(set (match_operand:SI 0 "" "")
- (const:SI (minus:SI
- (const:SI
- (unspec:SI [(match_operand:SI 1 "" "")] UNSPEC_PIC))
- (const:SI
- (plus:SI
- (match_operand:SI 2 "" "")
- (const_int 2))))))]
+ (const:SI (unspec:SI [(match_operand:SI 1 "" "")
+ (const (plus:SI (match_operand:SI 2 "" "")
+ (const_int 2)))]
+ UNSPEC_SYMOFF)))]
"TARGET_SH1" "")
(define_expand "symGOT_load"
@@ -8952,15 +8929,11 @@ label:
(define_expand "symPLT_label2reg"
[(set (match_operand:SI 0 "" "")
- (const:SI (minus:SI
- (const:SI
- (unspec:SI [(match_operand:SI 1 "" "")] UNSPEC_PLT))
- (const:SI
- (minus:SI
- (const:SI (plus:SI
- (match_operand:SI 2 "" "")
- (const_int 2)))
- (const:SI (unspec:SI [(pc)] UNSPEC_PIC)))))))
+ (const:SI
+ (unspec:SI
+ [(const:SI (unspec:SI [(match_operand:SI 1 "" "")] UNSPEC_PLT))
+ (const:SI (plus:SI (match_operand:SI 2 "" "")
+ (const_int 2)))] UNSPEC_PCREL_SYMOFF)))
;; Even though the PIC register is not really used by the call
;; sequence in which this is expanded, the PLT code assumes the PIC
;; register is set, so we must not skip its initialization. Since
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 222693f2a52..6b38199aa55 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,19 @@
+2008-10-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/37146
+ * cp-gimplify.c (cp_genericize_r): Fix up bitfield operands of
+ COND_EXPR.
+
+2008-10-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/37568
+ * semantics.c (finalize_nrv_r): Clear DECL_INITIAL instead of
+ setting it to error_mark_node.
+
+2008-10-07 Steve Ellcey <sje@cup.hp.com>
+
+ * decl.c (start_cleanup_fn): Declare as inline.
+
2008-10-06 Jason Merrill <jason@redhat.com>
PR c++/37376, other mangling issues
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index a1542b9f804..1641be5ebdc 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -803,6 +803,34 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
CLEANUP_BODY (stmt),
CLEANUP_EXPR (stmt));
+ /* COND_EXPR might have incompatible types in branches if one or both
+ arms are bitfields. Fix it up now. */
+ else if (TREE_CODE (stmt) == COND_EXPR)
+ {
+ tree type_left
+ = (TREE_OPERAND (stmt, 1)
+ ? is_bitfield_expr_with_lowered_type (TREE_OPERAND (stmt, 1))
+ : NULL_TREE);
+ tree type_right
+ = (TREE_OPERAND (stmt, 2)
+ ? is_bitfield_expr_with_lowered_type (TREE_OPERAND (stmt, 2))
+ : NULL_TREE);
+ if (type_left)
+ {
+ TREE_OPERAND (stmt, 1)
+ = fold_convert (type_left, TREE_OPERAND (stmt, 1));
+ gcc_assert (useless_type_conversion_p (TREE_TYPE (stmt),
+ type_left));
+ }
+ if (type_right)
+ {
+ TREE_OPERAND (stmt, 2)
+ = fold_convert (type_right, TREE_OPERAND (stmt, 2));
+ gcc_assert (useless_type_conversion_p (TREE_TYPE (stmt),
+ type_right));
+ }
+ }
+
pointer_set_insert (p_set, *stmt_p);
return NULL;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index be28e788600..b0b03a549e6 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -6006,6 +6006,7 @@ start_cleanup_fn (void)
actually needed. It is unlikely that it will be inlined, since
it is only called via a function pointer, but we avoid unnecessary
emissions this way. */
+ DECL_DECLARED_INLINE_P (fndecl) = 1;
DECL_INTERFACE_KNOWN (fndecl) = 1;
/* Build the parameter. */
if (use_cxa_atexit)
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index b1bbb38dfa8..040a9b10c35 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3310,13 +3310,11 @@ finalize_nrv_r (tree* tp, int* walk_subtrees, void* data)
tree init;
if (DECL_INITIAL (dp->var)
&& DECL_INITIAL (dp->var) != error_mark_node)
- {
- init = build2 (INIT_EXPR, void_type_node, dp->result,
- DECL_INITIAL (dp->var));
- DECL_INITIAL (dp->var) = error_mark_node;
- }
+ init = build2 (INIT_EXPR, void_type_node, dp->result,
+ DECL_INITIAL (dp->var));
else
init = build_empty_stmt ();
+ DECL_INITIAL (dp->var) = NULL_TREE;
SET_EXPR_LOCUS (init, EXPR_LOCUS (*tp));
*tp = init;
}
diff --git a/gcc/cse.c b/gcc/cse.c
index b911879bf79..ed7d8856439 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1,6 +1,6 @@
/* Common subexpression elimination for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
@@ -603,7 +603,8 @@ static bool set_live_p (rtx, rtx, int *);
static int cse_change_cc_mode (rtx *, void *);
static void cse_change_cc_mode_insn (rtx, rtx);
static void cse_change_cc_mode_insns (rtx, rtx, rtx);
-static enum machine_mode cse_cc_succs (basic_block, rtx, rtx, bool);
+static enum machine_mode cse_cc_succs (basic_block, basic_block, rtx, rtx,
+ bool);
#undef RTL_HOOKS_GEN_LOWPART
@@ -6007,11 +6008,11 @@ cse_extended_basic_block (struct cse_basic_block_data *ebb_data)
edge pointing to that bb. */
if (bb_has_eh_pred (bb))
{
- struct df_ref **def_rec;
+ df_ref *def_rec;
for (def_rec = df_get_artificial_defs (bb->index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (DF_REF_FLAGS (def) & DF_REF_AT_TOP)
invalidate (DF_REF_REG (def), GET_MODE (DF_REF_REG (def)));
}
@@ -6587,13 +6588,17 @@ cse_change_cc_mode_insns (rtx start, rtx end, rtx newreg)
permitted to change the mode of CC_SRC to a compatible mode. This
returns VOIDmode if no equivalent assignments were found.
Otherwise it returns the mode which CC_SRC should wind up with.
+ ORIG_BB should be the same as BB in the outermost cse_cc_succs call,
+ but is passed unmodified down to recursive calls in order to prevent
+ endless recursion.
The main complexity in this function is handling the mode issues.
We may have more than one duplicate which we can eliminate, and we
try to find a mode which will work for multiple duplicates. */
static enum machine_mode
-cse_cc_succs (basic_block bb, rtx cc_reg, rtx cc_src, bool can_change_mode)
+cse_cc_succs (basic_block bb, basic_block orig_bb, rtx cc_reg, rtx cc_src,
+ bool can_change_mode)
{
bool found_equiv;
enum machine_mode mode;
@@ -6624,7 +6629,9 @@ cse_cc_succs (basic_block bb, rtx cc_reg, rtx cc_src, bool can_change_mode)
continue;
if (EDGE_COUNT (e->dest->preds) != 1
- || e->dest == EXIT_BLOCK_PTR)
+ || e->dest == EXIT_BLOCK_PTR
+ /* Avoid endless recursion on unreachable blocks. */
+ || e->dest == orig_bb)
continue;
end = NEXT_INSN (BB_END (e->dest));
@@ -6729,7 +6736,7 @@ cse_cc_succs (basic_block bb, rtx cc_reg, rtx cc_src, bool can_change_mode)
{
enum machine_mode submode;
- submode = cse_cc_succs (e->dest, cc_reg, cc_src, false);
+ submode = cse_cc_succs (e->dest, orig_bb, cc_reg, cc_src, false);
if (submode != VOIDmode)
{
gcc_assert (submode == mode);
@@ -6857,7 +6864,7 @@ cse_condition_code_reg (void)
the basic block. */
orig_mode = GET_MODE (cc_src);
- mode = cse_cc_succs (bb, cc_reg, cc_src, true);
+ mode = cse_cc_succs (bb, bb, cc_reg, cc_src, true);
if (mode != VOIDmode)
{
gcc_assert (mode == GET_MODE (cc_src));
diff --git a/gcc/dce.c b/gcc/dce.c
index fc08751348c..63ea3806606 100644
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -218,10 +218,10 @@ mark_nonreg_stores (rtx body, rtx insn, bool fast)
static void
delete_corresponding_reg_eq_notes (rtx insn)
{
- struct df_ref **def_rec;
+ df_ref *def_rec;
for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
unsigned int regno = DF_REF_REGNO (def);
/* This loop is a little tricky. We cannot just go down the
chain because it is being modified by the actions in the
@@ -229,7 +229,7 @@ delete_corresponding_reg_eq_notes (rtx insn)
anyway. */
while (DF_REG_EQ_USE_CHAIN (regno))
{
- struct df_ref *eq_use = DF_REG_EQ_USE_CHAIN (regno);
+ df_ref eq_use = DF_REG_EQ_USE_CHAIN (regno);
rtx noted_insn = DF_REF_INSN (eq_use);
rtx note = find_reg_note (noted_insn, REG_EQUAL, NULL_RTX);
if (!note)
@@ -330,7 +330,7 @@ mark_artificial_uses (void)
{
basic_block bb;
struct df_link *defs;
- struct df_ref **use_rec;
+ df_ref *use_rec;
FOR_ALL_BB (bb)
{
@@ -349,11 +349,11 @@ static void
mark_reg_dependencies (rtx insn)
{
struct df_link *defs;
- struct df_ref **use_rec;
+ df_ref *use_rec;
for (use_rec = DF_INSN_USES (insn); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (dump_file)
{
fprintf (dump_file, "Processing use of ");
@@ -480,7 +480,7 @@ byte_dce_process_block (basic_block bb, bool redo_out, bitmap au)
bitmap local_live = BITMAP_ALLOC (&dce_tmp_bitmap_obstack);
rtx insn;
bool block_changed;
- struct df_ref **def_rec;
+ df_ref *def_rec;
if (redo_out)
{
@@ -511,7 +511,7 @@ byte_dce_process_block (basic_block bb, bool redo_out, bitmap au)
/* The insn is needed if there is someone who uses the output. */
for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
unsigned int last;
unsigned int dregno = DF_REF_REGNO (def);
unsigned int start = df_byte_lr_get_regno_start (dregno);
@@ -584,7 +584,7 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au)
bitmap local_live = BITMAP_ALLOC (&dce_tmp_bitmap_obstack);
rtx insn;
bool block_changed;
- struct df_ref **def_rec;
+ df_ref *def_rec;
if (redo_out)
{
diff --git a/gcc/ddg.c b/gcc/ddg.c
index 1f8c1406fc4..6ae2ae25b65 100644
--- a/gcc/ddg.c
+++ b/gcc/ddg.c
@@ -183,13 +183,13 @@ create_ddg_dep_from_intra_loop_link (ddg_ptr g, ddg_node_ptr src_node,
if (set && REG_P (SET_DEST (set)))
{
int regno = REGNO (SET_DEST (set));
- struct df_ref *first_def;
+ df_ref first_def;
struct df_rd_bb_info *bb_info = DF_RD_BB_INFO (g->bb);
first_def = df_bb_regno_first_def_find (g->bb, regno);
gcc_assert (first_def);
- if (bitmap_bit_p (bb_info->gen, first_def->id))
+ if (bitmap_bit_p (bb_info->gen, DF_REF_ID (first_def)))
return;
}
}
@@ -239,7 +239,7 @@ create_ddg_dep_no_link (ddg_ptr g, ddg_node_ptr from, ddg_node_ptr to,
and anti-dependences from its uses in the current iteration to the
first definition in the next iteration. */
static void
-add_cross_iteration_register_deps (ddg_ptr g, struct df_ref *last_def)
+add_cross_iteration_register_deps (ddg_ptr g, df_ref last_def)
{
int regno = DF_REF_REGNO (last_def);
struct df_link *r_use;
@@ -250,14 +250,14 @@ add_cross_iteration_register_deps (ddg_ptr g, struct df_ref *last_def)
#ifdef ENABLE_CHECKING
struct df_rd_bb_info *bb_info = DF_RD_BB_INFO (g->bb);
#endif
- struct df_ref *first_def = df_bb_regno_first_def_find (g->bb, regno);
+ df_ref first_def = df_bb_regno_first_def_find (g->bb, regno);
gcc_assert (last_def_node);
gcc_assert (first_def);
#ifdef ENABLE_CHECKING
- if (last_def->id != first_def->id)
- gcc_assert (!bitmap_bit_p (bb_info->gen, first_def->id));
+ if (DF_REF_ID (last_def) != DF_REF_ID (first_def))
+ gcc_assert (!bitmap_bit_p (bb_info->gen, DF_REF_ID (first_def)));
#endif
/* Create inter-loop true dependences and anti dependences. */
@@ -293,7 +293,7 @@ add_cross_iteration_register_deps (ddg_ptr g, struct df_ref *last_def)
gcc_assert (first_def_node);
- if (last_def->id != first_def->id
+ if (DF_REF_ID (last_def) != DF_REF_ID (first_def)
|| !flag_modulo_sched_allow_regmoves)
create_ddg_dep_no_link (g, use_node, first_def_node, ANTI_DEP,
REG_DEP, 1);
@@ -311,7 +311,7 @@ add_cross_iteration_register_deps (ddg_ptr g, struct df_ref *last_def)
{
ddg_node_ptr dest_node;
- if (last_def->id == first_def->id)
+ if (DF_REF_ID (last_def) == DF_REF_ID (first_def))
return;
dest_node = get_node_of_insn (g, DF_REF_INSN (first_def));
@@ -333,7 +333,7 @@ build_inter_loop_deps (ddg_ptr g)
/* Find inter-loop register output, true and anti deps. */
EXECUTE_IF_SET_IN_BITMAP (rd_bb_info->gen, 0, rd_num, bi)
{
- struct df_ref *rd = DF_DEFS_GET (rd_num);
+ df_ref rd = DF_DEFS_GET (rd_num);
add_cross_iteration_register_deps (g, rd);
}
diff --git a/gcc/df-byte-scan.c b/gcc/df-byte-scan.c
index 11252cd4474..7e4db4b35bc 100644
--- a/gcc/df-byte-scan.c
+++ b/gcc/df-byte-scan.c
@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3. If not see
df_compute_accessed_bytes for a description of MM. */
static bool
-df_compute_accessed_bytes_extract (struct df_ref *ref,
+df_compute_accessed_bytes_extract (df_ref ref,
enum df_mm mm ,
unsigned int *start_byte,
unsigned int *last_byte)
@@ -148,7 +148,7 @@ df_compute_accessed_bytes_extract (struct df_ref *ref,
otherwise and set START_BYTE and LAST_BYTE. */
static bool
-df_compute_accessed_bytes_strict_low_part (struct df_ref *ref,
+df_compute_accessed_bytes_strict_low_part (df_ref ref,
unsigned int *start_byte,
unsigned int *last_byte)
{
@@ -200,7 +200,7 @@ df_compute_accessed_bytes_strict_low_part (struct df_ref *ref,
otherwise and set START_BYTE and LAST_BYTE. */
static bool
-df_compute_accessed_bytes_subreg (struct df_ref *ref, unsigned int *start_byte,
+df_compute_accessed_bytes_subreg (df_ref ref, unsigned int *start_byte,
unsigned int *last_byte)
{
@@ -229,7 +229,7 @@ df_compute_accessed_bytes_subreg (struct df_ref *ref, unsigned int *start_byte,
return true;
/* Defs and uses are different in the amount of the reg that touch. */
- if (DF_REF_TYPE (ref) == DF_REF_REG_DEF)
+ if (DF_REF_REG_DEF_P (ref))
{
/* This is an lvalue. */
@@ -300,14 +300,14 @@ df_compute_accessed_bytes_subreg (struct df_ref *ref, unsigned int *start_byte,
This means that this use can be ignored. */
bool
-df_compute_accessed_bytes (struct df_ref *ref, enum df_mm mm,
+df_compute_accessed_bytes (df_ref ref, enum df_mm mm,
unsigned int *start_byte,
unsigned int *last_byte)
{
if (!dbg_cnt (df_byte_scan))
return true;
- if (DF_REF_TYPE (ref) != DF_REF_REG_DEF
+ if (!DF_REF_REG_DEF_P (ref)
&& DF_REF_FLAGS_IS_SET (ref, DF_REF_READ_WRITE))
{
if (DF_REF_FLAGS_IS_SET (ref, DF_REF_PRE_POST_MODIFY))
diff --git a/gcc/df-core.c b/gcc/df-core.c
index 1ea30122254..1ad7ab10464 100644
--- a/gcc/df-core.c
+++ b/gcc/df-core.c
@@ -1725,11 +1725,11 @@ df_set_clean_cfg (void)
/* Return first def of REGNO within BB. */
-struct df_ref *
+df_ref
df_bb_regno_first_def_find (basic_block bb, unsigned int regno)
{
rtx insn;
- struct df_ref **def_rec;
+ df_ref *def_rec;
unsigned int uid;
FOR_BB_INSNS (bb, insn)
@@ -1740,7 +1740,7 @@ df_bb_regno_first_def_find (basic_block bb, unsigned int regno)
uid = INSN_UID (insn);
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (DF_REF_REGNO (def) == regno)
return def;
}
@@ -1751,11 +1751,11 @@ df_bb_regno_first_def_find (basic_block bb, unsigned int regno)
/* Return last def of REGNO within BB. */
-struct df_ref *
+df_ref
df_bb_regno_last_def_find (basic_block bb, unsigned int regno)
{
rtx insn;
- struct df_ref **def_rec;
+ df_ref *def_rec;
unsigned int uid;
FOR_BB_INSNS_REVERSE (bb, insn)
@@ -1766,7 +1766,7 @@ df_bb_regno_last_def_find (basic_block bb, unsigned int regno)
uid = INSN_UID (insn);
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (DF_REF_REGNO (def) == regno)
return def;
}
@@ -1778,11 +1778,11 @@ df_bb_regno_last_def_find (basic_block bb, unsigned int regno)
/* Finds the reference corresponding to the definition of REG in INSN.
DF is the dataflow object. */
-struct df_ref *
+df_ref
df_find_def (rtx insn, rtx reg)
{
unsigned int uid;
- struct df_ref **def_rec;
+ df_ref *def_rec;
if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg);
@@ -1791,7 +1791,7 @@ df_find_def (rtx insn, rtx reg)
uid = INSN_UID (insn);
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (rtx_equal_p (DF_REF_REAL_REG (def), reg))
return def;
}
@@ -1812,11 +1812,11 @@ df_reg_defined (rtx insn, rtx reg)
/* Finds the reference corresponding to the use of REG in INSN.
DF is the dataflow object. */
-struct df_ref *
+df_ref
df_find_use (rtx insn, rtx reg)
{
unsigned int uid;
- struct df_ref **use_rec;
+ df_ref *use_rec;
if (GET_CODE (reg) == SUBREG)
reg = SUBREG_REG (reg);
@@ -1825,14 +1825,14 @@ df_find_use (rtx insn, rtx reg)
uid = INSN_UID (insn);
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (rtx_equal_p (DF_REF_REAL_REG (use), reg))
return use;
}
if (df->changeable_flags & DF_EQ_NOTES)
for (use_rec = DF_INSN_UID_EQ_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (rtx_equal_p (DF_REF_REAL_REG (use), reg))
return use;
}
@@ -2064,12 +2064,12 @@ df_dump_bottom (basic_block bb, FILE *file)
void
-df_refs_chain_dump (struct df_ref **ref_rec, bool follow_chain, FILE *file)
+df_refs_chain_dump (df_ref *ref_rec, bool follow_chain, FILE *file)
{
fprintf (file, "{ ");
while (*ref_rec)
{
- struct df_ref *ref = *ref_rec;
+ df_ref ref = *ref_rec;
fprintf (file, "%c%d(%d)",
DF_REF_REG_DEF_P (ref) ? 'd' : (DF_REF_FLAGS (ref) & DF_REF_IN_NOTE) ? 'e' : 'u',
DF_REF_ID (ref),
@@ -2085,7 +2085,7 @@ df_refs_chain_dump (struct df_ref **ref_rec, bool follow_chain, FILE *file)
/* Dump either a ref-def or reg-use chain. */
void
-df_regs_chain_dump (struct df_ref *ref, FILE *file)
+df_regs_chain_dump (df_ref ref, FILE *file)
{
fprintf (file, "{ ");
while (ref)
@@ -2094,7 +2094,7 @@ df_regs_chain_dump (struct df_ref *ref, FILE *file)
DF_REF_REG_DEF_P (ref) ? 'd' : 'u',
DF_REF_ID (ref),
DF_REF_REGNO (ref));
- ref = ref->next_reg;
+ ref = DF_REF_NEXT_REG (ref);
}
fprintf (file, "}");
}
@@ -2106,7 +2106,7 @@ df_mws_dump (struct df_mw_hardreg **mws, FILE *file)
while (*mws)
{
fprintf (file, "mw %c r[%d..%d]\n",
- ((*mws)->type == DF_REF_REG_DEF) ? 'd' : 'u',
+ (DF_MWS_REG_DEF_P (*mws)) ? 'd' : 'u',
(*mws)->start_regno, (*mws)->end_regno);
mws++;
}
@@ -2185,7 +2185,7 @@ df_regno_debug (unsigned int regno, FILE *file)
void
-df_ref_debug (struct df_ref *ref, FILE *file)
+df_ref_debug (df_ref ref, FILE *file)
{
fprintf (file, "%c%d ",
DF_REF_REG_DEF_P (ref) ? 'd' : 'u',
@@ -2193,7 +2193,7 @@ df_ref_debug (struct df_ref *ref, FILE *file)
fprintf (file, "reg %d bb %d insn %d flag 0x%x type 0x%x ",
DF_REF_REGNO (ref),
DF_REF_BBNO (ref),
- DF_REF_INSN_INFO (ref) ? INSN_UID (DF_REF_INSN (ref)) : -1,
+ DF_REF_IS_ARTIFICIAL (ref) ? -1 : DF_REF_INSN_UID (ref),
DF_REF_FLAGS (ref),
DF_REF_TYPE (ref));
if (DF_REF_LOC (ref))
@@ -2229,7 +2229,7 @@ debug_df_regno (unsigned int regno)
void
-debug_df_ref (struct df_ref *ref)
+debug_df_ref (df_ref ref)
{
df_ref_debug (ref, stderr);
}
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index abb34d0596a..25dea30817b 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -128,7 +128,7 @@ df_chain_dump (struct df_link *link, FILE *file)
DF_REF_REG_DEF_P (link->ref) ? 'd' : 'u',
DF_REF_ID (link->ref),
DF_REF_BBNO (link->ref),
- DF_REF_INSN_INFO (link->ref) ? DF_REF_INSN_UID (link->ref) : -1);
+ DF_REF_IS_ARTIFICIAL (link->ref) ? -1 : DF_REF_INSN_UID (link->ref));
}
fprintf (file, "}");
}
@@ -320,12 +320,12 @@ df_rd_alloc (bitmap all_blocks)
static void
df_rd_bb_local_compute_process_def (struct df_rd_bb_info *bb_info,
- struct df_ref **def_rec,
+ df_ref *def_rec,
enum df_ref_flags top_flag)
{
while (*def_rec)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (top_flag == (DF_REF_FLAGS (def) & DF_REF_AT_TOP))
{
unsigned int regno = DF_REF_REGNO (def);
@@ -795,13 +795,13 @@ df_lr_bb_local_compute (unsigned int bb_index)
basic_block bb = BASIC_BLOCK (bb_index);
struct df_lr_bb_info *bb_info = df_lr_get_bb_info (bb_index);
rtx insn;
- struct df_ref **def_rec;
- struct df_ref **use_rec;
+ df_ref *def_rec;
+ df_ref *use_rec;
/* Process the registers set in an exception handler. */
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if ((DF_REF_FLAGS (def) & DF_REF_AT_TOP) == 0)
{
unsigned int dregno = DF_REF_REGNO (def);
@@ -813,7 +813,7 @@ df_lr_bb_local_compute (unsigned int bb_index)
/* Process the hardware registers that are always live. */
for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
/* Add use to set of uses in this BB. */
if ((DF_REF_FLAGS (use) & DF_REF_AT_TOP) == 0)
bitmap_set_bit (bb_info->use, DF_REF_REGNO (use));
@@ -828,7 +828,7 @@ df_lr_bb_local_compute (unsigned int bb_index)
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
/* If the def is to only part of the reg, it does
not kill the other defs that reach here. */
if (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL)))
@@ -841,7 +841,7 @@ df_lr_bb_local_compute (unsigned int bb_index)
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
/* Add use to set of uses in this BB. */
bitmap_set_bit (bb_info->use, DF_REF_REGNO (use));
}
@@ -852,7 +852,7 @@ df_lr_bb_local_compute (unsigned int bb_index)
goto. */
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (DF_REF_FLAGS (def) & DF_REF_AT_TOP)
{
unsigned int dregno = DF_REF_REGNO (def);
@@ -865,7 +865,7 @@ df_lr_bb_local_compute (unsigned int bb_index)
/* Process the uses that are live into an exception handler. */
for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
/* Add use to set of uses in this BB. */
if (DF_REF_FLAGS (use) & DF_REF_AT_TOP)
bitmap_set_bit (bb_info->use, DF_REF_REGNO (use));
@@ -1415,7 +1415,7 @@ df_live_bb_local_compute (unsigned int bb_index)
basic_block bb = BASIC_BLOCK (bb_index);
struct df_live_bb_info *bb_info = df_live_get_bb_info (bb_index);
rtx insn;
- struct df_ref **def_rec;
+ df_ref *def_rec;
int luid = 0;
FOR_BB_INSNS (bb, insn)
@@ -1438,7 +1438,7 @@ df_live_bb_local_compute (unsigned int bb_index)
luid++;
for (def_rec = DF_INSN_INFO_DEFS (insn_info); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
unsigned int regno = DF_REF_REGNO (def);
if (DF_REF_FLAGS_IS_SET (def,
@@ -1457,7 +1457,7 @@ df_live_bb_local_compute (unsigned int bb_index)
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
bitmap_set_bit (bb_info->gen, DF_REF_REGNO (def));
}
}
@@ -1858,7 +1858,7 @@ df_live_verify_transfer_functions (void)
/* Create a du or ud chain from SRC to DST and link it into SRC. */
struct df_link *
-df_chain_create (struct df_ref *src, struct df_ref *dst)
+df_chain_create (df_ref src, df_ref dst)
{
struct df_link *head = DF_REF_CHAIN (src);
struct df_link *link = (struct df_link *) pool_alloc (df_chain->block_pool);
@@ -1873,7 +1873,7 @@ df_chain_create (struct df_ref *src, struct df_ref *dst)
/* Delete any du or ud chains that start at REF and point to
TARGET. */
static void
-df_chain_unlink_1 (struct df_ref *ref, struct df_ref *target)
+df_chain_unlink_1 (df_ref ref, df_ref target)
{
struct df_link *chain = DF_REF_CHAIN (ref);
struct df_link *prev = NULL;
@@ -1898,7 +1898,7 @@ df_chain_unlink_1 (struct df_ref *ref, struct df_ref *target)
/* Delete a du or ud chain that leave or point to REF. */
void
-df_chain_unlink (struct df_ref *ref)
+df_chain_unlink (df_ref ref)
{
struct df_link *chain = DF_REF_CHAIN (ref);
while (chain)
@@ -1917,7 +1917,7 @@ df_chain_unlink (struct df_ref *ref)
TO_REF. */
void
-df_chain_copy (struct df_ref *to_ref,
+df_chain_copy (df_ref to_ref,
struct df_link *from_ref)
{
while (from_ref)
@@ -1943,8 +1943,8 @@ df_chain_remove_problem (void)
EXECUTE_IF_SET_IN_BITMAP (df_chain->out_of_date_transfer_functions, 0, bb_index, bi)
{
rtx insn;
- struct df_ref **def_rec;
- struct df_ref **use_rec;
+ df_ref *def_rec;
+ df_ref *use_rec;
basic_block bb = BASIC_BLOCK (bb_index);
if (df_chain_problem_p (DF_DU_CHAIN))
@@ -2015,7 +2015,7 @@ df_chain_reset (bitmap blocks_to_clear ATTRIBUTE_UNUSED)
static void
df_chain_create_bb_process_use (bitmap local_rd,
- struct df_ref **use_rec,
+ df_ref *use_rec,
enum df_ref_flags top_flag)
{
bitmap_iterator bi;
@@ -2023,7 +2023,7 @@ df_chain_create_bb_process_use (bitmap local_rd,
while (*use_rec)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
unsigned int uregno = DF_REF_REGNO (use);
if ((!(df->changeable_flags & DF_NO_HARD_REGS))
|| (uregno >= FIRST_PSEUDO_REGISTER))
@@ -2039,7 +2039,7 @@ df_chain_create_bb_process_use (bitmap local_rd,
EXECUTE_IF_SET_IN_BITMAP (local_rd, first_index, def_index, bi)
{
- struct df_ref *def;
+ df_ref def;
if (def_index > last_index)
break;
@@ -2067,7 +2067,7 @@ df_chain_create_bb (unsigned int bb_index)
struct df_rd_bb_info *bb_info = df_rd_get_bb_info (bb_index);
rtx insn;
bitmap cpy = BITMAP_ALLOC (NULL);
- struct df_ref **def_rec;
+ df_ref *def_rec;
bitmap_copy (cpy, bb_info->in);
bitmap_set_bit (df_chain->out_of_date_transfer_functions, bb_index);
@@ -2088,7 +2088,7 @@ df_chain_create_bb (unsigned int bb_index)
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (DF_REF_FLAGS (def) & DF_REF_AT_TOP)
{
unsigned int dregno = DF_REF_REGNO (def);
@@ -2103,7 +2103,7 @@ df_chain_create_bb (unsigned int bb_index)
/* Process the regular instructions next. */
FOR_BB_INSNS (bb, insn)
{
- struct df_ref **def_rec;
+ df_ref *def_rec;
unsigned int uid = INSN_UID (insn);
if (!INSN_P (insn))
@@ -2122,7 +2122,7 @@ df_chain_create_bb (unsigned int bb_index)
pass only changes the bits in cpy. */
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
unsigned int dregno = DF_REF_REGNO (def);
if ((!(df->changeable_flags & DF_NO_HARD_REGS))
|| (dregno >= FIRST_PSEUDO_REGISTER))
@@ -2183,14 +2183,14 @@ df_chain_top_dump (basic_block bb, FILE *file)
if (df_chain_problem_p (DF_DU_CHAIN))
{
rtx insn;
- struct df_ref **def_rec = df_get_artificial_defs (bb->index);
+ df_ref *def_rec = df_get_artificial_defs (bb->index);
if (*def_rec)
{
fprintf (file, ";; DU chains for artificial defs\n");
while (*def_rec)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
fprintf (file, ";; reg %d ", DF_REF_REGNO (def));
df_chain_dump (DF_REF_CHAIN (def), file);
fprintf (file, "\n");
@@ -2211,9 +2211,9 @@ df_chain_top_dump (basic_block bb, FILE *file)
while (*def_rec)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
fprintf (file, ";; reg %d ", DF_REF_REGNO (def));
- if (def->flags & DF_REF_READ_WRITE)
+ if (DF_REF_FLAGS (def) & DF_REF_READ_WRITE)
fprintf (file, "read/write ");
df_chain_dump (DF_REF_CHAIN (def), file);
fprintf (file, "\n");
@@ -2232,14 +2232,14 @@ df_chain_bottom_dump (basic_block bb, FILE *file)
if (df_chain_problem_p (DF_UD_CHAIN))
{
rtx insn;
- struct df_ref **use_rec = df_get_artificial_uses (bb->index);
+ df_ref *use_rec = df_get_artificial_uses (bb->index);
if (*use_rec)
{
fprintf (file, ";; UD chains for artificial uses\n");
while (*use_rec)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
fprintf (file, ";; reg %d ", DF_REF_REGNO (use));
df_chain_dump (DF_REF_CHAIN (use), file);
fprintf (file, "\n");
@@ -2252,7 +2252,7 @@ df_chain_bottom_dump (basic_block bb, FILE *file)
if (INSN_P (insn))
{
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
- struct df_ref **eq_use_rec = DF_INSN_INFO_EQ_USES (insn_info);
+ df_ref *eq_use_rec = DF_INSN_INFO_EQ_USES (insn_info);
use_rec = DF_INSN_INFO_USES (insn_info);
if (*use_rec || *eq_use_rec)
{
@@ -2261,9 +2261,9 @@ df_chain_bottom_dump (basic_block bb, FILE *file)
while (*use_rec)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
fprintf (file, ";; reg %d ", DF_REF_REGNO (use));
- if (use->flags & DF_REF_READ_WRITE)
+ if (DF_REF_FLAGS (use) & DF_REF_READ_WRITE)
fprintf (file, "read/write ");
df_chain_dump (DF_REF_CHAIN (use), file);
fprintf (file, "\n");
@@ -2271,7 +2271,7 @@ df_chain_bottom_dump (basic_block bb, FILE *file)
}
while (*eq_use_rec)
{
- struct df_ref *use = *eq_use_rec;
+ df_ref use = *eq_use_rec;
fprintf (file, ";; eq_note reg %d ", DF_REF_REGNO (use));
df_chain_dump (DF_REF_CHAIN (use), file);
fprintf (file, "\n");
@@ -2432,14 +2432,14 @@ df_byte_lr_free_bb_info (basic_block bb ATTRIBUTE_UNUSED,
extracts, subregs or strict_low_parts. */
static void
-df_byte_lr_check_regs (struct df_ref **ref_rec)
+df_byte_lr_check_regs (df_ref *ref_rec)
{
struct df_byte_lr_problem_data *problem_data
= (struct df_byte_lr_problem_data *)df_byte_lr->problem_data;
for (; *ref_rec; ref_rec++)
{
- struct df_ref *ref = *ref_rec;
+ df_ref ref = *ref_rec;
if (DF_REF_FLAGS_IS_SET (ref, DF_REF_SIGN_EXTRACT
| DF_REF_ZERO_EXTRACT
| DF_REF_STRICT_LOW_PART)
@@ -2595,13 +2595,13 @@ df_byte_lr_bb_local_compute (unsigned int bb_index)
basic_block bb = BASIC_BLOCK (bb_index);
struct df_byte_lr_bb_info *bb_info = df_byte_lr_get_bb_info (bb_index);
rtx insn;
- struct df_ref **def_rec;
- struct df_ref **use_rec;
+ df_ref *def_rec;
+ df_ref *use_rec;
/* Process the registers set in an exception handler. */
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if ((DF_REF_FLAGS (def) & DF_REF_AT_TOP) == 0)
{
unsigned int dregno = DF_REF_REGNO (def);
@@ -2615,7 +2615,7 @@ df_byte_lr_bb_local_compute (unsigned int bb_index)
/* Process the hardware registers that are always live. */
for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
/* Add use to set of uses in this BB. */
if ((DF_REF_FLAGS (use) & DF_REF_AT_TOP) == 0)
{
@@ -2635,7 +2635,7 @@ df_byte_lr_bb_local_compute (unsigned int bb_index)
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
/* If the def is to only part of the reg, it does
not kill the other defs that reach here. */
if (!(DF_REF_FLAGS (def) & (DF_REF_CONDITIONAL)))
@@ -2660,7 +2660,7 @@ df_byte_lr_bb_local_compute (unsigned int bb_index)
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
unsigned int uregno = DF_REF_REGNO (use);
unsigned int start = problem_data->regno_start[uregno];
unsigned int len = problem_data->regno_len[uregno];
@@ -2682,7 +2682,7 @@ df_byte_lr_bb_local_compute (unsigned int bb_index)
goto. */
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (DF_REF_FLAGS (def) & DF_REF_AT_TOP)
{
unsigned int dregno = DF_REF_REGNO (def);
@@ -2697,7 +2697,7 @@ df_byte_lr_bb_local_compute (unsigned int bb_index)
/* Process the uses that are live into an exception handler. */
for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
/* Add use to set of uses in this BB. */
if (DF_REF_FLAGS (use) & DF_REF_AT_TOP)
{
@@ -2911,12 +2911,12 @@ df_byte_lr_simulate_defs (rtx insn, bitmap live)
{
struct df_byte_lr_problem_data *problem_data
= (struct df_byte_lr_problem_data *)df_byte_lr->problem_data;
- struct df_ref **def_rec;
+ df_ref *def_rec;
unsigned int uid = INSN_UID (insn);
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
/* If the def is to only part of the reg, it does
not kill the other defs that reach here. */
@@ -2947,12 +2947,12 @@ df_byte_lr_simulate_uses (rtx insn, bitmap live)
{
struct df_byte_lr_problem_data *problem_data
= (struct df_byte_lr_problem_data *)df_byte_lr->problem_data;
- struct df_ref **use_rec;
+ df_ref *use_rec;
unsigned int uid = INSN_UID (insn);
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
unsigned int uregno = DF_REF_REGNO (use);
unsigned int start = problem_data->regno_start[uregno];
unsigned int len = problem_data->regno_len[uregno];
@@ -2980,16 +2980,16 @@ df_byte_lr_simulate_artificial_refs_at_top (basic_block bb, bitmap live)
{
struct df_byte_lr_problem_data *problem_data
= (struct df_byte_lr_problem_data *)df_byte_lr->problem_data;
- struct df_ref **def_rec;
+ df_ref *def_rec;
#ifdef EH_USES
- struct df_ref **use_rec;
+ df_ref *use_rec;
#endif
int bb_index = bb->index;
#ifdef EH_USES
for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (DF_REF_FLAGS (use) & DF_REF_AT_TOP)
{
unsigned int uregno = DF_REF_REGNO (use);
@@ -3002,7 +3002,7 @@ df_byte_lr_simulate_artificial_refs_at_top (basic_block bb, bitmap live)
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (DF_REF_FLAGS (def) & DF_REF_AT_TOP)
{
unsigned int dregno = DF_REF_REGNO (def);
@@ -3022,13 +3022,13 @@ df_byte_lr_simulate_artificial_refs_at_end (basic_block bb, bitmap live)
{
struct df_byte_lr_problem_data *problem_data
= (struct df_byte_lr_problem_data *)df_byte_lr->problem_data;
- struct df_ref **def_rec;
- struct df_ref **use_rec;
+ df_ref *def_rec;
+ df_ref *use_rec;
int bb_index = bb->index;
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if ((DF_REF_FLAGS (def) & DF_REF_AT_TOP) == 0)
{
unsigned int dregno = DF_REF_REGNO (def);
@@ -3040,7 +3040,7 @@ df_byte_lr_simulate_artificial_refs_at_end (basic_block bb, bitmap live)
for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if ((DF_REF_FLAGS (use) & DF_REF_AT_TOP) == 0)
{
unsigned int uregno = DF_REF_REGNO (use);
@@ -3351,7 +3351,7 @@ df_set_dead_notes_for_mw (rtx insn, rtx old, struct df_mw_hardreg *mws,
LIVE. Do not generate notes for registers in ARTIFICIAL_USES. */
static rtx
-df_create_unused_note (rtx insn, rtx old, struct df_ref *def,
+df_create_unused_note (rtx insn, rtx old, df_ref def,
bitmap live, bitmap artificial_uses)
{
unsigned int dregno = DF_REF_REGNO (def);
@@ -3391,8 +3391,8 @@ df_note_bb_compute (unsigned int bb_index,
{
basic_block bb = BASIC_BLOCK (bb_index);
rtx insn;
- struct df_ref **def_rec;
- struct df_ref **use_rec;
+ df_ref *def_rec;
+ df_ref *use_rec;
bitmap_copy (live, df_get_live_out (bb));
bitmap_clear (artificial_uses);
@@ -3409,7 +3409,7 @@ df_note_bb_compute (unsigned int bb_index,
to begin processing. */
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
#ifdef REG_DEAD_DEBUGGING
if (dump_file)
fprintf (dump_file, "artificial def %d\n", DF_REF_REGNO (def));
@@ -3421,7 +3421,7 @@ df_note_bb_compute (unsigned int bb_index,
for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if ((DF_REF_FLAGS (use) & DF_REF_AT_TOP) == 0)
{
unsigned int regno = DF_REF_REGNO (use);
@@ -3470,7 +3470,7 @@ df_note_bb_compute (unsigned int bb_index,
while (*mws_rec)
{
struct df_mw_hardreg *mws = *mws_rec;
- if ((mws->type == DF_REF_REG_DEF)
+ if ((DF_MWS_REG_DEF_P (mws))
&& !df_ignore_stack_reg (mws->start_regno))
old_unused_notes
= df_set_unused_notes_for_mw (insn, old_unused_notes,
@@ -3483,7 +3483,7 @@ df_note_bb_compute (unsigned int bb_index,
clobber. This code is for the return. */
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
unsigned int dregno = DF_REF_REGNO (def);
if (!DF_REF_FLAGS_IS_SET (def, DF_REF_MUST_CLOBBER | DF_REF_MAY_CLOBBER))
{
@@ -3504,7 +3504,7 @@ df_note_bb_compute (unsigned int bb_index,
while (*mws_rec)
{
struct df_mw_hardreg *mws = *mws_rec;
- if (mws->type == DF_REF_REG_DEF)
+ if (DF_MWS_REG_DEF_P (mws))
old_unused_notes
= df_set_unused_notes_for_mw (insn, old_unused_notes,
mws, live, do_not_gen,
@@ -3514,7 +3514,7 @@ df_note_bb_compute (unsigned int bb_index,
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
unsigned int dregno = DF_REF_REGNO (def);
old_unused_notes
= df_create_unused_note (insn, old_unused_notes,
@@ -3533,7 +3533,7 @@ df_note_bb_compute (unsigned int bb_index,
while (*mws_rec)
{
struct df_mw_hardreg *mws = *mws_rec;
- if ((mws->type != DF_REF_REG_DEF)
+ if ((DF_MWS_REG_DEF_P (mws))
&& !df_ignore_stack_reg (mws->start_regno))
old_dead_notes
= df_set_dead_notes_for_mw (insn, old_dead_notes,
@@ -3544,7 +3544,7 @@ df_note_bb_compute (unsigned int bb_index,
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
unsigned int uregno = DF_REF_REGNO (use);
#ifdef REG_DEAD_DEBUGGING
@@ -3689,12 +3689,12 @@ df_note_add_problem (void)
void
df_simulate_find_defs (rtx insn, bitmap defs)
{
- struct df_ref **def_rec;
+ df_ref *def_rec;
unsigned int uid = INSN_UID (insn);
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
/* If the def is to only part of the reg, it does
not kill the other defs that reach here. */
if (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL)))
@@ -3708,12 +3708,12 @@ df_simulate_find_defs (rtx insn, bitmap defs)
void
df_simulate_defs (rtx insn, bitmap live)
{
- struct df_ref **def_rec;
+ df_ref *def_rec;
unsigned int uid = INSN_UID (insn);
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
unsigned int dregno = DF_REF_REGNO (def);
/* If the def is to only part of the reg, it does
@@ -3729,12 +3729,12 @@ df_simulate_defs (rtx insn, bitmap live)
void
df_simulate_uses (rtx insn, bitmap live)
{
- struct df_ref **use_rec;
+ df_ref *use_rec;
unsigned int uid = INSN_UID (insn);
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
/* Add use to set of uses in this BB. */
bitmap_set_bit (live, DF_REF_REGNO (use));
}
@@ -3778,20 +3778,20 @@ df_simulate_fixup_sets (basic_block bb, bitmap live)
void
df_simulate_artificial_refs_at_end (basic_block bb, bitmap live)
{
- struct df_ref **def_rec;
- struct df_ref **use_rec;
+ df_ref *def_rec;
+ df_ref *use_rec;
int bb_index = bb->index;
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if ((DF_REF_FLAGS (def) & DF_REF_AT_TOP) == 0)
bitmap_clear_bit (live, DF_REF_REGNO (def));
}
for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if ((DF_REF_FLAGS (use) & DF_REF_AT_TOP) == 0)
bitmap_set_bit (live, DF_REF_REGNO (use));
}
@@ -3818,15 +3818,15 @@ df_simulate_one_insn (basic_block bb, rtx insn, bitmap live)
void
df_simulate_artificial_refs_at_top (basic_block bb, bitmap live)
{
- struct df_ref **def_rec;
+ df_ref *def_rec;
#ifdef EH_USES
- struct df_ref **use_rec;
+ df_ref *use_rec;
#endif
int bb_index = bb->index;
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (DF_REF_FLAGS (def) & DF_REF_AT_TOP)
bitmap_clear_bit (live, DF_REF_REGNO (def));
}
@@ -3834,7 +3834,7 @@ df_simulate_artificial_refs_at_top (basic_block bb, bitmap live)
#ifdef EH_USES
for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (DF_REF_FLAGS (use) & DF_REF_AT_TOP)
bitmap_set_bit (live, DF_REF_REGNO (use));
}
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 7e6796b40e7..761ba79121c 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -94,20 +94,20 @@ bitmap df_invalidated_by_call = NULL;
struct df_collection_rec
{
- struct df_ref ** def_vec;
+ df_ref * def_vec;
unsigned int next_def;
- struct df_ref ** use_vec;
+ df_ref * use_vec;
unsigned int next_use;
- struct df_ref ** eq_use_vec;
+ df_ref * eq_use_vec;
unsigned int next_eq_use;
struct df_mw_hardreg **mw_vec;
unsigned int next_mw;
};
-static struct df_ref * df_null_ref_rec[1];
+static df_ref df_null_ref_rec[1];
static struct df_mw_hardreg * df_null_mw_rec[1];
-static void df_ref_record (struct df_collection_rec *,
+static void df_ref_record (enum df_ref_class, struct df_collection_rec *,
rtx, rtx *,
basic_block, struct df_insn_info *,
enum df_ref_type, enum df_ref_flags,
@@ -118,16 +118,17 @@ static void df_def_record_1 (struct df_collection_rec *, rtx,
static void df_defs_record (struct df_collection_rec *, rtx,
basic_block, struct df_insn_info *,
enum df_ref_flags);
-static void df_uses_record (struct df_collection_rec *,
+static void df_uses_record (enum df_ref_class, struct df_collection_rec *,
rtx *, enum df_ref_type,
basic_block, struct df_insn_info *,
enum df_ref_flags,
int, int, enum machine_mode);
-static struct df_ref *df_ref_create_structure (struct df_collection_rec *, rtx, rtx *,
- basic_block, struct df_insn_info *,
- enum df_ref_type, enum df_ref_flags,
- int, int, enum machine_mode);
+static df_ref df_ref_create_structure (enum df_ref_class,
+ struct df_collection_rec *, rtx, rtx *,
+ basic_block, struct df_insn_info *,
+ enum df_ref_type, enum df_ref_flags,
+ int, int, enum machine_mode);
static void df_insn_refs_collect (struct df_collection_rec*,
basic_block, struct df_insn_info *);
@@ -141,8 +142,8 @@ static void df_record_exit_block_uses (bitmap);
static void df_get_exit_block_use_set (bitmap);
static void df_get_entry_block_def_set (bitmap);
static void df_grow_ref_info (struct df_ref_info *, unsigned int);
-static void df_ref_chain_delete_du_chain (struct df_ref **);
-static void df_ref_chain_delete (struct df_ref **);
+static void df_ref_chain_delete_du_chain (df_ref *);
+static void df_ref_chain_delete (df_ref *);
static void df_refs_add_to_chains (struct df_collection_rec *,
basic_block, rtx);
@@ -150,7 +151,7 @@ static void df_refs_add_to_chains (struct df_collection_rec *,
static bool df_insn_refs_verify (struct df_collection_rec *, basic_block, rtx, bool);
static void df_entry_block_defs_collect (struct df_collection_rec *, bitmap);
static void df_exit_block_uses_collect (struct df_collection_rec *, bitmap);
-static void df_install_ref (struct df_ref *, struct df_reg_info *,
+static void df_install_ref (df_ref, struct df_reg_info *,
struct df_ref_info *, bool);
static int df_ref_compare (const void *, const void *);
@@ -178,7 +179,9 @@ static bool regs_ever_live[FIRST_PSEUDO_REGISTER];
/* Problem data for the scanning dataflow function. */
struct df_scan_problem_data
{
- alloc_pool ref_pool;
+ alloc_pool ref_base_pool;
+ alloc_pool ref_artificial_pool;
+ alloc_pool ref_regular_pool;
alloc_pool ref_extract_pool;
alloc_pool insn_pool;
alloc_pool reg_pool;
@@ -264,7 +267,9 @@ df_scan_free_internal (void)
BITMAP_FREE (df->insns_to_notes_rescan);
free_alloc_pool (df_scan->block_pool);
- free_alloc_pool (problem_data->ref_pool);
+ free_alloc_pool (problem_data->ref_base_pool);
+ free_alloc_pool (problem_data->ref_artificial_pool);
+ free_alloc_pool (problem_data->ref_regular_pool);
free_alloc_pool (problem_data->ref_extract_pool);
free_alloc_pool (problem_data->insn_pool);
free_alloc_pool (problem_data->reg_pool);
@@ -344,20 +349,26 @@ df_scan_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
df_scan->problem_data = problem_data;
df_scan->computed = true;
- problem_data->ref_pool
- = create_alloc_pool ("df_scan_ref pool",
- sizeof (struct df_ref), block_size);
+ problem_data->ref_base_pool
+ = create_alloc_pool ("df_scan ref base",
+ sizeof (struct df_base_ref), block_size);
+ problem_data->ref_artificial_pool
+ = create_alloc_pool ("df_scan ref artificial",
+ sizeof (struct df_artificial_ref), block_size);
+ problem_data->ref_regular_pool
+ = create_alloc_pool ("df_scan ref regular",
+ sizeof (struct df_regular_ref), block_size);
problem_data->ref_extract_pool
- = create_alloc_pool ("df_scan_ref extract pool",
- sizeof (struct df_ref_extract), block_size);
+ = create_alloc_pool ("df_scan ref extract",
+ sizeof (struct df_extract_ref), block_size);
problem_data->insn_pool
- = create_alloc_pool ("df_scan_insn pool",
+ = create_alloc_pool ("df_scan insn",
sizeof (struct df_insn_info), block_size);
problem_data->reg_pool
- = create_alloc_pool ("df_scan_reg pool",
+ = create_alloc_pool ("df_scan reg",
sizeof (struct df_reg_info), block_size);
problem_data->mw_reg_pool
- = create_alloc_pool ("df_scan_mw_reg pool",
+ = create_alloc_pool ("df_scan mw_reg",
sizeof (struct df_mw_hardreg), block_size);
bitmap_obstack_initialize (&problem_data->reg_bitmaps);
@@ -416,6 +427,13 @@ static void
df_scan_start_dump (FILE *file ATTRIBUTE_UNUSED)
{
int i;
+ int dcount = 0;
+ int ucount = 0;
+ int ecount = 0;
+ int icount = 0;
+ int ccount = 0;
+ basic_block bb;
+ rtx insn;
fprintf (file, ";; invalidated by call \t");
df_print_regset (file, df_invalidated_by_call);
@@ -433,8 +451,46 @@ df_scan_start_dump (FILE *file ATTRIBUTE_UNUSED)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (df_regs_ever_live_p (i))
fprintf (file, " %d[%s]", i, reg_names[i]);
+ fprintf (file, "\n;; ref usage \t");
+
+ for (i = 0; i < (int)df->regs_inited; i++)
+ if (DF_REG_DEF_COUNT (i) || DF_REG_USE_COUNT (i) || DF_REG_EQ_USE_COUNT (i))
+ {
+ const char * sep = "";
+
+ fprintf (file, "r%d={", i);
+ if (DF_REG_DEF_COUNT (i))
+ {
+ fprintf (file, "%dd", DF_REG_DEF_COUNT (i));
+ sep = ",";
+ dcount += DF_REG_DEF_COUNT (i);
+ }
+ if (DF_REG_USE_COUNT (i))
+ {
+ fprintf (file, "%s%du", sep, DF_REG_USE_COUNT (i));
+ sep = ",";
+ ucount += DF_REG_USE_COUNT (i);
+ }
+ if (DF_REG_EQ_USE_COUNT (i))
+ {
+ fprintf (file, "%s%dd", sep, DF_REG_EQ_USE_COUNT (i));
+ ecount += DF_REG_EQ_USE_COUNT (i);
+ }
+ fprintf (file, "} ");
+ }
- fprintf (file, "\n");
+ FOR_EACH_BB (bb)
+ FOR_BB_INSNS (bb, insn)
+ if (INSN_P (insn))
+ {
+ if (CALL_P (insn))
+ ccount++;
+ else
+ icount++;
+ }
+
+ fprintf (file, "\n;; total ref usage %d{%dd,%du,%de} in %d{%d regular + %d call} insns.\n",
+ dcount + ucount + ecount, dcount, ucount, ecount, icount + ccount, icount, ccount);
}
/* Dump the bb_info for a given basic block. */
@@ -565,9 +621,9 @@ df_grow_ref_info (struct df_ref_info *ref_info, unsigned int new_size)
{
if (ref_info->refs_size < new_size)
{
- ref_info->refs = XRESIZEVEC (struct df_ref *, ref_info->refs, new_size);
+ ref_info->refs = XRESIZEVEC (df_ref, ref_info->refs, new_size);
memset (ref_info->refs + ref_info->refs_size, 0,
- (new_size - ref_info->refs_size) *sizeof (struct df_ref *));
+ (new_size - ref_info->refs_size) *sizeof (df_ref));
ref_info->refs_size = new_size;
}
}
@@ -658,30 +714,38 @@ df_scan_blocks (void)
fields if they were constants. Otherwise they should be -1 if
those flags were set. */
-struct df_ref *
+df_ref
df_ref_create (rtx reg, rtx *loc, rtx insn,
basic_block bb,
enum df_ref_type ref_type,
enum df_ref_flags ref_flags,
int width, int offset, enum machine_mode mode)
{
- struct df_ref *ref;
+ df_ref ref;
struct df_reg_info **reg_info;
struct df_ref_info *ref_info;
- struct df_ref **ref_rec;
- struct df_ref ***ref_rec_ptr;
+ df_ref *ref_rec;
+ df_ref **ref_rec_ptr;
unsigned int count = 0;
bool add_to_table;
+ enum df_ref_class cl;
df_grow_reg_info ();
/* You cannot hack artificial refs. */
gcc_assert (insn);
- ref = df_ref_create_structure (NULL, reg, loc, bb, DF_INSN_INFO_GET (insn),
+
+ if (width != -1 || offset != -1)
+ cl = DF_REF_EXTRACT;
+ else if (loc)
+ cl = DF_REF_REGULAR;
+ else
+ cl = DF_REF_BASE;
+ ref = df_ref_create_structure (cl, NULL, reg, loc, bb, DF_INSN_INFO_GET (insn),
ref_type, ref_flags,
width, offset, mode);
- if (DF_REF_TYPE (ref) == DF_REF_REG_DEF)
+ if (DF_REF_REG_DEF_P (ref))
{
reg_info = df->def_regs;
ref_info = &df->def_info;
@@ -742,15 +806,15 @@ df_ref_create (rtx reg, rtx *loc, rtx insn,
ref_rec = *ref_rec_ptr;
if (count)
{
- ref_rec = XRESIZEVEC (struct df_ref *, ref_rec, count+2);
+ ref_rec = XRESIZEVEC (df_ref, ref_rec, count+2);
*ref_rec_ptr = ref_rec;
ref_rec[count] = ref;
ref_rec[count+1] = NULL;
- qsort (ref_rec, count + 1, sizeof (struct df_ref *), df_ref_compare);
+ qsort (ref_rec, count + 1, sizeof (df_ref), df_ref_compare);
}
else
{
- struct df_ref **ref_rec = XNEWVEC (struct df_ref*, 2);
+ df_ref *ref_rec = XNEWVEC (df_ref, 2);
ref_rec[0] = ref;
ref_rec[1] = NULL;
*ref_rec_ptr = ref_rec;
@@ -778,15 +842,29 @@ df_ref_create (rtx reg, rtx *loc, rtx insn,
----------------------------------------------------------------------------*/
static void
-df_free_ref (struct df_ref *ref)
+df_free_ref (df_ref ref)
{
struct df_scan_problem_data *problem_data
= (struct df_scan_problem_data *) df_scan->problem_data;
- if (DF_REF_FLAGS_IS_SET (ref, DF_REF_SIGN_EXTRACT | DF_REF_ZERO_EXTRACT))
- pool_free (problem_data->ref_extract_pool, (struct df_ref_extract *)ref);
- else
- pool_free (problem_data->ref_pool, ref);
+ switch (DF_REF_CLASS (ref))
+ {
+ case DF_REF_BASE:
+ pool_free (problem_data->ref_base_pool, ref);
+ break;
+
+ case DF_REF_ARTIFICIAL:
+ pool_free (problem_data->ref_artificial_pool, ref);
+ break;
+
+ case DF_REF_REGULAR:
+ pool_free (problem_data->ref_regular_pool, ref);
+ break;
+
+ case DF_REF_EXTRACT:
+ pool_free (problem_data->ref_extract_pool, ref);
+ break;
+ }
}
@@ -794,17 +872,18 @@ df_free_ref (struct df_ref *ref)
Also delete the def-use or use-def chain if it exists. */
static void
-df_reg_chain_unlink (struct df_ref *ref)
+df_reg_chain_unlink (df_ref ref)
{
- struct df_ref *next = DF_REF_NEXT_REG (ref);
- struct df_ref *prev = DF_REF_PREV_REG (ref);
+ df_ref next = DF_REF_NEXT_REG (ref);
+ df_ref prev = DF_REF_PREV_REG (ref);
int id = DF_REF_ID (ref);
struct df_reg_info *reg_info;
- struct df_ref **refs = NULL;
+ df_ref *refs = NULL;
- if (DF_REF_TYPE (ref) == DF_REF_REG_DEF)
+ if (DF_REF_REG_DEF_P (ref))
{
- reg_info = DF_REG_DEF_GET (DF_REF_REGNO (ref));
+ int regno = DF_REF_REGNO (ref);
+ reg_info = DF_REG_DEF_GET (regno);
refs = df->def_info.refs;
}
else
@@ -834,7 +913,7 @@ df_reg_chain_unlink (struct df_ref *ref)
{
if (df->analyze_subset)
{
- if (bitmap_bit_p (df->blocks_to_analyze, DF_REF_BB (ref)->index))
+ if (bitmap_bit_p (df->blocks_to_analyze, DF_REF_BBNO (ref)))
refs[id] = NULL;
}
else
@@ -875,9 +954,9 @@ df_reg_chain_unlink (struct df_ref *ref)
/* Remove REF from VEC. */
static void
-df_ref_compress_rec (struct df_ref ***vec_ptr, struct df_ref *ref)
+df_ref_compress_rec (df_ref **vec_ptr, df_ref ref)
{
- struct df_ref **vec = *vec_ptr;
+ df_ref *vec = *vec_ptr;
if (vec[1])
{
@@ -901,7 +980,7 @@ df_ref_compress_rec (struct df_ref ***vec_ptr, struct df_ref *ref)
/* Unlink REF from all def-use/use-def chains, etc. */
void
-df_ref_remove (struct df_ref *ref)
+df_ref_remove (df_ref ref)
{
#if 0
if (dump_file)
@@ -916,7 +995,7 @@ df_ref_remove (struct df_ref *ref)
if (DF_REF_IS_ARTIFICIAL (ref))
{
struct df_scan_bb_info *bb_info
- = df_scan_get_bb_info (DF_REF_BB (ref)->index);
+ = df_scan_get_bb_info (DF_REF_BBNO (ref));
df_ref_compress_rec (&bb_info->artificial_defs, ref);
}
else
@@ -931,7 +1010,7 @@ df_ref_remove (struct df_ref *ref)
if (DF_REF_IS_ARTIFICIAL (ref))
{
struct df_scan_bb_info *bb_info
- = df_scan_get_bb_info (DF_REF_BB (ref)->index);
+ = df_scan_get_bb_info (DF_REF_BBNO (ref));
df_ref_compress_rec (&bb_info->artificial_uses, ref);
}
else
@@ -980,11 +1059,11 @@ df_insn_create_insn_record (rtx insn)
/* Delete all du chain (DF_REF_CHAIN()) of all refs in the ref chain. */
static void
-df_ref_chain_delete_du_chain (struct df_ref **ref_rec)
+df_ref_chain_delete_du_chain (df_ref *ref_rec)
{
while (*ref_rec)
{
- struct df_ref *ref = *ref_rec;
+ df_ref ref = *ref_rec;
/* CHAIN is allocated by DF_CHAIN. So make sure to
pass df_scan instance for the problem. */
if (DF_REF_CHAIN (ref))
@@ -997,9 +1076,9 @@ df_ref_chain_delete_du_chain (struct df_ref **ref_rec)
/* Delete all refs in the ref chain. */
static void
-df_ref_chain_delete (struct df_ref **ref_rec)
+df_ref_chain_delete (df_ref *ref_rec)
{
- struct df_ref **start = ref_rec;
+ df_ref *start = ref_rec;
while (*ref_rec)
{
df_reg_chain_unlink (*ref_rec);
@@ -1113,7 +1192,7 @@ df_free_collection_rec (struct df_collection_rec *collection_rec)
{
struct df_scan_problem_data *problem_data
= (struct df_scan_problem_data *) df_scan->problem_data;
- struct df_ref **ref;
+ df_ref *ref;
struct df_mw_hardreg **mw;
if (collection_rec->def_vec)
@@ -1140,9 +1219,9 @@ df_insn_rescan (rtx insn)
struct df_insn_info *insn_info = NULL;
basic_block bb = BLOCK_FOR_INSN (insn);
struct df_collection_rec collection_rec;
- collection_rec.def_vec = XALLOCAVEC (struct df_ref *, 1000);
- collection_rec.use_vec = XALLOCAVEC (struct df_ref *, 1000);
- collection_rec.eq_use_vec = XALLOCAVEC (struct df_ref *, 1000);
+ collection_rec.def_vec = XALLOCAVEC (df_ref, 1000);
+ collection_rec.use_vec = XALLOCAVEC (df_ref, 1000);
+ collection_rec.eq_use_vec = XALLOCAVEC (df_ref, 1000);
collection_rec.mw_vec = XALLOCAVEC (struct df_mw_hardreg *, 100);
if ((!df) || (!INSN_P (insn)))
@@ -1407,7 +1486,7 @@ df_reorganize_refs_by_reg_by_reg (struct df_ref_info *ref_info,
ref_info->begin[regno] = offset;
if (include_defs)
{
- struct df_ref *ref = DF_REG_DEF_CHAIN (regno);
+ df_ref ref = DF_REG_DEF_CHAIN (regno);
while (ref)
{
ref_info->refs[offset] = ref;
@@ -1419,7 +1498,7 @@ df_reorganize_refs_by_reg_by_reg (struct df_ref_info *ref_info,
}
if (include_uses)
{
- struct df_ref *ref = DF_REG_USE_CHAIN (regno);
+ df_ref ref = DF_REG_USE_CHAIN (regno);
while (ref)
{
ref_info->refs[offset] = ref;
@@ -1431,7 +1510,7 @@ df_reorganize_refs_by_reg_by_reg (struct df_ref_info *ref_info,
}
if (include_eq_uses)
{
- struct df_ref *ref = DF_REG_EQ_USE_CHAIN (regno);
+ df_ref ref = DF_REG_EQ_USE_CHAIN (regno);
while (ref)
{
ref_info->refs[offset] = ref;
@@ -1480,7 +1559,7 @@ df_reorganize_refs_by_reg_by_insn (struct df_ref_info *ref_info,
{
basic_block bb = BASIC_BLOCK (bb_index);
rtx insn;
- struct df_ref **ref_rec;
+ df_ref *ref_rec;
if (include_defs)
for (ref_rec = df_get_artificial_defs (bb_index); *ref_rec; ref_rec++)
@@ -1534,12 +1613,12 @@ df_reorganize_refs_by_reg_by_insn (struct df_ref_info *ref_info,
{
basic_block bb = BASIC_BLOCK (bb_index);
rtx insn;
- struct df_ref **ref_rec;
+ df_ref *ref_rec;
if (include_defs)
for (ref_rec = df_get_artificial_defs (bb_index); *ref_rec; ref_rec++)
{
- struct df_ref *ref = *ref_rec;
+ df_ref ref = *ref_rec;
unsigned int regno = DF_REF_REGNO (ref);
if (regno >= start)
{
@@ -1552,7 +1631,7 @@ df_reorganize_refs_by_reg_by_insn (struct df_ref_info *ref_info,
if (include_uses)
for (ref_rec = df_get_artificial_uses (bb_index); *ref_rec; ref_rec++)
{
- struct df_ref *ref = *ref_rec;
+ df_ref ref = *ref_rec;
unsigned int regno = DF_REF_REGNO (ref);
if (regno >= start)
{
@@ -1572,7 +1651,7 @@ df_reorganize_refs_by_reg_by_insn (struct df_ref_info *ref_info,
if (include_defs)
for (ref_rec = DF_INSN_UID_DEFS (uid); *ref_rec; ref_rec++)
{
- struct df_ref *ref = *ref_rec;
+ df_ref ref = *ref_rec;
unsigned int regno = DF_REF_REGNO (ref);
if (regno >= start)
{
@@ -1585,7 +1664,7 @@ df_reorganize_refs_by_reg_by_insn (struct df_ref_info *ref_info,
if (include_uses)
for (ref_rec = DF_INSN_UID_USES (uid); *ref_rec; ref_rec++)
{
- struct df_ref *ref = *ref_rec;
+ df_ref ref = *ref_rec;
unsigned int regno = DF_REF_REGNO (ref);
if (regno >= start)
{
@@ -1598,7 +1677,7 @@ df_reorganize_refs_by_reg_by_insn (struct df_ref_info *ref_info,
if (include_eq_uses)
for (ref_rec = DF_INSN_UID_EQ_USES (uid); *ref_rec; ref_rec++)
{
- struct df_ref *ref = *ref_rec;
+ df_ref ref = *ref_rec;
unsigned int regno = DF_REF_REGNO (ref);
if (regno >= start)
{
@@ -1641,11 +1720,11 @@ df_reorganize_refs_by_reg (struct df_ref_info *ref_info,
static unsigned int
df_add_refs_to_table (unsigned int offset,
struct df_ref_info *ref_info,
- struct df_ref **ref_vec)
+ df_ref *ref_vec)
{
while (*ref_vec)
{
- struct df_ref *ref = *ref_vec;
+ df_ref ref = *ref_vec;
if ((!(df->changeable_flags & DF_NO_HARD_REGS))
|| (DF_REF_REGNO (ref) >= FIRST_PSEUDO_REGISTER))
{
@@ -1813,25 +1892,6 @@ df_maybe_reorganize_def_refs (enum df_ref_order order)
}
-/* Change the BB of all refs in the ref chain from OLD_BB to NEW_BB.
- Assumes that all refs in the chain have the same BB. */
-
-static void
-df_ref_chain_change_bb (struct df_ref **ref_rec,
- basic_block old_bb,
- basic_block new_bb)
-{
- while (*ref_rec)
- {
- struct df_ref *ref = *ref_rec;
-
- gcc_assert (DF_REF_BB (ref) == old_bb);
- DF_REF_BB (ref) = new_bb;
- ref_rec++;
- }
-}
-
-
/* Change all of the basic block references in INSN to use the insn's
current basic block. This function is called from routines that move
instructions from one block to another. */
@@ -1866,10 +1926,6 @@ df_insn_change_bb (rtx insn, basic_block new_bb)
if (!INSN_P (insn))
return;
- df_ref_chain_change_bb (insn_info->defs, old_bb, new_bb);
- df_ref_chain_change_bb (insn_info->uses, old_bb, new_bb);
- df_ref_chain_change_bb (insn_info->eq_uses, old_bb, new_bb);
-
df_set_bb_dirty (new_bb);
if (old_bb)
{
@@ -1887,18 +1943,22 @@ df_insn_change_bb (rtx insn, basic_block new_bb)
/* Helper function for df_ref_change_reg_with_loc. */
static void
-df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df, struct df_reg_info *new_df,
+df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df,
+ struct df_reg_info *new_df,
int new_regno, rtx loc)
{
- struct df_ref *the_ref = old_df->reg_chain;
+ df_ref the_ref = old_df->reg_chain;
while (the_ref)
{
- if (DF_REF_LOC(the_ref) && (*DF_REF_LOC(the_ref) == loc))
+ if ((!DF_REF_IS_ARTIFICIAL (the_ref))
+ && (DF_REF_LOC (the_ref))
+ && (*DF_REF_LOC (the_ref) == loc))
{
- struct df_ref *next_ref = the_ref->next_reg;
- struct df_ref *prev_ref = the_ref->prev_reg;
- struct df_ref **ref_vec, **ref_vec_t;
+ df_ref next_ref = DF_REF_NEXT_REG (the_ref);
+ df_ref prev_ref = DF_REF_PREV_REG (the_ref);
+ df_ref *ref_vec, *ref_vec_t;
+ struct df_insn_info *insn_info = DF_REF_INSN_INFO (the_ref);
unsigned int count = 0;
DF_REF_REGNO (the_ref) = new_regno;
@@ -1906,64 +1966,56 @@ df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df, struct df_reg_info *ne
/* Pull the_ref out of the old regno chain. */
if (prev_ref)
- prev_ref->next_reg = next_ref;
+ DF_REF_NEXT_REG (prev_ref) = next_ref;
else
old_df->reg_chain = next_ref;
if (next_ref)
- next_ref->prev_reg = prev_ref;
+ DF_REF_PREV_REG (next_ref) = prev_ref;
old_df->n_refs--;
/* Put the ref into the new regno chain. */
- the_ref->prev_reg = NULL;
- the_ref->next_reg = new_df->reg_chain;
+ DF_REF_PREV_REG (the_ref) = NULL;
+ DF_REF_NEXT_REG (the_ref) = new_df->reg_chain;
if (new_df->reg_chain)
- new_df->reg_chain->prev_reg = the_ref;
+ DF_REF_PREV_REG (new_df->reg_chain) = the_ref;
new_df->reg_chain = the_ref;
new_df->n_refs++;
- df_set_bb_dirty (DF_REF_BB (the_ref));
-
- /* Need to resort the record that the ref was in because the
- regno is a sorting key. First, find the right record. */
- if (DF_REF_IS_ARTIFICIAL (the_ref))
- {
- unsigned int bb_index = DF_REF_BB (the_ref)->index;
- if (DF_REF_REG_DEF_P (the_ref))
- ref_vec = df_get_artificial_defs (bb_index);
- else
- ref_vec = df_get_artificial_uses (bb_index);
- }
+ if (DF_REF_BB (the_ref))
+ df_set_bb_dirty (DF_REF_BB (the_ref));
+
+ /* Need to sort the record again that the ref was in because
+ the regno is a sorting key. First, find the right
+ record. */
+ if (DF_REF_FLAGS (the_ref) & DF_REF_IN_NOTE)
+ ref_vec = insn_info->eq_uses;
else
- {
- struct df_insn_info *insn_info = DF_REF_INSN_INFO (the_ref);
- if (DF_REF_FLAGS (the_ref) & DF_REF_IN_NOTE)
- ref_vec = insn_info->eq_uses;
- else
- ref_vec = insn_info->uses;
- if (dump_file)
- fprintf (dump_file, "changing reg in insn %d\n",
- INSN_UID (DF_REF_INSN (the_ref)));
- }
+ ref_vec = insn_info->uses;
+ if (dump_file)
+ fprintf (dump_file, "changing reg in insn %d\n",
+ DF_REF_INSN_UID (the_ref));
+
ref_vec_t = ref_vec;
-
+
/* Find the length. */
while (*ref_vec_t)
{
count++;
ref_vec_t++;
}
- qsort (ref_vec, count, sizeof (struct df_ref *), df_ref_compare);
+ qsort (ref_vec, count, sizeof (df_ref ), df_ref_compare);
the_ref = next_ref;
}
else
- the_ref = the_ref->next_reg;
+ the_ref = DF_REF_NEXT_REG (the_ref);
}
}
/* Change the regno of all refs that contained LOC from OLD_REGNO to
- NEW_REGNO. Refs that do not match LOC are not changed. This call
- is to support the SET_REGNO macro. */
+ NEW_REGNO. Refs that do not match LOC are not changed which means
+ that artificial refs are not changed since they have no loc. This
+ call is to support the SET_REGNO macro. */
void
df_ref_change_reg_with_loc (int old_regno, int new_regno, rtx loc)
@@ -2087,7 +2139,7 @@ df_notes_rescan (rtx insn)
unsigned int num_deleted;
memset (&collection_rec, 0, sizeof (struct df_collection_rec));
- collection_rec.eq_use_vec = XALLOCAVEC (struct df_ref *, 1000);
+ collection_rec.eq_use_vec = XALLOCAVEC (df_ref, 1000);
collection_rec.mw_vec = XALLOCAVEC (struct df_mw_hardreg *, 1000);
num_deleted = df_mw_hardreg_chain_delete_eq_uses (insn_info);
@@ -2102,7 +2154,7 @@ df_notes_rescan (rtx insn)
{
case REG_EQUIV:
case REG_EQUAL:
- df_uses_record (&collection_rec,
+ df_uses_record (DF_REF_REGULAR, &collection_rec,
&XEXP (note, 0), DF_REF_REG_USE,
bb, insn_info, DF_REF_IN_NOTE, -1, -1, 0);
default:
@@ -2170,30 +2222,44 @@ df_notes_rescan (rtx insn)
It ignores DF_REF_MARKER. */
static bool
-df_ref_equal_p (struct df_ref *ref1, struct df_ref *ref2)
+df_ref_equal_p (df_ref ref1, df_ref ref2)
{
if (!ref2)
return false;
+
+ if (ref1 == ref2)
+ return true;
+
+ if (DF_REF_CLASS (ref1) != DF_REF_CLASS (ref2)
+ || DF_REF_REGNO (ref1) != DF_REF_REGNO (ref2)
+ || DF_REF_REG (ref1) != DF_REF_REG (ref2)
+ || DF_REF_TYPE (ref1) != DF_REF_TYPE (ref2)
+ || ((DF_REF_FLAGS (ref1) & ~(DF_REF_REG_MARKER + DF_REF_MW_HARDREG))
+ != (DF_REF_FLAGS (ref2) & ~(DF_REF_REG_MARKER + DF_REF_MW_HARDREG)))
+ || DF_REF_BB (ref1) != DF_REF_BB (ref2)
+ || DF_REF_INSN_INFO (ref1) != DF_REF_INSN_INFO (ref2))
+ return false;
+
+ switch (DF_REF_CLASS (ref1))
+ {
+ case DF_REF_ARTIFICIAL:
+ case DF_REF_BASE:
+ return true;
- /* The two flag tests here are only to make sure we do not look at
- the offset and width if they are not there. The flags are
- compared in the next set of tests. */
- if ((DF_REF_FLAGS_IS_SET (ref1, DF_REF_SIGN_EXTRACT | DF_REF_ZERO_EXTRACT))
- && (DF_REF_FLAGS_IS_SET (ref2, DF_REF_SIGN_EXTRACT | DF_REF_ZERO_EXTRACT))
- && ((DF_REF_EXTRACT_OFFSET (ref1) != DF_REF_EXTRACT_OFFSET (ref2))
+ case DF_REF_EXTRACT:
+ if ((DF_REF_EXTRACT_OFFSET (ref1) != DF_REF_EXTRACT_OFFSET (ref2))
|| (DF_REF_EXTRACT_WIDTH (ref1) != DF_REF_EXTRACT_WIDTH (ref2))
- || (DF_REF_EXTRACT_MODE (ref1) != DF_REF_EXTRACT_MODE (ref2))))
- return false;
+ || (DF_REF_EXTRACT_MODE (ref1) != DF_REF_EXTRACT_MODE (ref2)))
+ return false;
+ /* fallthru. */
- return (ref1 == ref2) ||
- (DF_REF_REG (ref1) == DF_REF_REG (ref2)
- && DF_REF_REGNO (ref1) == DF_REF_REGNO (ref2)
- && DF_REF_LOC (ref1) == DF_REF_LOC (ref2)
- && DF_REF_INSN_INFO (ref1) == DF_REF_INSN_INFO (ref2)
- && DF_REF_TYPE (ref1) == DF_REF_TYPE (ref2)
- && ((DF_REF_FLAGS (ref1) & ~(DF_REF_REG_MARKER + DF_REF_MW_HARDREG))
- == (DF_REF_FLAGS (ref2) & ~(DF_REF_REG_MARKER + DF_REF_MW_HARDREG)))
- && DF_REF_BB (ref1) == DF_REF_BB (ref2));
+ case DF_REF_REGULAR:
+ return DF_REF_LOC (ref1) == DF_REF_LOC (ref2);
+
+ default:
+ gcc_unreachable ();
+ }
+ return false;
}
@@ -2204,20 +2270,27 @@ df_ref_equal_p (struct df_ref *ref1, struct df_ref *ref2)
static int
df_ref_compare (const void *r1, const void *r2)
{
- const struct df_ref *const ref1 = *(const struct df_ref *const*)r1;
- const struct df_ref *const ref2 = *(const struct df_ref *const*)r2;
+ const df_ref ref1 = *(const df_ref *)r1;
+ const df_ref ref2 = *(const df_ref *)r2;
if (ref1 == ref2)
return 0;
+ if (DF_REF_CLASS (ref1) != DF_REF_CLASS (ref2))
+ return (int)DF_REF_CLASS (ref1) - (int)DF_REF_CLASS (ref2);
+
if (DF_REF_REGNO (ref1) != DF_REF_REGNO (ref2))
return (int)DF_REF_REGNO (ref1) - (int)DF_REF_REGNO (ref2);
if (DF_REF_TYPE (ref1) != DF_REF_TYPE (ref2))
return (int)DF_REF_TYPE (ref1) - (int)DF_REF_TYPE (ref2);
- if ((DF_REF_REG (ref1) != DF_REF_REG (ref2))
- || (DF_REF_LOC (ref1) != DF_REF_LOC (ref2)))
+ if (DF_REF_REG (ref1) != DF_REF_REG (ref2))
+ return (int)DF_REF_ORDER (ref1) - (int)DF_REF_ORDER (ref2);
+
+ /* Cannot look at the LOC field on artificial refs. */
+ if (DF_REF_CLASS (ref1) != DF_REF_ARTIFICIAL
+ && DF_REF_LOC (ref1) != DF_REF_LOC (ref2))
return (int)DF_REF_ORDER (ref1) - (int)DF_REF_ORDER (ref2);
if (DF_REF_FLAGS (ref1) != DF_REF_FLAGS (ref2))
@@ -2234,24 +2307,24 @@ df_ref_compare (const void *r1, const void *r2)
return 1;
}
- /* The flags are the same at this point so it is safe to only look
+ /* The classes are the same at this point so it is safe to only look
at ref1. */
- if (DF_REF_FLAGS_IS_SET (ref1, DF_REF_SIGN_EXTRACT | DF_REF_ZERO_EXTRACT))
+ if (DF_REF_CLASS (ref1) == DF_REF_EXTRACT)
{
- if (DF_REF_EXTRACT_OFFSET_CONST (ref1) != DF_REF_EXTRACT_OFFSET_CONST (ref2))
- return DF_REF_EXTRACT_OFFSET_CONST (ref1) - DF_REF_EXTRACT_OFFSET_CONST (ref2);
- if (DF_REF_EXTRACT_WIDTH_CONST (ref1) != DF_REF_EXTRACT_WIDTH_CONST (ref2))
- return DF_REF_EXTRACT_WIDTH_CONST (ref1) - DF_REF_EXTRACT_WIDTH_CONST (ref2);
- if (DF_REF_EXTRACT_MODE_CONST (ref1) != DF_REF_EXTRACT_MODE_CONST (ref2))
- return DF_REF_EXTRACT_MODE_CONST (ref1) - DF_REF_EXTRACT_MODE_CONST (ref2);
+ if (DF_REF_EXTRACT_OFFSET (ref1) != DF_REF_EXTRACT_OFFSET (ref2))
+ return DF_REF_EXTRACT_OFFSET (ref1) - DF_REF_EXTRACT_OFFSET (ref2);
+ if (DF_REF_EXTRACT_WIDTH (ref1) != DF_REF_EXTRACT_WIDTH (ref2))
+ return DF_REF_EXTRACT_WIDTH (ref1) - DF_REF_EXTRACT_WIDTH (ref2);
+ if (DF_REF_EXTRACT_MODE (ref1) != DF_REF_EXTRACT_MODE (ref2))
+ return DF_REF_EXTRACT_MODE (ref1) - DF_REF_EXTRACT_MODE (ref2);
}
return 0;
}
static void
-df_swap_refs (struct df_ref **ref_vec, int i, int j)
+df_swap_refs (df_ref *ref_vec, int i, int j)
{
- struct df_ref *tmp = ref_vec[i];
+ df_ref tmp = ref_vec[i];
ref_vec[i] = ref_vec[j];
ref_vec[j] = tmp;
}
@@ -2259,7 +2332,7 @@ df_swap_refs (struct df_ref **ref_vec, int i, int j)
/* Sort and compress a set of refs. */
static unsigned int
-df_sort_and_compress_refs (struct df_ref **ref_vec, unsigned int count)
+df_sort_and_compress_refs (df_ref *ref_vec, unsigned int count)
{
unsigned int i;
unsigned int dist = 0;
@@ -2287,7 +2360,7 @@ df_sort_and_compress_refs (struct df_ref **ref_vec, unsigned int count)
of DF_REF_COMPARE. */
if (i == count - 1)
return count;
- qsort (ref_vec, count, sizeof (struct df_ref *), df_ref_compare);
+ qsort (ref_vec, count, sizeof (df_ref), df_ref_compare);
}
for (i=0; i<count-dist; i++)
@@ -2427,14 +2500,14 @@ df_canonize_collection_rec (struct df_collection_rec *collection_rec)
/* Add the new df_ref to appropriate reg_info/ref_info chains. */
static void
-df_install_ref (struct df_ref *this_ref,
+df_install_ref (df_ref this_ref,
struct df_reg_info *reg_info,
struct df_ref_info *ref_info,
bool add_to_table)
{
unsigned int regno = DF_REF_REGNO (this_ref);
/* Add the ref to the reg_{def,use,eq_use} chain. */
- struct df_ref *head = reg_info->reg_chain;
+ df_ref head = reg_info->reg_chain;
reg_info->reg_chain = this_ref;
reg_info->n_refs++;
@@ -2476,9 +2549,9 @@ df_install_ref (struct df_ref *this_ref,
eq_uses) and installs the entire group into the insn. It also adds
each of these refs into the appropriate chains. */
-static struct df_ref **
+static df_ref *
df_install_refs (basic_block bb,
- struct df_ref **old_vec, unsigned int count,
+ df_ref *old_vec, unsigned int count,
struct df_reg_info **reg_info,
struct df_ref_info *ref_info,
bool is_notes)
@@ -2486,7 +2559,7 @@ df_install_refs (basic_block bb,
if (count)
{
unsigned int i;
- struct df_ref **new_vec = XNEWVEC (struct df_ref*, count + 1);
+ df_ref *new_vec = XNEWVEC (df_ref, count + 1);
bool add_to_table;
switch (ref_info->ref_order)
@@ -2514,7 +2587,7 @@ df_install_refs (basic_block bb,
for (i = 0; i < count; i++)
{
- struct df_ref *this_ref = old_vec[i];
+ df_ref this_ref = old_vec[i];
new_vec[i] = this_ref;
df_install_ref (this_ref, reg_info[DF_REF_REGNO (this_ref)],
ref_info, add_to_table);
@@ -2622,37 +2695,57 @@ df_refs_add_to_chains (struct df_collection_rec *collection_rec,
if they were constants. Otherwise they should be -1 if those flags
were set. */
-static struct df_ref *
-df_ref_create_structure (struct df_collection_rec *collection_rec,
+static df_ref
+df_ref_create_structure (enum df_ref_class cl,
+ struct df_collection_rec *collection_rec,
rtx reg, rtx *loc,
basic_block bb, struct df_insn_info *info,
enum df_ref_type ref_type,
enum df_ref_flags ref_flags,
int width, int offset, enum machine_mode mode)
{
- struct df_ref *this_ref;
+ df_ref this_ref = NULL;
int regno = REGNO (GET_CODE (reg) == SUBREG ? SUBREG_REG (reg) : reg);
struct df_scan_problem_data *problem_data
= (struct df_scan_problem_data *) df_scan->problem_data;
- if (ref_flags & (DF_REF_SIGN_EXTRACT | DF_REF_ZERO_EXTRACT))
+ switch (cl)
{
- this_ref = (struct df_ref *) pool_alloc (problem_data->ref_extract_pool);
+ case DF_REF_BASE:
+ this_ref = (df_ref) pool_alloc (problem_data->ref_base_pool);
+ gcc_assert (loc == NULL);
+ break;
+
+ case DF_REF_ARTIFICIAL:
+ this_ref = (df_ref) pool_alloc (problem_data->ref_artificial_pool);
+ this_ref->artificial_ref.bb = bb;
+ gcc_assert (loc == NULL);
+ break;
+
+ case DF_REF_REGULAR:
+ this_ref = (df_ref) pool_alloc (problem_data->ref_regular_pool);
+ this_ref->regular_ref.loc = loc;
+ gcc_assert (loc);
+ break;
+
+ case DF_REF_EXTRACT:
+ this_ref = (df_ref) pool_alloc (problem_data->ref_extract_pool);
DF_REF_EXTRACT_WIDTH (this_ref) = width;
DF_REF_EXTRACT_OFFSET (this_ref) = offset;
DF_REF_EXTRACT_MODE (this_ref) = mode;
+ this_ref->regular_ref.loc = loc;
+ gcc_assert (loc);
+ break;
}
- else
- this_ref = (struct df_ref *) pool_alloc (problem_data->ref_pool);
+
+ DF_REF_CLASS (this_ref) = cl;
DF_REF_ID (this_ref) = -1;
DF_REF_REG (this_ref) = reg;
DF_REF_REGNO (this_ref) = regno;
- DF_REF_LOC (this_ref) = loc;
+ DF_REF_TYPE (this_ref) = ref_type;
DF_REF_INSN_INFO (this_ref) = info;
DF_REF_CHAIN (this_ref) = NULL;
- DF_REF_TYPE (this_ref) = ref_type;
DF_REF_FLAGS (this_ref) = ref_flags;
- DF_REF_BB (this_ref) = bb;
DF_REF_NEXT_REG (this_ref) = NULL;
DF_REF_PREV_REG (this_ref) = NULL;
DF_REF_ORDER (this_ref) = df->ref_order++;
@@ -2666,7 +2759,7 @@ df_ref_create_structure (struct df_collection_rec *collection_rec,
if ((regno < FIRST_PSEUDO_REGISTER)
&& (!DF_REF_IS_ARTIFICIAL (this_ref)))
{
- if (DF_REF_TYPE (this_ref) == DF_REF_REG_DEF)
+ if (DF_REF_REG_DEF_P (this_ref))
{
if (!DF_REF_FLAGS_IS_SET (this_ref, DF_REF_MAY_CLOBBER))
DF_REF_FLAGS_SET (this_ref, DF_HARD_REG_LIVE);
@@ -2679,7 +2772,7 @@ df_ref_create_structure (struct df_collection_rec *collection_rec,
if (collection_rec)
{
- if (DF_REF_TYPE (this_ref) == DF_REF_REG_DEF)
+ if (DF_REF_REG_DEF_P (this_ref))
collection_rec->def_vec[collection_rec->next_def++] = this_ref;
else if (DF_REF_FLAGS (this_ref) & DF_REF_IN_NOTE)
collection_rec->eq_use_vec[collection_rec->next_eq_use++] = this_ref;
@@ -2701,7 +2794,8 @@ df_ref_create_structure (struct df_collection_rec *collection_rec,
static void
-df_ref_record (struct df_collection_rec *collection_rec,
+df_ref_record (enum df_ref_class cl,
+ struct df_collection_rec *collection_rec,
rtx reg, rtx *loc,
basic_block bb, struct df_insn_info *insn_info,
enum df_ref_type ref_type,
@@ -2720,7 +2814,7 @@ df_ref_record (struct df_collection_rec *collection_rec,
= (struct df_scan_problem_data *) df_scan->problem_data;
unsigned int i;
unsigned int endregno;
- struct df_ref *ref;
+ df_ref ref;
if (GET_CODE (reg) == SUBREG)
{
@@ -2754,7 +2848,7 @@ df_ref_record (struct df_collection_rec *collection_rec,
for (i = regno; i < endregno; i++)
{
- ref = df_ref_create_structure (collection_rec, regno_reg_rtx[i], loc,
+ ref = df_ref_create_structure (cl, collection_rec, regno_reg_rtx[i], loc,
bb, insn_info, ref_type, ref_flags,
width, offset, mode);
@@ -2763,9 +2857,8 @@ df_ref_record (struct df_collection_rec *collection_rec,
}
else
{
- struct df_ref *ref;
- ref = df_ref_create_structure (collection_rec, reg, loc, bb, insn_info,
- ref_type, ref_flags, width, offset, mode);
+ df_ref_create_structure (cl, collection_rec, reg, loc, bb, insn_info,
+ ref_type, ref_flags, width, offset, mode);
}
}
@@ -2802,6 +2895,7 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
int offset = -1;
int width = -1;
enum machine_mode mode = 0;
+ enum df_ref_class cl = DF_REF_REGULAR;
/* We may recursively call ourselves on EXPR_LIST when dealing with PARALLEL
construct. */
@@ -2847,6 +2941,7 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
width = INTVAL (XEXP (dst, 1));
offset = INTVAL (XEXP (dst, 2));
mode = GET_MODE (dst);
+ cl = DF_REF_EXTRACT;
}
loc = &XEXP (dst, 0);
@@ -2856,14 +2951,14 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
/* At this point if we do not have a reg or a subreg, just return. */
if (REG_P (dst))
{
- df_ref_record (collection_rec,
+ df_ref_record (cl, collection_rec,
dst, loc, bb, insn_info, DF_REF_REG_DEF, flags,
width, offset, mode);
/* We want to keep sp alive everywhere - by making all
writes to sp also use of sp. */
if (REGNO (dst) == STACK_POINTER_REGNUM)
- df_ref_record (collection_rec,
+ df_ref_record (DF_REF_BASE, collection_rec,
dst, NULL, bb, insn_info, DF_REF_REG_USE, flags,
width, offset, mode);
}
@@ -2874,7 +2969,7 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
flags |= DF_REF_SUBREG;
- df_ref_record (collection_rec,
+ df_ref_record (cl, collection_rec,
dst, loc, bb, insn_info, DF_REF_REG_DEF, flags,
width, offset, mode);
}
@@ -2921,7 +3016,7 @@ df_defs_record (struct df_collection_rec *collection_rec,
those flags were set. */
static void
-df_uses_record (struct df_collection_rec *collection_rec,
+df_uses_record (enum df_ref_class cl, struct df_collection_rec *collection_rec,
rtx *loc, enum df_ref_type ref_type,
basic_block bb, struct df_insn_info *insn_info,
enum df_ref_flags flags,
@@ -2954,7 +3049,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
/* If we are clobbering a MEM, mark any registers inside the address
as being used. */
if (MEM_P (XEXP (x, 0)))
- df_uses_record (collection_rec,
+ df_uses_record (cl, collection_rec,
&XEXP (XEXP (x, 0), 0),
DF_REF_REG_MEM_STORE,
bb, insn_info,
@@ -2964,7 +3059,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
return;
case MEM:
- df_uses_record (collection_rec,
+ df_uses_record (cl, collection_rec,
&XEXP (x, 0), DF_REF_REG_MEM_LOAD,
bb, insn_info, flags & DF_REF_IN_NOTE,
width, offset, mode);
@@ -2977,14 +3072,14 @@ df_uses_record (struct df_collection_rec *collection_rec,
if (!REG_P (SUBREG_REG (x)))
{
loc = &SUBREG_REG (x);
- df_uses_record (collection_rec, loc, ref_type, bb, insn_info, flags,
+ df_uses_record (cl, collection_rec, loc, ref_type, bb, insn_info, flags,
width, offset, mode);
return;
}
/* ... Fall through ... */
case REG:
- df_ref_record (collection_rec,
+ df_ref_record (cl, collection_rec,
x, loc, bb, insn_info,
ref_type, flags,
width, offset, mode);
@@ -3008,7 +3103,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
else
flags |= DF_REF_SIGN_EXTRACT;
- df_uses_record (collection_rec,
+ df_uses_record (DF_REF_EXTRACT, collection_rec,
&XEXP (x, 0), ref_type, bb, insn_info, flags,
width, offset, mode);
return;
@@ -3020,7 +3115,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
{
rtx dst = SET_DEST (x);
gcc_assert (!(flags & DF_REF_IN_NOTE));
- df_uses_record (collection_rec,
+ df_uses_record (cl, collection_rec,
&SET_SRC (x), DF_REF_REG_USE, bb, insn_info, flags,
width, offset, mode);
@@ -3029,7 +3124,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
case SUBREG:
if (df_read_modify_subreg_p (dst))
{
- df_uses_record (collection_rec, &SUBREG_REG (dst),
+ df_uses_record (cl, collection_rec, &SUBREG_REG (dst),
DF_REF_REG_USE, bb, insn_info,
flags | DF_REF_READ_WRITE | DF_REF_SUBREG,
width, offset, mode);
@@ -3043,7 +3138,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
case CC0:
break;
case MEM:
- df_uses_record (collection_rec, &XEXP (dst, 0),
+ df_uses_record (cl, collection_rec, &XEXP (dst, 0),
DF_REF_REG_MEM_STORE, bb, insn_info, flags,
width, offset, mode);
break;
@@ -3053,7 +3148,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
/* A strict_low_part uses the whole REG and not just the
SUBREG. */
dst = XEXP (dst, 0);
- df_uses_record (collection_rec,
+ df_uses_record (cl, collection_rec,
(GET_CODE (dst) == SUBREG) ? &SUBREG_REG (dst) : temp,
DF_REF_REG_USE, bb, insn_info,
DF_REF_READ_WRITE | DF_REF_STRICT_LOW_PART,
@@ -3068,21 +3163,25 @@ df_uses_record (struct df_collection_rec *collection_rec,
width = INTVAL (XEXP (dst, 1));
offset = INTVAL (XEXP (dst, 2));
mode = GET_MODE (dst);
+ df_uses_record (DF_REF_EXTRACT, collection_rec, &XEXP (dst, 0),
+ DF_REF_REG_USE, bb, insn_info,
+ DF_REF_READ_WRITE | DF_REF_ZERO_EXTRACT,
+ width, offset, mode);
}
else
{
- df_uses_record (collection_rec, &XEXP (dst, 1),
+ df_uses_record (cl, collection_rec, &XEXP (dst, 1),
DF_REF_REG_USE, bb, insn_info, flags,
width, offset, mode);
- df_uses_record (collection_rec, &XEXP (dst, 2),
+ df_uses_record (cl, collection_rec, &XEXP (dst, 2),
DF_REF_REG_USE, bb, insn_info, flags,
width, offset, mode);
+ df_uses_record (cl, collection_rec, &XEXP (dst, 0),
+ DF_REF_REG_USE, bb, insn_info,
+ DF_REF_READ_WRITE | DF_REF_ZERO_EXTRACT,
+ width, offset, mode);
}
- df_uses_record (collection_rec, &XEXP (dst, 0),
- DF_REF_REG_USE, bb, insn_info,
- DF_REF_READ_WRITE | DF_REF_ZERO_EXTRACT,
- width, offset, mode);
}
break;
@@ -3131,7 +3230,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
int j;
for (j = 0; j < ASM_OPERANDS_INPUT_LENGTH (x); j++)
- df_uses_record (collection_rec, &ASM_OPERANDS_INPUT (x, j),
+ df_uses_record (cl, collection_rec, &ASM_OPERANDS_INPUT (x, j),
DF_REF_REG_USE, bb, insn_info, flags,
width, offset, mode);
return;
@@ -3146,7 +3245,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
case PRE_MODIFY:
case POST_MODIFY:
/* Catch the def of the register being modified. */
- df_ref_record (collection_rec, XEXP (x, 0), &XEXP (x, 0),
+ df_ref_record (cl, collection_rec, XEXP (x, 0), &XEXP (x, 0),
bb, insn_info,
DF_REF_REG_DEF,
flags | DF_REF_READ_WRITE | DF_REF_PRE_POST_MODIFY,
@@ -3173,7 +3272,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
loc = &XEXP (x, 0);
goto retry;
}
- df_uses_record (collection_rec, &XEXP (x, i), ref_type,
+ df_uses_record (cl, collection_rec, &XEXP (x, i), ref_type,
bb, insn_info, flags,
width, offset, mode);
}
@@ -3181,7 +3280,7 @@ df_uses_record (struct df_collection_rec *collection_rec,
{
int j;
for (j = 0; j < XVECLEN (x, i); j++)
- df_uses_record (collection_rec,
+ df_uses_record (cl, collection_rec,
&XVECEXP (x, i, j), ref_type,
bb, insn_info, flags,
width, offset, mode);
@@ -3201,13 +3300,13 @@ df_get_conditional_uses (struct df_collection_rec *collection_rec)
unsigned int i;
for (i = 0; i < collection_rec->next_def; i++)
{
- struct df_ref *ref = collection_rec->def_vec[i];
+ df_ref ref = collection_rec->def_vec[i];
if (DF_REF_FLAGS_IS_SET (ref, DF_REF_CONDITIONAL))
{
int width = -1;
int offset = -1;
enum machine_mode mode = 0;
- struct df_ref *use;
+ df_ref use;
if (DF_REF_FLAGS_IS_SET (ref, DF_REF_SIGN_EXTRACT | DF_REF_ZERO_EXTRACT))
{
@@ -3216,7 +3315,7 @@ df_get_conditional_uses (struct df_collection_rec *collection_rec)
mode = DF_REF_EXTRACT_MODE (ref);
}
- use = df_ref_create_structure (collection_rec, DF_REF_REG (ref),
+ use = df_ref_create_structure (DF_REF_CLASS (ref), collection_rec, DF_REF_REG (ref),
DF_REF_LOC (ref), DF_REF_BB (ref),
DF_REF_INSN_INFO (ref), DF_REF_REG_USE,
DF_REF_FLAGS (ref) & ~DF_REF_CONDITIONAL,
@@ -3247,7 +3346,7 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
depending on which def is seen first. */
for (i=0; i<collection_rec->next_def; i++)
{
- struct df_ref *def = collection_rec->def_vec[i];
+ df_ref def = collection_rec->def_vec[i];
bitmap_set_bit (defs_generated, DF_REF_REGNO (def));
}
@@ -3257,7 +3356,7 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
note = XEXP (note, 1))
{
if (GET_CODE (XEXP (note, 0)) == USE)
- df_uses_record (collection_rec, &XEXP (XEXP (note, 0), 0),
+ df_uses_record (DF_REF_REGULAR, collection_rec, &XEXP (XEXP (note, 0), 0),
DF_REF_REG_USE, bb, insn_info, flags, -1, -1, 0);
else if (GET_CODE (XEXP (note, 0)) == CLOBBER)
{
@@ -3269,13 +3368,13 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
insn_info, flags);
}
else
- df_uses_record (collection_rec, &XEXP (note, 0),
+ df_uses_record (DF_REF_REGULAR, collection_rec, &XEXP (note, 0),
DF_REF_REG_USE, bb, insn_info, flags, -1, -1, 0);
}
}
/* The stack ptr is used (honorarily) by a CALL insn. */
- df_ref_record (collection_rec, regno_reg_rtx[STACK_POINTER_REGNUM],
+ df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[STACK_POINTER_REGNUM],
NULL, bb, insn_info, DF_REF_REG_USE,
DF_REF_CALL_STACK_USAGE | flags,
-1, -1, 0);
@@ -3285,9 +3384,9 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (global_regs[i])
{
- df_ref_record (collection_rec, regno_reg_rtx[i],
+ df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i],
NULL, bb, insn_info, DF_REF_REG_USE, flags, -1, -1, 0);
- df_ref_record (collection_rec, regno_reg_rtx[i],
+ df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i],
NULL, bb, insn_info, DF_REF_REG_DEF, flags, -1, -1, 0);
}
@@ -3300,7 +3399,7 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
|| !bitmap_bit_p (df->exit_block_uses, ui)
|| refers_to_regno_p (ui, ui+1,
crtl->return_rtx, NULL)))
- df_ref_record (collection_rec, regno_reg_rtx[ui],
+ df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[ui],
NULL, bb, insn_info, DF_REF_REG_DEF,
DF_REF_MAY_CLOBBER | flags,
-1, -1, 0);
@@ -3339,18 +3438,18 @@ df_insn_refs_collect (struct df_collection_rec* collection_rec,
{
case REG_EQUIV:
case REG_EQUAL:
- df_uses_record (collection_rec,
+ df_uses_record (DF_REF_REGULAR, collection_rec,
&XEXP (note, 0), DF_REF_REG_USE,
bb, insn_info, DF_REF_IN_NOTE, -1, -1, 0);
break;
case REG_NON_LOCAL_GOTO:
/* The frame ptr is used by a non-local goto. */
- df_ref_record (collection_rec,
+ df_ref_record (DF_REF_BASE, collection_rec,
regno_reg_rtx[FRAME_POINTER_REGNUM],
NULL, bb, insn_info,
DF_REF_REG_USE, 0, -1, -1, 0);
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
- df_ref_record (collection_rec,
+ df_ref_record (DF_REF_BASE, collection_rec,
regno_reg_rtx[HARD_FRAME_POINTER_REGNUM],
NULL, bb, insn_info,
DF_REF_REG_USE, 0, -1, -1, 0);
@@ -3366,7 +3465,7 @@ df_insn_refs_collect (struct df_collection_rec* collection_rec,
(is_cond_exec) ? DF_REF_CONDITIONAL : 0);
/* Record the register uses. */
- df_uses_record (collection_rec,
+ df_uses_record (DF_REF_REGULAR, collection_rec,
&PATTERN (insn_info->insn), DF_REF_REG_USE, bb, insn_info, 0,
-1, -1, 0);
@@ -3450,7 +3549,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
unsigned regno = EH_RETURN_DATA_REGNO (i);
if (regno == INVALID_REGNUM)
break;
- df_ref_record (collection_rec, regno_reg_rtx[regno], NULL,
+ df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[regno], NULL,
bb, NULL, DF_REF_REG_DEF, DF_REF_AT_TOP, -1, -1, 0);
}
}
@@ -3474,7 +3573,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
eh-receiver for all of the edges at once. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (EH_USES (i))
- df_ref_record (collection_rec, regno_reg_rtx[i], NULL,
+ df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[i], NULL,
bb, NULL, DF_REF_REG_USE, DF_REF_AT_TOP, -1, -1, 0);
}
#endif
@@ -3482,7 +3581,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
/* Add the hard_frame_pointer if this block is the target of a
non-local goto. */
if (bb->flags & BB_NON_LOCAL_GOTO_TARGET)
- df_ref_record (collection_rec, hard_frame_pointer_rtx, NULL,
+ df_ref_record (DF_REF_ARTIFICIAL, collection_rec, hard_frame_pointer_rtx, NULL,
bb, NULL, DF_REF_REG_DEF, DF_REF_AT_TOP, -1, -1, 0);
/* Add the artificial uses. */
@@ -3496,7 +3595,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
EXECUTE_IF_SET_IN_BITMAP (au, 0, regno, bi)
{
- df_ref_record (collection_rec, regno_reg_rtx[regno], NULL,
+ df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[regno], NULL,
bb, NULL, DF_REF_REG_USE, 0, -1, -1, 0);
}
}
@@ -3515,9 +3614,9 @@ df_bb_refs_record (int bb_index, bool scan_insns)
int luid = 0;
struct df_scan_bb_info *bb_info;
struct df_collection_rec collection_rec;
- collection_rec.def_vec = XALLOCAVEC (struct df_ref *, 1000);
- collection_rec.use_vec = XALLOCAVEC (struct df_ref *, 1000);
- collection_rec.eq_use_vec = XALLOCAVEC (struct df_ref *, 1000);
+ collection_rec.def_vec = XALLOCAVEC (df_ref, 1000);
+ collection_rec.use_vec = XALLOCAVEC (df_ref, 1000);
+ collection_rec.eq_use_vec = XALLOCAVEC (df_ref, 1000);
collection_rec.mw_vec = XALLOCAVEC (struct df_mw_hardreg *, 100);
if (!df)
@@ -3789,7 +3888,7 @@ df_entry_block_defs_collect (struct df_collection_rec *collection_rec,
EXECUTE_IF_SET_IN_BITMAP (entry_block_defs, 0, i, bi)
{
- df_ref_record (collection_rec, regno_reg_rtx[i], NULL,
+ df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[i], NULL,
ENTRY_BLOCK_PTR, NULL, DF_REF_REG_DEF, 0, -1, -1, 0);
}
@@ -3805,7 +3904,7 @@ df_record_entry_block_defs (bitmap entry_block_defs)
{
struct df_collection_rec collection_rec;
memset (&collection_rec, 0, sizeof (struct df_collection_rec));
- collection_rec.def_vec = XALLOCAVEC (struct df_ref *, FIRST_PSEUDO_REGISTER);
+ collection_rec.def_vec = XALLOCAVEC (df_ref, FIRST_PSEUDO_REGISTER);
df_entry_block_defs_collect (&collection_rec, entry_block_defs);
@@ -3950,7 +4049,7 @@ df_exit_block_uses_collect (struct df_collection_rec *collection_rec, bitmap exi
bitmap_iterator bi;
EXECUTE_IF_SET_IN_BITMAP (exit_block_uses, 0, i, bi)
- df_ref_record (collection_rec, regno_reg_rtx[i], NULL,
+ df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[i], NULL,
EXIT_BLOCK_PTR, NULL, DF_REF_REG_USE, 0, -1, -1, 0);
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
@@ -3960,7 +4059,7 @@ df_exit_block_uses_collect (struct df_collection_rec *collection_rec, bitmap exi
&& !bitmap_bit_p (exit_block_uses, ARG_POINTER_REGNUM)
&& bb_has_eh_pred (EXIT_BLOCK_PTR)
&& fixed_regs[ARG_POINTER_REGNUM])
- df_ref_record (collection_rec, regno_reg_rtx[ARG_POINTER_REGNUM], NULL,
+ df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[ARG_POINTER_REGNUM], NULL,
EXIT_BLOCK_PTR, NULL, DF_REF_REG_USE, 0, -1, -1, 0);
#endif
@@ -3976,7 +4075,7 @@ df_record_exit_block_uses (bitmap exit_block_uses)
{
struct df_collection_rec collection_rec;
memset (&collection_rec, 0, sizeof (struct df_collection_rec));
- collection_rec.use_vec = XALLOCAVEC (struct df_ref *, FIRST_PSEUDO_REGISTER);
+ collection_rec.use_vec = XALLOCAVEC (df_ref, FIRST_PSEUDO_REGISTER);
df_exit_block_uses_collect (&collection_rec, exit_block_uses);
@@ -4183,11 +4282,11 @@ df_compute_regs_ever_live (bool reset)
are in the correct chain. */
static unsigned int
-df_reg_chain_mark (struct df_ref *refs, unsigned int regno,
+df_reg_chain_mark (df_ref refs, unsigned int regno,
bool is_def, bool is_eq_use)
{
unsigned int count = 0;
- struct df_ref *ref;
+ df_ref ref;
for (ref = refs; ref; ref = DF_REF_NEXT_REG (ref))
{
gcc_assert (!DF_REF_IS_REG_MARKED (ref));
@@ -4200,17 +4299,17 @@ df_reg_chain_mark (struct df_ref *refs, unsigned int regno,
/* Check to make sure the ref is in the correct chain. */
gcc_assert (DF_REF_REGNO (ref) == regno);
if (is_def)
- gcc_assert (DF_REF_TYPE(ref) == DF_REF_REG_DEF);
+ gcc_assert (DF_REF_REG_DEF_P (ref));
else
- gcc_assert (DF_REF_TYPE(ref) != DF_REF_REG_DEF);
+ gcc_assert (!DF_REF_REG_DEF_P (ref));
if (is_eq_use)
gcc_assert ((DF_REF_FLAGS (ref) & DF_REF_IN_NOTE));
else
gcc_assert ((DF_REF_FLAGS (ref) & DF_REF_IN_NOTE) == 0);
- if (ref->next_reg)
- gcc_assert (ref->next_reg->prev_reg == ref);
+ if (DF_REF_NEXT_REG (ref))
+ gcc_assert (DF_REF_PREV_REG (DF_REF_NEXT_REG (ref)) == ref);
count++;
DF_REF_REG_MARK (ref);
}
@@ -4221,9 +4320,9 @@ df_reg_chain_mark (struct df_ref *refs, unsigned int regno,
/* Verify that all of the registers in the chain are unmarked. */
static void
-df_reg_chain_verify_unmarked (struct df_ref *refs)
+df_reg_chain_verify_unmarked (df_ref refs)
{
- struct df_ref *ref;
+ df_ref ref;
for (ref = refs; ref; ref = DF_REF_NEXT_REG (ref))
gcc_assert (!DF_REF_IS_REG_MARKED (ref));
}
@@ -4232,7 +4331,7 @@ df_reg_chain_verify_unmarked (struct df_ref *refs)
/* Verify that NEW_REC and OLD_REC have exactly the same members. */
static bool
-df_refs_verify (struct df_ref **new_rec, struct df_ref **old_rec,
+df_refs_verify (df_ref *new_rec, df_ref *old_rec,
bool abort_if_fail)
{
while ((*new_rec) && (*old_rec))
@@ -4350,14 +4449,14 @@ df_bb_verify (basic_block bb)
struct df_collection_rec collection_rec;
memset (&collection_rec, 0, sizeof (struct df_collection_rec));
- collection_rec.def_vec = XALLOCAVEC (struct df_ref *, 1000);
- collection_rec.use_vec = XALLOCAVEC (struct df_ref *, 1000);
- collection_rec.eq_use_vec = XALLOCAVEC (struct df_ref *, 1000);
+ collection_rec.def_vec = XALLOCAVEC (df_ref, 1000);
+ collection_rec.use_vec = XALLOCAVEC (df_ref, 1000);
+ collection_rec.eq_use_vec = XALLOCAVEC (df_ref, 1000);
collection_rec.mw_vec = XALLOCAVEC (struct df_mw_hardreg *, 100);
gcc_assert (bb_info);
- /* Scan the block an insn at a time from beginning to end. */
+ /* Scan the block, one insn at a time, from beginning to end. */
FOR_BB_INSNS_REVERSE (bb, insn)
{
if (!INSN_P (insn))
diff --git a/gcc/df.h b/gcc/df.h
index 93c0bbb080a..979065aa269 100644
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -34,6 +34,8 @@ struct dataflow;
struct df;
struct df_problem;
struct df_link;
+struct df_insn_info;
+union df_ref_d;
/* Data flow problems. All problems must have a unique id here. */
@@ -68,13 +70,14 @@ enum df_mm
DF_MM_MUST
};
-/* The first of these is a set of a register. The remaining three are
- all uses of a register (the mem_load and mem_store relate to how
- the register as an addressing operand). */
-enum df_ref_type {DF_REF_REG_DEF, DF_REF_REG_USE, DF_REF_REG_MEM_LOAD,
- DF_REF_REG_MEM_STORE};
+/* Descriminator for the various df_ref types. */
+enum df_ref_class {DF_REF_BASE, DF_REF_ARTIFICIAL, DF_REF_REGULAR, DF_REF_EXTRACT};
-#define DF_REF_TYPE_NAMES {"def", "use", "mem load", "mem store"}
+/* The first of these us a set of a registers. The remaining three
+ are all uses of a register (the mem_load and mem_store relate to
+ how the register as an addressing operand). */
+enum df_ref_type {DF_REF_REG_DEF, DF_REF_REG_USE,
+ DF_REF_REG_MEM_LOAD, DF_REF_REG_MEM_STORE};
enum df_ref_flags
{
@@ -346,75 +349,106 @@ struct df_mw_hardreg
};
-/* One of these structures is allocated for every insn. */
-struct df_insn_info
-{
- rtx insn; /* The insn this info comes from. */
- struct df_ref **defs; /* Head of insn-def chain. */
- struct df_ref **uses; /* Head of insn-use chain. */
- /* Head of insn-use chain for uses in REG_EQUAL/EQUIV notes. */
- struct df_ref **eq_uses;
- struct df_mw_hardreg **mw_hardregs;
- /* The logical uid of the insn in the basic block. This is valid
- after any call to df_analyze but may rot after insns are added,
- deleted or moved. */
- int luid;
-};
-
-
/* Define a register reference structure. One of these is allocated
- for every register reference (use or def). Note some register
- references (e.g., post_inc, subreg) generate both a def and a use. */
-struct df_ref
+ for every register reference (use or def). Note some register
+ references (e.g., post_inc, subreg) generate both a def and a use. */
+struct df_base_ref
{
- rtx reg; /* The register referenced. */
- basic_block bb; /* Basic block containing the instruction. */
-
- /* Insn info for the insn containing ref. This will be null if this is
- an artificial reference. */
- struct df_insn_info *insn_info;
+ /* These three bitfields are intentionally oversized, in the hope that
+ accesses to 8 and 16-bit fields will usually be quicker. */
+ ENUM_BITFIELD(df_ref_class) cl : 8;
- rtx *loc; /* The location of the reg. */
+ ENUM_BITFIELD(df_ref_type) type : 8;
+ /* Type of ref. */
+ ENUM_BITFIELD(df_ref_flags) flags : 16;
+ /* Various flags. */
+ rtx reg; /* The register referenced. */
struct df_link *chain; /* Head of def-use, use-def. */
+ /* Pointer to the insn info of the containing instruction. FIXME!
+ Currently this is NULL for artificial refs but this will be used
+ when FUDs are added. */
+ struct df_insn_info *insn_info;
+ /* For each regno, there are three chains of refs, one for the uses,
+ the eq_uses and the defs. These chains go thru the refs
+ themselves rather than using an external structure. */
+ union df_ref_d *next_reg; /* Next ref with same regno and type. */
+ union df_ref_d *prev_reg; /* Prev ref with same regno and type. */
+ unsigned int regno; /* The register number referenced. */
/* Location in the ref table. This is only valid after a call to
df_maybe_reorganize_[use,def]_refs which is an expensive operation. */
int id;
/* The index at which the operand was scanned in the insn. This is
used to totally order the refs in an insn. */
unsigned int ref_order;
+};
- unsigned int regno; /* The register number referenced. */
- /* These two bitfields are intentionally oversized, in the hope that
- accesses to 16-bit fields will usually be quicker. */
- ENUM_BITFIELD(df_ref_type) type : 16;
- /* Type of ref. */
- ENUM_BITFIELD(df_ref_flags) flags : 16;
- /* Various flags. */
- /* For each regno, there are three chains of refs, one for the uses,
- the eq_uses and the defs. These chains go thru the refs
- themselves rather than using an external structure. */
- struct df_ref *next_reg; /* Next ref with same regno and type. */
- struct df_ref *prev_reg; /* Prev ref with same regno and type. */
+/* The three types of df_refs. Note that the df_ref_extract is an
+ extension of the df_regular_ref, not the df_base_ref. */
+struct df_artificial_ref
+{
+ struct df_base_ref base;
+
+ /* Artificial refs do not have an insn, so to get the basic block,
+ it must be explicitly here. */
+ basic_block bb;
+};
+
+
+struct df_regular_ref
+{
+ struct df_base_ref base;
+ /* The loc is the address in the insn of the reg. This is not
+ defined for special registers, such as clobbers and stack
+ pointers that are also associated with call insns and so those
+ just use the base. */
+ rtx *loc;
};
+
/* A df_ref_extract is just a df_ref with a width and offset field at
the end of it. It is used to hold this information if the ref was
wrapped by a SIGN_EXTRACT or a ZERO_EXTRACT and to pass this info
to passes that wish to process partial regs precisely. */
-struct df_ref_extract
+struct df_extract_ref
{
- struct df_ref ref;
+ struct df_regular_ref base;
int width;
int offset;
enum machine_mode mode;
};
+/* Union of the different kinds of defs/uses placeholders. */
+union df_ref_d
+{
+ struct df_base_ref base;
+ struct df_regular_ref regular_ref;
+ struct df_artificial_ref artificial_ref;
+ struct df_extract_ref extract_ref;
+};
+typedef union df_ref_d *df_ref;
+
+
+/* One of these structures is allocated for every insn. */
+struct df_insn_info
+{
+ rtx insn; /* The insn this info comes from. */
+ df_ref *defs; /* Head of insn-def chain. */
+ df_ref *uses; /* Head of insn-use chain. */
+ /* Head of insn-use chain for uses in REG_EQUAL/EQUIV notes. */
+ df_ref *eq_uses;
+ struct df_mw_hardreg **mw_hardregs;
+ /* The logical uid of the insn in the basic block. This is valid
+ after any call to df_analyze but may rot after insns are added,
+ deleted or moved. */
+ int luid;
+};
+
/* These links are used for ref-ref chains. Currently only DEF-USE and
USE-DEF chains can be built by DF. */
struct df_link
{
- struct df_ref *ref;
+ df_ref ref;
struct df_link *next;
};
@@ -454,7 +488,7 @@ enum df_changeable_flags
boundary of the df_set_blocks if that has been defined. */
struct df_ref_info
{
- struct df_ref **refs; /* Ref table, indexed by id. */
+ df_ref *refs; /* Ref table, indexed by id. */
unsigned int *begin; /* First ref_index for this pseudo. */
unsigned int *count; /* Count of refs for this pseudo. */
unsigned int refs_size; /* Size of currently allocated refs table. */
@@ -476,7 +510,7 @@ struct df_ref_info
struct df_reg_info
{
/* Head of chain for refs of that type and regno. */
- struct df_ref *reg_chain;
+ df_ref reg_chain;
/* Number of refs in the chain. */
unsigned int n_refs;
};
@@ -604,46 +638,45 @@ struct df
/* Macros to access the elements within the ref structure. */
-#define DF_REF_REAL_REG(REF) (GET_CODE ((REF)->reg) == SUBREG \
- ? SUBREG_REG ((REF)->reg) : ((REF)->reg))
-#define DF_REF_REGNO(REF) ((REF)->regno)
-#define DF_REF_REAL_LOC(REF) (GET_CODE (*((REF)->loc)) == SUBREG \
- ? &SUBREG_REG (*((REF)->loc)) : ((REF)->loc))
-#define DF_REF_REG(REF) ((REF)->reg)
-#define DF_REF_LOC(REF) ((REF)->loc)
-#define DF_REF_BB(REF) ((REF)->bb)
+#define DF_REF_REAL_REG(REF) (GET_CODE ((REF)->base.reg) == SUBREG \
+ ? SUBREG_REG ((REF)->base.reg) : ((REF)->base.reg))
+#define DF_REF_REGNO(REF) ((REF)->base.regno)
+#define DF_REF_REAL_LOC(REF) (GET_CODE (*((REF)->regular_ref.loc)) == SUBREG \
+ ? &SUBREG_REG (*((REF)->regular_ref.loc)) : ((REF)->regular_ref.loc))
+#define DF_REF_REG(REF) ((REF)->base.reg)
+#define DF_REF_LOC(REF) ((DF_REF_CLASS(REF) == DF_REF_REGULAR || DF_REF_CLASS(REF) == DF_REF_EXTRACT) ? \
+ (REF)->regular_ref.loc : NULL)
+#define DF_REF_BB(REF) (DF_REF_IS_ARTIFICIAL(REF) ? \
+ (REF)->artificial_ref.bb : BLOCK_FOR_INSN (DF_REF_INSN(REF)))
#define DF_REF_BBNO(REF) (DF_REF_BB (REF)->index)
-#define DF_REF_INSN_INFO(REF) ((REF)->insn_info)
-#define DF_REF_INSN(REF) ((REF)->insn_info->insn)
+#define DF_REF_INSN_INFO(REF) ((REF)->base.insn_info)
+#define DF_REF_INSN(REF) ((REF)->base.insn_info->insn)
#define DF_REF_INSN_UID(REF) (INSN_UID (DF_REF_INSN(REF)))
-#define DF_REF_TYPE(REF) ((REF)->type)
-#define DF_REF_CHAIN(REF) ((REF)->chain)
-#define DF_REF_ID(REF) ((REF)->id)
-#define DF_REF_FLAGS(REF) ((REF)->flags)
+#define DF_REF_CLASS(REF) ((REF)->base.cl)
+#define DF_REF_TYPE(REF) ((REF)->base.type)
+#define DF_REF_CHAIN(REF) ((REF)->base.chain)
+#define DF_REF_ID(REF) ((REF)->base.id)
+#define DF_REF_FLAGS(REF) ((REF)->base.flags)
#define DF_REF_FLAGS_IS_SET(REF, v) ((DF_REF_FLAGS (REF) & (v)) != 0)
#define DF_REF_FLAGS_SET(REF, v) (DF_REF_FLAGS (REF) |= (v))
#define DF_REF_FLAGS_CLEAR(REF, v) (DF_REF_FLAGS (REF) &= ~(v))
-#define DF_REF_ORDER(REF) ((REF)->ref_order)
-/* If DF_REF_IS_ARTIFICIAL () is true, this is not a real definition/use,
- but an artificial one created to model
- always live registers, eh uses, etc.
- ARTIFICIAL refs has NULL insn. */
-#define DF_REF_IS_ARTIFICIAL(REF) ((REF)->insn_info == NULL)
+#define DF_REF_ORDER(REF) ((REF)->base.ref_order)
+/* If DF_REF_IS_ARTIFICIAL () is true, this is not a real
+ definition/use, but an artificial one created to model always live
+ registers, eh uses, etc. */
+#define DF_REF_IS_ARTIFICIAL(REF) (DF_REF_CLASS(REF) == DF_REF_ARTIFICIAL)
#define DF_REF_REG_MARK(REF) (DF_REF_FLAGS_SET ((REF),DF_REF_REG_MARKER))
#define DF_REF_REG_UNMARK(REF) (DF_REF_FLAGS_CLEAR ((REF),DF_REF_REG_MARKER))
#define DF_REF_IS_REG_MARKED(REF) (DF_REF_FLAGS_IS_SET ((REF),DF_REF_REG_MARKER))
-#define DF_REF_NEXT_REG(REF) ((REF)->next_reg)
-#define DF_REF_PREV_REG(REF) ((REF)->prev_reg)
+#define DF_REF_NEXT_REG(REF) ((REF)->base.next_reg)
+#define DF_REF_PREV_REG(REF) ((REF)->base.prev_reg)
/* The following two macros may only be applied if one of
DF_REF_SIGN_EXTRACT | DF_REF_ZERO_EXTRACT is true. */
-#define DF_REF_EXTRACT_WIDTH(REF) (((struct df_ref_extract *)(REF))->width)
-#define DF_REF_EXTRACT_WIDTH_CONST(REF) (((const struct df_ref_extract *)(REF))->width)
-#define DF_REF_EXTRACT_OFFSET(REF) (((struct df_ref_extract *)(REF))->offset)
-#define DF_REF_EXTRACT_OFFSET_CONST(REF) (((const struct df_ref_extract *)(REF))->offset)
-#define DF_REF_EXTRACT_MODE(REF) (((struct df_ref_extract *)(REF))->mode)
-#define DF_REF_EXTRACT_MODE_CONST(REF) (((const struct df_ref_extract *)(REF))->mode)
-/* Macros to determine the reference type. */
+#define DF_REF_EXTRACT_WIDTH(REF) ((REF)->extract_ref.width)
+#define DF_REF_EXTRACT_OFFSET(REF) ((REF)->extract_ref.offset)
+#define DF_REF_EXTRACT_MODE(REF) ((REF)->extract_ref.mode)
+/* Macros to determine the reference type. */
#define DF_REF_REG_DEF_P(REF) (DF_REF_TYPE (REF) == DF_REF_REG_DEF)
#define DF_REF_REG_USE_P(REF) ((REF) && !DF_REF_REG_DEF_P (REF))
#define DF_REF_REG_MEM_STORE_P(REF) (DF_REF_TYPE (REF) == DF_REF_REG_MEM_STORE)
@@ -651,6 +684,10 @@ struct df
#define DF_REF_REG_MEM_P(REF) (DF_REF_REG_MEM_STORE_P (REF) \
|| DF_REF_REG_MEM_LOAD_P (REF))
+#define DF_MWS_REG_DEF_P(MREF) (DF_MWS_TYPE (MREF) == DF_REF_REG_DEF)
+#define DF_MWS_REG_USE_P(MREF) ((MREF) && !DF_MWS_REG_DEF_P (MREF))
+#define DF_MWS_TYPE(MREF) ((MREF)->type)
+
/* Macros to get the refs out of def_info or use_info refs table. If
the focus of the dataflow has been set to some subset of blocks
with df_set_blocks, these macros will only find the uses and defs
@@ -743,13 +780,13 @@ struct df_scan_bb_info
Blocks that are the targets of non-local goto's have the hard
frame pointer defined at the top of the block. */
- struct df_ref **artificial_defs;
+ df_ref *artificial_defs;
/* Blocks that are targets of exception edges may have some
artificial uses. These are logically at the top of the block.
Most blocks have artificial uses at the bottom of the block. */
- struct df_ref **artificial_uses;
+ df_ref *artificial_uses;
};
@@ -866,11 +903,11 @@ extern void df_verify (void);
#ifdef DF_DEBUG_CFG
extern void df_check_cfg_clean (void);
#endif
-extern struct df_ref *df_bb_regno_first_def_find (basic_block, unsigned int);
-extern struct df_ref *df_bb_regno_last_def_find (basic_block, unsigned int);
-extern struct df_ref *df_find_def (rtx, rtx);
+extern df_ref df_bb_regno_first_def_find (basic_block, unsigned int);
+extern df_ref df_bb_regno_last_def_find (basic_block, unsigned int);
+extern df_ref df_find_def (rtx, rtx);
extern bool df_reg_defined (rtx, rtx);
-extern struct df_ref *df_find_use (rtx, rtx);
+extern df_ref df_find_use (rtx, rtx);
extern bool df_reg_used (rtx, rtx);
extern void df_worklist_dataflow (struct dataflow *,bitmap, int *, int);
extern void df_print_regset (FILE *file, bitmap r);
@@ -880,25 +917,25 @@ extern void df_dump_region (FILE *);
extern void df_dump_start (FILE *);
extern void df_dump_top (basic_block, FILE *);
extern void df_dump_bottom (basic_block, FILE *);
-extern void df_refs_chain_dump (struct df_ref **, bool, FILE *);
-extern void df_regs_chain_dump (struct df_ref *, FILE *);
+extern void df_refs_chain_dump (df_ref *, bool, FILE *);
+extern void df_regs_chain_dump (df_ref, FILE *);
extern void df_insn_debug (rtx, bool, FILE *);
extern void df_insn_debug_regno (rtx, FILE *);
extern void df_regno_debug (unsigned int, FILE *);
-extern void df_ref_debug (struct df_ref *, FILE *);
+extern void df_ref_debug (df_ref, FILE *);
extern void debug_df_insn (rtx);
extern void debug_df_regno (unsigned int);
extern void debug_df_reg (rtx);
extern void debug_df_defno (unsigned int);
extern void debug_df_useno (unsigned int);
-extern void debug_df_ref (struct df_ref *);
+extern void debug_df_ref (df_ref);
extern void debug_df_chain (struct df_link *);
/* Functions defined in df-problems.c. */
-extern struct df_link *df_chain_create (struct df_ref *, struct df_ref *);
-extern void df_chain_unlink (struct df_ref *);
-extern void df_chain_copy (struct df_ref *, struct df_link *);
+extern struct df_link *df_chain_create (df_ref, df_ref);
+extern void df_chain_unlink (df_ref);
+extern void df_chain_copy (df_ref, struct df_link *);
extern bitmap df_get_live_in (basic_block);
extern bitmap df_get_live_out (basic_block);
extern void df_grow_bb_info (struct dataflow *);
@@ -933,10 +970,10 @@ extern void df_scan_add_problem (void);
extern void df_grow_reg_info (void);
extern void df_grow_insn_info (void);
extern void df_scan_blocks (void);
-extern struct df_ref *df_ref_create (rtx, rtx *, rtx,basic_block,
+extern df_ref df_ref_create (rtx, rtx *, rtx,basic_block,
enum df_ref_type, enum df_ref_flags,
int, int, enum machine_mode);
-extern void df_ref_remove (struct df_ref *);
+extern void df_ref_remove (df_ref);
extern struct df_insn_info * df_insn_create_insn_record (rtx);
extern void df_insn_delete (basic_block, unsigned int);
extern void df_bb_refs_record (int, bool);
@@ -962,7 +999,7 @@ extern bool df_read_modify_subreg_p (rtx);
extern void df_scan_verify (void);
/* Functions defined in df-byte-scan.c. */
-extern bool df_compute_accessed_bytes (struct df_ref *, enum df_mm,
+extern bool df_compute_accessed_bytes (df_ref, enum df_mm,
unsigned int *, unsigned int *);
@@ -1015,7 +1052,7 @@ df_byte_lr_get_bb_info (unsigned int index)
/* Get the artificial defs for a basic block. */
-static inline struct df_ref **
+static inline df_ref *
df_get_artificial_defs (unsigned int bb_index)
{
return df_scan_get_bb_info (bb_index)->artificial_defs;
@@ -1024,7 +1061,7 @@ df_get_artificial_defs (unsigned int bb_index)
/* Get the artificial uses for a basic block. */
-static inline struct df_ref **
+static inline df_ref *
df_get_artificial_uses (unsigned int bb_index)
{
return df_scan_get_bb_info (bb_index)->artificial_uses;
@@ -1045,7 +1082,7 @@ struct web_entry
extern struct web_entry *unionfind_root (struct web_entry *);
extern bool unionfind_union (struct web_entry *, struct web_entry *);
-extern void union_defs (struct df_ref *,
+extern void union_defs (df_ref,
struct web_entry *, struct web_entry *,
bool (*fun) (struct web_entry *, struct web_entry *));
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 8f054229ebd..1d29df36c20 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -309,7 +309,7 @@ library search path, you will have to configure with the
@option{--with-gmp} configure option. See also
@option{--with-gmp-lib} and @option{--with-gmp-include}.
-@item MPFR Library version 2.3.0 (or later)
+@item MPFR Library version 2.3.2 (or later)
Necessary to build GCC@. It can be downloaded from
@uref{http://www.mpfr.org/}. The version of MPFR that is bundled with
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 49b5e5017b3..c5c47fed86f 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -649,6 +649,7 @@ Objective-C and Objective-C++ Dialects}.
-mshared -mno-shared -mplt -mno-plt -mxgot -mno-xgot @gol
-mgp32 -mgp64 -mfp32 -mfp64 -mhard-float -msoft-float @gol
-msingle-float -mdouble-float -mdsp -mno-dsp -mdspr2 -mno-dspr2 @gol
+-mfpu=@var{fpu-type} @gol
-msmartmips -mno-smartmips @gol
-mpaired-single -mno-paired-single -mdmx -mno-mdmx @gol
-mips3d -mno-mips3d -mmt -mno-mt -mllsc -mno-llsc @gol
@@ -6080,7 +6081,7 @@ ENDDO
loop strip mining will transform the loop as if the user had written:
@smallexample
DO II = 1, N, 4
- DO I = II, min (II + 4, N)
+ DO I = II, min (II + 3, N)
A(I) = A(I) + C
ENDDO
ENDDO
@@ -6103,8 +6104,8 @@ loop blocking will transform the loop as if the user had written:
@smallexample
DO II = 1, N, 64
DO JJ = 1, M, 64
- DO I = II, min (II + 64, N)
- DO J = JJ, min (JJ + 64, M)
+ DO I = II, min (II + 63, N)
+ DO J = JJ, min (JJ + 63, M)
A(J, I) = B(I) + C(J)
ENDDO
ENDDO
@@ -13656,6 +13657,17 @@ Generate code for single or double-precision floating point operations.
@opindex msimple-fpu
Do not generate sqrt and div instructions for hardware floating point unit.
+@item -mfpu
+@opindex mfpu
+Specify type of floating point unit. Valid values are @var{sp_lite}
+(equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
+to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
+and @var{dp_full} (equivalent to -mdouble-float).
+
+@item -mxilinx-fpu
+@opindex mxilinx-fpu
+Perform optimizations for floating point unit on Xilinx PPC 405/440.
+
@item -mmultiple
@itemx -mno-multiple
@opindex mmultiple
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 37bf21f07a2..614871ed917 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -4748,6 +4748,10 @@ static GTY((param_is (struct dwarf_file_data))) htab_t file_table;
The key is a DECL_UID() which is a unique number identifying each decl. */
static GTY ((param_is (struct die_struct))) htab_t decl_die_table;
+/* A hash table of references to DIE's that describe COMMON blocks.
+ The key is DECL_UID() ^ die_parent. */
+static GTY ((param_is (struct die_struct))) htab_t common_block_die_table;
+
/* Node of the variable location list. */
struct var_loc_node GTY ((chain_next ("%h.next")))
{
@@ -4960,6 +4964,8 @@ static void equate_type_number_to_die (tree, dw_die_ref);
static hashval_t decl_die_table_hash (const void *);
static int decl_die_table_eq (const void *, const void *);
static dw_die_ref lookup_decl_die (tree);
+static hashval_t common_block_die_table_hash (const void *);
+static int common_block_die_table_eq (const void *, const void *);
static hashval_t decl_loc_table_hash (const void *);
static int decl_loc_table_eq (const void *, const void *);
static var_loc_list *lookup_decl_loc (const_tree);
@@ -10002,6 +10008,16 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
distinction between OP_REG and OP_BASEREG. */
if (REGNO (rtl) < FIRST_PSEUDO_REGISTER)
mem_loc_result = based_loc_descr (rtl, 0, VAR_INIT_STATUS_INITIALIZED);
+ else if (stack_realign_drap
+ && crtl->drap_reg
+ && crtl->args.internal_arg_pointer == rtl
+ && REGNO (crtl->drap_reg) < FIRST_PSEUDO_REGISTER)
+ {
+ /* If RTL is internal_arg_pointer, which has been optimized
+ out, use DRAP instead. */
+ mem_loc_result = based_loc_descr (crtl->drap_reg, 0,
+ VAR_INIT_STATUS_INITIALIZED);
+ }
break;
case MEM:
@@ -13812,6 +13828,26 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
}
+/* Returns a hash value for X (which really is a die_struct). */
+
+static hashval_t
+common_block_die_table_hash (const void *x)
+{
+ const_dw_die_ref d = (const_dw_die_ref) x;
+ return (hashval_t) d->decl_id ^ htab_hash_pointer (d->die_parent);
+}
+
+/* Return nonzero if decl_id and die_parent of die_struct X is the same
+ as decl_id and die_parent of die_struct Y. */
+
+static int
+common_block_die_table_eq (const void *x, const void *y)
+{
+ const_dw_die_ref d = (const_dw_die_ref) x;
+ const_dw_die_ref e = (const_dw_die_ref) y;
+ return d->decl_id == e->decl_id && d->die_parent == e->die_parent;
+}
+
/* Generate a DIE to represent a declared data object. */
static void
@@ -13853,6 +13889,7 @@ gen_variable_die (tree decl, dw_die_ref context_die)
tree field;
dw_die_ref com_die;
dw_loc_descr_ref loc;
+ die_node com_die_arg;
var_die = lookup_decl_die (decl);
if (var_die)
@@ -13863,21 +13900,41 @@ gen_variable_die (tree decl, dw_die_ref context_die)
if (loc)
{
if (off)
- add_loc_descr (&loc, new_loc_descr (DW_OP_plus_uconst,
+ {
+ /* Optimize the common case. */
+ if (loc->dw_loc_opc == DW_OP_addr
+ && loc->dw_loc_next == NULL
+ && GET_CODE (loc->dw_loc_oprnd1.v.val_addr)
+ == SYMBOL_REF)
+ loc->dw_loc_oprnd1.v.val_addr
+ = plus_constant (loc->dw_loc_oprnd1.v.val_addr, off);
+ else
+ add_loc_descr (&loc,
+ new_loc_descr (DW_OP_plus_uconst,
off, 0));
+ }
add_AT_loc (var_die, DW_AT_location, loc);
remove_AT (var_die, DW_AT_declaration);
}
}
return;
}
+
+ if (common_block_die_table == NULL)
+ common_block_die_table
+ = htab_create_ggc (10, common_block_die_table_hash,
+ common_block_die_table_eq, NULL);
+
field = TREE_OPERAND (DECL_VALUE_EXPR (decl), 0);
- com_die = lookup_decl_die (com_decl);
+ com_die_arg.decl_id = DECL_UID (com_decl);
+ com_die_arg.die_parent = context_die;
+ com_die = (dw_die_ref) htab_find (common_block_die_table, &com_die_arg);
loc = loc_descriptor_from_tree (com_decl);
if (com_die == NULL)
{
const char *cnam
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (com_decl));
+ void **slot;
com_die = new_die (DW_TAG_common_block, context_die, decl);
add_name_and_src_coords_attributes (com_die, com_decl);
@@ -13891,7 +13948,9 @@ gen_variable_die (tree decl, dw_die_ref context_die)
else if (DECL_EXTERNAL (decl))
add_AT_flag (com_die, DW_AT_declaration, 1);
add_pubname_string (cnam, com_die); /* ??? needed? */
- equate_decl_number_to_die (com_decl, com_die);
+ com_die->decl_id = DECL_UID (com_decl);
+ slot = htab_find_slot (common_block_die_table, com_die, INSERT);
+ *slot = (void *) com_die;
}
else if (get_AT (com_die, DW_AT_location) == NULL && loc)
{
@@ -13907,7 +13966,17 @@ gen_variable_die (tree decl, dw_die_ref context_die)
if (loc)
{
if (off)
- add_loc_descr (&loc, new_loc_descr (DW_OP_plus_uconst, off, 0));
+ {
+ /* Optimize the common case. */
+ if (loc->dw_loc_opc == DW_OP_addr
+ && loc->dw_loc_next == NULL
+ && GET_CODE (loc->dw_loc_oprnd1.v.val_addr) == SYMBOL_REF)
+ loc->dw_loc_oprnd1.v.val_addr
+ = plus_constant (loc->dw_loc_oprnd1.v.val_addr, off);
+ else
+ add_loc_descr (&loc, new_loc_descr (DW_OP_plus_uconst,
+ off, 0));
+ }
add_AT_loc (var_die, DW_AT_location, loc);
}
else if (DECL_EXTERNAL (decl))
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 318ae775330..46fefda614b 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1564,6 +1564,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
if (! TYPE_P (t))
{
tree base;
+ bool align_computed = false;
if (TREE_THIS_VOLATILE (t))
MEM_VOLATILE_P (ref) = 1;
@@ -1620,6 +1621,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
&& host_integerp (DECL_SIZE_UNIT (t), 1)
? GEN_INT (tree_low_cst (DECL_SIZE_UNIT (t), 1)) : 0);
align = DECL_ALIGN (t);
+ align_computed = true;
}
/* If this is a constant, we know the alignment. */
@@ -1629,6 +1631,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
#ifdef CONSTANT_ALIGNMENT
align = CONSTANT_ALIGNMENT (t, align);
#endif
+ align_computed = true;
}
/* If this is a field reference and not a bit-field, record it. */
@@ -1688,6 +1691,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
align = DECL_ALIGN (t2);
if (aoff && (unsigned HOST_WIDE_INT) aoff < align)
align = aoff;
+ align_computed = true;
offset = GEN_INT (ioff);
apply_bitpos = bitpos;
}
@@ -1721,6 +1725,13 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
expr = t;
offset = NULL;
}
+
+ if (!align_computed && !INDIRECT_REF_P (t))
+ {
+ unsigned int obj_align
+ = get_object_alignment (t, align, BIGGEST_ALIGNMENT);
+ align = MAX (align, obj_align);
+ }
}
/* If we modified OFFSET based on T, then subtract the outstanding
@@ -2127,6 +2138,65 @@ widen_memory_access (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset)
return new_rtx;
}
+/* A fake decl that is used as the MEM_EXPR of spill slots. */
+static GTY(()) tree spill_slot_decl;
+
+static tree
+get_spill_slot_decl (void)
+{
+ tree d = spill_slot_decl;
+ rtx rd;
+
+ if (d)
+ return d;
+
+ d = build_decl (VAR_DECL, get_identifier ("%sfp"), void_type_node);
+ DECL_ARTIFICIAL (d) = 1;
+ DECL_IGNORED_P (d) = 1;
+ TREE_USED (d) = 1;
+ TREE_THIS_NOTRAP (d) = 1;
+ spill_slot_decl = d;
+
+ rd = gen_rtx_MEM (BLKmode, frame_pointer_rtx);
+ MEM_NOTRAP_P (rd) = 1;
+ MEM_ATTRS (rd) = get_mem_attrs (new_alias_set (), d, const0_rtx,
+ NULL_RTX, 0, BLKmode);
+ SET_DECL_RTL (d, rd);
+
+ return d;
+}
+
+/* Given MEM, a result from assign_stack_local, fill in the memory
+ attributes as appropriate for a register allocator spill slot.
+ These slots are not aliasable by other memory. We arrange for
+ them all to use a single MEM_EXPR, so that the aliasing code can
+ work properly in the case of shared spill slots. */
+
+void
+set_mem_attrs_for_spill (rtx mem)
+{
+ alias_set_type alias;
+ rtx addr, offset;
+ tree expr;
+
+ expr = get_spill_slot_decl ();
+ alias = MEM_ALIAS_SET (DECL_RTL (expr));
+
+ /* We expect the incoming memory to be of the form:
+ (mem:MODE (plus (reg sfp) (const_int offset)))
+ with perhaps the plus missing for offset = 0. */
+ addr = XEXP (mem, 0);
+ offset = const0_rtx;
+ if (GET_CODE (addr) == PLUS
+ && GET_CODE (XEXP (addr, 1)) == CONST_INT)
+ offset = XEXP (addr, 1);
+
+ MEM_ATTRS (mem) = get_mem_attrs (alias, expr, offset,
+ MEM_SIZE (mem), MEM_ALIGN (mem),
+ GET_MODE (mem));
+ MEM_NOTRAP_P (mem) = 1;
+}
+
/* Return a newly created CODE_LABEL rtx with a unique label number. */
rtx
diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h
index 32f5c91d630..6d4249f518e 100644
--- a/gcc/emit-rtl.h
+++ b/gcc/emit-rtl.h
@@ -35,6 +35,9 @@ extern void set_mem_offset (rtx, rtx);
/* Set the size for MEM to SIZE. */
extern void set_mem_size (rtx, rtx);
+/* Set the attributes for MEM appropriate for a spill slot. */
+extern void set_mem_attrs_for_spill (rtx);
+
/* Return a memory reference like MEMREF, but with its address changed to
ADDR. The caller is asserting that the actual piece of memory pointed
to is the same, just the form of the address is being changed, such as
diff --git a/gcc/expmed.c b/gcc/expmed.c
index ae5ad0a2f12..5e8d7f30324 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -3075,7 +3075,8 @@ expand_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target,
{
/* If we are multiplying in DImode, it may still be a win
to try to work with shifts and adds. */
- if (CONST_DOUBLE_HIGH (op1) == 0)
+ if (CONST_DOUBLE_HIGH (op1) == 0
+ && CONST_DOUBLE_LOW (op1) > 0)
coeff = CONST_DOUBLE_LOW (op1);
else if (CONST_DOUBLE_LOW (op1) == 0
&& EXACT_POWER_OF_2_OR_ZERO_P (CONST_DOUBLE_HIGH (op1)))
diff --git a/gcc/expr.c b/gcc/expr.c
index 32c8d01fe7f..11902b832b2 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5021,6 +5021,9 @@ count_type_elements (const_tree type, bool allow_flexarr)
case REFERENCE_TYPE:
return 1;
+ case ERROR_MARK:
+ return 0;
+
case VOID_TYPE:
case METHOD_TYPE:
case FUNCTION_TYPE:
@@ -6076,9 +6079,9 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize,
return exp;
}
-/* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF,
- look for whether EXP or any nested component-refs within EXP is marked
- as PACKED. */
+/* Given an expression EXP that may be a COMPONENT_REF, an ARRAY_REF or an
+ ARRAY_RANGE_REF, look for whether EXP or any nested component-refs within
+ EXP is marked as PACKED. */
bool
contains_packed_reference (const_tree exp)
@@ -6118,7 +6121,7 @@ contains_packed_reference (const_tree exp)
}
/* Return a tree of sizetype representing the size, in bytes, of the element
- of EXP, an ARRAY_REF. */
+ of EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
tree
array_ref_element_size (tree exp)
@@ -6145,7 +6148,7 @@ array_ref_element_size (tree exp)
}
/* Return a tree representing the lower bound of the array mentioned in
- EXP, an ARRAY_REF. */
+ EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
tree
array_ref_low_bound (tree exp)
@@ -6166,7 +6169,7 @@ array_ref_low_bound (tree exp)
}
/* Return a tree representing the upper bound of the array mentioned in
- EXP, an ARRAY_REF. */
+ EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
tree
array_ref_up_bound (tree exp)
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 53f3f0c1526..1d26c1f2c97 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,55 @@
+2008-10-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * simplify.c: Remove MPFR_VERSION_NUM(2,3,0) conditionals.
+
+2008-10-12 Daniel Kraft <d@domob.eu>
+
+ PR fortran/37688
+ * expr.c (gfc_expr_check_typed): Extend permission of untyped
+ expressions to both top-level variable and basic arithmetic expressions.
+
+2008-10-12 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/37787
+ * dependency.c (gfc_are_equivalenced_arrays): Look in symbol
+ namespace rather than current namespace, if it is available.
+
+2008-10-12 Steven G. Kargl <kargls@comcast.net>
+
+ PR fortran/37792
+ * fortran/resolve.c (resolve_fl_variable): Simplify the
+ initializer if there is one.
+
+2008-10-11 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/37794
+ * module.c (check_for_ambiguous): Remove redundant code.
+
+2008-10-09 Daniel Kraft <d@domob.eu>
+
+ PR fortran/35723
+ * gfortran.h (gfc_suppress_error): Removed from header.
+ (gfc_push_suppress_errors), (gfc_pop_suppress_errors): New methods.
+ * array.c (gfc_array_size): Use new gfc_push/pop_suppress_errors
+ instead of directly changing gfc_suppress_error.
+ * intrinsic.c (gfc_intrinsic_func_interface): Ditto.
+ (gfc_intrinsic_sub_interface): Ditto.
+ * error.c (suppress_errors): Made static from `gfc_suppress_error'.
+ (gfc_push_suppress_errors), (gfc_pop_suppress_errors): New methods.
+ (gfc_notify_std), (gfc_error): Use new static name of global.
+ * expr.c (check_arglist), (check_references): New methods.
+ (check_restricted): Check arglists and references of EXPR_FUNCTIONs
+ and EXPR_VARAIBALEs, respectively. Allow PARAMETER symbols.
+
+2008-10-07 Jakub Jelinek <jakub@redhat.com>
+
+ * f95-lang.c (poplevel): Don't clear BLOCK_VARS if functionbody.
+ * trans-decl.c (gfc_build_qualified_array): Build accurate debug type
+ even if nest.
+ (build_entry_thunks, gfc_generate_function_code,
+ gfc_generate_constructors): Ensure DECL_SAVED_TREE is a BIND_EXPR
+ with DECL_INITIAL as its BLOCK.
+
2008-10-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35680
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index d99ed9e30a0..70cf66294da 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -2073,14 +2073,13 @@ gfc_array_size (gfc_expr *array, mpz_t *result)
{
expand_info expand_save;
gfc_ref *ref;
- int i, flag;
+ int i;
gfc_try t;
switch (array->expr_type)
{
case EXPR_ARRAY:
- flag = gfc_suppress_error;
- gfc_suppress_error = 1;
+ gfc_push_suppress_errors ();
expand_save = current_expand;
@@ -2091,7 +2090,8 @@ gfc_array_size (gfc_expr *array, mpz_t *result)
iter_stack = NULL;
t = expand_constructor (array->value.constructor);
- gfc_suppress_error = flag;
+
+ gfc_pop_suppress_errors ();
if (t == FAILURE)
mpz_clear (*result);
diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c
index e58c9aaa0e9..05a3dccf1a9 100644
--- a/gcc/fortran/dependency.c
+++ b/gcc/fortran/dependency.c
@@ -547,10 +547,16 @@ gfc_are_equivalenced_arrays (gfc_expr *e1, gfc_expr *e2)
|| !e2->symtree->n.sym->attr.in_equivalence|| !e1->rank || !e2->rank)
return 0;
+ if (e1->symtree->n.sym->ns
+ && e1->symtree->n.sym->ns != gfc_current_ns)
+ l = e1->symtree->n.sym->ns->equiv_lists;
+ else
+ l = gfc_current_ns->equiv_lists;
+
/* Go through the equiv_lists and return 1 if the variables
e1 and e2 are members of the same group and satisfy the
requirement on their relative offsets. */
- for (l = gfc_current_ns->equiv_lists; l; l = l->next)
+ for (; l; l = l->next)
{
fl1 = NULL;
fl2 = NULL;
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index 7a5fbd34711..a7005e9fbb6 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -30,13 +30,33 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "gfortran.h"
-int gfc_suppress_error = 0;
+static int suppress_errors = 0;
static int terminal_width, buffer_flag, errors, warnings;
static gfc_error_buf error_buffer, warning_buffer, *cur_error_buffer;
+/* Go one level deeper suppressing errors. */
+
+void
+gfc_push_suppress_errors (void)
+{
+ gcc_assert (suppress_errors >= 0);
+ ++suppress_errors;
+}
+
+
+/* Leave one level of error suppressing. */
+
+void
+gfc_pop_suppress_errors (void)
+{
+ gcc_assert (suppress_errors > 0);
+ --suppress_errors;
+}
+
+
/* Per-file error initialization. */
void
@@ -764,7 +784,7 @@ gfc_notify_std (int std, const char *nocmsgid, ...)
if ((gfc_option.allow_std & std) != 0 && !warning)
return SUCCESS;
- if (gfc_suppress_error)
+ if (suppress_errors)
return warning ? SUCCESS : FAILURE;
cur_error_buffer = warning ? &warning_buffer : &error_buffer;
@@ -850,7 +870,7 @@ gfc_error (const char *nocmsgid, ...)
{
va_list argp;
- if (gfc_suppress_error)
+ if (suppress_errors)
return;
error_buffer.flag = 1;
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 7f6bf1b07e4..73f2c40a36c 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -2503,6 +2503,64 @@ restricted_intrinsic (gfc_expr *e)
}
+/* Check the expressions of an actual arglist. Used by check_restricted. */
+
+static gfc_try
+check_arglist (gfc_actual_arglist* arg, gfc_try (*checker) (gfc_expr*))
+{
+ for (; arg; arg = arg->next)
+ if (checker (arg->expr) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+/* Check the subscription expressions of a reference chain with a checking
+ function; used by check_restricted. */
+
+static gfc_try
+check_references (gfc_ref* ref, gfc_try (*checker) (gfc_expr*))
+{
+ int dim;
+
+ if (!ref)
+ return SUCCESS;
+
+ switch (ref->type)
+ {
+ case REF_ARRAY:
+ for (dim = 0; dim != ref->u.ar.dimen; ++dim)
+ {
+ if (checker (ref->u.ar.start[dim]) == FAILURE)
+ return FAILURE;
+ if (checker (ref->u.ar.end[dim]) == FAILURE)
+ return FAILURE;
+ if (checker (ref->u.ar.stride[dim]) == FAILURE)
+ return FAILURE;
+ }
+ break;
+
+ case REF_COMPONENT:
+ /* Nothing needed, just proceed to next reference. */
+ break;
+
+ case REF_SUBSTRING:
+ if (checker (ref->u.ss.start) == FAILURE)
+ return FAILURE;
+ if (checker (ref->u.ss.end) == FAILURE)
+ return FAILURE;
+ break;
+
+ default:
+ gcc_unreachable ();
+ break;
+ }
+
+ return check_references (ref->next, checker);
+}
+
+
/* Verify that an expression is a restricted expression. Like its
cousin check_init_expr(), an error message is generated if we
return FAILURE. */
@@ -2510,7 +2568,7 @@ restricted_intrinsic (gfc_expr *e)
static gfc_try
check_restricted (gfc_expr *e)
{
- gfc_symbol *sym;
+ gfc_symbol* sym;
gfc_try t;
if (e == NULL)
@@ -2526,8 +2584,22 @@ check_restricted (gfc_expr *e)
break;
case EXPR_FUNCTION:
- t = e->value.function.esym ? external_spec_function (e)
- : restricted_intrinsic (e);
+ if (e->value.function.esym)
+ {
+ t = check_arglist (e->value.function.actual, &check_restricted);
+ if (t == SUCCESS)
+ t = external_spec_function (e);
+ }
+ else
+ {
+ if (e->value.function.isym && e->value.function.isym->inquiry)
+ t = SUCCESS;
+ else
+ t = check_arglist (e->value.function.actual, &check_restricted);
+
+ if (t == SUCCESS)
+ t = restricted_intrinsic (e);
+ }
break;
case EXPR_VARIABLE:
@@ -2561,6 +2633,10 @@ check_restricted (gfc_expr *e)
break;
}
+ /* Check reference chain if any. */
+ if (check_references (e->ref, &check_restricted) == FAILURE)
+ break;
+
/* gfc_is_formal_arg broadcasts that a formal argument list is being
processed in resolve.c(resolve_formal_arglist). This is done so
that host associated dummy array indices are accepted (PR23446).
@@ -2571,6 +2647,7 @@ check_restricted (gfc_expr *e)
|| sym->attr.use_assoc
|| sym->attr.dummy
|| sym->attr.implied_index
+ || sym->attr.flavor == FL_PARAMETER
|| (sym->ns && sym->ns == gfc_current_ns->parent)
|| (sym->ns && gfc_current_ns->parent
&& sym->ns == gfc_current_ns->parent->parent)
@@ -3352,9 +3429,11 @@ gfc_expr_set_symbols_referenced (gfc_expr *expr)
/* Walk an expression tree and check each variable encountered for being typed.
If strict is not set, a top-level variable is tolerated untyped in -std=gnu
- mode; this is for things in legacy-code like:
+ mode as is a basic arithmetic expression using those; this is for things in
+ legacy-code like:
INTEGER :: arr(n), n
+ INTEGER :: arr(n + 1), n
The namespace is needed for IMPLICIT typing. */
@@ -3381,9 +3460,26 @@ gfc_expr_check_typed (gfc_expr* e, gfc_namespace* ns, bool strict)
{
bool error_found;
- /* If this is a top-level variable, do the check with strict given to us. */
- if (!strict && e->expr_type == EXPR_VARIABLE && !e->ref)
- return gfc_check_symbol_typed (e->symtree->n.sym, ns, strict, e->where);
+ /* If this is a top-level variable or EXPR_OP, do the check with strict given
+ to us. */
+ if (!strict)
+ {
+ if (e->expr_type == EXPR_VARIABLE && !e->ref)
+ return gfc_check_symbol_typed (e->symtree->n.sym, ns, strict, e->where);
+
+ if (e->expr_type == EXPR_OP)
+ {
+ gfc_try t = SUCCESS;
+
+ gcc_assert (e->value.op.op1);
+ t = gfc_expr_check_typed (e->value.op.op1, ns, strict);
+
+ if (t == SUCCESS && e->value.op.op2)
+ t = gfc_expr_check_typed (e->value.op.op2, ns, strict);
+
+ return t;
+ }
+ }
/* Otherwise, walk the expression and do it strictly. */
check_typed_ns = ns;
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index cf0dc2d48b7..a7d6c8f66a5 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -430,14 +430,8 @@ poplevel (int keep, int reverse, int functionbody)
current_binding_level = current_binding_level->level_chain;
if (functionbody)
- {
- /* This is the top level block of a function. The ..._DECL chain stored
- in BLOCK_VARS are the function's parameters (PARM_DECL nodes). Don't
- leave them in the BLOCK because they are found in the FUNCTION_DECL
- instead. */
- DECL_INITIAL (current_function_decl) = block_node;
- BLOCK_VARS (block_node) = 0;
- }
+ /* This is the top level block of a function. */
+ DECL_INITIAL (current_function_decl) = block_node;
else if (current_binding_level == global_binding_level)
/* When using gfc_start_block/gfc_finish_block from middle-end hooks,
don't add newly created BLOCKs as subblocks of global_binding_level. */
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index b032486abfd..42f5516b746 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -770,7 +770,10 @@ typedef struct
#endif
-extern int gfc_suppress_error;
+/* Suppress error messages or re-enable them. */
+
+void gfc_push_suppress_errors (void);
+void gfc_pop_suppress_errors (void);
/* Character length structures hold the expression that gives the
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 035aef70d65..7acdcb05e60 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -3598,7 +3598,8 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
return (do_simplify (expr->value.function.isym, expr) == FAILURE)
? MATCH_ERROR : MATCH_YES;
- gfc_suppress_error = !error_flag;
+ if (!error_flag)
+ gfc_push_suppress_errors ();
flag = 0;
for (actual = expr->value.function.actual; actual; actual = actual->next)
@@ -3611,7 +3612,8 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
isym = specific = gfc_find_function (name);
if (isym == NULL)
{
- gfc_suppress_error = 0;
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
return MATCH_NO;
}
@@ -3621,7 +3623,11 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
&& gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Function '%s' "
"as initialization expression at %L", name,
&expr->where) == FAILURE)
- return MATCH_ERROR;
+ {
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
+ return MATCH_ERROR;
+ }
gfc_current_intrinsic_where = &expr->where;
@@ -3633,7 +3639,8 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
if (gfc_check_min_max (expr->value.function.actual) == SUCCESS)
goto got_specific;
- gfc_suppress_error = 0;
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
return MATCH_NO;
}
@@ -3641,7 +3648,7 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
incarnations. If the generic name is also a specific, we check
that name last, so that any error message will correspond to the
specific. */
- gfc_suppress_error = 1;
+ gfc_push_suppress_errors ();
if (isym->generic)
{
@@ -3651,15 +3658,19 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
if (specific == isym)
continue;
if (check_specific (specific, expr, 0) == SUCCESS)
- goto got_specific;
+ {
+ gfc_pop_suppress_errors ();
+ goto got_specific;
+ }
}
}
- gfc_suppress_error = !error_flag;
+ gfc_pop_suppress_errors ();
if (check_specific (isym, expr, error_flag) == FAILURE)
{
- gfc_suppress_error = 0;
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
return MATCH_NO;
}
@@ -3669,7 +3680,9 @@ got_specific:
expr->value.function.isym = specific;
gfc_intrinsic_symbol (expr->symtree->n.sym);
- gfc_suppress_error = 0;
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
+
if (do_simplify (specific, expr) == FAILURE)
return MATCH_ERROR;
@@ -3709,7 +3722,8 @@ gfc_intrinsic_sub_interface (gfc_code *c, int error_flag)
if (isym == NULL)
return MATCH_NO;
- gfc_suppress_error = !error_flag;
+ if (!error_flag)
+ gfc_push_suppress_errors ();
init_arglist (isym);
@@ -3729,7 +3743,8 @@ gfc_intrinsic_sub_interface (gfc_code *c, int error_flag)
/* The subroutine corresponds to an intrinsic. Allow errors to be
seen at this point. */
- gfc_suppress_error = 0;
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
if (isym->resolve.s1 != NULL)
isym->resolve.s1 (c);
@@ -3751,7 +3766,8 @@ gfc_intrinsic_sub_interface (gfc_code *c, int error_flag)
return MATCH_YES;
fail:
- gfc_suppress_error = 0;
+ if (!error_flag)
+ gfc_pop_suppress_errors ();
return MATCH_NO;
}
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 3846d953e6b..b9c99fe8f35 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -3960,13 +3960,6 @@ check_for_ambiguous (gfc_symbol *st_sym, pointer_info *info)
if (st_sym == rsym)
return false;
- /* Identical derived types are not ambiguous and will be rolled up
- later. */
- if (st_sym->attr.flavor == FL_DERIVED
- && rsym->attr.flavor == FL_DERIVED
- && gfc_compare_derived_types (st_sym, rsym))
- return false;
-
/* If the existing symbol is generic from a different module and
the new symbol is generic there can be no ambiguity. */
if (st_sym->attr.generic
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 6976e64e0c8..70d3ad5df99 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -7525,6 +7525,10 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
}
}
+ /* Ensure that any initializer is simplified. */
+ if (sym->value)
+ gfc_simplify_expr (sym->value, 1);
+
/* Reject illegal initializers. */
if (!sym->mark && sym->value)
{
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 429c5151d2e..c5327940e9e 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -668,7 +668,6 @@ gfc_simplify_atan2 (gfc_expr *y, gfc_expr *x)
gfc_expr *
gfc_simplify_bessel_j0 (gfc_expr *x ATTRIBUTE_UNUSED)
{
-#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
gfc_expr *result;
if (x->expr_type != EXPR_CONSTANT)
@@ -678,16 +677,12 @@ gfc_simplify_bessel_j0 (gfc_expr *x ATTRIBUTE_UNUSED)
mpfr_j0 (result->value.real, x->value.real, GFC_RND_MODE);
return range_check (result, "BESSEL_J0");
-#else
- return NULL;
-#endif
}
gfc_expr *
gfc_simplify_bessel_j1 (gfc_expr *x ATTRIBUTE_UNUSED)
{
-#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
gfc_expr *result;
if (x->expr_type != EXPR_CONSTANT)
@@ -697,9 +692,6 @@ gfc_simplify_bessel_j1 (gfc_expr *x ATTRIBUTE_UNUSED)
mpfr_j1 (result->value.real, x->value.real, GFC_RND_MODE);
return range_check (result, "BESSEL_J1");
-#else
- return NULL;
-#endif
}
@@ -707,7 +699,6 @@ gfc_expr *
gfc_simplify_bessel_jn (gfc_expr *order ATTRIBUTE_UNUSED,
gfc_expr *x ATTRIBUTE_UNUSED)
{
-#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
gfc_expr *result;
long n;
@@ -719,16 +710,12 @@ gfc_simplify_bessel_jn (gfc_expr *order ATTRIBUTE_UNUSED,
mpfr_jn (result->value.real, n, x->value.real, GFC_RND_MODE);
return range_check (result, "BESSEL_JN");
-#else
- return NULL;
-#endif
}
gfc_expr *
gfc_simplify_bessel_y0 (gfc_expr *x ATTRIBUTE_UNUSED)
{
-#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
gfc_expr *result;
if (x->expr_type != EXPR_CONSTANT)
@@ -738,16 +725,12 @@ gfc_simplify_bessel_y0 (gfc_expr *x ATTRIBUTE_UNUSED)
mpfr_y0 (result->value.real, x->value.real, GFC_RND_MODE);
return range_check (result, "BESSEL_Y0");
-#else
- return NULL;
-#endif
}
gfc_expr *
gfc_simplify_bessel_y1 (gfc_expr *x ATTRIBUTE_UNUSED)
{
-#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
gfc_expr *result;
if (x->expr_type != EXPR_CONSTANT)
@@ -757,9 +740,6 @@ gfc_simplify_bessel_y1 (gfc_expr *x ATTRIBUTE_UNUSED)
mpfr_y1 (result->value.real, x->value.real, GFC_RND_MODE);
return range_check (result, "BESSEL_Y1");
-#else
- return NULL;
-#endif
}
@@ -767,7 +747,6 @@ gfc_expr *
gfc_simplify_bessel_yn (gfc_expr *order ATTRIBUTE_UNUSED,
gfc_expr *x ATTRIBUTE_UNUSED)
{
-#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
gfc_expr *result;
long n;
@@ -779,9 +758,6 @@ gfc_simplify_bessel_yn (gfc_expr *order ATTRIBUTE_UNUSED,
mpfr_yn (result->value.real, n, x->value.real, GFC_RND_MODE);
return range_check (result, "BESSEL_YN");
-#else
- return NULL;
-#endif
}
@@ -2483,7 +2459,6 @@ gfc_simplify_len_trim (gfc_expr *e, gfc_expr *kind)
gfc_expr *
gfc_simplify_lgamma (gfc_expr *x ATTRIBUTE_UNUSED)
{
-#if MPFR_VERSION >= MPFR_VERSION_NUM(2,3,0)
gfc_expr *result;
int sg;
@@ -2495,9 +2470,6 @@ gfc_simplify_lgamma (gfc_expr *x ATTRIBUTE_UNUSED)
mpfr_lgamma (result->value.real, &sg, x->value.real, GFC_RND_MODE);
return range_check (result, "LGAMMA");
-#else
- return NULL;
-#endif
}
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 20253e668ca..1b47f2673e6 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -704,7 +704,7 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
layout_type (type);
}
- if (nest || write_symbols == NO_DEBUG)
+ if (write_symbols == NO_DEBUG)
return;
if (TYPE_NAME (type) != NULL_TREE
@@ -1761,7 +1761,7 @@ build_entry_thunks (gfc_namespace * ns)
thunk_fndecl = thunk_sym->backend_decl;
- gfc_start_block (&body);
+ gfc_init_block (&body);
/* Pass extra parameter identifying this entry point. */
tmp = build_int_cst (gfc_array_index_type, el->id);
@@ -1869,8 +1869,12 @@ build_entry_thunks (gfc_namespace * ns)
/* Finish off this function and send it for code generation. */
DECL_SAVED_TREE (thunk_fndecl) = gfc_finish_block (&body);
+ tmp = getdecls ();
poplevel (1, 0, 1);
BLOCK_SUPERCONTEXT (DECL_INITIAL (thunk_fndecl)) = thunk_fndecl;
+ DECL_SAVED_TREE (thunk_fndecl)
+ = build3_v (BIND_EXPR, tmp, DECL_SAVED_TREE (thunk_fndecl),
+ DECL_INITIAL (thunk_fndecl));
/* Output the GENERIC tree. */
dump_function (TDI_original, thunk_fndecl);
@@ -3652,7 +3656,7 @@ gfc_generate_function_code (gfc_namespace * ns)
trans_function_start (sym);
- gfc_start_block (&block);
+ gfc_init_block (&block);
if (ns->entries && ns->proc_name->ts.type == BT_CHARACTER)
{
@@ -3886,11 +3890,16 @@ gfc_generate_function_code (gfc_namespace * ns)
saved_function_decls = NULL_TREE;
DECL_SAVED_TREE (fndecl) = gfc_finish_block (&block);
+ decl = getdecls ();
/* Finish off this function and send it for code generation. */
poplevel (1, 0, 1);
BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
+ DECL_SAVED_TREE (fndecl)
+ = build3_v (BIND_EXPR, decl, DECL_SAVED_TREE (fndecl),
+ DECL_INITIAL (fndecl));
+
/* Output the GENERIC tree. */
dump_function (TDI_original, fndecl);
@@ -3969,9 +3978,13 @@ gfc_generate_constructors (void)
DECL_SAVED_TREE (fndecl) = build_stmt (EXPR_STMT, tmp);
}
+ decl = getdecls ();
poplevel (1, 0, 1);
BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
+ DECL_SAVED_TREE (fndecl)
+ = build3_v (BIND_EXPR, decl, DECL_SAVED_TREE (fndecl),
+ DECL_INITIAL (fndecl));
free_after_parsing (cfun);
free_after_compilation (cfun);
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index c3d2a918040..c4c83143777 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -1415,10 +1415,10 @@ gfc_get_nodesc_array_type (tree etype, gfc_array_spec * as, gfc_packed packed)
mpz_clear (stride);
mpz_clear (delta);
- /* In debug info represent packed arrays as multi-dimensional
- if they have rank > 1 and with proper bounds, instead of flat
- arrays. */
- if (known_offset && write_symbols != NO_DEBUG)
+ /* Represent packed arrays as multi-dimensional if they have rank >
+ 1 and with proper bounds, instead of flat arrays. This makes for
+ better debug info. */
+ if (known_offset)
{
tree gtype = etype, rtype, type_decl;
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index c546f3e15a1..88be943b20d 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -487,19 +487,19 @@ propagate_rtx (rtx x, enum machine_mode mode, rtx old_rtx, rtx new_rtx,
between FROM to (but not including) TO. */
static bool
-local_ref_killed_between_p (struct df_ref * ref, rtx from, rtx to)
+local_ref_killed_between_p (df_ref ref, rtx from, rtx to)
{
rtx insn;
for (insn = from; insn != to; insn = NEXT_INSN (insn))
{
- struct df_ref **def_rec;
+ df_ref *def_rec;
if (!INSN_P (insn))
continue;
for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (DF_REF_REGNO (ref) == DF_REF_REGNO (def))
return true;
}
@@ -517,12 +517,12 @@ local_ref_killed_between_p (struct df_ref * ref, rtx from, rtx to)
we check if the definition is killed after DEF_INSN or before
TARGET_INSN insn, in their respective basic blocks. */
static bool
-use_killed_between (struct df_ref *use, rtx def_insn, rtx target_insn)
+use_killed_between (df_ref use, rtx def_insn, rtx target_insn)
{
basic_block def_bb = BLOCK_FOR_INSN (def_insn);
basic_block target_bb = BLOCK_FOR_INSN (target_insn);
int regno;
- struct df_ref * def;
+ df_ref def;
/* In some obscure situations we can have a def reaching a use
that is _before_ the def. In other words the def does not
@@ -543,7 +543,7 @@ use_killed_between (struct df_ref *use, rtx def_insn, rtx target_insn)
regno = DF_REF_REGNO (use);
def = DF_REG_DEF_CHAIN (regno);
if (def
- && def->next_reg == NULL
+ && DF_REF_NEXT_REG (def) == NULL
&& regno >= FIRST_PSEUDO_REGISTER)
return false;
@@ -555,7 +555,7 @@ use_killed_between (struct df_ref *use, rtx def_insn, rtx target_insn)
if (single_pred_p (target_bb)
&& single_pred (target_bb) == def_bb)
{
- struct df_ref *x;
+ df_ref x;
/* See if USE is killed between DEF_INSN and the last insn in the
basic block containing DEF_INSN. */
@@ -583,7 +583,7 @@ use_killed_between (struct df_ref *use, rtx def_insn, rtx target_insn)
static bool
all_uses_available_at (rtx def_insn, rtx target_insn)
{
- struct df_ref **use_rec;
+ df_ref *use_rec;
struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn);
rtx def_set = single_set (def_insn);
@@ -600,14 +600,14 @@ all_uses_available_at (rtx def_insn, rtx target_insn)
invalid. */
for (use_rec = DF_INSN_INFO_USES (insn_info); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (rtx_equal_p (DF_REF_REG (use), def_reg))
return false;
}
for (use_rec = DF_INSN_INFO_EQ_USES (insn_info); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
- if (rtx_equal_p (use->reg, def_reg))
+ df_ref use = *use_rec;
+ if (rtx_equal_p (DF_REF_REG (use), def_reg))
return false;
}
}
@@ -617,13 +617,13 @@ all_uses_available_at (rtx def_insn, rtx target_insn)
killed between DEF_INSN and TARGET_INSN. */
for (use_rec = DF_INSN_INFO_USES (insn_info); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (use_killed_between (use, def_insn, target_insn))
return false;
}
for (use_rec = DF_INSN_INFO_EQ_USES (insn_info); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (use_killed_between (use, def_insn, target_insn))
return false;
}
@@ -682,7 +682,7 @@ find_occurrence (rtx *px, rtx find)
in the data flow object of the pass. Mark any new uses as having the
given TYPE. */
static void
-update_df (rtx insn, rtx *loc, struct df_ref **use_rec, enum df_ref_type type,
+update_df (rtx insn, rtx *loc, df_ref *use_rec, enum df_ref_type type,
int new_flags)
{
bool changed = false;
@@ -690,8 +690,8 @@ update_df (rtx insn, rtx *loc, struct df_ref **use_rec, enum df_ref_type type,
/* Add a use for the registers that were propagated. */
while (*use_rec)
{
- struct df_ref *use = *use_rec;
- struct df_ref *orig_use = use, *new_use;
+ df_ref use = *use_rec;
+ df_ref orig_use = use, new_use;
int width = -1;
int offset = -1;
enum machine_mode mode = 0;
@@ -731,7 +731,7 @@ update_df (rtx insn, rtx *loc, struct df_ref **use_rec, enum df_ref_type type,
performed. */
static bool
-try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new_rtx, rtx def_insn, bool set_reg_equal)
+try_fwprop_subst (df_ref use, rtx *loc, rtx new_rtx, rtx def_insn, bool set_reg_equal)
{
rtx insn = DF_REF_INSN (use);
enum df_ref_type type = DF_REF_TYPE (use);
@@ -821,7 +821,7 @@ try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new_rtx, rtx def_insn, bool
/* If USE is a paradoxical subreg, see if it can be replaced by a pseudo. */
static bool
-forward_propagate_subreg (struct df_ref *use, rtx def_insn, rtx def_set)
+forward_propagate_subreg (df_ref use, rtx def_insn, rtx def_set)
{
rtx use_reg = DF_REF_REG (use);
rtx use_insn, src;
@@ -856,7 +856,7 @@ forward_propagate_subreg (struct df_ref *use, rtx def_insn, rtx def_set)
result. */
static bool
-forward_propagate_and_simplify (struct df_ref *use, rtx def_insn, rtx def_set)
+forward_propagate_and_simplify (df_ref use, rtx def_insn, rtx def_set)
{
rtx use_insn = DF_REF_INSN (use);
rtx use_set = single_set (use_insn);
@@ -952,10 +952,10 @@ forward_propagate_and_simplify (struct df_ref *use, rtx def_insn, rtx def_set)
definition, try to forward propagate it into that insn. */
static void
-forward_propagate_into (struct df_ref *use)
+forward_propagate_into (df_ref use)
{
struct df_link *defs;
- struct df_ref *def;
+ df_ref def;
rtx def_insn, def_set, use_insn;
rtx parent;
@@ -1064,7 +1064,7 @@ fwprop (void)
for (i = 0; i < DF_USES_TABLE_SIZE (); i++)
{
- struct df_ref *use = DF_USES_GET (i);
+ df_ref use = DF_USES_GET (i);
if (use)
if (DF_REF_TYPE (use) == DF_REF_REG_USE
|| DF_REF_BB (use)->loop_father == NULL
@@ -1109,7 +1109,7 @@ fwprop_addr (void)
for (i = 0; i < DF_USES_TABLE_SIZE (); i++)
{
- struct df_ref *use = DF_USES_GET (i);
+ df_ref use = DF_USES_GET (i);
if (use)
if (DF_REF_TYPE (use) != DF_REF_REG_USE
&& DF_REF_BB (use)->loop_father != NULL
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index 99f8754473b..197ba352b45 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -133,6 +133,7 @@ lower_function_body (void)
{
x = gimple_build_return (NULL);
gimple_set_location (x, cfun->function_end_locus);
+ gimple_set_block (x, DECL_INITIAL (current_function_decl));
gsi_insert_after (&i, x, GSI_CONTINUE_LINKING);
}
@@ -659,6 +660,7 @@ lower_gimple_return (gimple_stmt_iterator *gsi, struct lower_data *data)
found:
t = gimple_build_goto (tmp_rs.label);
gimple_set_location (t, gimple_location (stmt));
+ gimple_set_block (t, gimple_block (stmt));
gsi_insert_before (gsi, t, GSI_SAME_STMT);
gsi_remove (gsi, false);
}
@@ -736,6 +738,7 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi)
t = implicit_built_in_decls[BUILT_IN_SETJMP_SETUP];
g = gimple_build_call (t, 2, gimple_call_arg (stmt, 0), arg);
gimple_set_location (g, gimple_location (stmt));
+ gimple_set_block (g, gimple_block (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
/* Build 'DEST = 0' and insert. */
@@ -744,6 +747,7 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi)
g = gimple_build_assign (dest, fold_convert (TREE_TYPE (dest),
integer_zero_node));
gimple_set_location (g, gimple_location (stmt));
+ gimple_set_block (g, gimple_block (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
}
@@ -760,6 +764,7 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi)
t = implicit_built_in_decls[BUILT_IN_SETJMP_RECEIVER];
g = gimple_build_call (t, 1, arg);
gimple_set_location (g, gimple_location (stmt));
+ gimple_set_block (g, gimple_block (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
/* Build 'DEST = 1' and insert. */
@@ -768,6 +773,7 @@ lower_builtin_setjmp (gimple_stmt_iterator *gsi)
g = gimple_build_assign (dest, fold_convert (TREE_TYPE (dest),
integer_one_node));
gimple_set_location (g, gimple_location (stmt));
+ gimple_set_block (g, gimple_block (stmt));
gsi_insert_before (gsi, g, GSI_SAME_STMT);
}
diff --git a/gcc/global.c b/gcc/global.c
index 88fe38352f7..edc2a42c590 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -165,11 +165,11 @@ compute_regs_asm_clobbered (char *regs_asm_clobbered)
rtx insn;
FOR_BB_INSNS_REVERSE (bb, insn)
{
- struct df_ref **def_rec;
+ df_ref *def_rec;
if (insn_contains_asm (insn))
for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
unsigned int dregno = DF_REF_REGNO (def);
if (dregno < FIRST_PSEUDO_REGISTER)
{
@@ -1448,8 +1448,8 @@ build_insn_chain (void)
if (!NOTE_P (insn) && !BARRIER_P (insn))
{
unsigned int uid = INSN_UID (insn);
- struct df_ref **def_rec;
- struct df_ref **use_rec;
+ df_ref *def_rec;
+ df_ref *use_rec;
c = new_insn_chain ();
c->next = next;
@@ -1463,7 +1463,7 @@ build_insn_chain (void)
if (INSN_P (insn))
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
unsigned int regno = DF_REF_REGNO (def);
/* Ignore may clobbers because these are generated
@@ -1555,7 +1555,7 @@ build_insn_chain (void)
if (INSN_P (insn))
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
unsigned int regno = DF_REF_REGNO (use);
rtx reg = DF_REF_REG (use);
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 4531936b154..a615e2c1e49 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -4162,7 +4162,6 @@ gloog (scop_p scop, struct clast_stmt *stmt)
if (new_scop_exit_edge->dest == EXIT_BLOCK_PTR)
new_scop_exit_edge->flags = 0;
- find_unreachable_blocks ();
delete_unreachable_blocks ();
patch_phis_for_virtual_defs ();
patch_scop_exit_phi_args (new_scop_exit_edge, phi_args);
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index a0b49a3979c..cd148abd7a9 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -3922,10 +3922,10 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
if (INSN_P (insn))
{
unsigned int uid = INSN_UID (insn);
- struct df_ref **def_rec;
+ df_ref *def_rec;
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
bitmap_set_bit (merge_set, DF_REF_REGNO (def));
}
}
diff --git a/gcc/init-regs.c b/gcc/init-regs.c
index 83abe715971..843f8a38443 100644
--- a/gcc/init-regs.c
+++ b/gcc/init-regs.c
@@ -70,13 +70,13 @@ initialize_uninitialized_regs (void)
FOR_BB_INSNS (bb, insn)
{
unsigned int uid = INSN_UID (insn);
- struct df_ref **use_rec;
+ df_ref *use_rec;
if (!INSN_P (insn))
continue;
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
unsigned int regno = DF_REF_REGNO (use);
/* Only do this for the pseudos. */
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index c1b2bdd6548..89343fe30f3 100644
--- a/gcc/ira-lives.c
+++ b/gcc/ira-lives.c
@@ -266,7 +266,7 @@ mark_reg_live (rtx reg)
/* Mark the register referenced by use or def REF as live. */
static void
-mark_ref_live (struct df_ref *ref)
+mark_ref_live (df_ref ref)
{
rtx reg;
@@ -335,7 +335,7 @@ mark_reg_dead (rtx reg)
/* Mark the register referenced by definition DEF as dead, if the
definition is a total one. */
static void
-mark_ref_dead (struct df_ref *def)
+mark_ref_dead (df_ref def)
{
rtx reg;
@@ -356,7 +356,7 @@ mark_early_clobbers (rtx insn, bool live_p)
{
int alt;
int def;
- struct df_ref **def_rec;
+ df_ref *def_rec;
bool set_p = false;
for (def = 0; def < recog_data.n_operands; def++)
@@ -702,7 +702,7 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node)
pessimistic, but it probably doesn't matter much in practice. */
FOR_BB_INSNS_REVERSE (bb, insn)
{
- struct df_ref **def_rec, **use_rec;
+ df_ref *def_rec, *use_rec;
bool call_p;
if (! INSN_P (insn))
diff --git a/gcc/ira.c b/gcc/ira.c
index f4d399cb491..5fbd713ac75 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1216,12 +1216,12 @@ compute_regs_asm_clobbered (char *regs_asm_clobbered)
rtx insn;
FOR_BB_INSNS_REVERSE (bb, insn)
{
- struct df_ref **def_rec;
+ df_ref *def_rec;
if (insn_contains_asm (insn))
for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
unsigned int dregno = DF_REF_REGNO (def);
if (dregno < FIRST_PSEUDO_REGISTER)
{
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 5926d6af354..648f239a65d 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -1279,7 +1279,7 @@ block_alloc (basic_block b)
int insn_count = 0;
int max_uid = get_max_uid ();
int *qty_order;
- struct df_ref ** def_rec;
+ df_ref *def_rec;
/* Count the instructions in the basic block. */
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 524727e9a37..9c0be87bc87 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -243,13 +243,13 @@ check_maybe_invariant (rtx x)
invariant. */
static struct invariant *
-invariant_for_use (struct df_ref *use)
+invariant_for_use (df_ref use)
{
struct df_link *defs;
- struct df_ref *def;
+ df_ref def;
basic_block bb = DF_REF_BB (use), def_bb;
- if (use->flags & DF_REF_READ_WRITE)
+ if (DF_REF_FLAGS (use) & DF_REF_READ_WRITE)
return NULL;
defs = DF_REF_CHAIN (use);
@@ -276,7 +276,7 @@ hash_invariant_expr_1 (rtx insn, rtx x)
const char *fmt;
hashval_t val = code;
int do_not_record_p;
- struct df_ref *use;
+ df_ref use;
struct invariant *inv;
switch (code)
@@ -330,7 +330,7 @@ invariant_expr_equal_p (rtx insn1, rtx e1, rtx insn2, rtx e2)
enum rtx_code code = GET_CODE (e1);
int i, j;
const char *fmt;
- struct df_ref *use1, *use2;
+ df_ref use1, use2;
struct invariant *inv1 = NULL, *inv2 = NULL;
rtx sub1, sub2;
@@ -724,15 +724,15 @@ record_use (struct def *def, rtx *use, rtx insn)
loop invariants, false otherwise. */
static bool
-check_dependency (basic_block bb, struct df_ref *use, bitmap depends_on)
+check_dependency (basic_block bb, df_ref use, bitmap depends_on)
{
- struct df_ref *def;
+ df_ref def;
basic_block def_bb;
struct df_link *defs;
struct def *def_data;
struct invariant *inv;
- if (use->flags & DF_REF_READ_WRITE)
+ if (DF_REF_FLAGS (use) & DF_REF_READ_WRITE)
return false;
defs = DF_REF_CHAIN (use);
@@ -772,7 +772,7 @@ static bool
check_dependencies (rtx insn, bitmap depends_on)
{
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
- struct df_ref **use_rec;
+ df_ref *use_rec;
basic_block bb = BLOCK_FOR_INSN (insn);
for (use_rec = DF_INSN_INFO_USES (insn_info); *use_rec; use_rec++)
@@ -792,7 +792,7 @@ check_dependencies (rtx insn, bitmap depends_on)
static void
find_invariant_insn (rtx insn, bool always_reached, bool always_executed)
{
- struct df_ref *ref;
+ df_ref ref;
struct def *def;
bitmap depends_on;
rtx set, dest;
@@ -855,19 +855,19 @@ static void
record_uses (rtx insn)
{
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
- struct df_ref **use_rec;
+ df_ref *use_rec;
struct invariant *inv;
for (use_rec = DF_INSN_INFO_USES (insn_info); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
inv = invariant_for_use (use);
if (inv)
record_use (inv->def, DF_REF_REAL_LOC (use), DF_REF_INSN (use));
}
for (use_rec = DF_INSN_INFO_EQ_USES (insn_info); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
inv = invariant_for_use (use);
if (inv)
record_use (inv->def, DF_REF_REAL_LOC (use), DF_REF_INSN (use));
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index e0635970bff..2523963f36d 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -293,15 +293,15 @@ iv_analysis_loop_init (struct loop *loop)
is set to NULL and true is returned. */
static bool
-latch_dominating_def (rtx reg, struct df_ref **def)
+latch_dominating_def (rtx reg, df_ref *def)
{
- struct df_ref *single_rd = NULL, *adef;
+ df_ref single_rd = NULL, adef;
unsigned regno = REGNO (reg);
struct df_rd_bb_info *bb_info = DF_RD_BB_INFO (current_loop->latch);
- for (adef = DF_REG_DEF_CHAIN (regno); adef; adef = adef->next_reg)
+ for (adef = DF_REG_DEF_CHAIN (regno); adef; adef = DF_REF_NEXT_REG (adef))
{
- if (!bitmap_bit_p (df->blocks_to_analyze, DF_REF_BB (adef)->index)
+ if (!bitmap_bit_p (df->blocks_to_analyze, DF_REF_BBNO (adef))
|| !bitmap_bit_p (bb_info->out, DF_REF_ID (adef)))
continue;
@@ -322,9 +322,9 @@ latch_dominating_def (rtx reg, struct df_ref **def)
/* Gets definition of REG reaching its use in INSN and stores it to DEF. */
static enum iv_grd_result
-iv_get_reaching_def (rtx insn, rtx reg, struct df_ref **def)
+iv_get_reaching_def (rtx insn, rtx reg, df_ref *def)
{
- struct df_ref *use, *adef;
+ df_ref use, adef;
basic_block def_bb, use_bb;
rtx def_insn;
bool dom_p;
@@ -349,7 +349,7 @@ iv_get_reaching_def (rtx insn, rtx reg, struct df_ref **def)
adef = DF_REF_CHAIN (use)->ref;
/* We do not handle setting only part of the register. */
- if (adef->flags & DF_REF_READ_WRITE)
+ if (DF_REF_FLAGS (adef) & DF_REF_READ_WRITE)
return GRD_INVALID;
def_insn = DF_REF_INSN (adef);
@@ -616,7 +616,7 @@ iv_shift (struct rtx_iv *iv, rtx mby)
at get_biv_step. */
static bool
-get_biv_step_1 (struct df_ref *def, rtx reg,
+get_biv_step_1 (df_ref def, rtx reg,
rtx *inner_step, enum machine_mode *inner_mode,
enum rtx_code *extend, enum machine_mode outer_mode,
rtx *outer_step)
@@ -625,7 +625,7 @@ get_biv_step_1 (struct df_ref *def, rtx reg,
rtx next, nextr, tmp;
enum rtx_code code;
rtx insn = DF_REF_INSN (def);
- struct df_ref *next_def;
+ df_ref next_def;
enum iv_grd_result res;
set = single_set (insn);
@@ -783,7 +783,7 @@ get_biv_step_1 (struct df_ref *def, rtx reg,
LAST_DEF is the definition of REG that dominates loop latch. */
static bool
-get_biv_step (struct df_ref *last_def, rtx reg, rtx *inner_step,
+get_biv_step (df_ref last_def, rtx reg, rtx *inner_step,
enum machine_mode *inner_mode, enum rtx_code *extend,
enum machine_mode *outer_mode, rtx *outer_step)
{
@@ -803,7 +803,7 @@ get_biv_step (struct df_ref *last_def, rtx reg, rtx *inner_step,
/* Records information that DEF is induction variable IV. */
static void
-record_iv (struct df_ref *def, struct rtx_iv *iv)
+record_iv (df_ref def, struct rtx_iv *iv)
{
struct rtx_iv *recorded_iv = XNEW (struct rtx_iv);
@@ -849,7 +849,7 @@ iv_analyze_biv (rtx def, struct rtx_iv *iv)
rtx inner_step, outer_step;
enum machine_mode inner_mode, outer_mode;
enum rtx_code extend;
- struct df_ref *last_def;
+ df_ref last_def;
if (dump_file)
{
@@ -1042,7 +1042,7 @@ iv_analyze_expr (rtx insn, rtx rhs, enum machine_mode mode, struct rtx_iv *iv)
/* Analyzes iv DEF and stores the result to *IV. */
static bool
-iv_analyze_def (struct df_ref *def, struct rtx_iv *iv)
+iv_analyze_def (df_ref def, struct rtx_iv *iv)
{
rtx insn = DF_REF_INSN (def);
rtx reg = DF_REF_REG (def);
@@ -1107,7 +1107,7 @@ iv_analyze_def (struct df_ref *def, struct rtx_iv *iv)
static bool
iv_analyze_op (rtx insn, rtx op, struct rtx_iv *iv)
{
- struct df_ref *def = NULL;
+ df_ref def = NULL;
enum iv_grd_result res;
if (dump_file)
@@ -1190,7 +1190,7 @@ iv_analyze (rtx insn, rtx val, struct rtx_iv *iv)
bool
iv_analyze_result (rtx insn, rtx def, struct rtx_iv *iv)
{
- struct df_ref *adef;
+ df_ref adef;
adef = df_find_def (insn, def);
if (!adef)
@@ -1207,7 +1207,7 @@ bool
biv_p (rtx insn, rtx reg)
{
struct rtx_iv iv;
- struct df_ref *def, *last_def;
+ df_ref def, last_def;
if (!simple_reg_p (reg))
return false;
diff --git a/gcc/opts.c b/gcc/opts.c
index bac50b0925f..6e210ea7ceb 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1459,8 +1459,7 @@ common_handle_option (size_t scode, const char *arg, int value,
print_specific_help (0, undoc_mask, all_langs_mask);
/* Then display any remaining, non-language options. */
for (i = CL_MIN_OPTION_CLASS; i <= CL_MAX_OPTION_CLASS; i <<= 1)
- if (i != CL_SAVE)
- print_specific_help (i, undoc_mask, 0);
+ print_specific_help (i, undoc_mask, 0);
exit_after_options = true;
break;
}
diff --git a/gcc/opts.h b/gcc/opts.h
index 7a51a0e3b52..bc290f6457c 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -65,14 +65,13 @@ extern const unsigned int cl_options_count;
extern const char *const lang_names[];
extern const unsigned int cl_lang_count;
-#define CL_SAVE (1 << 17) /* Target-specific option for attribute. */
-#define CL_PARAMS (1 << 18) /* Fake entry. Used to display --param info with --help. */
-#define CL_WARNING (1 << 19) /* Enables an (optional) warning message. */
-#define CL_OPTIMIZATION (1 << 20) /* Enables an (optional) optimization. */
-#define CL_TARGET (1 << 21) /* Target-specific option. */
-#define CL_COMMON (1 << 22) /* Language-independent. */
-
-#define CL_MIN_OPTION_CLASS CL_SAVE
+#define CL_PARAMS (1 << 17) /* Fake entry. Used to display --param info with --help. */
+#define CL_WARNING (1 << 18) /* Enables an (optional) warning message. */
+#define CL_OPTIMIZATION (1 << 19) /* Enables an (optional) optimization. */
+#define CL_TARGET (1 << 20) /* Target-specific option. */
+#define CL_COMMON (1 << 21) /* Language-independent. */
+
+#define CL_MIN_OPTION_CLASS CL_PARAMS
#define CL_MAX_OPTION_CLASS CL_COMMON
/* From here on the bits describe attributes of the options.
@@ -80,6 +79,7 @@ extern const unsigned int cl_lang_count;
This distinction is important because --help will not list options
which only have these higher bits set. */
+#define CL_SAVE (1 << 22) /* Target-specific option for attribute. */
#define CL_DISABLED (1 << 23) /* Disabled in this configuration. */
#define CL_REPORT (1 << 24) /* Report argument with -fverbose-asm */
#define CL_JOINED (1 << 25) /* If takes joined argument. */
diff --git a/gcc/profile.c b/gcc/profile.c
index 0ece72519d9..976d91cc17b 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -960,10 +960,12 @@ branch_prob (void)
&& (LOCATION_FILE (e->goto_locus)
!= LOCATION_FILE (gimple_location (last))
|| (LOCATION_LINE (e->goto_locus)
- != LOCATION_LINE (gimple_location (last)))))
+ != LOCATION_LINE (gimple_location (last)))))
{
basic_block new_bb = split_edge (e);
- single_succ_edge (new_bb)->goto_locus = e->goto_locus;
+ edge ne = single_succ_edge (new_bb);
+ ne->goto_locus = e->goto_locus;
+ ne->goto_block = e->goto_block;
}
if ((e->flags & (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL))
&& e->dest != EXIT_BLOCK_PTR)
diff --git a/gcc/ra-conflict.c b/gcc/ra-conflict.c
index c693bc4d8b3..e0ffbbd4c3f 100644
--- a/gcc/ra-conflict.c
+++ b/gcc/ra-conflict.c
@@ -54,7 +54,7 @@ HOST_WIDE_INT max_bitnum;
alloc_pool adjacency_pool;
adjacency_t **adjacency;
-typedef struct df_ref * df_ref_t;
+typedef df_ref df_ref_t;
DEF_VEC_P(df_ref_t);
DEF_VEC_ALLOC_P(df_ref_t,heap);
@@ -278,7 +278,7 @@ record_one_conflict (sparseset allocnos_live,
static void
mark_reg_store (sparseset allocnos_live,
HARD_REG_SET *hard_regs_live,
- struct df_ref *ref)
+ df_ref ref)
{
rtx reg = DF_REF_REG (ref);
unsigned int regno = DF_REF_REGNO (ref);
@@ -448,7 +448,7 @@ clear_reg_in_live (sparseset allocnos_live,
sbitmap *live_subregs,
int *live_subregs_used,
HARD_REG_SET *hard_regs_live,
- rtx reg, struct df_ref *def)
+ rtx reg, df_ref def)
{
unsigned int regno = (GET_CODE (reg) == SUBREG)
? REGNO (SUBREG_REG (reg)): REGNO (reg);
@@ -813,8 +813,8 @@ global_conflicts (void)
FOR_BB_INSNS_REVERSE (bb, insn)
{
unsigned int uid = INSN_UID (insn);
- struct df_ref **def_rec;
- struct df_ref **use_rec;
+ df_ref *def_rec;
+ df_ref *use_rec;
if (!INSN_P (insn))
continue;
@@ -849,7 +849,7 @@ global_conflicts (void)
later. */
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
/* FIXME: Ignoring may clobbers is technically the wrong
thing to do. However the old version of the this
@@ -880,7 +880,7 @@ global_conflicts (void)
/* Add the interferences for the defs. */
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (!DF_REF_FLAGS_IS_SET (def, DF_REF_MAY_CLOBBER))
mark_reg_store (allocnos_live, &renumbers_live, def);
}
@@ -891,7 +891,7 @@ global_conflicts (void)
VEC_truncate (df_ref_t, clobbers, 0);
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (!DF_REF_FLAGS_IS_SET (def, DF_REF_CONDITIONAL))
{
@@ -931,7 +931,7 @@ global_conflicts (void)
VEC_truncate (df_ref_t, dying_regs, 0);
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
unsigned int regno = DF_REF_REGNO (use);
bool added = false;
int renumber = reg_renumber[regno];
@@ -1079,12 +1079,12 @@ global_conflicts (void)
fprintf (dump_file, " clobber conflicts\n");
for (k = VEC_length (df_ref_t, clobbers) - 1; k >= 0; k--)
{
- struct df_ref *def = VEC_index (df_ref_t, clobbers, k);
+ df_ref def = VEC_index (df_ref_t, clobbers, k);
int j;
for (j = VEC_length (df_ref_t, dying_regs) - 1; j >= 0; j--)
{
- struct df_ref *use = VEC_index (df_ref_t, dying_regs, j);
+ df_ref use = VEC_index (df_ref_t, dying_regs, j);
record_one_conflict_between_regnos (GET_MODE (DF_REF_REG (def)),
DF_REF_REGNO (def),
GET_MODE (DF_REF_REG (use)),
@@ -1143,7 +1143,7 @@ global_conflicts (void)
for (j = VEC_length (df_ref_t, dying_regs) - 1; j >= 0; j--)
{
int used_in_output = 0;
- struct df_ref *use = VEC_index (df_ref_t, dying_regs, j);
+ df_ref use = VEC_index (df_ref_t, dying_regs, j);
rtx reg = DF_REF_REG (use);
int uregno = DF_REF_REGNO (use);
enum machine_mode umode = GET_MODE (DF_REF_REG (use));
diff --git a/gcc/regstat.c b/gcc/regstat.c
index 2ec8c5bd739..d6e398930b7 100644
--- a/gcc/regstat.c
+++ b/gcc/regstat.c
@@ -108,8 +108,8 @@ regstat_bb_compute_ri (unsigned int bb_index,
{
basic_block bb = BASIC_BLOCK (bb_index);
rtx insn;
- struct df_ref **def_rec;
- struct df_ref **use_rec;
+ df_ref *def_rec;
+ df_ref *use_rec;
int luid = 0;
bitmap_iterator bi;
unsigned int regno;
@@ -126,14 +126,14 @@ regstat_bb_compute_ri (unsigned int bb_index,
to begin processing. */
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if ((DF_REF_FLAGS (def) & DF_REF_AT_TOP) == 0)
bitmap_clear_bit (live, DF_REF_REGNO (def));
}
for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if ((DF_REF_FLAGS (use) & DF_REF_AT_TOP) == 0)
{
regno = DF_REF_REGNO (use);
@@ -205,7 +205,7 @@ regstat_bb_compute_ri (unsigned int bb_index,
for (mws_rec = DF_INSN_UID_MWS (uid); *mws_rec; mws_rec++)
{
struct df_mw_hardreg *mws = *mws_rec;
- if (mws->type == DF_REF_REG_DEF)
+ if (DF_MWS_REG_DEF_P (mws))
{
bool all_dead = true;
unsigned int r;
@@ -232,7 +232,7 @@ regstat_bb_compute_ri (unsigned int bb_index,
clobber. This code is for the return. */
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if ((!CALL_P (insn))
|| (!(DF_REF_FLAGS (def) & (DF_REF_MUST_CLOBBER | DF_REF_MAY_CLOBBER))))
{
@@ -281,7 +281,7 @@ regstat_bb_compute_ri (unsigned int bb_index,
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
unsigned int uregno = DF_REF_REGNO (use);
if (uregno >= FIRST_PSEUDO_REGISTER)
@@ -412,8 +412,8 @@ regstat_bb_compute_calls_crossed (unsigned int bb_index, bitmap live)
{
basic_block bb = BASIC_BLOCK (bb_index);
rtx insn;
- struct df_ref **def_rec;
- struct df_ref **use_rec;
+ df_ref *def_rec;
+ df_ref *use_rec;
bitmap_copy (live, df_get_live_out (bb));
@@ -421,14 +421,14 @@ regstat_bb_compute_calls_crossed (unsigned int bb_index, bitmap live)
to begin processing. */
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if ((DF_REF_FLAGS (def) & DF_REF_AT_TOP) == 0)
bitmap_clear_bit (live, DF_REF_REGNO (def));
}
for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if ((DF_REF_FLAGS (use) & DF_REF_AT_TOP) == 0)
bitmap_set_bit (live, DF_REF_REGNO (use));
}
@@ -456,7 +456,7 @@ regstat_bb_compute_calls_crossed (unsigned int bb_index, bitmap live)
clobber. This code is for the return. */
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if ((!CALL_P (insn))
|| (!(DF_REF_FLAGS (def) & (DF_REF_MUST_CLOBBER | DF_REF_MAY_CLOBBER))))
{
@@ -468,7 +468,7 @@ regstat_bb_compute_calls_crossed (unsigned int bb_index, bitmap live)
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
bitmap_set_bit (live, DF_REF_REGNO (use));
}
}
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 684f8596c80..76175e3ecf3 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see
#include "ira.h"
#include "df.h"
#include "target.h"
-#include "dse.h"
+#include "emit-rtl.h"
/* This file contains the reload pass of the compiler, which is
run after register allocation has been done. It checks that
@@ -2150,22 +2150,25 @@ alter_reg (int i, int from_reg, bool dont_share_p)
&& (reg_equiv_invariant[i] == 0 || reg_equiv_init[i] == 0)
&& reg_equiv_memory_loc[i] == 0)
{
- rtx x;
+ rtx x = NULL_RTX;
enum machine_mode mode = GET_MODE (regno_reg_rtx[i]);
unsigned int inherent_size = PSEUDO_REGNO_BYTES (i);
unsigned int inherent_align = GET_MODE_ALIGNMENT (mode);
unsigned int total_size = MAX (inherent_size, reg_max_ref_width[i]);
unsigned int min_align = reg_max_ref_width[i] * BITS_PER_UNIT;
int adjust = 0;
- bool shared_p = false;
if (flag_ira && optimize)
- /* Mark the spill for IRA. */
- SET_REGNO_REG_SET (&spilled_pseudos, i);
- x = (dont_share_p || ! flag_ira || ! optimize
- ? NULL_RTX : ira_reuse_stack_slot (i, inherent_size, total_size));
+ {
+ /* Mark the spill for IRA. */
+ SET_REGNO_REG_SET (&spilled_pseudos, i);
+ if (!dont_share_p)
+ x = ira_reuse_stack_slot (i, inherent_size, total_size);
+ }
+
if (x)
- shared_p = true;
+ ;
+
/* Each pseudo reg has an inherent size which comes from its own mode,
and a total size which provides room for paradoxical subregs
which refer to the pseudo reg in wider modes.
@@ -2174,10 +2177,9 @@ alter_reg (int i, int from_reg, bool dont_share_p)
enough inherent space and enough total space.
Otherwise, we allocate a new slot, making sure that it has no less
inherent space, and no less total space, then the previous slot. */
- else if (from_reg == -1 || (! dont_share_p && flag_ira && optimize))
+ else if (from_reg == -1 || (!dont_share_p && flag_ira && optimize))
{
rtx stack_slot;
- alias_set_type alias_set = new_alias_set ();
/* No known place to spill from => no slot to reuse. */
x = assign_stack_local (mode, total_size,
@@ -2186,12 +2188,11 @@ alter_reg (int i, int from_reg, bool dont_share_p)
stack_slot = x;
+ /* Cancel the big-endian correction done in assign_stack_local.
+ Get the address of the beginning of the slot. This is so we
+ can do a big-endian correction unconditionally below. */
if (BYTES_BIG_ENDIAN)
{
- /* Cancel the big-endian correction done in assign_stack_local.
- Get the address of the beginning of the slot.
- This is so we can do a big-endian correction unconditionally
- below. */
adjust = inherent_size - total_size;
if (adjust)
stack_slot
@@ -2201,10 +2202,6 @@ alter_reg (int i, int from_reg, bool dont_share_p)
adjust);
}
- /* Nothing can alias this slot except this pseudo. */
- set_mem_alias_set (x, alias_set);
- dse_record_singleton_alias_set (alias_set, mode);
-
if (! dont_share_p && flag_ira && optimize)
/* Inform IRA about allocation a new stack slot. */
ira_mark_new_stack_slot (stack_slot, i, total_size);
@@ -2217,6 +2214,7 @@ alter_reg (int i, int from_reg, bool dont_share_p)
>= inherent_size)
&& MEM_ALIGN (spill_stack_slot[from_reg]) >= min_align)
x = spill_stack_slot[from_reg];
+
/* Allocate a bigger slot. */
else
{
@@ -2241,27 +2239,11 @@ alter_reg (int i, int from_reg, bool dont_share_p)
|| total_size > inherent_size ? -1 : 0);
stack_slot = x;
- /* All pseudos mapped to this slot can alias each other. */
- if (spill_stack_slot[from_reg])
- {
- alias_set_type alias_set
- = MEM_ALIAS_SET (spill_stack_slot[from_reg]);
- set_mem_alias_set (x, alias_set);
- dse_invalidate_singleton_alias_set (alias_set);
- }
- else
- {
- alias_set_type alias_set = new_alias_set ();
- set_mem_alias_set (x, alias_set);
- dse_record_singleton_alias_set (alias_set, mode);
- }
-
+ /* Cancel the big-endian correction done in assign_stack_local.
+ Get the address of the beginning of the slot. This is so we
+ can do a big-endian correction unconditionally below. */
if (BYTES_BIG_ENDIAN)
{
- /* Cancel the big-endian correction done in assign_stack_local.
- Get the address of the beginning of the slot.
- This is so we can do a big-endian correction unconditionally
- below. */
adjust = GET_MODE_SIZE (mode) - total_size;
if (adjust)
stack_slot
@@ -2284,30 +2266,8 @@ alter_reg (int i, int from_reg, bool dont_share_p)
wrong mode, make a new stack slot. */
x = adjust_address_nv (x, GET_MODE (regno_reg_rtx[i]), adjust);
- /* If we have a decl for the original register, set it for the
- memory. If this is a shared MEM, make a copy. */
- if (shared_p)
- {
- x = copy_rtx (x);
- set_mem_attrs_from_reg (x, regno_reg_rtx[i]);
- }
- else if (REG_EXPR (regno_reg_rtx[i])
- && DECL_P (REG_EXPR (regno_reg_rtx[i])))
- {
- rtx decl = DECL_RTL_IF_SET (REG_EXPR (regno_reg_rtx[i]));
-
- /* We can do this only for the DECLs home pseudo, not for
- any copies of it, since otherwise when the stack slot
- is reused, nonoverlapping_memrefs_p might think they
- cannot overlap. */
- if (decl && REG_P (decl) && REGNO (decl) == (unsigned) i)
- {
- if (from_reg != -1 && spill_stack_slot[from_reg] == x)
- x = copy_rtx (x);
-
- set_mem_attrs_from_reg (x, regno_reg_rtx[i]);
- }
- }
+ /* Set all of the memory attributes as appropriate for a spill. */
+ set_mem_attrs_for_spill (x);
/* Save the stack slot for later. */
reg_equiv_memory_loc[i] = x;
diff --git a/gcc/rtl.h b/gcc/rtl.h
index fd855e9c650..118025a4ff0 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1639,6 +1639,7 @@ extern int insn_line (const_rtx);
extern const char * insn_file (const_rtx);
extern int locator_line (int);
extern const char * locator_file (int);
+extern bool locator_eq (int, int);
extern int prologue_locator, epilogue_locator;
/* In jump.c */
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index e6f14fa2f78..fe08a0b6361 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -1177,14 +1177,21 @@ sdbout_one_type (tree type)
if (TREE_CODE (type) == ENUMERAL_TYPE)
{
for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem))
- if (host_integerp (TREE_VALUE (tem), 0))
- {
- PUT_SDB_DEF (IDENTIFIER_POINTER (TREE_PURPOSE (tem)));
- PUT_SDB_INT_VAL (tree_low_cst (TREE_VALUE (tem), 0));
- PUT_SDB_SCL (C_MOE);
- PUT_SDB_TYPE (T_MOE);
- PUT_SDB_ENDEF;
- }
+ {
+ tree value = TREE_VALUE (tem);
+
+ if (TREE_CODE (value) == CONST_DECL)
+ value = DECL_INITIAL (value);
+
+ if (host_integerp (value, 0))
+ {
+ PUT_SDB_DEF (IDENTIFIER_POINTER (TREE_PURPOSE (tem)));
+ PUT_SDB_INT_VAL (tree_low_cst (value, 0));
+ PUT_SDB_SCL (C_MOE);
+ PUT_SDB_TYPE (T_MOE);
+ PUT_SDB_ENDEF;
+ }
+ }
}
else /* record or union type */
for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
diff --git a/gcc/see.c b/gcc/see.c
index 55b37bf7c2a..27e70216f05 100644
--- a/gcc/see.c
+++ b/gcc/see.c
@@ -3242,7 +3242,7 @@ see_store_reference_and_extension (rtx ref_insn, rtx se_insn,
happened and the optimization should be aborted. */
static int
-see_handle_relevant_defs (struct df_ref *ref, rtx insn)
+see_handle_relevant_defs (df_ref ref, rtx insn)
{
struct web_entry *root_entry = NULL;
rtx se_insn = NULL;
@@ -3311,7 +3311,7 @@ see_handle_relevant_defs (struct df_ref *ref, rtx insn)
happened and the optimization should be aborted. */
static int
-see_handle_relevant_uses (struct df_ref *ref, rtx insn)
+see_handle_relevant_uses (df_ref ref, rtx insn)
{
struct web_entry *root_entry = NULL;
rtx se_insn = NULL;
@@ -3367,12 +3367,12 @@ see_handle_relevant_refs (void)
if (INSN_P (insn))
{
- struct df_ref **use_rec;
- struct df_ref **def_rec;
+ df_ref *use_rec;
+ df_ref *def_rec;
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
int result = see_handle_relevant_uses (use, insn);
if (result == -1)
return -1;
@@ -3380,7 +3380,7 @@ see_handle_relevant_refs (void)
}
for (use_rec = DF_INSN_UID_EQ_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
int result = see_handle_relevant_uses (use, insn);
if (result == -1)
return -1;
@@ -3388,7 +3388,7 @@ see_handle_relevant_refs (void)
}
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
int result = see_handle_relevant_defs (def, insn);
if (result == -1)
return -1;
@@ -3404,7 +3404,7 @@ see_handle_relevant_refs (void)
/* Initialized the use_entry field for REF in INSN at INDEX with ET. */
static void
-see_update_uses_relevancy (rtx insn, struct df_ref *ref,
+see_update_uses_relevancy (rtx insn, df_ref ref,
enum entry_type et, unsigned int index)
{
struct see_entry_extra_info *curr_entry_extra_info;
@@ -3585,7 +3585,7 @@ see_analyze_one_def (rtx insn, enum machine_mode *source_mode,
/* Initialized the def_entry field for REF in INSN at INDEX with ET. */
static void
-see_update_defs_relevancy (rtx insn, struct df_ref *ref,
+see_update_defs_relevancy (rtx insn, df_ref ref,
enum entry_type et,
enum machine_mode source_mode,
enum machine_mode source_mode_unsigned,
@@ -3685,8 +3685,8 @@ see_update_relevancy (void)
FOR_ALL_BB (bb)
{
- struct df_ref **use_rec;
- struct df_ref **def_rec;
+ df_ref *use_rec;
+ df_ref *def_rec;
rtx insn;
FOR_BB_INSNS (bb, insn)
{
@@ -3697,14 +3697,14 @@ see_update_relevancy (void)
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
see_update_uses_relevancy (insn, use, et, u);
u++;
}
for (use_rec = DF_INSN_UID_EQ_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
see_update_uses_relevancy (insn, use, et, u);
u++;
}
@@ -3712,7 +3712,7 @@ see_update_relevancy (void)
et = see_analyze_one_def (insn, &source_mode, &source_mode_unsigned);
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
see_update_defs_relevancy (insn, def, et, source_mode,
source_mode_unsigned, d);
d++;
@@ -3722,14 +3722,14 @@ see_update_relevancy (void)
for (use_rec = df_get_artificial_uses (bb->index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
see_update_uses_relevancy (NULL, use, NOT_RELEVANT, u);
u++;
}
for (def_rec = df_get_artificial_defs (bb->index); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
see_update_defs_relevancy (NULL, def, NOT_RELEVANT,
MAX_MACHINE_MODE, MAX_MACHINE_MODE, d);
d++;
@@ -3766,7 +3766,7 @@ see_propagate_extensions_to_uses (void)
FOR_ALL_BB (bb)
{
rtx insn;
- struct df_ref **use_rec;
+ df_ref *use_rec;
FOR_BB_INSNS (bb, insn)
{
@@ -3775,13 +3775,13 @@ see_propagate_extensions_to_uses (void)
{
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
union_defs (use, def_entry, use_entry, see_update_leader_extra_info);
}
for (use_rec = DF_INSN_UID_EQ_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
union_defs (use, def_entry, use_entry, see_update_leader_extra_info);
}
}
@@ -3789,7 +3789,7 @@ see_propagate_extensions_to_uses (void)
for (use_rec = df_get_artificial_uses (bb->index); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
union_defs (use, def_entry, use_entry, see_update_leader_extra_info);
}
}
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index d08384656f1..a11d68978e8 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -2552,7 +2552,7 @@ maybe_downgrade_id_to_use (idata_t id, insn_t insn)
{
bool must_be_use = false;
unsigned uid = INSN_UID (insn);
- struct df_ref **rec;
+ df_ref *rec;
rtx lhs = IDATA_LHS (id);
rtx rhs = IDATA_RHS (id);
@@ -2568,7 +2568,7 @@ maybe_downgrade_id_to_use (idata_t id, insn_t insn)
for (rec = DF_INSN_UID_DEFS (uid); *rec; rec++)
{
- struct df_ref *def = *rec;
+ df_ref def = *rec;
if (DF_REF_INSN (def)
&& DF_REF_FLAGS_IS_SET (def, DF_REF_PRE_POST_MODIFY)
@@ -2598,12 +2598,12 @@ static void
setup_id_reg_sets (idata_t id, insn_t insn)
{
unsigned uid = INSN_UID (insn);
- struct df_ref **rec;
+ df_ref *rec;
regset tmp = get_clear_regset_from_pool ();
for (rec = DF_INSN_UID_DEFS (uid); *rec; rec++)
{
- struct df_ref *def = *rec;
+ df_ref def = *rec;
unsigned int regno = DF_REF_REGNO (def);
/* Post modifies are treated like clobbers by sched-deps.c. */
@@ -2629,7 +2629,7 @@ setup_id_reg_sets (idata_t id, insn_t insn)
for (rec = DF_INSN_UID_USES (uid); *rec; rec++)
{
- struct df_ref *use = *rec;
+ df_ref use = *rec;
unsigned int regno = DF_REF_REGNO (use);
/* When these refs are met for the first time, skip them, as
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1c76fb09b99..a3f773803bf 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,134 @@
+2008-10-12 Daniel Kraft <d@domob.eu>
+
+ PR fortran/37688
+ * gfortran.dg/used_before_typed_6.f90: New test.
+
+2008-10-12 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/37787
+ * gfortran.dg/module_equivalence_5.f90: New test.
+
+2008-10-12 Steven G. Kargl <kargls@comcast.net>
+
+ PR fortran/37792
+ * gfortran.dg/arithmetic_overflow_1.f90: New test.
+
+2008-10-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/loop_optimization5.adb: New test.
+ * gnat.dg/loop_optimization5_pkg.adb: New helper.
+
+2008-10-11 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/37794
+ * gfortran.dg/used_types_24.f90: New test.
+
+2008-10-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/35760
+ * gcc.c-torture/compile/pr35760.c: New test.
+
+2008-10-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/37146
+ * g++.dg/torture/pr37146-1.C: New test.
+ * g++.dg/torture/pr37146-2.C: New test.
+ * g++.dg/expr/bitfield10.C: New test.
+
+2008-10-08 Jerry DeLisle <jvdelisle@gcc.gnu.org
+
+ PR libfortran/37707
+ * gfortran.dg/namelist_54.f90: Revise test, check a(3).
+
+2008-10-09 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/37753
+ * gfortran.dg/convert_2.f90: New test case.
+
+2008-10-09 Daniel Kraft <d@domob.eu>
+
+ PR fortran/35723
+ * gfortran.dg/restricted_expression_1.f90: New test.
+ * gfortran.dg/restricted_expression_2.f90: New test.
+ * gfortran.dg/restricted_expression_3.f90: New test.
+
+2008-10-08 Jerry DeLisle <jvdelisle@gcc.gnu.org
+
+ PR libfortran/37707
+ * gfortran.dg/namelist_54.f90: New test.
+
+2008-10-08 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.dg/vect/ggc-pr37574.c: Cleanup "vect" tree dump.
+ * gfortran.dg/intrinsic_optional_char_arg_1.f90: Cleanup
+ "original" tree dump.
+
+ * lib/gfortran-dg.exp (gfortran-dg-debug-runtest): Remove build
+ file trivial.S.
+
+2008-10-08 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gcc.target/mips/octeon-exts-2.c: Compile it with -meb.
+ * gcc.target/mips/octeon-exts-5.c: New test.
+ * gcc.target/mips/octeon-bbit-3.c: Compile with -meb. Add
+ comment why this is necessary.
+
+2008-10-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/36635
+ PR target/37290
+ PR rtl-optimization/37341
+ * gcc.c-torture/compile/pr37341.c: New test.
+
+2008-10-07 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c/35437
+ * gcc.dg/struct-parse-2.c: New test.
+ * g++.dg/parse/struct-4.C: New test.
+
+2008-10-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/29609
+ PR debug/36690
+ PR debug/37616
+ * gcc.dg/debug/pr29609-1.c: New test.
+ * gcc.dg/debug/pr29609-2.c: New test.
+ * gcc.dg/debug/pr36690-1.c: New test.
+ * gcc.dg/debug/pr36690-2.c: New test.
+ * gcc.dg/debug/pr36690-3.c: New test.
+ * gcc.dg/debug/pr37616.c: New test.
+ * gcc.dg/debug/dwarf2/pr29609-1.c: New test.
+ * gcc.dg/debug/dwarf2/pr29609-2.c: New test.
+ * gcc.dg/debug/dwarf2/pr36690-1.c: New test.
+ * gcc.dg/debug/dwarf2/pr36690-2.c: New test.
+ * gcc.dg/debug/dwarf2/pr36690-3.c: New test.
+ * gcc.dg/debug/dwarf2/pr37616.c: New test.
+
+2008-10-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/37731
+ * gcc.dg/torture/pr37731-1.c: New.
+ * gcc.dg/torture/pr37731-2.c: Likewise.
+
+2008-10-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/37738
+ * gfortran.dg/debug/pr37738.f: New test.
+
+2008-10-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/loop_optimization4.adb: New test.
+ * gnat.dg/loop_optimization4_pkg.ad[sb]: New helper.
+
+2008-10-07 Bob Wilson <bob.wilson@acm.org>
+
+ * gcc.dg/compat/struct-layout-1_generate.c (dg_options): New. Moved
+ dg-options lines to this array, and added options for xtensa*-*-*.
+ (NDG_OPTIONS): Define.
+ (switchfiles): Print dg-options lines from new dg_options array.
+ * g++.dg/compat/struct-layout-1_generate.c (dg_options): Add options
+ for xtensa*-*-* targets.
+
2008-10-07 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/addr4.adb: New test.
diff --git a/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c b/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
index 8535022b7fc..589cc787fd8 100644
--- a/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
+++ b/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
@@ -46,7 +46,8 @@ const char *dg_options[] = {
"/* { dg-options \"%s-I%s\" } */\n",
"/* { dg-options \"%s-I%s -mno-mmx\" { target i?86-*-* x86_64-*-* } } */\n",
"/* { dg-options \"%s-I%s -fno-common\" { target hppa*-*-hpux* } } */\n",
-"/* { dg-options \"%s-I%s -mno-base-addresses\" { target mmix-*-* } } */\n"
+"/* { dg-options \"%s-I%s -mno-base-addresses\" { target mmix-*-* } } */\n",
+"/* { dg-options \"%s-I%s -mlongcalls -mtext-section-literals\" { target xtensa*-*-* } } */\n"
#define NDG_OPTIONS (sizeof (dg_options) / sizeof (dg_options[0]))
};
diff --git a/gcc/testsuite/g++.dg/expr/bitfield10.C b/gcc/testsuite/g++.dg/expr/bitfield10.C
new file mode 100644
index 00000000000..0a6581e32b7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/bitfield10.C
@@ -0,0 +1,16 @@
+// PR c++/37146
+// { dg-do compile }
+
+enum E { E0 = 0, E1 = 'E' };
+
+struct S
+{
+ E s0 : 8;
+ enum E foo (bool, E);
+};
+
+E
+S::foo (bool a, E b)
+{
+ return a ? s0 : b;
+}
diff --git a/gcc/testsuite/g++.dg/parse/struct-4.C b/gcc/testsuite/g++.dg/parse/struct-4.C
new file mode 100644
index 00000000000..559411a19cf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/struct-4.C
@@ -0,0 +1,13 @@
+/* PR c/35437 */
+/* { dg-do "compile" } */
+
+struct A
+{
+ int i;
+ struct A a; /* { dg-error "has incomplete type" } */
+};
+
+void foo()
+{
+ struct A b = { 0 };
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr37146-1.C b/gcc/testsuite/g++.dg/torture/pr37146-1.C
new file mode 100644
index 00000000000..ea65226f13d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr37146-1.C
@@ -0,0 +1,83 @@
+// PR c++/37146
+// { dg-do run }
+
+extern "C" void abort ();
+int a, b;
+struct A { int i:8; int j:8; int k:16; int l:32; } c;
+
+void
+f1 (int x, int y)
+{
+ (x ? a : b) = y;
+}
+
+void
+f2 (int x, int y)
+{
+ (x ? c.i : c.j) = y;
+}
+
+void
+f3 (int x, int y)
+{
+ (x ? c.i : a) = y;
+}
+
+void
+f4 (int x, int y)
+{
+ (x ? c.i : c.k) = y;
+}
+
+void
+f5 (int x, int y)
+{
+ (x ? c.l : b) = y;
+}
+
+#define CHECK(var, exp) \
+ do \
+ { \
+ if (var != exp) \
+ abort (); \
+ var = -1; \
+ if (a != -1 \
+ || b != -1 \
+ || c.i != -1 \
+ || c.j != -1 \
+ || c.k != -1 \
+ || c.l != -1) \
+ abort (); \
+ } \
+ while (0)
+
+int
+main ()
+{
+ a = -1;
+ b = -1;
+ c.i = -1;
+ c.j = -1;
+ c.k = -1;
+ c.l = -1;
+ f1 (1, 264);
+ CHECK (a, 264);
+ f1 (0, 264);
+ CHECK (b, 264);
+ f2 (1, 112);
+ CHECK (c.i, 112);
+ f2 (0, 112);
+ CHECK (c.j, 112);
+ f3 (1, 26);
+ CHECK (c.i, 26);
+ f3 (0, 26);
+ CHECK (a, 26);
+ f4 (1, 107);
+ CHECK (c.i, 107);
+ f4 (0, 107);
+ CHECK (c.k, 107);
+ f5 (1, 95);
+ CHECK (c.l, 95);
+ f5 (0, 95);
+ CHECK (b, 95);
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr37146-2.C b/gcc/testsuite/g++.dg/torture/pr37146-2.C
new file mode 100644
index 00000000000..2a541769492
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr37146-2.C
@@ -0,0 +1,67 @@
+// PR c++/37146
+// { dg-do run }
+
+extern "C" void abort ();
+int a, b;
+struct A { int i:8; int j:8; int k:16; int l:32; } c;
+
+int
+f1 (int x)
+{
+ return x ? a : b;
+}
+
+int
+f2 (int x)
+{
+ return x ? c.i : c.j;
+}
+
+int
+f3 (int x)
+{
+ return x ? c.i : a;
+}
+
+int
+f4 (int x)
+{
+ return x ? c.i : c.k;
+}
+
+int
+f5 (int x)
+{
+ return x ? c.l : b;
+}
+
+int
+main ()
+{
+ a = 17;
+ b = 18;
+ c.i = 19;
+ c.j = 20;
+ c.k = 21;
+ c.l = 22;
+ if (f1 (1) != a)
+ abort ();
+ if (f1 (0) != b)
+ abort ();
+ if (f2 (1) != c.i)
+ abort ();
+ if (f2 (0) != c.j)
+ abort ();
+ if (f3 (1) != c.i)
+ abort ();
+ if (f3 (0) != a)
+ abort ();
+ if (f4 (1) != c.i)
+ abort ();
+ if (f4 (0) != c.k)
+ abort ();
+ if (f5 (1) != c.l)
+ abort ();
+ if (f5 (0) != b)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr35760.c b/gcc/testsuite/gcc.c-torture/compile/pr35760.c
new file mode 100644
index 00000000000..9b972f6b1b7
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr35760.c
@@ -0,0 +1,7 @@
+/* PR target/35760 */
+
+void
+foo (void)
+{
+ __complex__ float i = 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37341.c b/gcc/testsuite/gcc.c-torture/compile/pr37341.c
new file mode 100644
index 00000000000..adbf0c7e484
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37341.c
@@ -0,0 +1,35 @@
+/* PR rtl-optimization/37341 */
+
+short int a;
+int b;
+
+static inline int
+f1 (int x, int y)
+{
+ if (x < 0 || y < 0 || y >= sizeof (int) * 8 || x > (1 >> y))
+ return x;
+}
+
+static inline unsigned int
+f2 (int x, int y)
+{
+ if (y <= 0 && x && y < __INT_MAX__ / x)
+ return x;
+ return x * y;
+}
+
+int
+f3 (void)
+{
+ return (signed char) 0xb6;
+}
+
+unsigned int
+f4 (unsigned int x)
+{
+ while (1)
+ {
+ if ((f2 (f3 (), (f1 (a, b)))) < x)
+ return 1;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
index 097ef5053a8..d50322c9f87 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
@@ -1,5 +1,5 @@
/* Structure layout test generator.
- Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Contributed by Jakub Jelinek <jakub@redhat.com>.
This file is part of GCC.
@@ -42,6 +42,14 @@ along with GCC; see the file COPYING3. If not see
#define COMPAT_PRLL "ll"
#endif
+const char *dg_options[] = {
+"/* { dg-options \"%s-I%s\" } */\n",
+"/* { dg-options \"%s-I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n",
+"/* { dg-options \"%s-I%s -mno-base-addresses\" { target mmix-*-* } } */\n",
+"/* { dg-options \"%s-I%s -mlongcalls -mtext-section-literals\" { target xtensa*-*-* } } */\n"
+#define NDG_OPTIONS (sizeof (dg_options) / sizeof (dg_options[0]))
+};
+
typedef unsigned int hashval_t;
enum TYPE
@@ -747,6 +755,8 @@ switchfiles (int fields)
{
static int filecnt;
static char *destbuf, *destptr;
+ int i;
+
++filecnt;
if (outfile)
fclose (outfile);
@@ -774,11 +784,10 @@ switchfiles (int fields)
fputs ("failed to create test files\n", stderr);
exit (1);
}
+ fprintf (outfile, "/* { dg-require-effective-target int32plus } */\n");
+ for (i = 0; i < NDG_OPTIONS; i++)
+ fprintf (outfile, dg_options[i], "", srcdir_safe);
fprintf (outfile, "\
-/* { dg-require-effective-target int32plus } */\n\
-/* { dg-options \"-I%s\" } */\n\
-/* { dg-options \"-I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n\
-/* { dg-options \"-I%s -mno-base-addresses\" { target mmix-*-* } } */\n\
#include \"struct-layout-1.h\"\n\
\n\
#define TX(n, type, attrs, fields, ops) extern void test##n (void);\n\
@@ -796,33 +805,31 @@ int main (void)\n\
abort ();\n\
}\n\
exit (0);\n\
-}\n", srcdir_safe, srcdir_safe, srcdir_safe, filecnt, filecnt);
+}\n", filecnt, filecnt);
fclose (outfile);
sprintf (destptr, "t%03d_x.c", filecnt);
outfile = fopen (destbuf, "w");
if (outfile == NULL)
goto fail;
+ for (i = 0; i < NDG_OPTIONS; i++)
+ fprintf (outfile, dg_options[i], "-w ", srcdir_safe);
fprintf (outfile, "\
-/* { dg-options \"-w -I%s\" } */\n\
-/* { dg-options \"-w -I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n\
-/* { dg-options \"-w -I%s -mno-base-addresses\" { target mmix-*-* } } */\n\
#include \"struct-layout-1_x1.h\"\n\
#include \"t%03d_test.h\"\n\
#include \"struct-layout-1_x2.h\"\n\
-#include \"t%03d_test.h\"\n", srcdir_safe, srcdir_safe, srcdir_safe, filecnt, filecnt);
+#include \"t%03d_test.h\"\n", filecnt, filecnt);
fclose (outfile);
sprintf (destptr, "t%03d_y.c", filecnt);
outfile = fopen (destbuf, "w");
if (outfile == NULL)
goto fail;
+ for (i = 0; i < NDG_OPTIONS; i++)
+ fprintf (outfile, dg_options[i], "-w ", srcdir_safe);
fprintf (outfile, "\
-/* { dg-options \"-w -I%s\" } */\n\
-/* { dg-options \"-w -I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n\
-/* { dg-options \"-w -I%s -mno-base-addresses\" { target mmix-*-* } } */\n\
#include \"struct-layout-1_y1.h\"\n\
#include \"t%03d_test.h\"\n\
#include \"struct-layout-1_y2.h\"\n\
-#include \"t%03d_test.h\"\n", srcdir_safe, srcdir_safe, srcdir_safe, filecnt, filecnt);
+#include \"t%03d_test.h\"\n", filecnt, filecnt);
fclose (outfile);
sprintf (destptr, "t%03d_test.h", filecnt);
outfile = fopen (destbuf, "w");
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-1.c
new file mode 100644
index 00000000000..5476aac0afd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-1.c
@@ -0,0 +1,32 @@
+/* PR debug/29609 */
+/* Verify that breakpoint on the break is hit. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf-2 -dA" } */
+
+void abort (void);
+
+int
+foo (void)
+{
+ int a, i;
+
+ for (i = 1; i <= 10; i++)
+ {
+ if (i < 3)
+ a = 1;
+ else
+ break;
+ a = 5;
+ }
+ return a;
+}
+
+int
+main (void)
+{
+ if (foo () != 5)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "pr29609-1.c:18" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-2.c
new file mode 100644
index 00000000000..43bc54524a9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-2.c
@@ -0,0 +1,53 @@
+/* PR debug/29609 */
+/* Verify that breakpoint on both goto failure; stmts is hit. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf-2 -dA" } */
+
+extern void abort (void);
+int x;
+
+int
+foo (void)
+{
+ return 0 ^ x;
+}
+
+int
+bar (void)
+{
+ return 1 ^ x;
+}
+
+int
+baz (void)
+{
+ int c;
+
+ if (!foo ())
+ goto failure;
+
+ if (!bar ())
+ goto failure;
+
+ return 0;
+
+failure:
+ return 1;
+}
+
+int
+main (void)
+{
+ if (baz () != 1)
+ abort ();
+ x = 1;
+ if (baz () != 1)
+ abort ();
+ x = 2;
+ if (baz () != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "pr29609-2.c:27" } } */
+/* { dg-final { scan-assembler "pr29609-2.c:30" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-1.c
new file mode 100644
index 00000000000..de90acb81bf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-1.c
@@ -0,0 +1,22 @@
+/* PR debug/36690 */
+/* Verify that break func is hit. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf-2 -dA" } */
+
+int i;
+
+void
+func (void)
+{
+ while (i == 1)
+ i = 0;
+}
+
+int
+main (void)
+{
+ func ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "pr36690-1.c:11" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-2.c
new file mode 100644
index 00000000000..2330f53858e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-2.c
@@ -0,0 +1,39 @@
+/* PR debug/36690 */
+/* Verify that breakpoint can be put on goto f1, it is hit and
+ varz at that spot is defined and contains 5. Nowhere else
+ in the function should be varz in the scope. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf-2 -dA" } */
+
+int cnt;
+
+void
+bar (int i)
+{
+ cnt += i;
+}
+
+void
+foo (int i)
+{
+ if (!i)
+ bar (0);
+ else
+ {
+ static int varz = 5;
+ goto f1;
+ }
+ bar (1);
+f1:
+ bar (2);
+}
+
+int
+main (void)
+{
+ foo (0);
+ foo (1);
+ return 0;
+}
+
+/* { dg-final { scan-assembler "pr36690-2.c:24" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-3.c
new file mode 100644
index 00000000000..234ad1263b2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-3.c
@@ -0,0 +1,53 @@
+/* PR debug/36690 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf-2 -dA" } */
+
+int cnt;
+
+void
+bar (int i)
+{
+ cnt += i;
+}
+
+void
+foo (int i, int j)
+{
+ if (j)
+ {
+ bar (i + 1);
+ goto f1;
+ }
+ bar (i + 2);
+ goto f2;
+f1:
+ if (i > 10)
+ goto f3;
+f2:
+ if (i > 40)
+ goto f4;
+ else
+ goto f5;
+f3:
+ bar (i);
+f4:
+ bar (i);
+f5:
+ bar (i);
+}
+
+int
+main (void)
+{
+ foo (0, 1);
+ foo (11, 1);
+ foo (21, 0);
+ foo (41, 0);
+ return 0;
+}
+
+/* { dg-final { scan-assembler "pr36690-3.c:19" } } */
+/* { dg-final { scan-assembler "pr36690-3.c:22" } } */
+/* { dg-final { scan-assembler "pr36690-3.c:25" } } */
+/* { dg-final { scan-assembler "pr36690-3.c:28" } } */
+/* { dg-final { scan-assembler "pr36690-3.c:30" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr37616.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr37616.c
new file mode 100644
index 00000000000..badff447a8b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr37616.c
@@ -0,0 +1,41 @@
+/* PR debug/37616 */
+/* Test that one can put breakpoints onto continue, exitlab and break
+ and actually see program reaching those breakpoints. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf-2 -dA" } */
+
+extern void abort (void);
+
+int
+foo (int parm)
+{
+ int varj, varm;
+
+ for (varj = 0; varj < 10; varj++)
+ {
+ if (varj == 5)
+ continue;
+ if (varj == 7 && !parm)
+ goto exitlab;
+ if (varj == 9)
+ break;
+ varm = varj;
+ }
+
+exitlab:
+ return varm;
+}
+
+int
+main (void)
+{
+ if (foo (0) != 6)
+ abort ();
+ if (foo (1) != 8)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "pr37616.c:17" } } */
+/* { dg-final { scan-assembler "pr37616.c:19" } } */
+/* { dg-final { scan-assembler "pr37616.c:21" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/pr29609-1.c b/gcc/testsuite/gcc.dg/debug/pr29609-1.c
new file mode 100644
index 00000000000..85069ebd650
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr29609-1.c
@@ -0,0 +1,33 @@
+/* PR debug/29609 */
+/* Verify that breakpoint on the break is hit.
+ This version of the test just checks that it can be compiled, linked
+ and executed, further testing is done in corresponding gcc.dg/dwarf2/
+ test and hopefully in gdb testsuite. */
+/* { dg-do run } */
+/* { dg-options "-O0 -g -dA" } */
+
+extern void abort (void);
+
+int
+foo (void)
+{
+ int a, i;
+
+ for (i = 1; i <= 10; i++)
+ {
+ if (i < 3)
+ a = 1;
+ else
+ break;
+ a = 5;
+ }
+ return a;
+}
+
+int
+main (void)
+{
+ if (foo () != 5)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr29609-2.c b/gcc/testsuite/gcc.dg/debug/pr29609-2.c
new file mode 100644
index 00000000000..1ae1a738d97
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr29609-2.c
@@ -0,0 +1,53 @@
+/* PR debug/29609 */
+/* Verify that breakpoint on both goto failure; stmts is hit.
+ This version of the test just checks that it can be compiled, linked
+ and executed, further testing is done in corresponding gcc.dg/dwarf2/
+ test and hopefully in gdb testsuite. */
+/* { dg-do run } */
+/* { dg-options "-O0 -g -dA" } */
+
+extern void abort (void);
+int x;
+
+int
+foo (void)
+{
+ return 0 ^ x;
+}
+
+int
+bar (void)
+{
+ return 1 ^ x;
+}
+
+int
+baz (void)
+{
+ int c;
+
+ if (!foo ())
+ goto failure;
+
+ if (!bar ())
+ goto failure;
+
+ return 0;
+
+failure:
+ return 1;
+}
+
+int
+main (void)
+{
+ if (baz () != 1)
+ abort ();
+ x = 1;
+ if (baz () != 1)
+ abort ();
+ x = 2;
+ if (baz () != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr36690-1.c b/gcc/testsuite/gcc.dg/debug/pr36690-1.c
new file mode 100644
index 00000000000..e3c913b6bb0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr36690-1.c
@@ -0,0 +1,23 @@
+/* PR debug/36690 */
+/* Verify that break func is hit.
+ This version of the test just checks that it can be compiled, linked
+ and executed, further testing is done in corresponding gcc.dg/dwarf2/
+ test and hopefully in gdb testsuite. */
+/* { dg-do run } */
+/* { dg-options "-O0 -g -dA" } */
+
+int i;
+
+void
+func (void)
+{
+ while (i == 1)
+ i = 0;
+}
+
+int
+main (void)
+{
+ func ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr36690-2.c b/gcc/testsuite/gcc.dg/debug/pr36690-2.c
new file mode 100644
index 00000000000..ddda18cf73c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr36690-2.c
@@ -0,0 +1,40 @@
+/* PR debug/36690 */
+/* Verify that breakpoint can be put on goto f1, it is hit and
+ varz at that spot is defined and contains 5. Nowhere else
+ in the function should be varz in the scope.
+ This version of the test just checks that it can be compiled, linked
+ and executed, further testing is done in corresponding gcc.dg/dwarf2/
+ test and hopefully in gdb testsuite. */
+/* { dg-do run } */
+/* { dg-options "-O0 -g -dA" } */
+
+int cnt;
+
+void
+bar (int i)
+{
+ cnt += i;
+}
+
+void
+foo (int i)
+{
+ if (!i)
+ bar (0);
+ else
+ {
+ static int varz = 5;
+ goto f1;
+ }
+ bar (1);
+f1:
+ bar (2);
+}
+
+int
+main (void)
+{
+ foo (0);
+ foo (1);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr36690-3.c b/gcc/testsuite/gcc.dg/debug/pr36690-3.c
new file mode 100644
index 00000000000..62d3494dacd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr36690-3.c
@@ -0,0 +1,47 @@
+/* PR debug/36690 */
+/* { dg-do run } */
+/* { dg-options "-O0 -g -dA" } */
+
+int cnt;
+
+void
+bar (int i)
+{
+ cnt += i;
+}
+
+void
+foo (int i, int j)
+{
+ if (j)
+ {
+ bar (i + 1);
+ goto f1;
+ }
+ bar (i + 2);
+ goto f2;
+f1:
+ if (i > 10)
+ goto f3;
+f2:
+ if (i > 40)
+ goto f4;
+ else
+ goto f5;
+f3:
+ bar (i);
+f4:
+ bar (i);
+f5:
+ bar (i);
+}
+
+int
+main (void)
+{
+ foo (0, 1);
+ foo (11, 1);
+ foo (21, 0);
+ foo (41, 0);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr37616.c b/gcc/testsuite/gcc.dg/debug/pr37616.c
new file mode 100644
index 00000000000..3bbaebbdf78
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr37616.c
@@ -0,0 +1,40 @@
+/* PR debug/37616 */
+/* Test that one can put breakpoints onto continue, exitlab and break
+ and actually see program reaching those breakpoints.
+ This version of the test just checks that it can be compiled, linked
+ and executed, further testing is done in corresponding gcc.dg/dwarf2/
+ test and hopefully in gdb testsuite. */
+/* { dg-do run } */
+/* { dg-options "-O0 -g -dA" } */
+
+extern void abort (void);
+
+int
+foo (int parm)
+{
+ int varj, varm;
+
+ for (varj = 0; varj < 10; varj++)
+ {
+ if (varj == 5)
+ continue;
+ if (varj == 7 && !parm)
+ goto exitlab;
+ if (varj == 9)
+ break;
+ varm = varj;
+ }
+
+exitlab:
+ return varm;
+}
+
+int
+main (void)
+{
+ if (foo (0) != 6)
+ abort ();
+ if (foo (1) != 8)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/struct-parse-2.c b/gcc/testsuite/gcc.dg/struct-parse-2.c
new file mode 100644
index 00000000000..559411a19cf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/struct-parse-2.c
@@ -0,0 +1,13 @@
+/* PR c/35437 */
+/* { dg-do "compile" } */
+
+struct A
+{
+ int i;
+ struct A a; /* { dg-error "has incomplete type" } */
+};
+
+void foo()
+{
+ struct A b = { 0 };
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr37731-1.c b/gcc/testsuite/gcc.dg/torture/pr37731-1.c
new file mode 100644
index 00000000000..5c156b1f9a6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr37731-1.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+
+extern void abort ();
+
+unsigned long long xh = 1;
+
+int
+main ()
+{
+ unsigned long long yh = 0xffffffffull;
+ unsigned long long z = xh * yh;
+
+ if (z != yh)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr37731-2.c b/gcc/testsuite/gcc.dg/torture/pr37731-2.c
new file mode 100644
index 00000000000..a7f8f1e02e5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr37731-2.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+
+extern void abort ();
+
+long long xh = 1;
+
+int
+main ()
+{
+ long long yh = 0xffffffffll;
+ long long z = xh * yh;
+
+ if (z != yh)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/ggc-pr37574.c b/gcc/testsuite/gcc.dg/vect/ggc-pr37574.c
index b95bfafe1fa..176aa7eafc0 100644
--- a/gcc/testsuite/gcc.dg/vect/ggc-pr37574.c
+++ b/gcc/testsuite/gcc.dg/vect/ggc-pr37574.c
@@ -18,3 +18,5 @@ int main (void) {
return -1;
return 0;
}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c b/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c
index ac8d0ca5c7a..fd01f12181d 100644
--- a/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c
+++ b/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c
@@ -1,5 +1,18 @@
/* { dg-do compile } */
-/* { dg-mips-options "-O2 -march=octeon" } */
+
+/* Force big-endian because for little-endian, combine generates this:
+
+ (if_then_else (ne (zero_extract:DI (subreg:DI (truncate:SI (reg:DI 196)) 0)
+ (const_int 1)
+ (const_int 0))
+ (const_int 0))
+ (label_ref 20)
+ (pc)))
+
+ which does not get recognized as a valid bbit pattern. The
+ middle-end should be able to simplify this further. */
+/* { dg-mips-options "-O2 -march=octeon -meb" } */
+
/* { dg-final { scan-assembler-times "\tbbit\[01\]\t|\tbgez\t" 2 } } */
/* { dg-final { scan-assembler-not "ext\t" } } */
diff --git a/gcc/testsuite/gcc.target/mips/octeon-exts-2.c b/gcc/testsuite/gcc.target/mips/octeon-exts-2.c
index a87c5fb45db..7847cf9411b 100644
--- a/gcc/testsuite/gcc.target/mips/octeon-exts-2.c
+++ b/gcc/testsuite/gcc.target/mips/octeon-exts-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-mips-options "-O -march=octeon" } */
+/* { dg-mips-options "-O -march=octeon -meb" } */
/* { dg-final { scan-assembler-times "\texts\t" 4 } } */
struct bar
diff --git a/gcc/testsuite/gcc.target/mips/octeon-exts-5.c b/gcc/testsuite/gcc.target/mips/octeon-exts-5.c
new file mode 100644
index 00000000000..31251e74763
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/octeon-exts-5.c
@@ -0,0 +1,38 @@
+/* -mel version of octeon-exts-2.c. */
+/* { dg-do compile } */
+/* { dg-mips-options "-O -march=octeon -mel" } */
+/* { dg-final { scan-assembler-times "\texts\t" 4 } } */
+
+struct bar
+{
+ long long d:1;
+ unsigned long long c:48;
+ long long b:14;
+ unsigned long long a:1;
+};
+
+NOMIPS16 int
+f1 (struct bar *s, int a)
+{
+ return (int) s->b + a;
+}
+
+NOMIPS16 char
+f2 (struct bar *s)
+{
+ return s->d + 1;
+}
+
+NOMIPS16 int
+f3 ()
+{
+ struct bar s;
+ asm ("" : "=r"(s));
+ return (int) s.b + 1;
+}
+
+NOMIPS16 long long
+f4 (struct bar *s)
+{
+ return s->d;
+}
diff --git a/gcc/testsuite/gfortran.dg/arithmetic_overflow_1.f90 b/gcc/testsuite/gfortran.dg/arithmetic_overflow_1.f90
new file mode 100644
index 00000000000..b19844f93fd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/arithmetic_overflow_1.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! Fixes PR37787 where the arithmetic overflow was not detected and an ICE ensued.
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+program bug
+ implicit none
+ integer(1) :: a(2) = (/ Z'FF', Z'FF' /) ! { dg-error "Arithmetic overflow" }
+ print*, a
+end program bug
diff --git a/gcc/testsuite/gfortran.dg/convert_2.f90 b/gcc/testsuite/gfortran.dg/convert_2.f90
new file mode 100644
index 00000000000..9f90606885a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/convert_2.f90
@@ -0,0 +1,20 @@
+! { dg-do run }
+! Check for correct ordering of character variables with CONVERT
+
+program main
+ implicit none
+ integer, parameter :: two_swap = 2**25
+ integer(kind=4) i,j
+ character(len=2) :: c,d
+ open(20,file="convert.dat",form="unformatted",convert="swap") ! { dg-warning "CONVERT" }
+ write (20) "ab"
+ close (20)
+ open(20,file="convert.dat",form="unformatted",access="stream")
+ read(20) i,c,j
+ if (i .ne. two_swap .or. j .ne. two_swap .or. c .ne. "ab") call abort
+ close (20)
+ open(20,file="convert.dat",form="unformatted",convert="swap") ! { dg-warning "CONVERT" }
+ read (20) d
+ close (20,status="delete")
+ if (d .ne. "ab") call abort
+end program main
diff --git a/gcc/testsuite/gfortran.dg/debug/pr37738.f b/gcc/testsuite/gfortran.dg/debug/pr37738.f
new file mode 100644
index 00000000000..b0a787b2e52
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/debug/pr37738.f
@@ -0,0 +1,30 @@
+C PR debug/37738
+C { dg-do compile }
+C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "*" } { "-gdwarf-2" } }
+C { dg-options "-dA" }
+
+ subroutine a
+ integer*4 a_i, c_i
+ common /block/a_i, c_i
+ a_i = 1
+ c_i = 4
+ end subroutine a
+ subroutine b
+ integer*4 b_i
+ common /block/b_i, d_i
+ b_i = 2
+ d_i = 5
+ end subroutine b
+ subroutine c
+ integer*4 a_i, c_i
+ common /block/a_i, c_i
+ if (a_i .ne. 2) call abort
+ if (c_i .ne. 5) call abort
+ end subroutine c
+ program abc
+ call a
+ call b
+ call c
+ end program abc
+
+C { dg-final { scan-assembler-times "DIE\[^\n\]*DW_TAG_common_block" 3 } }
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_optional_char_arg_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_optional_char_arg_1.f90
index 5352ee4bf26..3215f43fa40 100644
--- a/gcc/testsuite/gfortran.dg/intrinsic_optional_char_arg_1.f90
+++ b/gcc/testsuite/gfortran.dg/intrinsic_optional_char_arg_1.f90
@@ -29,3 +29,4 @@ END PROGRAM main
! { dg-final { scan-tree-dump "_eoshift\[0-9_\]+char \\(\[&a-zA-Z0-9._, \]+, 1, 0\\)" "original" } }
! { dg-final { scan-tree-dump "_reshape\[0-9_\]+char \\(\[&a-zA-Z0-9._, \]+, 1, 0\\)" "original" } }
! { dg-final { scan-tree-dump "_pack\[0-9_\]+char \\(\[&a-zA-Z0-9._, \]+, 1, 0\\)" "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/module_equivalence_5.f90 b/gcc/testsuite/gfortran.dg/module_equivalence_5.f90
new file mode 100644
index 00000000000..de1d5043d79
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/module_equivalence_5.f90
@@ -0,0 +1,34 @@
+! { dg-do run }
+!
+! Fixes PR37787 where the EQUIVALENCE between QLA1 and QLA2 wasn't recognized
+! in the dependency checking because the compiler was looking in the wrong name
+! space.
+!
+! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com>
+!
+module stuff
+ integer, parameter :: r4_kv = 4
+contains
+
+ SUBROUTINE CF0004
+! COPYRIGHT 1999 SPACKMAN & HENDRICKSON, INC.
+ REAL(R4_KV), dimension (10) :: QLA1, QLA2, QLA3, &
+ QCA = (/(i, i= 1, 10)/)
+ EQUIVALENCE (QLA1, QLA2)
+ QLA1 = QCA
+ QLA3 = QCA
+ QLA3( 2:10:3) = QCA ( 1:5:2) + 1
+ QLA1( 2:10:3) = QLA2( 1:5:2) + 1 !failed because of dependency
+ if (any (qla1 .ne. qla3)) call abort
+ END SUBROUTINE
+end module
+
+program try_cf004
+ use stuff
+ nf1 = 1
+ nf2 = 2
+ call cf0004
+end
+
+! { dg-final { cleanup-modules "stuff" } }
+
diff --git a/gcc/testsuite/gfortran.dg/namelist_54.f90 b/gcc/testsuite/gfortran.dg/namelist_54.f90
new file mode 100644
index 00000000000..25061c48fc5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_54.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+! PR37707 Namelist read of array of derived type incorrect.
+type s
+ integer m
+ integer n
+end type s
+type(s) :: a(3)
+character*80 :: l = ' &namlis a%m=1,2, a%n=5,6, /'
+namelist /namlis/ a
+a%m=[87,88,89]
+a%n=[97,98,99]
+read(l,namlis)
+if (a(1)%m /= 1 .or. a(2)%m /= 2 .or. a(1)%n /= 5 .or. a(2)%n /= 6 .or. &
+ & a(3)%m /= 89 .or. a(3)%n /= 99) call abort
+end
diff --git a/gcc/testsuite/gfortran.dg/restricted_expression_1.f90 b/gcc/testsuite/gfortran.dg/restricted_expression_1.f90
new file mode 100644
index 00000000000..45211a585f4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/restricted_expression_1.f90
@@ -0,0 +1,25 @@
+! { dg-do compile }
+! { dg-options "-pedantic -ffixed-form" }
+
+! PR fortran/35723
+! An argument subscript into a parameter array was not allowed as
+! dimension. Check this is fixed.
+
+! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com>
+
+ call vf0016( 1, 2, 3)
+
+ end
+ SUBROUTINE VF0016(nf1,nf2,nf3)
+ CHARACTER(LEN=9,KIND=1),DIMENSION(3), PARAMETER
+ $ :: TEST_STRINGS =
+ $ (/' HI','ABC ',' CDEFG '/)
+ CHARACTER :: TEST_ARRAY
+ $(LEN_TRIM(ADJUSTL(TEST_STRINGS(nf1))),
+ $ SUM(LEN_TRIM(ADJUSTL(TEST_STRINGS))),
+ $ LEN_TRIM(ADJUSTL(ADJUSTR(TEST_STRINGS(3)))),
+ $ SUM(LEN_TRIM(ADJUSTL(ADJUSTR(TEST_STRINGS(NF1:NF3:NF2))))) )
+
+ print *, 2, 10, 5, 7
+ print *, shape (test_array)
+ end
diff --git a/gcc/testsuite/gfortran.dg/restricted_expression_2.f90 b/gcc/testsuite/gfortran.dg/restricted_expression_2.f90
new file mode 100644
index 00000000000..9c281664a84
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/restricted_expression_2.f90
@@ -0,0 +1,25 @@
+! { dg-do compile }
+! { dg-options "-pedantic -ffixed-form" }
+
+! PR fortran/35723
+! Check that a program using a local variable subscript is still rejected.
+
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+ call vf0016( 1, 2, 3)
+
+ end
+ SUBROUTINE VF0016(nf1,nf2,nf3)
+ CHARACTER(LEN=9,KIND=1),DIMENSION(3), PARAMETER
+ $ :: TEST_STRINGS =
+ $ (/' HI','ABC ',' CDEFG '/)
+ INTEGER :: i = 2
+ CHARACTER :: TEST_ARRAY
+ $(LEN_TRIM(ADJUSTL(TEST_STRINGS(i))), ! { dg-error "'i' cannot appear" }
+ $ SUM(LEN_TRIM(ADJUSTL(TEST_STRINGS))),
+ $ LEN_TRIM(ADJUSTL(ADJUSTR(TEST_STRINGS(3)))),
+ $ SUM(LEN_TRIM(ADJUSTL(ADJUSTR(TEST_STRINGS(NF1:NF3:NF2))))) )
+
+ print *, 2, 10, 5, 7
+ print *, shape (test_array)
+ end
diff --git a/gcc/testsuite/gfortran.dg/restricted_expression_3.f90 b/gcc/testsuite/gfortran.dg/restricted_expression_3.f90
new file mode 100644
index 00000000000..0b84f67aa58
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/restricted_expression_3.f90
@@ -0,0 +1,26 @@
+! { dg-do compile }
+
+! PR fortran/35723
+! Check that a dummy-argument array with non-restricted subscript is
+! rejected and some more reference-checks.
+
+PROGRAM main
+ IMPLICIT NONE
+ CALL test (5, (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), "0123456789" )
+
+CONTAINS
+
+ SUBROUTINE test (n, arr, str)
+ IMPLICIT NONE
+ INTEGER :: n, arr(:)
+ CHARACTER(len=10) :: str
+
+ INTEGER :: i = 5
+ INTEGER :: ok1(arr(n)), ok2(LEN_TRIM (str(3:n)))
+ INTEGER :: ok3(LEN_TRIM("hello, world!"(2:n)))
+ INTEGER :: wrong1(arr(i)) ! { dg-error "'i' cannot appear" }
+ INTEGER :: wrong2(LEN_TRIM (str(i:n))) ! { dg-error "'i' cannot appear" }
+ INTEGER :: wrong3(LEN_TRIM ("hello, world!"(i:n))) ! { dg-error "'i' cannot appear" }
+ END SUBROUTINE test
+
+END PROGRAM main
diff --git a/gcc/testsuite/gfortran.dg/used_before_typed_6.f90 b/gcc/testsuite/gfortran.dg/used_before_typed_6.f90
new file mode 100644
index 00000000000..abcac8cf96d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/used_before_typed_6.f90
@@ -0,0 +1,20 @@
+! { dg-do compile }
+! { dg-options "-std=gnu" }
+
+! Allow legacy code to work even if not only a single symbol is used as
+! expression but a basic arithmetic expression.
+
+SUBROUTINE test (n, m)
+ IMPLICIT NONE
+
+ ! These should go fine.
+ INTEGER :: arr1(n + 1) ! { dg-bogus "used before it is typed" }
+ INTEGER :: arr2(n / (2 * m**5)) ! { dg-bogus "used before it is typed" }
+
+ ! These should fail for obvious reasons.
+ INTEGER :: arr3(n * 1.1) ! { dg-error "must be of INTEGER type" }
+ INTEGER :: arr4(REAL (m)) ! { dg-error "used before it is typed" }
+ INTEGER :: arr5(SIN (m)) ! { dg-error "used before it is typed" }
+
+ INTEGER :: n, m
+END SUBROUTINE test
diff --git a/gcc/testsuite/gfortran.dg/used_types_24.f90 b/gcc/testsuite/gfortran.dg/used_types_24.f90
new file mode 100644
index 00000000000..44d2f5ec199
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/used_types_24.f90
@@ -0,0 +1,33 @@
+! { dg-do compile }
+! Tests the fix for PR37794 a regression where a bit of redundant code caused an ICE.
+!
+! Contributed by Jonathan Hogg <J.Hogg@rl.ac.uk>
+!
+module m1
+ implicit none
+
+ type of01_data_private
+ real :: foo
+ end type of01_data_private
+
+ type of01_data
+ type (of01_data_private) :: private
+ end type of01_data
+end module m1
+
+module m2
+ implicit none
+
+ type of01_data_private
+ integer :: youngest
+ end type of01_data_private
+end module m2
+
+module test_mod
+ use m1, of01_rdata => of01_data
+ use m2, of01_idata => of01_data ! { dg-error "not found in module" }
+
+ implicit none
+end module test_mod
+
+! { dg-final { cleanup-modules "m1 m2 test_mod" } }
diff --git a/gcc/testsuite/gnat.dg/loop_optimization4.adb b/gcc/testsuite/gnat.dg/loop_optimization4.adb
new file mode 100644
index 00000000000..a6799f393e7
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization4.adb
@@ -0,0 +1,9 @@
+-- { dg-do run }
+-- { dg-options "-O2" }
+
+with Loop_Optimization4_Pkg; use Loop_Optimization4_Pkg;
+
+procedure Loop_Optimization4 is
+begin
+ Add ("Nothing");
+end;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization4_pkg.adb b/gcc/testsuite/gnat.dg/loop_optimization4_pkg.adb
new file mode 100644
index 00000000000..ba372f6bddd
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization4_pkg.adb
@@ -0,0 +1,17 @@
+package body Loop_Optimization4_Pkg is
+
+ procedure Add (Phrase : String) is
+ begin
+ if Debug_Buffer_Len = Max_Debug_Buffer_Len then
+ return;
+ end if;
+ for I in Phrase'Range loop
+ Debug_Buffer_Len := Debug_Buffer_Len + 1;
+ Debug_Buffer (Debug_Buffer_Len) := Phrase (I);
+ if Debug_Buffer_Len = Max_Debug_Buffer_Len then
+ exit;
+ end if;
+ end loop;
+ end Add;
+
+end Loop_Optimization4_Pkg;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization4_pkg.ads b/gcc/testsuite/gnat.dg/loop_optimization4_pkg.ads
new file mode 100644
index 00000000000..a07c4e568c6
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization4_pkg.ads
@@ -0,0 +1,9 @@
+package Loop_Optimization4_Pkg is
+
+ Max_Debug_Buffer_Len : Natural := 8 * 1024;
+ Debug_Buffer : String (1 .. Max_Debug_Buffer_Len);
+ Debug_Buffer_Len : Natural range 0 .. Max_Debug_Buffer_Len;
+
+ procedure Add (Phrase : String);
+
+end Loop_Optimization4_Pkg;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization5.adb b/gcc/testsuite/gnat.dg/loop_optimization5.adb
new file mode 100644
index 00000000000..09bf3e216d7
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization5.adb
@@ -0,0 +1,21 @@
+-- { dg-do compile }
+-- { dg-options "-O -gnatp" }
+
+with Loop_Optimization5_Pkg; use Loop_Optimization5_Pkg;
+
+procedure Loop_Optimization5 is
+ Str : constant String := "12345678";
+ Cmd : constant String := Init;
+ StartP : Positive := Cmd'First;
+ StartS : Positive := Cmd'Last + 1;
+ EndP : Natural := StartP - 1;
+ Full_Cmd : String_Access;
+begin
+ for J in StartP .. Cmd'Last - Str'Length + 1 loop
+ if Cmd (J .. J + Str'Length - 1) = Str then
+ EndP := J - 1;
+ exit;
+ end if;
+ end loop;
+ Full_Cmd := Locate (Cmd (StartP .. EndP));
+end;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization5_pkg.ads b/gcc/testsuite/gnat.dg/loop_optimization5_pkg.ads
new file mode 100644
index 00000000000..4af6c1ce693
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization5_pkg.ads
@@ -0,0 +1,7 @@
+package Loop_Optimization5_Pkg is
+
+ type String_Access is access all String;
+ function Init return String;
+ function Locate (S : String) return String_Access;
+
+end Loop_Optimization5_Pkg;
diff --git a/gcc/testsuite/lib/gfortran-dg.exp b/gcc/testsuite/lib/gfortran-dg.exp
index d7b1f2d7824..55d6d400c40 100644
--- a/gcc/testsuite/lib/gfortran-dg.exp
+++ b/gcc/testsuite/lib/gfortran-dg.exp
@@ -133,6 +133,7 @@ proc gfortran-dg-debug-runtest { target_compile trivial opt_opts testcases } {
} {
continue
}
+ remove-build-file "trivial.S"
foreach level {1 "" 3} {
lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"]
foreach opt $opt_opts {
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index e9f315c53a2..28ee8ef40c4 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -658,9 +658,15 @@ make_cond_expr_edges (basic_block bb)
e = make_edge (bb, then_bb, EDGE_TRUE_VALUE);
e->goto_locus = gimple_location (then_stmt);
+ if (e->goto_locus)
+ e->goto_block = gimple_block (then_stmt);
e = make_edge (bb, else_bb, EDGE_FALSE_VALUE);
if (e)
- e->goto_locus = gimple_location (else_stmt);
+ {
+ e->goto_locus = gimple_location (else_stmt);
+ if (e->goto_locus)
+ e->goto_block = gimple_block (else_stmt);
+ }
/* We do not need the labels anymore. */
gimple_cond_set_true_label (entry, NULL_TREE);
@@ -849,6 +855,8 @@ make_goto_expr_edges (basic_block bb)
tree dest = gimple_goto_dest (goto_t);
edge e = make_edge (bb, label_to_block (dest), EDGE_FALLTHRU);
e->goto_locus = gimple_location (goto_t);
+ if (e->goto_locus)
+ e->goto_block = gimple_block (goto_t);
gsi_remove (&last, true);
return;
}
@@ -5743,6 +5751,23 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb,
update_stmt (stmt);
pop_cfun ();
}
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (e->goto_locus)
+ {
+ tree block = e->goto_block;
+ if (d->orig_block == NULL_TREE
+ || block == d->orig_block)
+ e->goto_block = d->new_block;
+#ifdef ENABLE_CHECKING
+ else if (block != d->new_block)
+ {
+ while (block && block != d->orig_block)
+ block = BLOCK_SUPERCONTEXT (block);
+ gcc_assert (block);
+ }
+#endif
+ }
}
/* Examine the statements in BB (which is in SRC_CFUN); find and return
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 859c0c7427d..47315184f9a 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -600,6 +600,8 @@ remove_unused_locals (void)
{
gimple_stmt_iterator gsi;
size_t i;
+ edge_iterator ei;
+ edge e;
/* Walk the statements. */
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
@@ -634,6 +636,10 @@ remove_unused_locals (void)
mark_all_vars_used (&arg, NULL);
}
}
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (e->goto_locus)
+ TREE_USED (e->goto_block) = true;
}
/* Remove unmarked local vars from local_decls. */
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 4639588a162..628d426935c 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -632,7 +632,7 @@ static bool
idx_contains_abnormal_ssa_name_p (tree base, tree *index,
void *data ATTRIBUTE_UNUSED)
{
- if (TREE_CODE (base) == ARRAY_REF)
+ if (TREE_CODE (base) == ARRAY_REF || TREE_CODE (base) == ARRAY_RANGE_REF)
{
if (abnormal_ssa_name_p (TREE_OPERAND (base, 2)))
return false;
@@ -1356,8 +1356,13 @@ idx_find_step (tree base, tree *idx, void *data)
reference out of the loop (in order to take its address in strength
reduction). In order for this to work we need both lower bound
and step to be loop invariants. */
- if (TREE_CODE (base) == ARRAY_REF)
+ if (TREE_CODE (base) == ARRAY_REF || TREE_CODE (base) == ARRAY_RANGE_REF)
{
+ /* Moreover, for a range, the size needs to be invariant as well. */
+ if (TREE_CODE (base) == ARRAY_RANGE_REF
+ && !expr_invariant_in_loop_p (loop, TYPE_SIZE (TREE_TYPE (base))))
+ return false;
+
step = array_ref_element_size (base);
lbound = array_ref_low_bound (base);
@@ -1381,7 +1386,7 @@ idx_find_step (tree base, tree *idx, void *data)
if (integer_zerop (iv->step))
return true;
- if (TREE_CODE (base) == ARRAY_REF)
+ if (TREE_CODE (base) == ARRAY_REF || TREE_CODE (base) == ARRAY_RANGE_REF)
{
step = array_ref_element_size (base);
@@ -1418,7 +1423,7 @@ idx_record_use (tree base, tree *idx,
{
struct ivopts_data *data = (struct ivopts_data *) vdata;
find_interesting_uses_op (data, *idx);
- if (TREE_CODE (base) == ARRAY_REF)
+ if (TREE_CODE (base) == ARRAY_REF || TREE_CODE (base) == ARRAY_RANGE_REF)
{
find_interesting_uses_op (data, array_ref_element_size (base));
find_interesting_uses_op (data, array_ref_low_bound (base));
@@ -1558,7 +1563,7 @@ may_be_nonaddressable_p (tree expr)
non-addressability may be uncovered again, causing ADDR_EXPRs
of inappropriate objects to be built. */
if (is_gimple_reg (TREE_OPERAND (expr, 0))
- || is_gimple_min_invariant (TREE_OPERAND (expr, 0)))
+ || !is_gimple_addressable (TREE_OPERAND (expr, 0)))
return true;
/* ... fall through ... */
@@ -1918,6 +1923,7 @@ strip_offset_1 (tree expr, bool inside_addr, bool top_compref,
return fold_convert (orig_type, expr);
case ARRAY_REF:
+ case ARRAY_RANGE_REF:
if (!inside_addr)
return orig_expr;
@@ -5180,7 +5186,7 @@ idx_remove_ssa_names (tree base, tree *idx,
if (TREE_CODE (*idx) == SSA_NAME)
*idx = SSA_NAME_VAR (*idx);
- if (TREE_CODE (base) == ARRAY_REF)
+ if (TREE_CODE (base) == ARRAY_REF || TREE_CODE (base) == ARRAY_RANGE_REF)
{
op = &TREE_OPERAND (base, 2);
if (*op
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index e9757454f21..798cf161569 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -296,12 +296,29 @@ check_final_bb (void)
{
basic_block bb = gimple_phi_arg_edge (phi, i)->src;
- if ((bb == info.switch_bb
- || (single_pred_p (bb) && single_pred (bb) == info.switch_bb))
- && !is_gimple_ip_invariant (gimple_phi_arg_def (phi, i)))
+ if (bb == info.switch_bb
+ || (single_pred_p (bb) && single_pred (bb) == info.switch_bb))
{
- info.reason = " Non-invariant value from a case\n";
- return false; /* Non-invariant argument. */
+ tree reloc, val;
+
+ val = gimple_phi_arg_def (phi, i);
+ if (!is_gimple_ip_invariant (val))
+ {
+ info.reason = " Non-invariant value from a case\n";
+ return false; /* Non-invariant argument. */
+ }
+ reloc = initializer_constant_valid_p (val, TREE_TYPE (val));
+ if ((flag_pic && reloc != null_pointer_node)
+ || (!flag_pic && reloc == NULL_TREE))
+ {
+ if (reloc)
+ info.reason
+ = " Value from a case would need runtime relocations\n";
+ else
+ info.reason
+ = " Value from a case is not a valid initializer\n";
+ return false;
+ }
}
}
}
diff --git a/gcc/tree.h b/gcc/tree.h
index 44bc3f0f282..a8edda7fb56 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4552,24 +4552,24 @@ extern tree get_inner_reference (tree, HOST_WIDE_INT *, HOST_WIDE_INT *,
tree *, enum machine_mode *, int *, int *,
bool);
-/* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF,
- look for whether EXP or any nested component-refs within EXP is marked
- as PACKED. */
+/* Given an expression EXP that may be a COMPONENT_REF, an ARRAY_REF or an
+ ARRAY_RANGE_REF, look for whether EXP or any nested component-refs within
+ EXP is marked as PACKED. */
extern bool contains_packed_reference (const_tree exp);
/* Return a tree of sizetype representing the size, in bytes, of the element
- of EXP, an ARRAY_REF. */
+ of EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
extern tree array_ref_element_size (tree);
/* Return a tree representing the lower bound of the array mentioned in
- EXP, an ARRAY_REF. */
+ EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
extern tree array_ref_low_bound (tree);
/* Return a tree representing the upper bound of the array mentioned in
- EXP, an ARRAY_REF. */
+ EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
extern tree array_ref_up_bound (tree);
@@ -4864,6 +4864,7 @@ extern tree build_string_literal (int, const char *);
extern bool validate_arglist (const_tree, ...);
extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
extern int get_pointer_alignment (tree, unsigned int);
+extern int get_object_alignment (tree, unsigned int, unsigned int);
extern tree fold_call_stmt (gimple, bool);
extern tree gimple_fold_builtin_snprintf_chk (gimple, tree, enum built_in_function);
diff --git a/gcc/web.c b/gcc/web.c
index d04e8a22890..1f7169fe069 100644
--- a/gcc/web.c
+++ b/gcc/web.c
@@ -60,8 +60,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
-static rtx entry_register (struct web_entry *, struct df_ref *, char *);
-static void replace_ref (struct df_ref *, rtx);
+static rtx entry_register (struct web_entry *, df_ref, char *);
+static void replace_ref (df_ref, rtx);
/* Find the root of unionfind tree (the representative of set). */
@@ -101,15 +101,15 @@ unionfind_union (struct web_entry *first, struct web_entry *second)
FUN is the function that does the union. */
void
-union_defs (struct df_ref *use, struct web_entry *def_entry,
+union_defs (df_ref use, struct web_entry *def_entry,
struct web_entry *use_entry,
bool (*fun) (struct web_entry *, struct web_entry *))
{
struct df_insn_info *insn_info = DF_REF_INSN_INFO (use);
struct df_link *link = DF_REF_CHAIN (use);
- struct df_ref **use_link;
- struct df_ref **eq_use_link;
- struct df_ref **def_link;
+ df_ref *use_link;
+ df_ref *eq_use_link;
+ df_ref *def_link;
rtx set;
if (insn_info)
@@ -178,9 +178,9 @@ union_defs (struct df_ref *use, struct web_entry *def_entry,
/* A READ_WRITE use requires the corresponding def to be in the same
register. Find it and union. */
- if (use->flags & DF_REF_READ_WRITE)
+ if (DF_REF_FLAGS (use) & DF_REF_READ_WRITE)
{
- struct df_ref **link;
+ df_ref *link;
if (insn_info)
link = DF_INSN_INFO_DEFS (insn_info);
@@ -201,7 +201,7 @@ union_defs (struct df_ref *use, struct web_entry *def_entry,
/* Find the corresponding register for the given entry. */
static rtx
-entry_register (struct web_entry *entry, struct df_ref *ref, char *used)
+entry_register (struct web_entry *entry, df_ref ref, char *used)
{
struct web_entry *root;
rtx reg, newreg;
@@ -243,11 +243,11 @@ entry_register (struct web_entry *entry, struct df_ref *ref, char *used)
/* Replace the reference by REG. */
static void
-replace_ref (struct df_ref *ref, rtx reg)
+replace_ref (df_ref ref, rtx reg)
{
rtx oldreg = DF_REF_REAL_REG (ref);
rtx *loc = DF_REF_REAL_LOC (ref);
- unsigned int uid = INSN_UID (DF_REF_INSN (ref));
+ unsigned int uid = DF_REF_INSN_UID (ref);
if (oldreg == reg)
return;
@@ -290,16 +290,16 @@ web_main (void)
unsigned int uid = INSN_UID (insn);
if (INSN_P (insn))
{
- struct df_ref **use_rec;
+ df_ref *use_rec;
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (DF_REF_REGNO (use) >= FIRST_PSEUDO_REGISTER)
DF_REF_ID (use) = uses_num++;
}
for (use_rec = DF_INSN_UID_EQ_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (DF_REF_REGNO (use) >= FIRST_PSEUDO_REGISTER)
DF_REF_ID (use) = uses_num++;
}
@@ -318,16 +318,16 @@ web_main (void)
unsigned int uid = INSN_UID (insn);
if (INSN_P (insn))
{
- struct df_ref **use_rec;
+ df_ref *use_rec;
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (DF_REF_REGNO (use) >= FIRST_PSEUDO_REGISTER)
union_defs (use, def_entry, use_entry, unionfind_union);
}
for (use_rec = DF_INSN_UID_EQ_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (DF_REF_REGNO (use) >= FIRST_PSEUDO_REGISTER)
union_defs (use, def_entry, use_entry, unionfind_union);
}
@@ -342,23 +342,23 @@ web_main (void)
unsigned int uid = INSN_UID (insn);
if (INSN_P (insn))
{
- struct df_ref **use_rec;
- struct df_ref **def_rec;
+ df_ref *use_rec;
+ df_ref *def_rec;
for (use_rec = DF_INSN_UID_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (DF_REF_REGNO (use) >= FIRST_PSEUDO_REGISTER)
replace_ref (use, entry_register (use_entry + DF_REF_ID (use), use, used));
}
for (use_rec = DF_INSN_UID_EQ_USES (uid); *use_rec; use_rec++)
{
- struct df_ref *use = *use_rec;
+ df_ref use = *use_rec;
if (DF_REF_REGNO (use) >= FIRST_PSEUDO_REGISTER)
replace_ref (use, entry_register (use_entry + DF_REF_ID (use), use, used));
}
for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++)
{
- struct df_ref *def = *def_rec;
+ df_ref def = *def_rec;
if (DF_REF_REGNO (def) >= FIRST_PSEUDO_REGISTER)
replace_ref (def, entry_register (def_entry + DF_REF_ID (def), def, used));
}
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 5fc628b6840..1894509429c 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,7 @@
+2008-10-08 Thomas Schwinge <tschwinge@gnu.org>
+
+ * config.host: Fold `*-*-gnu*' cases into the Linux ones.
+
2008-09-03 Hari Sandanagobalane <hariharan@picochip.com>
Add picoChip port.
diff --git a/libgcc/config.host b/libgcc/config.host
index cf33e04de44..a92ffa04455 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -150,12 +150,9 @@ case ${host} in
# machine-specific sections may refine and add to this
# configuration.
;;
-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
- # Must come before *-*-gnu* (because of *-*-linux-gnu* systems).
+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu*)
extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
;;
-*-*-gnu*)
- ;;
*-*-netbsd*)
;;
*-*-openbsd*)
@@ -176,12 +173,10 @@ case ${host} in
then tmake_file=${cpu_type}/t-$rest
fi
;;
-alpha*-*-linux*)
+alpha*-*-linux* | alpha*-*-gnu*)
tmake_file="${tmake_file} alpha/t-crtfm"
extra_parts="$extra_parts crtfastmath.o"
;;
-alpha*-*-gnu*)
- ;;
alpha*-*-freebsd*)
;;
alpha*-*-netbsd*)
@@ -299,7 +294,7 @@ i[34567]86-*-openbsd*)
;;
i[34567]86-*-coff*)
;;
-i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu)
+i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu*)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm"
;;
@@ -307,8 +302,6 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm"
;;
-i[34567]86-*-gnu*)
- ;;
i[34567]86-pc-msdosdjgpp*)
;;
i[34567]86-*-lynxos*)
@@ -576,7 +569,9 @@ m32c-*-elf*)
esac
case ${host} in
-i[34567]86-*-linux* | x86_64-*-linux*)
+i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu)
+ ;;
+i[34567]86-*-linux* | x86_64-*-linux* | i[34567]86-*-gnu*)
tmake_file="${tmake_file} t-tls"
;;
esac
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 1130bdf602c..8332fea3522 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,18 @@
+2008-10-09 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/37753
+ * io/transfer.c (unformatted_read): CONVERT_NATIVE
+ is the usual case. Check for kind==1 for non-byte-reversing
+ operation.
+ (unformatted_write): Likewise.
+
+2008-10-08 Jerry DeLisle <jvdelisle@gcc.gnu.org
+
+ PR libfortran/37707
+ * io/list_read.c (nml_get_obj_data): If the first namelist object rank
+ is greater than zero, call nml_object_read with the first object rather
+ than the sub-object.
+
2008-09-26 Peter O'Gorman <pogma@thewrittenword.com>
Steve Ellcey <sje@cup.hp.com>
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index bcde3e1d49b..76634a3ee25 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -2839,6 +2839,9 @@ get_name:
goto nml_err_ret;
}
+ if (first_nl != NULL && first_nl->var_rank > 0)
+ nl = first_nl;
+
if (nml_read_obj (dtp, nl, 0, pprev_nl, nml_err_msg, nml_err_msg_size,
clow, chigh) == FAILURE)
goto nml_err_ret;
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index cf93a286f98..acc7cbe9b94 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -738,8 +738,8 @@ unformatted_read (st_parameter_dt *dtp, bt type,
{
size_t i, sz;
- if (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE
- || size == 1)
+ if (likely (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE)
+ || kind == 1)
{
sz = size * nelems;
if (type == BT_CHARACTER)
@@ -789,8 +789,8 @@ static void
unformatted_write (st_parameter_dt *dtp, bt type,
void *source, int kind, size_t size, size_t nelems)
{
- if (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE ||
- size == 1)
+ if (likely (dtp->u.p.current_unit->flags.convert == GFC_CONVERT_NATIVE)
+ || kind == 1)
{
size_t stride = type == BT_CHARACTER ?
size * GFC_SIZE_OF_CHAR_KIND(kind) : size;
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index b0c1c203ac5..955e55003dd 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,13 @@
+2008-10-08 David Edelsohn <edelsohn@gnu.org>
+
+ * xstrdup.c: Include <sys/types.h> after "config.h"
+
+2008-10-07 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * configure.ac: Call AC_SYS_LARGEFILE.
+ * config.in: Regenerated.
+ * configure: Likewise.
+
2008-10-06 Jason Merrill <jason@redhat.com>
* cp-demangle.c (struct d_print_info): Add pack_index.
diff --git a/libiberty/config.in b/libiberty/config.in
index 436a58d7e79..9260d560a6e 100644
--- a/libiberty/config.in
+++ b/libiberty/config.in
@@ -425,6 +425,12 @@
first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
diff --git a/libiberty/configure b/libiberty/configure
index 50e9ba3699e..71b6ccd95b5 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -849,6 +849,7 @@ Optional Features:
enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--enable-multilib build many library versions (default)
+ --disable-largefile omit support for large files
--enable-install-libiberty Install headers for end users
Optional Packages:
@@ -2741,6 +2742,371 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+# Check whether --enable-largefile or --disable-largefile was given.
+if test "${enable_largefile+set}" = set; then
+ enableval="$enable_largefile"
+
+fi;
+if test "$enable_largefile" != no; then
+
+ echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_largefile_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_largefile_CC=' -n32'; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ while :; do
+ ac_cv_sys_file_offset_bits=no
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_file_offset_bits=64; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ break
+done
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
+if test "$ac_cv_sys_file_offset_bits" != no; then
+
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+
+fi
+rm -f conftest*
+ echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_large_files+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ while :; do
+ ac_cv_sys_large_files=no
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_large_files=1; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ break
+done
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6
+if test "$ac_cv_sys_large_files" != no; then
+
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+
+fi
+rm -f conftest*
+fi
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2980,7 +3346,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_c_preproc_warn_flag=yes
-
ac_libiberty_warn_cflags=
save_CFLAGS="$CFLAGS"
for option in -W -Wall -Wwrite-strings -Wc++-compat \
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index 419351bbb93..ff0ae6a81e4 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -130,6 +130,7 @@ fi
GCC_NO_EXECUTABLES
AC_PROG_CC
+AC_SYS_LARGEFILE
AC_PROG_CPP_WERROR
ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wc++-compat \
diff --git a/libiberty/xstrdup.c b/libiberty/xstrdup.c
index 9ac2ea038f3..fa12c96a3cd 100644
--- a/libiberty/xstrdup.c
+++ b/libiberty/xstrdup.c
@@ -13,10 +13,10 @@ obtain memory.
*/
-#include <sys/types.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#include <sys/types.h>
#ifdef HAVE_STRING_H
#include <string.h>
#else
diff --git a/libmudflap/ChangeLog b/libmudflap/ChangeLog
index b09f9440d5f..9214759b304 100644
--- a/libmudflap/ChangeLog
+++ b/libmudflap/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/37568
+ * testsuite/libmudflap.c++/pass66-frag.cxx: New test.
+
2008-09-26 Peter O'Gorman <pogma@thewrittenword.com>
Steve Ellcey <sje@cup.hp.com>
diff --git a/libmudflap/testsuite/libmudflap.c++/pass66-frag.cxx b/libmudflap/testsuite/libmudflap.c++/pass66-frag.cxx
new file mode 100644
index 00000000000..989c7ca6f1c
--- /dev/null
+++ b/libmudflap/testsuite/libmudflap.c++/pass66-frag.cxx
@@ -0,0 +1,17 @@
+// PR c++/37568
+// { dg-do compile }
+// { dg-options "-fmudflap -O" }
+
+struct A
+{
+ int i;
+};
+
+A
+foo ()
+{
+ A a = { 1 };
+ return a;
+}
+
+A a = foo ();
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 7ab200becd4..2d969f12795 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,68 @@
+2008-10-10 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/20_util/reference_wrapper/24803.cc: Avoid uninitialized
+ warnings.
+
+2008-10-10 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/std/system_error (native_category): Remove.
+ (posix_category): Add.
+ (error_code::error_code(_ErrorCodeEnum, typename enable_if<>:type*):
+ Fix _M_cat initialization.
+ (error_code::operator=(_ErrorCodeEnum)): Assign _M_cat too.
+ (error_condition::_M_cat, error_condtion::operator=
+ (_ErrorConditionEnum)): Implement resolution of DR 804.
+ (error_condition::error_condition(_ErrorConditionEnum, typename
+ enable_if<>:type*): Fix.
+ (error_condition::clear, error_condition::assign): Implement.
+ (operator==, operator!=): Fix uglification of parameters.
+ (make_error_code, make_error_condition): Define in namespace
+ posix_error.
+ (operator<<(basic_ostream<>&, const error_code&)): Define here.
+ * include/std/ostream (operator<<(basic_ostream<>&,
+ const error_code&)): Do not define here.
+ * testsuite/19_diagnostics/error_condition/cons/1.cc: New.
+ * testsuite/19_diagnostics/error_condition/operators/bool.cc: Likewise.
+ * testsuite/19_diagnostics/error_condition/operators/bool_neg.cc:
+ Likewise.
+ * testsuite/19_diagnostics/error_condition/operators/equal.cc:
+ Likewise.
+ * testsuite/19_diagnostics/error_condition/operators/not_equal.cc:
+ Likewise.
+ * testsuite/19_diagnostics/error_code/cons/1.cc: Tweak.
+ * testsuite/19_diagnostics/error_category/cons/copy_neg.cc: Adjust
+ dg-error line numbers.
+ * testsuite/30_threads/unique_lock/locking/2.cc: Tweak.
+
+ * testsuite/util/testsuite_error.h: Minor tweaks.
+ * testsuite/util/testsuite_hooks.cc: Avoid uninitialized warning.
+
+2008-10-10 Chris Fairles <cfairles@gcc.gnu.org>
+
+ * testsuite/20_util/duration/cons/1.cc: Remove invalid check of
+ uninitialized duration.
+
+2008-10-08 Bob Walters <bob.s.walters@gmail.com>
+
+ * include/bits/stl_vector.h (_Vector_base<>::_Vector_impl::_M_start,
+ _M_finish, _M_end_of_storage, _Vector_base<>::_M_allocate,
+ _M_deallocate): Use _Tp_alloc_type::pointer.
+
+2008-10-07 Jason Merrill <jason@redhat.com>
+
+ PR libstdc++/37761
+ * testsuite/abi/demangle/abi_examples/20.cc: Adjust expected spacing.
+ * testsuite/abi/demangle/abi_text/02.cc: Likewise.
+ * testsuite/abi/demangle/regression/cw-16.cc: Likewise.
+
+2008-10-07 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/stl_iterator.h (operator-(const reverse_iterator<>&,
+ const reverse_iterator<>&), operator-(const __normal_iterator<>&,
+ const __normal_iterator<>&), operator-(const move_iterator<>&,
+ const move_iterator<>&)): Use the auto -> return type syntax,
+ implement DR 685.
+
2008-10-06 Jason Merrill <jason@redhat.com>
* config/abi/pre/gnu.ver: Update char16/32_t manglings.
diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h
index 0d66129fb80..d161e303e30 100644
--- a/libstdc++-v3/include/bits/stl_iterator.h
+++ b/libstdc++-v3/include/bits/stl_iterator.h
@@ -365,9 +365,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return !(__x < __y); }
template<typename _IteratorL, typename _IteratorR>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // DR 685.
+ inline auto
+ operator-(const reverse_iterator<_IteratorL>& __x,
+ const reverse_iterator<_IteratorR>& __y)
+ -> decltype(__y.base() - __x.base())
+#else
inline typename reverse_iterator<_IteratorL>::difference_type
operator-(const reverse_iterator<_IteratorL>& __x,
const reverse_iterator<_IteratorR>& __y)
+#endif
{ return __y.base() - __x.base(); }
//@}
@@ -835,9 +843,17 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// operators but also operator- must accept mixed iterator/const_iterator
// parameters.
template<typename _IteratorL, typename _IteratorR, typename _Container>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // DR 685.
+ inline auto
+ operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+ -> decltype(__lhs.base() - __rhs.base())
+#else
inline typename __normal_iterator<_IteratorL, _Container>::difference_type
operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
+#endif
{ return __lhs.base() - __rhs.base(); }
template<typename _Iterator, typename _Container>
@@ -1001,10 +1017,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const move_iterator<_IteratorR>& __y)
{ return !(__x < __y); }
+ // DR 685.
template<typename _IteratorL, typename _IteratorR>
- inline typename move_iterator<_IteratorL>::difference_type
+ inline auto
operator-(const move_iterator<_IteratorL>& __x,
const move_iterator<_IteratorR>& __y)
+ -> decltype(__x.base() - __y.base())
{ return __x.base() - __y.base(); }
template<typename _Iterator>
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 28222f408f3..37bd21803d4 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -78,9 +78,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
struct _Vector_impl
: public _Tp_alloc_type
{
- _Tp* _M_start;
- _Tp* _M_finish;
- _Tp* _M_end_of_storage;
+ typename _Tp_alloc_type::pointer _M_start;
+ typename _Tp_alloc_type::pointer _M_finish;
+ typename _Tp_alloc_type::pointer _M_end_of_storage;
_Vector_impl()
: _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
@@ -140,12 +140,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
public:
_Vector_impl _M_impl;
- _Tp*
+ typename _Tp_alloc_type::pointer
_M_allocate(size_t __n)
{ return __n != 0 ? _M_impl.allocate(__n) : 0; }
void
- _M_deallocate(_Tp* __p, size_t __n)
+ _M_deallocate(typename _Tp_alloc_type::pointer __p, size_t __n)
{
if (__p)
_M_impl.deallocate(__p, __n);
diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream
index c0120fa2f05..913986ecf49 100644
--- a/libstdc++-v3/include/std/ostream
+++ b/libstdc++-v3/include/std/ostream
@@ -45,10 +45,6 @@
#include <ios>
#include <bits/ostream_insert.h>
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
-# include <system_error>
-#endif
-
_GLIBCXX_BEGIN_NAMESPACE(std)
// [27.6.2.1] Template class basic_ostream
@@ -535,13 +531,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return (__out << reinterpret_cast<const char*>(__s)); }
//@}
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- template<typename _CharT, typename _Traits>
- inline basic_ostream<_CharT, _Traits>&
- operator<<(basic_ostream<_CharT, _Traits>& __out, const error_code& __e)
- { return (__out << __e.category().name() << ':' << __e.value()); }
-#endif
-
// [27.6.2.7] standard basic_ostream manipulators
/**
* @brief Write a newline and flush the stream.
diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error
index b0585810663..6a09ebf5272 100644
--- a/libstdc++-v3/include/std/system_error
+++ b/libstdc++-v3/include/std/system_error
@@ -111,8 +111,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const error_category& get_posix_category();
const error_category& get_system_category();
+ static const error_category& posix_category = get_posix_category();
static const error_category& system_category = get_system_category();
- static const error_category& native_category = get_posix_category();
/// error_code
// Implementation-specific error identification
@@ -127,7 +127,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _ErrorCodeEnum>
error_code(_ErrorCodeEnum __e,
typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value>::type* = 0)
- : _M_value(__e), _M_cat(&system_category)
+ : _M_value(__e), _M_cat(&posix_category)
{ }
void
@@ -144,10 +144,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_cat = &system_category;
}
+ // DR 804.
template<typename _ErrorCodeEnum>
- typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value>::type&
+ typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value,
+ error_code&>::type
operator=(_ErrorCodeEnum __e)
- { _M_value = __e; }
+ {
+ _M_value = __e;
+ _M_cat = &posix_category;
+ return *this;
+ }
int
value() const { return _M_value; }
@@ -172,55 +178,73 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
operator __bool_type() const
{ return _M_value != 0 ? &__not_bool_type : false; }
+ // DR 804.
private:
int _M_value;
const error_category* _M_cat;
};
- error_code
- make_error_code(posix_error::posix_errno);
-
// 19.4.2.5 non-member functions
- bool operator<(const error_code& lhs, const error_code& rhs);
+ inline bool
+ operator<(const error_code& __lhs, const error_code& __rhs)
+ {
+ return (__lhs.category() < __rhs.category()
+ || (__lhs.category() == __rhs.category()
+ && __lhs.value() < __rhs.value()));
+ }
- template<typename charT, typename traits>
- basic_ostream<charT,traits>&
- operator<<(basic_ostream<charT, traits>& os, const error_code& __code);
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
+ { return (__os << __e.category().name() << ':' << __e.value()); }
/// error_condition
// Portable error identification
struct error_condition
{
- error_condition() : _M_value(0), _M_cat(system_category) { }
+ error_condition() : _M_value(0), _M_cat(&posix_category) { }
error_condition(int __v, const error_category& __cat)
- : _M_value(__v), _M_cat(__cat) { }
+ : _M_value(__v), _M_cat(&__cat) { }
- template<typename _ErrorEnum>
- error_condition(typename enable_if<
- is_error_condition_enum<_ErrorEnum>::value,
- _ErrorEnum>::type __v)
- : _M_value(__v), _M_cat(system_category) { }
+ template<typename _ErrorConditionEnum>
+ error_condition(_ErrorConditionEnum __e,
+ typename enable_if<is_error_condition_enum
+ <_ErrorConditionEnum>::value>::type* = 0)
+ : _M_value(__e), _M_cat(&posix_category) { }
- void
- assign(int val, const error_category& cat);
+ void
+ assign(int __v, const error_category& __cat)
+ {
+ _M_value = __v;
+ _M_cat = &__cat;
+ }
- template<typename _ErrorEnum>
- error_condition&
- operator=(typename enable_if<is_error_condition_enum<_ErrorEnum>::value,
- _ErrorEnum>::type __v)
- { _M_value = __v; }
+ // DR 804.
+ template<typename _ErrorConditionEnum>
+ typename enable_if<is_error_condition_enum
+ <_ErrorConditionEnum>::value, error_condition&>::type
+ operator=(_ErrorConditionEnum __e)
+ {
+ _M_value = __e;
+ _M_cat = &posix_category;
+ return *this;
+ }
void
- clear();
+ clear()
+ {
+ _M_value = 0;
+ _M_cat = &posix_category;
+ }
// 19.4.3.4 observers
int
value() const { return _M_value; }
- const error_category&
- category() const { return _M_cat; }
+ const error_category&
+ category() const { return *_M_cat; }
string
message() const
@@ -236,63 +260,75 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
operator __bool_type() const
{ return _M_value != 0 ? &__not_bool_type : false; }
+ // DR 804.
private:
int _M_value;
- const error_category& _M_cat;
+ const error_category* _M_cat;
};
- error_condition
- make_error_condition(posix_error::posix_errno);
-
// 19.4.3.5 non-member functions
inline bool
- operator<(const error_condition& lhs, const error_condition& rhs)
- {
- bool __t1 = lhs.category() < rhs.category();
- bool __t2 = lhs.category() == rhs.category() && lhs.value() < rhs.value();
- return __t1 || __t2;
+ operator<(const error_condition& __lhs, const error_condition& __rhs)
+ {
+ return (__lhs.category() < __rhs.category()
+ || (__lhs.category() == __rhs.category()
+ && __lhs.value() < __rhs.value()));
+ }
+
+ namespace posix_error
+ {
+ inline error_code
+ make_error_code(posix_errno __e)
+ { return error_code(__e, posix_category); }
+
+ inline error_condition
+ make_error_condition(posix_errno __e)
+ { return error_condition(__e, posix_category); }
}
// 19.4.4 Comparison operators
- inline bool
- operator==(const error_code& lhs, const error_code& rhs)
- { return lhs.category() == rhs.category() && lhs.value() == rhs.value(); }
+ inline bool
+ operator==(const error_code& __lhs, const error_code& __rhs)
+ { return (__lhs.category() == __rhs.category()
+ && __lhs.value() == __rhs.value()); }
- inline bool
- operator==(const error_code& lhs, const error_condition& rhs)
+ inline bool
+ operator==(const error_code& __lhs, const error_condition& __rhs)
{
- bool __t1 = lhs.category().equivalent(lhs.value(), rhs);
- bool __t2 = rhs.category().equivalent(lhs, rhs.value());
- return __t1 || __t2;
+ return (__lhs.category().equivalent(__lhs.value(), __rhs)
+ || __rhs.category().equivalent(__lhs, __rhs.value()));
}
- inline bool
- operator==(const error_condition& lhs, const error_code& rhs)
+ inline bool
+ operator==(const error_condition& __lhs, const error_code& __rhs)
{
- bool __t1 = rhs.category().equivalent(rhs.value(), lhs);
- bool __t2 = lhs.category().equivalent(rhs, lhs.value());
- return __t1 || __t2;
+ return (__rhs.category().equivalent(__rhs.value(), __lhs)
+ || __lhs.category().equivalent(__rhs, __lhs.value()));
}
- inline bool
- operator==(const error_condition& lhs, const error_condition& rhs)
- { return lhs.category() == rhs.category() && lhs.value() == rhs.value(); }
+ inline bool
+ operator==(const error_condition& __lhs, const error_condition& __rhs)
+ {
+ return (__lhs.category() == __rhs.category()
+ && __lhs.value() == __rhs.value());
+ }
- inline bool
- operator!=(const error_code& lhs, const error_code& rhs)
- { return !(lhs == rhs); }
+ inline bool
+ operator!=(const error_code& __lhs, const error_code& __rhs)
+ { return !(__lhs == __rhs); }
- inline bool
- operator!=(const error_code& lhs, const error_condition& rhs)
- { return !(lhs == rhs); }
+ inline bool
+ operator!=(const error_code& __lhs, const error_condition& __rhs)
+ { return !(__lhs == __rhs); }
- inline bool
- operator!=(const error_condition& lhs, const error_code& rhs)
- { return !(lhs == rhs); }
+ inline bool
+ operator!=(const error_condition& __lhs, const error_code& __rhs)
+ { return !(__lhs == __rhs); }
+
+ inline bool
+ operator!=(const error_condition& __lhs, const error_condition& __rhs)
+ { return !(__lhs == __rhs); }
- inline bool
- operator!=(const error_condition& lhs, const error_condition& rhs)
- { return !(lhs == rhs); }
/// Thrown to indicate error code of underlying system.
class system_error : public std::runtime_error
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc b/libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc
index b7635fee4c0..e73884cc35f 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc
@@ -34,6 +34,6 @@ int main()
}
// { dg-error "is private" "" { target *-*-* } 105 }
-// { dg-error "within this context" "" { target *-*-* } 41 }
+// { dg-error "within this context" "" { target *-*-* } 40 }
// { dg-error "first required here" "" { target *-*-* } 31 }
// { dg-excess-errors "copy constructor" }
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/1.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/1.cc
index 8ba68d645e1..9dc11b70a08 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/1.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/cons/1.cc
@@ -40,7 +40,7 @@ int main()
// 3
std::error_code e3(std::posix_error::operation_not_supported);
VERIFY( e3.value() == int(std::posix_error::operation_not_supported) );
- VERIFY( e3.category() == std::system_category );
+ VERIFY( e3.category() == std::posix_category );
return 0;
}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_condition/cons/1.cc b/libstdc++-v3/testsuite/19_diagnostics/error_condition/cons/1.cc
new file mode 100644
index 00000000000..572d2449546
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_condition/cons/1.cc
@@ -0,0 +1,49 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <system_error>
+#include <testsuite_error.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ // 1
+ std::error_condition e1;
+ VERIFY( e1.value() == 0 );
+ VERIFY( e1.category() == std::posix_category );
+
+ // 2
+ const __gnu_test::test_category cat;
+ std::error_condition e2(e1.value(), cat);
+ VERIFY( e2.value() == e1.value() );
+ VERIFY( e2.category() == cat );
+
+ // 3
+ std::error_condition e3(std::posix_error::operation_not_supported);
+ VERIFY( e3.value() == int(std::posix_error::operation_not_supported) );
+ VERIFY( e3.category() == std::posix_category );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool.cc b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool.cc
new file mode 100644
index 00000000000..c1cda2626d4
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool.cc
@@ -0,0 +1,48 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <system_error>
+#include <testsuite_hooks.h>
+
+// unspecified bool operator positive tests
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ // 1
+ std::error_condition e1;
+ if (e1)
+ {
+ VERIFY( false );
+ }
+
+ // 2
+ std::error_condition e2(std::posix_error::operation_not_supported);
+ if (e2)
+ {
+ VERIFY( true );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool_neg.cc b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool_neg.cc
new file mode 100644
index 00000000000..cad5f419480
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool_neg.cc
@@ -0,0 +1,33 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <system_error>
+#include <testsuite_hooks.h>
+
+int test01()
+{
+ std::error_condition e;
+ int i = e;
+
+ return i;
+}
+
+// { dg-error "invalid conversion" "" { target *-*-* } 28 }
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/equal.cc b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/equal.cc
new file mode 100644
index 00000000000..4bdf36190a9
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/equal.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <system_error>
+#include <testsuite_error.h>
+
+// unspecified bool operator positive tests
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::error_condition e1;
+ std::error_condition e2(std::posix_error::operation_not_supported);
+
+ VERIFY( e1 == e1 );
+ VERIFY( !(e1 == e2) );
+
+ const __gnu_test::test_category cat;
+ std::error_condition e3(e2.value(), cat);
+ VERIFY( !(e2 == e3) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/not_equal.cc b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/not_equal.cc
new file mode 100644
index 00000000000..1b78b0af029
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/not_equal.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <system_error>
+#include <testsuite_error.h>
+
+// unspecified bool operator positive tests
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::error_condition e1;
+ std::error_condition e2(std::posix_error::operation_not_supported);
+
+ VERIFY( !(e1 != e1) );
+ VERIFY( e1 != e2 );
+
+ const __gnu_test::test_category cat;
+ std::error_condition e3(e2.value(), cat);
+ VERIFY( e2 != e3 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/duration/cons/1.cc b/libstdc++-v3/testsuite/20_util/duration/cons/1.cc
index 6d12dbb5bd7..0ada4662889 100644
--- a/libstdc++-v3/testsuite/20_util/duration/cons/1.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/cons/1.cc
@@ -110,9 +110,6 @@ test01()
bool test __attribute__((unused)) = true;
using std::chrono::duration;
- duration<int> d0;
- VERIFY(d0.count() == static_cast<duration<int>::rep>(0));
-
int r = 3;
duration<int> d1(r);
VERIFY(d1.count() == static_cast<duration<int>::rep>(r));
diff --git a/libstdc++-v3/testsuite/20_util/reference_wrapper/24803.cc b/libstdc++-v3/testsuite/20_util/reference_wrapper/24803.cc
index eb3d9975a9c..d948235409b 100644
--- a/libstdc++-v3/testsuite/20_util/reference_wrapper/24803.cc
+++ b/libstdc++-v3/testsuite/20_util/reference_wrapper/24803.cc
@@ -59,29 +59,29 @@ void test01()
const test_type* null_ttc = 0;
int zero;
- std::reference_wrapper<double (int)>* pr1;
+ std::reference_wrapper<double (int)>* pr1(0);
verify_return_type((*pr1)(0), double());
- std::reference_wrapper<double (*)(int)>* pr2;
+ std::reference_wrapper<double (*)(int)>* pr2(0);
verify_return_type((*pr2)(0), double());
- std::reference_wrapper<int (test_type::*)()>* pr3;
+ std::reference_wrapper<int (test_type::*)()>* pr3(0);
verify_return_type((*pr3)(null_tt), int());
- std::reference_wrapper<int (test_type::*)()const>* pr4;
+ std::reference_wrapper<int (test_type::*)()const>* pr4(0);
verify_return_type((*pr4)(null_ttc), int());
- std::reference_wrapper<functor1>* pr5;
+ std::reference_wrapper<functor1>* pr5(0);
// libstdc++/24803
// FIXME: verify_return_type((*pr5)(0), double());
verify_return_type((*pr5)(zero), double());
- std::reference_wrapper<double (int, char)>* pr1b;
+ std::reference_wrapper<double (int, char)>* pr1b(0);
verify_return_type((*pr1b)(0,0), double());
- std::reference_wrapper<double (*)(int, char)>* pr2b;
+ std::reference_wrapper<double (*)(int, char)>* pr2b(0);
verify_return_type((*pr2b)(0,0), double());
- std::reference_wrapper<int (test_type::*)(char)>* pr3b;
+ std::reference_wrapper<int (test_type::*)(char)>* pr3b(0);
verify_return_type((*pr3b)(null_tt,zero), int());
- std::reference_wrapper<int (test_type::*)()const>* pr4b;
+ std::reference_wrapper<int (test_type::*)()const>* pr4b(0);
verify_return_type((*pr4b)(null_ttc), int());
- std::reference_wrapper<functor2>* pr5b;
+ std::reference_wrapper<functor2>* pr5b(0);
// libstdc++/24803
// FIXME: verify_return_type((*pr5b)(0,0), double());
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc
index 96ab25e9999..2a3aa17c5e8 100644
--- a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc
+++ b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc
@@ -51,9 +51,10 @@ void test01()
{
l.lock();
}
- catch (std::system_error const& ex)
+ catch (const std::system_error& ex)
{
- VERIFY( ex.code() == std::posix_error::operation_not_permitted );
+ VERIFY( ex.code() == std::error_code(
+ std::posix_error::operation_not_permitted) );
}
catch (...)
{
@@ -89,7 +90,8 @@ void test02()
}
catch (const std::system_error& ex)
{
- VERIFY( ex.code() == std::posix_error::resource_deadlock_would_occur );
+ VERIFY( ex.code() == std::error_code(
+ std::posix_error::resource_deadlock_would_occur) );
}
catch (...)
{
diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/20.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/20.cc
index eaa5db0430f..1bef745b197 100644
--- a/libstdc++-v3/testsuite/abi/demangle/abi_examples/20.cc
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/20.cc
@@ -29,7 +29,7 @@ int main()
using namespace __gnu_test;
verify_demangle("_ZngILi42EEvN1AIXplT_Li2EEE1TE",
- "void operator-<42>(A<(42) + (2)>::T)");
+ "void operator-<42>(A<(42)+(2)>::T)");
return 0;
}
diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/02.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/02.cc
index 28a617aef7d..9a41fe55c20 100644
--- a/libstdc++-v3/testsuite/abi/demangle/abi_text/02.cc
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/02.cc
@@ -33,7 +33,7 @@ int main()
// Equivalent, but formatting difference in void argument and parentheses.
// icc, __cxa_demangle
verify_demangle("_Z3fooILi2EEvRAplT_Li1E_i",
- "void foo<2>(int (&) [(2) + (1)])");
+ "void foo<2>(int (&) [(2)+(1)])");
// cplus-dem
// verify_demangle("_Z3fooILi2EEvRAplT_Li1E_i",
// "void foo<(int)2>(int (&) [((int)2)+((int)1)])");
diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/cw-16.cc b/libstdc++-v3/testsuite/abi/demangle/regression/cw-16.cc
index 0c8c29f28af..0db740e991a 100644
--- a/libstdc++-v3/testsuite/abi/demangle/regression/cw-16.cc
+++ b/libstdc++-v3/testsuite/abi/demangle/regression/cw-16.cc
@@ -32,9 +32,9 @@ verify_demangle("_Z3fooIA6_KiEvA9_KT_rVPrS4_",
"void foo<int const [6]>(int const [9][6], int restrict const (* volatile restrict) [9][6])");
// 2003/11/12, libstdc++/12947
verify_demangle("_Z1fILi5E1AEvN1CIXqugtT_Li0ELi1ELi2EEE1qE",
- "void f<5, A>(C<(((5) > (0))) ? (1) : (2)>::q)");
+ "void f<5, A>(C<(((5)>(0)))?(1) : (2)>::q)");
verify_demangle("_Z1fILi5EEvN1AIXcvimlT_Li22EEE1qE",
- "void f<5>(A<(int)((5) * (22))>::q)");
+ "void f<5>(A<(int)((5)*(22))>::q)");
verify_demangle("_Z1fPFYPFiiEiE",
"f(int (*(*)(int))(int))");
verify_demangle("_Z1fI1XENT_1tES2_",
@@ -43,9 +43,9 @@ verify_demangle("_Z1fILi5E1AEvN1CIXstN1T1tEEXszsrS2_1tEE1qE",
"void f<5, A>(C<sizeof (T::t), sizeof (T::t)>::q)");
// 2003/12/03, libstdc++/13045
verify_demangle("_Z1fILi1ELc120EEv1AIXplT_cviLd4028ae147ae147aeEEE",
- "void f<1, (char)120>(A<(1) + ((int)((double)[4028ae147ae147ae]))>)");
+ "void f<1, (char)120>(A<(1)+((int)((double)[4028ae147ae147ae]))>)");
verify_demangle("_Z1fILi1ELc120EEv1AIXplT_cviLf3f800000EEE",
- "void f<1, (char)120>(A<(1) + ((int)((float)[3f800000]))>)");
+ "void f<1, (char)120>(A<(1)+((int)((float)[3f800000]))>)");
verify_demangle("_Z9hairyfuncM1YKFPVPFrPA2_PM1XKFKPA3_ilEPcEiE",
"hairyfunc(int (* const (X::** (* restrict (* volatile* (Y::*)(int) const)(char*)) [2])(long) const) [3])");
diff --git a/libstdc++-v3/testsuite/util/testsuite_error.h b/libstdc++-v3/testsuite/util/testsuite_error.h
index 56d641874b1..31f52e6e1f8 100644
--- a/libstdc++-v3/testsuite/util/testsuite_error.h
+++ b/libstdc++-v3/testsuite/util/testsuite_error.h
@@ -28,6 +28,7 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
+#include <string>
#include <testsuite_hooks.h>
#ifndef _TESTSUITE_ERROR_H
@@ -35,8 +36,6 @@
namespace __gnu_test
{
- using std::string;
-
struct test_category : public std::error_category
{
virtual const char*
@@ -46,10 +45,9 @@ namespace __gnu_test
return s;
}
- virtual string
+ virtual std::string
message(int) const
- { return string("message to be determined"); }
-
+ { return std::string("message to be determined"); }
};
struct test_derived_category : public test_category
diff --git a/libstdc++-v3/testsuite/util/testsuite_hooks.cc b/libstdc++-v3/testsuite/util/testsuite_hooks.cc
index 35ac5b2836f..c64dc1b8067 100644
--- a/libstdc++-v3/testsuite/util/testsuite_hooks.cc
+++ b/libstdc++-v3/testsuite/util/testsuite_hooks.cc
@@ -2,7 +2,7 @@
// Utility subroutines for the C++ library testsuite.
//
-// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -283,6 +283,7 @@ namespace __gnu_test
{
#ifdef _GLIBCXX_SYSV_SEM
union semun val;
+ val.val = 0; // Avoid uninitialized variable warning.
// Destroy the semaphore set only in the process that created it.
if (pid_ == getpid())
semctl(sem_set_, 0, IPC_RMID, val);