summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gcc.gnu.org>2016-11-22 17:36:18 +0100
committerAndre Vehreschild <vehre@gcc.gnu.org>2016-11-22 17:36:18 +0100
commit8e9fe41dfe28aed4147c9c71279f05c21b9b0b01 (patch)
tree3674e01f9c752bf7c76a51f125a3ea5a63c72469
parent68df2450ccd3d1688a8ede20c8db289a65761d06 (diff)
parentd950aa5141f87bb7da38fe77f4f50e03eebc374f (diff)
downloadgcc-8e9fe41dfe28aed4147c9c71279f05c21b9b0b01.tar.gz
Merge branch 'trunk' into vehre/coarray
-rw-r--r--fixincludes/ChangeLog7
-rw-r--r--fixincludes/fixincl.x63
-rw-r--r--fixincludes/inclhack.def19
-rw-r--r--fixincludes/tests/base/math.h6
-rw-r--r--gcc/ChangeLog179
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/builtin-types.def12
-rw-r--r--gcc/builtins.def6
-rw-r--r--gcc/c-family/ChangeLog11
-rw-r--r--gcc/c-family/c-common.c10
-rw-r--r--gcc/c-family/c.opt6
-rw-r--r--gcc/c/ChangeLog10
-rw-r--r--gcc/c/c-decl.c3
-rw-r--r--gcc/config.gcc17
-rw-r--r--gcc/config/arm/arm.c7
-rw-r--r--gcc/config/arm/arm.opt4
-rw-r--r--gcc/config/arm/t-rmprofile174
-rw-r--r--gcc/config/arm/vfp.md4
-rw-r--r--gcc/config/avr/avr-c.c8
-rw-r--r--gcc/config/avr/avr.c163
-rw-r--r--gcc/config/cris/cris.md3
-rw-r--r--gcc/config/m68k/m68k.md21
-rw-r--r--gcc/config/m68k/predicates.md3
-rw-r--r--gcc/config/rs6000/rs6000.md58
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/decl.c41
-rw-r--r--gcc/doc/install.texi60
-rw-r--r--gcc/doc/invoke.texi50
-rw-r--r--gcc/expmed.c54
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/class.c2
-rw-r--r--gcc/gimple-ssa-store-merging.c49
-rw-r--r--gcc/input.c9
-rw-r--r--gcc/ipa-icf.c64
-rw-r--r--gcc/ipa-icf.h17
-rw-r--r--gcc/lto/ChangeLog9
-rw-r--r--gcc/lto/lto-lang.c4
-rw-r--r--gcc/omp-simd-clone.c5
-rw-r--r--gcc/shrink-wrap.c6
-rw-r--r--gcc/testsuite/ChangeLog143
-rw-r--r--gcc/testsuite/c-c++-common/builtin-shuffle-1.c2
-rw-r--r--gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C3
-rw-r--r--gcc/testsuite/g++.dg/lto/pr68811_0.C2
-rw-r--r--gcc/testsuite/g++.dg/pr71973-1.C14
-rw-r--r--gcc/testsuite/g++.dg/pr71973-2.C18
-rw-r--r--gcc/testsuite/g++.dg/pr71973-3.C14
-rw-r--r--gcc/testsuite/g++.dg/torture/pr53321.C2
-rw-r--r--gcc/testsuite/g++.dg/torture/pr63512.C2
-rw-r--r--gcc/testsuite/g++.dg/vect/simd-clone-7.cc10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p700.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins10.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/realloc.C1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr68538.c52
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr78439.c56
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr30778.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr78436.c23
-rw-r--r--gcc/testsuite/gcc.dg/loop-split.c1
-rw-r--r--gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c16
-rw-r--r--gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-3.c43
-rw-r--r--gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-4.c43
-rw-r--r--gcc/testsuite/gcc.dg/plugin/plugin.exp4
-rw-r--r--gcc/testsuite/gcc.dg/pr78445.c19
-rw-r--r--gcc/testsuite/gcc.dg/stack-layout-dynamic-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr78416.c17
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-1.c29
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c80
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr78413.c35
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/tailcall-7.c89
-rw-r--r--gcc/testsuite/gcc.target/arm/empty_fiq_handler.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/pr53447-5.c7
-rw-r--r--gcc/testsuite/gcc.target/arm/pr77904.c45
-rw-r--r--gcc/testsuite/gcc.target/m68k/pr25128.c48
-rw-r--r--gcc/testsuite/gcc.target/mips/interrupt_handler-bug-1.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppc-round2.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr71785.c52
-rw-r--r--gcc/testsuite/gfortran.dg/ieee/ieee_8.f903
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_proc_35.f9088
-rw-r--r--gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f14
-rw-r--r--gcc/testsuite/lib/target-supports.exp6
-rw-r--r--gcc/tree-core.h1
-rw-r--r--gcc/tree-if-conv.c29
-rw-r--r--gcc/tree-ssa-loop-prefetch.c4
-rw-r--r--gcc/tree-tailcall.c28
-rw-r--r--gcc/tree.c2
-rw-r--r--gcc/tree.h2
-rw-r--r--libstdc++-v3/ChangeLog71
-rw-r--r--libstdc++-v3/acinclude.m479
-rw-r--r--libstdc++-v3/config.h.in9
-rwxr-xr-xlibstdc++-v3/configure84
-rw-r--r--libstdc++-v3/include/c_global/cmath184
-rw-r--r--libstdc++-v3/include/tr1/cmath72
-rw-r--r--libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc67
92 files changed, 2287 insertions, 523 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index fef9f9fdc6f..d447171a8da 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,10 @@
+2016-11-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * inclhack.def (solaris_math_12): New fix.
+ (hpux11_fabsf): Replace bypass by *-hp-hpux11* mach selector.
+ * fixincl.x: Regenerate.
+ * tests/base/math.h [SOLARIS_MATH_12_CHECK]: New test.
+
2016-11-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR sanitizer/78267
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 00d03be8ffe..b0eeef9dfdf 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed November 20, 2016 at 11:44:36 AM by AutoGen 5.16.2
+ * It has been AutoGen-ed November 20, 2016 at 12:02:46 PM by AutoGen 5.16.2
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Nov 20 11:44:37 MET 2016
+/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Nov 20 12:02:47 MET 2016
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 241 fixup descriptions.
+ * This file contains 242 fixup descriptions.
*
* See README for more information.
*
@@ -4507,7 +4507,9 @@ tSCC zHpux11_FabsfList[] =
/*
* Machine/OS name selection pattern
*/
-#define apzHpux11_FabsfMachs (const char**)NULL
+tSCC* apzHpux11_FabsfMachs[] = {
+ "*-hp-hpux11*",
+ (const char*)NULL };
/*
* content selection pattern - do fix if pattern found
@@ -4515,15 +4517,8 @@ tSCC zHpux11_FabsfList[] =
tSCC zHpux11_FabsfSelect0[] =
"^[ \t]*#[ \t]*define[ \t]+fabsf\\(.*";
-/*
- * content bypass pattern - skip fix if pattern found
- */
-tSCC zHpux11_FabsfBypass0[] =
- "__cplusplus";
-
-#define HPUX11_FABSF_TEST_CT 2
+#define HPUX11_FABSF_TEST_CT 1
static tTestDesc aHpux11_FabsfTests[] = {
- { TT_NEGREP, zHpux11_FabsfBypass0, (regex_t*)NULL },
{ TT_EGREP, zHpux11_FabsfSelect0, (regex_t*)NULL }, };
/*
@@ -7583,6 +7578,42 @@ static const char* apzSolaris_Math_11Patch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Solaris_Math_12 fix
+ */
+tSCC zSolaris_Math_12Name[] =
+ "solaris_math_12";
+
+/*
+ * File name selection pattern
+ */
+tSCC zSolaris_Math_12List[] =
+ "math.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzSolaris_Math_12Machs[] = {
+ "*-*-solaris2*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Math_12Select0[] =
+ "#undef.*_GLIBCXX_USE_C99_MATH";
+
+#define SOLARIS_MATH_12_TEST_CT 1
+static tTestDesc aSolaris_Math_12Tests[] = {
+ { TT_EGREP, zSolaris_Math_12Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Solaris_Math_12
+ */
+static const char* apzSolaris_Math_12Patch[] = { sed_cmd_z,
+ "-e", "/#undef[ \t]*_GLIBCXX_USE_C99_MATH/d",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Solaris_Once_Init_1 fix
*/
tSCC zSolaris_Once_Init_1Name[] =
@@ -9879,7 +9910,7 @@ static const char* apzX11_SprintfPatch[] = {
*/
#define REGEX_COUNT 279
#define MACH_LIST_SIZE_LIMIT 187
-#define FIX_COUNT 241
+#define FIX_COUNT 242
/*
* Enumerate the fixes
@@ -10068,6 +10099,7 @@ typedef enum {
SOLARIS_MATH_8_FIXIDX,
SOLARIS_MATH_9_FIXIDX,
SOLARIS_MATH_11_FIXIDX,
+ SOLARIS_MATH_12_FIXIDX,
SOLARIS_ONCE_INIT_1_FIXIDX,
SOLARIS_POSIX_SPAWN_RESTRICT_FIXIDX,
SOLARIS_POW_INT_OVERLOAD_FIXIDX,
@@ -11044,6 +11076,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
SOLARIS_MATH_11_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSolaris_Math_11Tests, apzSolaris_Math_11Patch, 0 },
+ { zSolaris_Math_12Name, zSolaris_Math_12List,
+ apzSolaris_Math_12Machs,
+ SOLARIS_MATH_12_TEST_CT, FD_MACH_ONLY,
+ aSolaris_Math_12Tests, apzSolaris_Math_12Patch, 0 },
+
{ zSolaris_Once_Init_1Name, zSolaris_Once_Init_1List,
apzSolaris_Once_Init_1Machs,
SOLARIS_ONCE_INIT_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 931161b69ce..240fc7437e6 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -2334,9 +2334,9 @@ fix = {
*/
fix = {
hackname = hpux11_fabsf;
+ mach = "*-hp-hpux11*";
files = math.h;
select = "^[ \t]*#[ \t]*define[ \t]+fabsf\\(.*";
- bypass = "__cplusplus";
c_fix = format;
c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
@@ -3868,6 +3868,23 @@ _EOText_;
};
/*
+ * Some versions of Solaris 10+ <math.h> #undef libstdc++-internal macros.
+ */
+fix = {
+ hackname = solaris_math_12;
+ files = math.h;
+ mach = '*-*-solaris2*';
+ select = '#undef.*_GLIBCXX_USE_C99_MATH';
+ sed = "/#undef[ \t]*_GLIBCXX_USE_C99_MATH/d";
+ test_text = << _EOText_
+#if __cplusplus >= 201103L
+#undef _GLIBCXX_USE_C99_MATH
+#undef _GLIBCXX_USE_C99_MATH_TR1
+#endif
+_EOText_;
+};
+
+/*
* Sun Solaris defines PTHREAD_ONCE_INIT as an array containing a
* structure. As such, it need two levels of brackets, but only
* contains one. Wrap the macro definition in an extra layer.
diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h
index 766017280b5..c7da15ad2c7 100644
--- a/fixincludes/tests/base/math.h
+++ b/fixincludes/tests/base/math.h
@@ -85,6 +85,12 @@ extern int class();
#endif /* RS6000_DOUBLE_CHECK */
+#if defined( SOLARIS_MATH_12_CHECK )
+#if __cplusplus >= 201103L
+#endif
+#endif /* SOLARIS_MATH_12_CHECK */
+
+
#if defined( STRICT_ANSI_NOT_CTD_CHECK )
#if 1 && \
&& defined(mumbling) |& ( !defined(__STRICT_ANSI__)) \
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bcad2c5ff54..ceb9a338dd4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,182 @@
+2016-11-22 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ * config.gcc: Allow new rmprofile value for configure option
+ --with-multilib-list.
+ * config/arm/t-rmprofile: New file.
+ * doc/install.texi (--with-multilib-list): Document new rmprofile value
+ for ARM.
+
+2016-11-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/78439
+ * config/arm/vfp.md (*movdi_vfp_cortexa8): Use 'q' constraints for the
+ register operand in alternatives 4,5,6.
+
+2016-11-22 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR target/77904
+ * config/arm/arm.c (thumb1_compute_save_reg_mask): Mark frame pointer
+ in save register mask if it is needed.
+
+2016-11-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/78436
+ * gimple-ssa-store-merging.c (zero_char_buf): Removed.
+ (shift_bytes_in_array, shift_bytes_in_array_right,
+ merged_store_group::apply_stores): Formatting fixes.
+ (clear_bit_region): Likewise. Use memset.
+ (encode_tree_to_bitpos): Formatting fixes. Fix comment typos - EPXR
+ instead of EXPR and inerted instead of inserted. Use memset instead
+ of zero_char_buf. For !BYTES_BIG_ENDIAN decrease byte_size by 1
+ if shift_amnt is 0.
+
+ PR middle-end/78416
+ * expmed.c (expand_divmod): Use wide_int for computation of
+ op1_is_pow2. Don't set it if op1 is 0. Formatting fixes.
+ Use size <= HOST_BITS_PER_WIDE_INT instead of
+ HOST_BITS_PER_WIDE_INT >= size.
+
+ PR tree-optimization/78445
+ * tree-if-conv.c (tree_if_conversion): If any_pred_load_store or
+ any_complicated_phi, version loop even if flag_tree_loop_if_convert is
+ 1. Formatting fix.
+
+2016-11-22 Martin Liska <mliska@suse.cz>
+
+ PR ipa/78309
+ * ipa-icf.c (void sem_item::set_hash): Update m_hash_set.
+ (sem_function::get_hash): Use the new field.
+ (sem_function::parse): Remove an argument from ctor.
+ (sem_variable::parse): Likewise.
+ (sem_variable::get_hash): Use the new field.
+ (sem_item_optimizer::read_section): Use new ctor and set hash.
+ * ipa-icf.h: _hash is removed from sem_item::sem_item,
+ sem_variable::sem_variable, sem_function::sem_function.
+
+2016-11-21 Jeff Law <law@redhat.com>
+
+ PR target/68538
+ * config/cris/cris.md: Don't call copy_to_mode_reg unless
+ can_create_pseudo_p is true.
+
+2016-11-21 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/68803
+ * config/rs6000/rs6000.md (*rotlsi3_insert_5, *rotldi3_insert_6,
+ *rotldi3_insert_7): New define_insns.
+
+2016-11-21 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ * config/rs6000/rs6000.md (movdi_internal32): Change constraints
+ so that DImode can be allocated to FP/vector registers in more
+ cases, and we can avoid direct move operations. If the register
+ needs reloading, prefer GPRs over FP/vector registers. In the
+ case of FPR vs. Altivec registers, prefer FPR registers unless we
+ have the ISA 3.0 reg+offset scalar instructions.
+ (movdi_internal64): Likewise.
+
+2016-11-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/67335
+ * omp-simd-clone.c (simd_clone_adjust_argument_types): Use NULL prefix
+ for tmp simd array if DECL_NAME (parm) is NULL.
+
+2016-11-20 Jeff Law <law@redhat.com>
+
+ PR target/25128
+ * config/m68k/predicates.md (swap_peephole_relational_operator): New
+ predicate.
+ * config/m68k/m68k.md (relational tests against 65535/65536): New
+ peephole2.
+
+2016-11-21 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * tree-ssa-loop-prefetch.c: Delete FIXME after the includes.
+
+2016-11-21 Martin Sebor <msebor@redhat.com>
+
+ * doc/invoke.texi (-fprintf-return-value): Document that option
+ is enabled by default.
+
+2016-11-21 Georg-Johann Lay <avr@gjlay.de>
+
+ * config/avr/avr-c.c (avr_register_target_pragmas): Use C++
+ for-loop declaration of loop variable.
+ (avr_register_target_pragmas, avr_cpu_cpp_builtins): Same.
+ * config/avr/avr.c (avr_popcount_each_byte)
+ (avr_init_expanders, avr_regs_to_save, sequent_regs_live)
+ (get_sequence_length, avr_prologue_setup_frame, avr_map_metric)
+ (avr_expand_epilogue, avr_function_arg_advance)
+ (avr_out_compare, avr_out_plus_1, avr_out_bitop, avr_out_fract)
+ (avr_rotate_bytes, _reg_unused_after, avr_assemble_integer)
+ (avr_adjust_reg_alloc_order, output_reload_in_const)
+ (avr_conditional_register_usage, avr_find_unused_d_reg)
+ (avr_map_decompose, avr_fold_builtin): Same.
+
+2016-11-21 Georg-Johann Lay <avr@gjlay.de>
+
+ * config/avr/avr.c (avr_popcount): Remove static function.
+ (avr_popcount_each_byte, avr_out_bitop): Use popcount_hwi instead.
+
+2016-11-21 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.opt (mapcs-float): Delete option.
+ * arm.c (arm_option_override): Remove hunk relating to
+ TARGET_APCS_FLOAT.
+ * doc/invoke.texi (arm options): Remove documentation for -mapcs-float.
+
+2016-11-21 Richard Sandiford <richard.sandiford@arm.com>
+
+ * tree-tailcall.c (process_assignment): Simplify the check for
+ a valid copy, allowing the source to be a local variable as
+ well as an SSA name.
+ (find_tail_calls): Allow copies between local variables to follow
+ the call. Allow the result to be stored in any local variable,
+ even if it's an aggregate.
+ (eliminate_tail_call): Check whether the result is an SSA name
+ before updating its SSA_NAME_DEF_STMT.
+
+2016-11-21 David Malcolm <dmalcolm@redhat.com>
+
+ PR preprocessor/78324
+ * input.c (get_substring_ranges_for_loc): Fail gracefully if
+ -ftrack-macro-expansion has a value other than 2.
+
+2016-11-21 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/78400
+ * shrink-wrap.c (try_shrink_wrapping_separate): Call
+ df_update_entry_exit_and_calls instead of df_update_entry_block_defs
+ and df_update_exit_block_uses.
+
+2016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR c++/71973
+ * doc/invoke.texi (-Wno-builtin-declaration-mismatch): Document the
+ new default-enabled warning..
+ * builtin-types.def (BT_CONST_TM_PTR): New primitive type.
+ (BT_PTR_CONST_STRING): Updated.
+ (BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR): Removed.
+ (BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_TM_PTR): New function type.
+ * builtins.def (DEF_TM_BUILTIN): Disable BOTH_P for TM builtins.
+ (strftime): Update builtin function.
+ * tree-core.h (TI_CONST_TM_PTR_TYPE): New enum value.
+ * tree.h (const_tm_ptr_type_node): New type node.
+ * tree.c (free_lang_data, build_common_tree_nodes): Initialize
+ const_tm_ptr_type_node.
+
+2016-11-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR tree-optimization/78413
+ * tree-if-conv.c (versionable_outer_loop_p): Require that both
+ inner and outer loop latches have single predecessors.
+
+2016-11-21 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/78093
+ * config/avr/avr.c (avr_decl_maybe_lds_p): New static function.
+ (avr_encode_section_info) [TARGET_ABSDATA && AVR_TINY]: Use it.
+
2016-11-21 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* rtl.h: Adjust prototype.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index dcc582cb168..b4ec7eacbcd 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20161121
+20161122
diff --git a/gcc/builtin-types.def b/gcc/builtin-types.def
index 468313c43e4..ecc6dcae8ff 100644
--- a/gcc/builtin-types.def
+++ b/gcc/builtin-types.def
@@ -103,6 +103,7 @@ DEF_PRIMITIVE_TYPE (BT_COMPLEX_LONGDOUBLE, complex_long_double_type_node)
DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_FILEPTR, fileptr_type_node)
+DEF_PRIMITIVE_TYPE (BT_CONST_TM_PTR, const_tm_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node)
DEF_PRIMITIVE_TYPE (BT_VOLATILE_PTR,
build_pointer_type
@@ -146,7 +147,12 @@ DEF_PRIMITIVE_TYPE (BT_I16, builtin_type_for_size (BITS_PER_UNIT*16, 1))
DEF_PRIMITIVE_TYPE (BT_BND, pointer_bounds_type_node)
-DEF_POINTER_TYPE (BT_PTR_CONST_STRING, BT_CONST_STRING)
+/* The C type `char * const *'. */
+DEF_PRIMITIVE_TYPE (BT_PTR_CONST_STRING,
+ build_pointer_type
+ (build_qualified_type (string_type_node,
+ TYPE_QUAL_CONST)))
+
DEF_POINTER_TYPE (BT_PTR_UINT, BT_UINT)
DEF_POINTER_TYPE (BT_PTR_LONG, BT_LONG)
DEF_POINTER_TYPE (BT_PTR_ULONG, BT_ULONG)
@@ -511,8 +517,8 @@ DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR,
BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_FILEPTR)
DEF_FUNCTION_TYPE_4 (BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG,
BT_INT, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_VALIST_ARG)
-DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR,
- BT_SIZE, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_CONST_PTR)
+DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_TM_PTR,
+ BT_SIZE, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_CONST_TM_PTR)
DEF_FUNCTION_TYPE_4 (BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE,
BT_PTR, BT_PTR, BT_CONST_PTR, BT_SIZE, BT_SIZE)
DEF_FUNCTION_TYPE_4 (BT_FN_PTR_PTR_INT_SIZE_SIZE,
diff --git a/gcc/builtins.def b/gcc/builtins.def
index 219feebd3ae..e2c582880c3 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -212,8 +212,8 @@ along with GCC; see the file COPYING3. If not see
functions are mapped to the actual implementation of the STM library. */
#undef DEF_TM_BUILTIN
#define DEF_TM_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
- true, true, true, ATTRS, false, flag_tm)
+ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
+ false, true, true, ATTRS, false, flag_tm)
/* Builtin used by the implementation of libsanitizer. These
functions are mapped to the actual implementation of the
@@ -866,7 +866,7 @@ DEF_GCC_BUILTIN (BUILT_IN_RETURN_ADDRESS, "return_address", BT_FN_PTR_UIN
DEF_GCC_BUILTIN (BUILT_IN_SAVEREGS, "saveregs", BT_FN_PTR_VAR, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_SETJMP, "setjmp", BT_FN_INT_PTR, ATTR_RT_NOTHROW_LEAF_LIST)
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRFMON, "strfmon", BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR, ATTR_FORMAT_STRFMON_NOTHROW_3_4)
-DEF_LIB_BUILTIN (BUILT_IN_STRFTIME, "strftime", BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR, ATTR_FORMAT_STRFTIME_NOTHROW_3_0)
+DEF_LIB_BUILTIN (BUILT_IN_STRFTIME, "strftime", BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_TM_PTR, ATTR_FORMAT_STRFTIME_NOTHROW_3_0)
DEF_GCC_BUILTIN (BUILT_IN_TRAP, "trap", BT_FN_VOID, ATTR_NORETURN_NOTHROW_LEAF_LIST)
DEF_GCC_BUILTIN (BUILT_IN_UNREACHABLE, "unreachable", BT_FN_VOID, ATTR_CONST_NORETURN_NOTHROW_LEAF_LIST)
DEF_GCC_BUILTIN (BUILT_IN_UNWIND_INIT, "unwind_init", BT_FN_VOID, ATTR_NULL)
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index acbe46154ec..f2ea179761e 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,14 @@
+2016-11-21 Martin Sebor <msebor@redhat.com>
+
+ * c.opt (-fprintf-return-value): Enable by default.
+
+2016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR c++/71973
+ * c.opt (-Wbuiltin-declaration-mismatch): New warning.
+ * c-common.c (c_common_nodes_and_builtins): Initialize
+ const_tm_ptr_type_node.
+
2016-11-16 Marek Polacek <polacek@redhat.com>
PR c/78285
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 3eb7f45aba4..cc18f295e00 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -4293,9 +4293,13 @@ c_common_nodes_and_builtins (void)
}
if (c_dialect_cxx ())
- /* For C++, make fileptr_type_node a distinct void * type until
- FILE type is defined. */
- fileptr_type_node = build_variant_type_copy (ptr_type_node);
+ {
+ /* For C++, make fileptr_type_node a distinct void * type until
+ FILE type is defined. */
+ fileptr_type_node = build_variant_type_copy (ptr_type_node);
+ /* Likewise for const struct tm*. */
+ const_tm_ptr_type_node = build_variant_type_copy (const_ptr_type_node);
+ }
record_builtin_type (RID_VOID, NULL, void_type_node);
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 722d3800cf0..c61fab8d2bc 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -337,6 +337,10 @@ Wframe-address
C ObjC C++ ObjC++ Var(warn_frame_address) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
Warn when __builtin_frame_address or __builtin_return_address is used unsafely.
+Wbuiltin-declaration-mismatch
+C ObjC C++ ObjC++ Var(warn_builtin_declaraion_mismatch) Init(1) Warning
+Warn when a built-in function is declared with the wrong signature.
+
Wbuiltin-macro-redefined
C ObjC C++ ObjC++ CPP(warn_builtin_macro_redefined) CppReason(CPP_W_BUILTIN_MACRO_REDEFINED) Var(cpp_warn_builtin_macro_redefined) Init(1) Warning
Warn when a built-in preprocessor macro is undefined or redefined.
@@ -1550,7 +1554,7 @@ C++ ObjC++ Var(flag_pretty_templates) Init(1)
-fno-pretty-templates Do not pretty-print template specializations as the template signature followed by the arguments.
fprintf-return-value
-C ObjC C++ ObjC++ LTO Optimization Var(flag_printf_return_value) Init(0)
+C ObjC C++ ObjC++ LTO Optimization Var(flag_printf_return_value) Init(1)
Treat known sprintf return values as constants.
freplace-objc-classes
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 98bb93851d9..dec9c9d4417 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,6 +1,12 @@
+2016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR c++/71973
+ * c-decl.c (diagnose_mismatched_decls): Use
+ OPT_Wbuiltin_declaration_mismatch here too.
+
2016-11-18 Richard Sandiford <richard.sandiford@arm.com>
- Alan Hayward <alan.hayward@arm.com>
- David Sherwood <david.sherwood@arm.com>
+ Alan Hayward <alan.hayward@arm.com>
+ David Sherwood <david.sherwood@arm.com>
* c-decl.c (merge_decls): Use SET_DECL_MODE.
(make_label, finish_struct): Likewise.
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 23581447a35..db293fe60d1 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -1867,7 +1867,8 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
/* If types don't match for a built-in, throw away the
built-in. No point in calling locate_old_decl here, it
won't print anything. */
- warning (0, "conflicting types for built-in function %q+D",
+ warning (OPT_Wbuiltin_declaration_mismatch,
+ "conflicting types for built-in function %q+D",
newdecl);
return false;
}
diff --git a/gcc/config.gcc b/gcc/config.gcc
index d1e3acd6ed0..98267d84a8e 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -3756,6 +3756,16 @@ case "${target}" in
# pragmatic.
tmake_profile_file="arm/t-aprofile"
;;
+ rmprofile)
+ # Note that arm/t-rmprofile is a
+ # stand-alone make file fragment to be
+ # used only with itself. We do not
+ # specifically use the
+ # TM_MULTILIB_OPTION framework because
+ # this shorthand is more
+ # pragmatic.
+ tmake_profile_file="arm/t-rmprofile"
+ ;;
default)
;;
*)
@@ -3765,9 +3775,10 @@ case "${target}" in
esac
if test "x${tmake_profile_file}" != x ; then
- # arm/t-aprofile is only designed to work
- # without any with-cpu, with-arch, with-mode,
- # with-fpu or with-float options.
+ # arm/t-aprofile and arm/t-rmprofile are only
+ # designed to work without any with-cpu,
+ # with-arch, with-mode, with-fpu or with-float
+ # options.
if test "x$with_arch" != x \
|| test "x$with_cpu" != x \
|| test "x$with_float" != x \
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 69c4a2bba81..abd3276f131 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -3187,9 +3187,6 @@ arm_option_override (void)
if (TARGET_APCS_REENT)
warning (0, "APCS reentrant code not supported. Ignored");
- if (TARGET_APCS_FLOAT)
- warning (0, "passing floating point arguments in fp regs not yet supported");
-
/* Initialize boolean versions of the flags, for use in the arm.md file. */
arm_arch3m = ARM_FSET_HAS_CPU1 (insn_flags, FL_ARCH3M);
arm_arch4 = ARM_FSET_HAS_CPU1 (insn_flags, FL_ARCH4);
@@ -18278,6 +18275,10 @@ thumb1_compute_save_reg_mask (void)
if (df_regs_ever_live_p (reg) && callee_saved_reg_p (reg))
mask |= 1 << reg;
+ /* Handle the frame pointer as a special case. */
+ if (frame_pointer_needed)
+ mask |= 1 << HARD_FRAME_POINTER_REGNUM;
+
if (flag_pic
&& !TARGET_SINGLE_PIC_BASE
&& arm_pic_register != INVALID_REGNUM
diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
index 0fcabb90ed2..8856976c6de 100644
--- a/gcc/config/arm/arm.opt
+++ b/gcc/config/arm/arm.opt
@@ -61,10 +61,6 @@ Generate a call to abort if a noreturn function returns.
mapcs
Target RejectNegative Mask(APCS_FRAME) Undocumented
-mapcs-float
-Target Report Mask(APCS_FLOAT)
-Pass FP arguments in FP registers.
-
mapcs-frame
Target Report Mask(APCS_FRAME)
Generate APCS conformant stack frames.
diff --git a/gcc/config/arm/t-rmprofile b/gcc/config/arm/t-rmprofile
new file mode 100644
index 00000000000..c8b5c9cbd03
--- /dev/null
+++ b/gcc/config/arm/t-rmprofile
@@ -0,0 +1,174 @@
+# Copyright (C) 2016 Free Software Foundation, Inc.
+#
+# 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/>.
+
+# This is a target makefile fragment that attempts to get
+# multilibs built for the range of CPU's, FPU's and ABI's that
+# are relevant for the ARM architecture. It should not be used in
+# conjunction with another make file fragment and assumes --with-arch,
+# --with-cpu, --with-fpu, --with-float, --with-mode have their default
+# values during the configure step. We enforce this during the
+# top-level configury.
+
+MULTILIB_OPTIONS =
+MULTILIB_DIRNAMES =
+MULTILIB_EXCEPTIONS =
+MULTILIB_MATCHES =
+MULTILIB_REUSE =
+
+# We have the following hierachy:
+# ISA: A32 (.) or T16/T32 (thumb).
+# Architecture: ARMv6S-M (v6-m), ARMv7-M (v7-m), ARMv7E-M (v7e-m),
+# ARMv8-M Baseline (v8-m.base) or ARMv8-M Mainline (v8-m.main).
+# FPU: VFPv3-D16 (fpv3), FPV4-SP-D16 (fpv4-sp), FPV5-SP-D16 (fpv5-sp),
+# VFPv5-D16 (fpv5), or None (.).
+# Float-abi: Soft (.), softfp (softfp), or hard (hardfp).
+
+# Options to build libraries with
+
+MULTILIB_OPTIONS += mthumb
+MULTILIB_DIRNAMES += thumb
+
+MULTILIB_OPTIONS += march=armv6s-m/march=armv7-m/march=armv7e-m/march=armv7/march=armv8-m.base/march=armv8-m.main
+MULTILIB_DIRNAMES += v6-m v7-m v7e-m v7-ar v8-m.base v8-m.main
+
+MULTILIB_OPTIONS += mfpu=vfpv3-d16/mfpu=fpv4-sp-d16/mfpu=fpv5-sp-d16/mfpu=fpv5-d16
+MULTILIB_DIRNAMES += fpv3 fpv4-sp fpv5-sp fpv5
+
+MULTILIB_OPTIONS += mfloat-abi=softfp/mfloat-abi=hard
+MULTILIB_DIRNAMES += softfp hard
+
+
+# Option combinations to build library with
+
+# Default CPU/Arch
+MULTILIB_REQUIRED += mthumb
+MULTILIB_REQUIRED += mfloat-abi=hard
+
+# ARMv6-M
+MULTILIB_REQUIRED += mthumb/march=armv6s-m
+
+# ARMv8-M Baseline
+MULTILIB_REQUIRED += mthumb/march=armv8-m.base
+
+# ARMv7-M
+MULTILIB_REQUIRED += mthumb/march=armv7-m
+
+# ARMv7E-M
+MULTILIB_REQUIRED += mthumb/march=armv7e-m
+MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfpu=fpv4-sp-d16/mfloat-abi=softfp
+MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfpu=fpv4-sp-d16/mfloat-abi=hard
+MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfpu=fpv5-d16/mfloat-abi=softfp
+MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfpu=fpv5-d16/mfloat-abi=hard
+MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfpu=fpv5-sp-d16/mfloat-abi=softfp
+MULTILIB_REQUIRED += mthumb/march=armv7e-m/mfpu=fpv5-sp-d16/mfloat-abi=hard
+
+# ARMv8-M Mainline
+MULTILIB_REQUIRED += mthumb/march=armv8-m.main
+MULTILIB_REQUIRED += mthumb/march=armv8-m.main/mfpu=fpv5-d16/mfloat-abi=softfp
+MULTILIB_REQUIRED += mthumb/march=armv8-m.main/mfpu=fpv5-d16/mfloat-abi=hard
+MULTILIB_REQUIRED += mthumb/march=armv8-m.main/mfpu=fpv5-sp-d16/mfloat-abi=softfp
+MULTILIB_REQUIRED += mthumb/march=armv8-m.main/mfpu=fpv5-sp-d16/mfloat-abi=hard
+
+# ARMv7-R as well as ARMv7-A and ARMv8-A if aprofile was not specified
+MULTILIB_REQUIRED += mthumb/march=armv7
+MULTILIB_REQUIRED += mthumb/march=armv7/mfpu=vfpv3-d16/mfloat-abi=softfp
+MULTILIB_REQUIRED += mthumb/march=armv7/mfpu=vfpv3-d16/mfloat-abi=hard
+
+
+# Matches
+
+# CPU Matches
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0.small-multiply
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0plus
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m0plus.small-multiply
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m1
+MULTILIB_MATCHES += march?armv6s-m=mcpu?cortex-m1.small-multiply
+MULTILIB_MATCHES += march?armv7-m=mcpu?cortex-m3
+MULTILIB_MATCHES += march?armv7e-m=mcpu?cortex-m4
+MULTILIB_MATCHES += march?armv7e-m=mcpu?cortex-m7
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4f
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-r5
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-r7
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-r8
+MULTILIB_MATCHES += march?armv7=mcpu?marvell-pj4
+MULTILIB_MATCHES += march?armv7=mcpu?generic-armv7-a
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a8
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a9
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a5
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a7
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a15
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a12
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a17
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a15.cortex-a7
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a17.cortex-a7
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a32
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a35
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a53
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a57
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a57.cortex-a53
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a72
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a72.cortex-a53
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a73
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a73.cortex-a35
+MULTILIB_MATCHES += march?armv7=mcpu?cortex-a73.cortex-a53
+MULTILIB_MATCHES += march?armv7=mcpu?exynos-m1
+MULTILIB_MATCHES += march?armv7=mcpu?qdf24xx
+MULTILIB_MATCHES += march?armv7=mcpu?xgene1
+
+# Arch Matches
+MULTILIB_MATCHES += march?armv6s-m=march?armv6-m
+MULTILIB_MATCHES += march?armv8-m.main=march?armv8-m.main+dsp
+MULTILIB_MATCHES += march?armv7=march?armv7-r
+ifeq (,$(HAS_APROFILE))
+MULTILIB_MATCHES += march?armv7=march?armv7-a
+MULTILIB_MATCHES += march?armv7=march?armv7ve
+MULTILIB_MATCHES += march?armv7=march?armv8-a
+MULTILIB_MATCHES += march?armv7=march?armv8-a+crc
+MULTILIB_MATCHES += march?armv7=march?armv8.1-a
+MULTILIB_MATCHES += march?armv7=march?armv8.1-a+crc
+MULTILIB_MATCHES += march?armv7=march?armv8.2-a
+MULTILIB_MATCHES += march?armv7=march?armv8.2-a+fp16
+endif
+
+# FPU matches
+ifeq (,$(HAS_APROFILE))
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3-fp16
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3-d16-fp16
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?neon
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?neon-fp16
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv4
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv4-d16
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?neon-vfpv4
+MULTILIB_MATCHES += mfpu?fpv5-d16=mfpu?fp-armv8
+MULTILIB_MATCHES += mfpu?fpv5-d16=mfpu?neon-fp-armv8
+MULTILIB_MATCHES += mfpu?fpv5-d16=mfpu?crypto-neon-fp-armv8
+endif
+
+
+# We map all requests for ARMv7-R or ARMv7-A in ARM mode to Thumb mode and
+# any FPU to VFPv3-d16 if possible.
+MULTILIB_REUSE += mthumb/march.armv7=march.armv7
+MULTILIB_REUSE += mthumb/march.armv7/mfpu.vfpv3-d16/mfloat-abi.softfp=march.armv7/mfpu.vfpv3-d16/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/march.armv7/mfpu.vfpv3-d16/mfloat-abi.hard=march.armv7/mfpu.vfpv3-d16/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/march.armv7/mfpu.vfpv3-d16/mfloat-abi.softfp=march.armv7/mfpu.fpv5-d16/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/march.armv7/mfpu.vfpv3-d16/mfloat-abi.hard=march.armv7/mfpu.fpv5-d16/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/march.armv7/mfpu.vfpv3-d16/mfloat-abi.softfp=mthumb/march.armv7/mfpu.fpv5-d16/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/march.armv7/mfpu.vfpv3-d16/mfloat-abi.hard=mthumb/march.armv7/mfpu.fpv5-d16/mfloat-abi.hard
diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md
index 2051f1018f1..ce56e160c04 100644
--- a/gcc/config/arm/vfp.md
+++ b/gcc/config/arm/vfp.md
@@ -355,8 +355,8 @@
)
(define_insn "*movdi_vfp_cortexa8"
- [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r,r,r,r,r,r,m,w,!r,w,w, Uv")
- (match_operand:DI 1 "di_operand" "r,rDa,Db,Dc,mi,mi,r,r,w,w,Uvi,w"))]
+ [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r,r,r,r,q,q,m,w,!r,w,w, Uv")
+ (match_operand:DI 1 "di_operand" "r,rDa,Db,Dc,mi,mi,q,r,w,w,Uvi,w"))]
"TARGET_32BIT && TARGET_HARD_FLOAT && arm_tune == TARGET_CPU_cortexa8
&& ( register_operand (operands[0], DImode)
|| register_operand (operands[1], DImode))
diff --git a/gcc/config/avr/avr-c.c b/gcc/config/avr/avr-c.c
index 6d363c9d20c..64c9eca59d1 100644
--- a/gcc/config/avr/avr-c.c
+++ b/gcc/config/avr/avr-c.c
@@ -249,8 +249,6 @@ avr_resolve_overloaded_builtin (unsigned int iloc, tree fndecl, void *vargs)
void
avr_register_target_pragmas (void)
{
- int i;
-
gcc_assert (ADDR_SPACE_GENERIC == ADDR_SPACE_RAM);
/* Register address spaces. The order must be the same as in the respective
@@ -259,7 +257,7 @@ avr_register_target_pragmas (void)
sense for some targets. Diagnose for non-supported spaces will be
emit by TARGET_ADDR_SPACE_DIAGNOSE_USAGE. */
- for (i = 0; i < ADDR_SPACE_COUNT; i++)
+ for (int i = 0; i < ADDR_SPACE_COUNT; i++)
{
gcc_assert (i == avr_addrspace[i].id);
@@ -292,8 +290,6 @@ avr_toupper (char *up, const char *lo)
void
avr_cpu_cpp_builtins (struct cpp_reader *pfile)
{
- int i;
-
builtin_define_std ("AVR");
/* __AVR_DEVICE_NAME__ and avr_mcu_types[].macro like __AVR_ATmega8__
@@ -391,7 +387,7 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile)
if (lang_GNU_C ())
{
- for (i = 0; i < ADDR_SPACE_COUNT; i++)
+ for (int i = 0; i < ADDR_SPACE_COUNT; i++)
if (!ADDR_SPACE_GENERIC_P (i)
/* Only supply __FLASH<n> macro if the address space is reasonable
for this target. The address space qualifier itself is still
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index caa9af05fae..7f3f93d026c 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -243,23 +243,6 @@ avr_tolower (char *lo, const char *up)
}
-/* Custom function to count number of set bits. */
-
-static inline int
-avr_popcount (unsigned int val)
-{
- int pop = 0;
-
- while (val)
- {
- val &= val-1;
- pop++;
- }
-
- return pop;
-}
-
-
/* Constraint helper function. XVAL is a CONST_INT or a CONST_DOUBLE.
Return true if the least significant N_BYTES bytes of XVAL all have a
popcount in POP_MASK and false, otherwise. POP_MASK represents a subset
@@ -268,19 +251,17 @@ avr_popcount (unsigned int val)
bool
avr_popcount_each_byte (rtx xval, int n_bytes, int pop_mask)
{
- int i;
-
machine_mode mode = GET_MODE (xval);
if (VOIDmode == mode)
mode = SImode;
- for (i = 0; i < n_bytes; i++)
+ for (int i = 0; i < n_bytes; i++)
{
rtx xval8 = simplify_gen_subreg (QImode, xval, mode, i);
unsigned int val8 = UINTVAL (xval8) & GET_MODE_MASK (QImode);
- if (0 == (pop_mask & (1 << avr_popcount (val8))))
+ if (0 == (pop_mask & (1 << popcount_hwi (val8))))
return false;
}
@@ -829,9 +810,7 @@ avr_init_machine_status (void)
void
avr_init_expanders (void)
{
- int regno;
-
- for (regno = 0; regno < 32; regno ++)
+ for (int regno = 0; regno < 32; regno ++)
all_regs_rtx[regno] = gen_rtx_REG (QImode, regno);
lpm_reg_rtx = all_regs_rtx[LPM_REGNO];
@@ -1155,7 +1134,7 @@ avr_starting_frame_offset (void)
static int
avr_regs_to_save (HARD_REG_SET *set)
{
- int reg, count;
+ int count;
int int_or_sig_p = cfun->machine->is_interrupt || cfun->machine->is_signal;
if (set)
@@ -1170,7 +1149,7 @@ avr_regs_to_save (HARD_REG_SET *set)
|| cfun->machine->is_OS_main)
return 0;
- for (reg = 0; reg < 32; reg++)
+ for (int reg = 0; reg < 32; reg++)
{
/* Do not push/pop __tmp_reg__, __zero_reg__, as well as
any global register variables. */
@@ -1357,11 +1336,10 @@ avr_simple_epilogue (void)
static int
sequent_regs_live (void)
{
- int reg;
int live_seq = 0;
int cur_seq = 0;
- for (reg = 0; reg <= LAST_CALLEE_SAVED_REG; ++reg)
+ for (int reg = 0; reg <= LAST_CALLEE_SAVED_REG; ++reg)
{
if (fixed_regs[reg])
{
@@ -1417,10 +1395,9 @@ sequent_regs_live (void)
int
get_sequence_length (rtx_insn *insns)
{
- rtx_insn *insn;
- int length;
+ int length = 0;
- for (insn = insns, length = 0; insn; insn = NEXT_INSN (insn))
+ for (rtx_insn *insn = insns; insn; insn = NEXT_INSN (insn))
length += get_attr_length (insn);
return length;
@@ -1556,9 +1533,7 @@ avr_prologue_setup_frame (HOST_WIDE_INT size, HARD_REG_SET set)
}
else /* !minimize */
{
- int reg;
-
- for (reg = 0; reg < 32; ++reg)
+ for (int reg = 0; reg < 32; ++reg)
if (TEST_HARD_REG_BIT (set, reg))
emit_push_byte (reg, true);
@@ -1901,7 +1876,6 @@ emit_pop_byte (unsigned regno)
void
avr_expand_epilogue (bool sibcall_p)
{
- int reg;
int live_seq;
HARD_REG_SET set;
int minimize;
@@ -2043,7 +2017,7 @@ avr_expand_epilogue (bool sibcall_p)
/* Restore used registers. */
- for (reg = 31; reg >= 0; --reg)
+ for (int reg = 31; reg >= 0; --reg)
if (TEST_HARD_REG_BIT (set, reg))
emit_pop_byte (reg);
@@ -3235,9 +3209,7 @@ avr_function_arg_advance (cumulative_args_t cum_v, machine_mode mode,
if (cum->regno >= 8
&& cum->nregs >= 0)
{
- int regno;
-
- for (regno = cum->regno; regno < cum->regno + bytes; regno++)
+ for (int regno = cum->regno; regno < cum->regno + bytes; regno++)
if (fixed_regs[regno])
warning (0, "fixed register %s used to pass parameter to function",
reg_names[regno]);
@@ -3351,11 +3323,10 @@ avr_xload_libgcc_p (machine_mode mode)
static rtx
avr_find_unused_d_reg (rtx_insn *insn, rtx exclude)
{
- int regno;
bool isr_p = (avr_interrupt_function_p (current_function_decl)
|| avr_signal_function_p (current_function_decl));
- for (regno = 16; regno < 32; regno++)
+ for (int regno = 16; regno < 32; regno++)
{
rtx reg = all_regs_rtx[regno];
@@ -5688,7 +5659,7 @@ avr_out_compare (rtx_insn *insn, rtx *xop, int *plen)
machine_mode mode;
/* Number of bytes to operate on. */
- int i, n_bytes = GET_MODE_SIZE (GET_MODE (xreg));
+ int n_bytes = GET_MODE_SIZE (GET_MODE (xreg));
/* Value (0..0xff) held in clobber register xop[2] or -1 if unknown. */
int clobber_val = -1;
@@ -5774,7 +5745,7 @@ avr_out_compare (rtx_insn *insn, rtx *xop, int *plen)
}
}
- for (i = 0; i < n_bytes; i++)
+ for (int i = 0; i < n_bytes; i++)
{
/* We compare byte-wise. */
rtx reg8 = simplify_gen_subreg (QImode, xreg, mode, i);
@@ -7508,7 +7479,7 @@ avr_out_plus_1 (rtx *xop, int *plen, enum rtx_code code, int *pcc,
machine_mode imode = int_mode_for_mode (mode);
/* Number of bytes to operate on. */
- int i, n_bytes = GET_MODE_SIZE (mode);
+ int n_bytes = GET_MODE_SIZE (mode);
/* Value (0..0xff) held in clobber register op[3] or -1 if unknown. */
int clobber_val = -1;
@@ -7536,7 +7507,7 @@ avr_out_plus_1 (rtx *xop, int *plen, enum rtx_code code, int *pcc,
{
*pcc = MINUS == code ? (int) CC_SET_CZN : (int) CC_CLOBBER;
- for (i = 0; i < n_bytes; i++)
+ for (int i = 0; i < n_bytes; i++)
{
/* We operate byte-wise on the destination. */
op[0] = simplify_gen_subreg (QImode, xop[0], mode, i);
@@ -7603,7 +7574,7 @@ avr_out_plus_1 (rtx *xop, int *plen, enum rtx_code code, int *pcc,
goto saturate;
}
- for (i = 0; i < n_bytes; i++)
+ for (int i = 0; i < n_bytes; i++)
{
/* We operate byte-wise on the destination. */
rtx reg8 = simplify_gen_subreg (QImode, xop[0], mode, i);
@@ -8105,7 +8076,7 @@ avr_out_bitop (rtx insn, rtx *xop, int *plen)
machine_mode mode = GET_MODE (xop[0]);
/* Number of bytes to operate on. */
- int i, n_bytes = GET_MODE_SIZE (mode);
+ int n_bytes = GET_MODE_SIZE (mode);
/* Value of T-flag (0 or 1) or -1 if unknow. */
int set_t = -1;
@@ -8125,7 +8096,7 @@ avr_out_bitop (rtx insn, rtx *xop, int *plen)
if (plen)
*plen = 0;
- for (i = 0; i < n_bytes; i++)
+ for (int i = 0; i < n_bytes; i++)
{
/* We operate byte-wise on the destination. */
rtx reg8 = simplify_gen_subreg (QImode, xop[0], mode, i);
@@ -8135,7 +8106,7 @@ avr_out_bitop (rtx insn, rtx *xop, int *plen)
unsigned int val8 = UINTVAL (xval8) & GET_MODE_MASK (QImode);
/* Number of bits set in the current byte of the constant. */
- int pop8 = avr_popcount (val8);
+ int pop8 = popcount_hwi (val8);
/* Registers R16..R31 can operate with immediate. */
bool ld_reg_p = test_hard_reg_class (LD_REGS, reg8);
@@ -8411,7 +8382,6 @@ avr_out_insert_notbit (rtx_insn *insn, rtx operands[], rtx xbitno, int *plen)
const char*
avr_out_fract (rtx_insn *insn, rtx operands[], bool intsigned, int *plen)
{
- size_t i;
rtx xop[6];
RTX_CODE shift = UNKNOWN;
bool sign_in_carry = false;
@@ -8447,7 +8417,7 @@ avr_out_fract (rtx_insn *insn, rtx operands[], bool intsigned, int *plen)
/* Step 0: Determine information on source and destination operand we
====== will need in the remainder. */
- for (i = 0; i < sizeof (val) / sizeof (*val); i++)
+ for (size_t i = 0; i < ARRAY_SIZE (val); i++)
{
machine_mode mode;
@@ -9004,7 +8974,6 @@ avr_out_round (rtx_insn *insn ATTRIBUTE_UNUSED, rtx *xop, int *plen)
bool
avr_rotate_bytes (rtx operands[])
{
- int i, j;
machine_mode mode = GET_MODE (operands[0]);
bool overlapped = reg_overlap_mentioned_p (operands[0], operands[1]);
bool same_reg = rtx_equal_p (operands[0], operands[1]);
@@ -9063,7 +9032,7 @@ avr_rotate_bytes (rtx operands[])
gcc_assert (size <= MAX_SIZE);
/* Generate list of subreg moves. */
- for (i = 0; i < size; i++)
+ for (int i = 0; i < size; i++)
{
int from = i;
int to = (from + offset) % size;
@@ -9077,9 +9046,9 @@ avr_rotate_bytes (rtx operands[])
The first move is a conflict as it must wait until second is
performed. We ignore moves to self - we catch this later. */
if (overlapped)
- for (i = 0; i < size; i++)
+ for (int i = 0; i < size; i++)
if (reg_overlap_mentioned_p (move[i].dst, operands[1]))
- for (j = 0; j < size; j++)
+ for (int j = 0; j < size; j++)
if (j != i && rtx_equal_p (move[j].src, move[i].dst))
{
/* The dst of move i is the src of move j. */
@@ -9098,7 +9067,7 @@ avr_rotate_bytes (rtx operands[])
moves = 0;
/* Emit move where dst is not also a src or we have used that
src already. */
- for (i = 0; i < size; i++)
+ for (int i = 0; i < size; i++)
if (move[i].src != NULL_RTX)
{
if (move[i].links == -1
@@ -9306,10 +9275,9 @@ _reg_unused_after (rtx_insn *insn, rtx reg)
else if (code == INSN && GET_CODE (PATTERN (insn)) == SEQUENCE)
{
rtx_sequence *seq = as_a <rtx_sequence *> (PATTERN (insn));
- int i;
int retval = 0;
- for (i = 0; i < seq->len (); i++)
+ for (int i = 0; i < seq->len (); i++)
{
rtx_insn *this_insn = seq->insn (i);
rtx set = single_set (this_insn);
@@ -9403,11 +9371,9 @@ avr_assemble_integer (rtx x, unsigned int size, int aligned_p)
}
else if (CONST_FIXED_P (x))
{
- unsigned n;
-
/* varasm fails to handle big fixed modes that don't fit in hwi. */
- for (n = 0; n < size; n++)
+ for (unsigned n = 0; n < size; n++)
{
rtx xn = simplify_gen_subreg (QImode, x, GET_MODE (x), n);
default_assemble_integer (xn, 1, aligned_p);
@@ -10102,6 +10068,38 @@ avr_section_type_flags (tree decl, const char *name, int reloc)
}
+/* A helper for the next function. NODE is a decl that is associated with
+ a symbol. Return TRUE if the respective object may be accessed by LDS.
+ There might still be other reasons for why LDS is not appropriate.
+ This function is only appropriate for AVR_TINY. */
+
+static bool
+avr_decl_maybe_lds_p (tree node)
+{
+ if (!node
+ || TREE_CODE (node) != VAR_DECL
+ || DECL_SECTION_NAME (node) != NULL)
+ return false;
+
+ /* Don't use LDS for objects that go to .rodata. The current default
+ linker description file still locates .rodata in RAM, but this is not
+ a must. A better linker script would just keep .rodata in flash and
+ add an offset of 0x4000 to the VMA. Hence avoid LDS for such data. */
+
+ if (TREE_READONLY (node))
+ return false;
+
+ // C++ requires peeling arrays.
+
+ do
+ node = TREE_TYPE (node);
+ while (ARRAY_TYPE == TREE_CODE (node));
+
+ return (node != error_mark_node
+ && !TYPE_READONLY (node));
+}
+
+
/* Implement `TARGET_ENCODE_SECTION_INFO'. */
static void
@@ -10193,7 +10191,8 @@ avr_encode_section_info (tree decl, rtx rtl, int new_decl_p)
if (avr_decl_absdata_p (decl, DECL_ATTRIBUTES (decl))
|| (TARGET_ABSDATA
&& !progmem_p
- && !addr_attr)
+ && !addr_attr
+ && avr_decl_maybe_lds_p (decl))
|| (addr_attr
// If addr_attr is non-null, it has an argument. Peek into it.
&& TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (addr_attr))) < 0xc0))
@@ -10326,7 +10325,6 @@ avr_file_end (void)
void
avr_adjust_reg_alloc_order (void)
{
- unsigned int i;
static const int order_0[] =
{
24, 25,
@@ -10387,7 +10385,7 @@ avr_adjust_reg_alloc_order (void)
: TARGET_ORDER_2 ? (AVR_TINY ? tiny_order_0 : order_2)
: (AVR_TINY ? tiny_order_0 : order_0));
- for (i = 0; i < ARRAY_SIZE (order_0); ++i)
+ for (size_t i = 0; i < ARRAY_SIZE (order_0); ++i)
reg_alloc_order[i] = order[i];
}
@@ -11984,7 +11982,7 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
bool cooked_clobber_p = false;
bool set_p = false;
machine_mode mode = GET_MODE (dest);
- int n, n_bytes = GET_MODE_SIZE (mode);
+ int n_bytes = GET_MODE_SIZE (mode);
gcc_assert (REG_P (dest)
&& CONSTANT_P (src));
@@ -12021,11 +12019,10 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
/* Now start filling DEST from LSB to MSB. */
- for (n = 0; n < n_bytes; n++)
+ for (int n = 0; n < n_bytes; n++)
{
int ldreg_p;
bool done_byte = false;
- int j;
rtx xop[3];
/* Crop the n-th destination byte. */
@@ -12110,7 +12107,7 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
/* Try to reuse value already loaded in some lower byte. */
- for (j = 0; j < n; j++)
+ for (int j = 0; j < n; j++)
if (ival[j] == ival[n])
{
xop[0] = xdest[n];
@@ -12293,8 +12290,6 @@ avr_conditional_register_usage(void)
{
if (AVR_TINY)
{
- unsigned int i;
-
const int tiny_reg_alloc_order[] = {
24, 25,
22, 23,
@@ -12311,7 +12306,7 @@ avr_conditional_register_usage(void)
- R0-R15 are not available in Tiny Core devices
- R16 and R17 are fixed registers. */
- for (i = 0; i <= 17; i++)
+ for (size_t i = 0; i <= 17; i++)
{
fixed_regs[i] = 1;
call_used_regs[i] = 1;
@@ -12321,14 +12316,14 @@ avr_conditional_register_usage(void)
- R18, R19, R20 and R21 are the callee saved registers in
Tiny Core devices */
- for (i = 18; i <= LAST_CALLEE_SAVED_REG; i++)
+ for (size_t i = 18; i <= LAST_CALLEE_SAVED_REG; i++)
{
call_used_regs[i] = 0;
}
/* Update register allocation order for Tiny Core devices */
- for (i = 0; i < ARRAY_SIZE (tiny_reg_alloc_order); i++)
+ for (size_t i = 0; i < ARRAY_SIZE (tiny_reg_alloc_order); i++)
{
reg_alloc_order[i] = tiny_reg_alloc_order[i];
}
@@ -13229,9 +13224,9 @@ enum
static unsigned
avr_map_metric (unsigned int a, int mode)
{
- unsigned i, metric = 0;
+ unsigned metric = 0;
- for (i = 0; i < 8; i++)
+ for (unsigned i = 0; i < 8; i++)
{
unsigned ai = avr_map (a, i);
@@ -13328,7 +13323,6 @@ static const avr_map_op_t avr_map_op[] =
static avr_map_op_t
avr_map_decompose (unsigned int f, const avr_map_op_t *g, bool val_const_p)
{
- int i;
bool val_used_p = 0 != avr_map_metric (f, MAP_MASK_PREIMAGE_F);
avr_map_op_t f_ginv = *g;
unsigned int ginv = g->ginv;
@@ -13337,7 +13331,7 @@ avr_map_decompose (unsigned int f, const avr_map_op_t *g, bool val_const_p)
/* Step 1: Computing F o G^-1 */
- for (i = 7; i >= 0; i--)
+ for (int i = 7; i >= 0; i--)
{
int x = avr_map (f, i);
@@ -13405,15 +13399,13 @@ avr_map_decompose (unsigned int f, const avr_map_op_t *g, bool val_const_p)
static void
avr_move_bits (rtx *xop, unsigned int map, bool fixp_p, int *plen)
{
- int bit_dest, b;
-
/* T-flag contains this bit of the source, i.e. of XOP[1] */
int t_bit_src = -1;
/* We order the operations according to the requested source bit b. */
- for (b = 0; b < 8; b++)
- for (bit_dest = 0; bit_dest < 8; bit_dest++)
+ for (int b = 0; b < 8; b++)
+ for (int bit_dest = 0; bit_dest < 8; bit_dest++)
{
int bit_src = avr_map (map, bit_dest);
@@ -13775,7 +13767,7 @@ static rtx
avr_default_expand_builtin (enum insn_code icode, tree exp, rtx target)
{
rtx pat, xop[3];
- int n, n_args = call_expr_nargs (exp);
+ int n_args = call_expr_nargs (exp);
machine_mode tmode = insn_data[icode].operand[0].mode;
gcc_assert (n_args >= 1 && n_args <= 3);
@@ -13787,7 +13779,7 @@ avr_default_expand_builtin (enum insn_code icode, tree exp, rtx target)
target = gen_reg_rtx (tmode);
}
- for (n = 0; n < n_args; n++)
+ for (int n = 0; n < n_args; n++)
{
tree arg = CALL_EXPR_ARG (exp, n);
rtx op = expand_expr (arg, NULL_RTX, VOIDmode, EXPAND_NORMAL);
@@ -14060,7 +14052,6 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
tree map_type = TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (fndecl)));
unsigned int map;
bool changed = false;
- unsigned i;
avr_map_op_t best_g;
if (TREE_CODE (arg[0]) != INTEGER_CST)
@@ -14102,7 +14093,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
int bits = TREE_INT_CST_LOW (tbits);
int mask_ior = 0, mask_and = 0xff;
- for (i = 0; i < 8; i++)
+ for (size_t i = 0; i < 8; i++)
{
int mi = avr_map (map, i);
@@ -14143,7 +14134,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
best_g = avr_map_op[0];
best_g.cost = 1000;
- for (i = 0; i < sizeof (avr_map_op) / sizeof (*avr_map_op); i++)
+ for (size_t i = 0; i < ARRAY_SIZE (avr_map_op); i++)
{
avr_map_op_t g
= avr_map_decompose (map, avr_map_op + i,
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index 59a386252c6..13279b538ba 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -499,7 +499,8 @@
{
if (MEM_P (operands[0])
&& operands[1] != const0_rtx
- && (!TARGET_V32 || (!REG_P (operands[1]) && can_create_pseudo_p ())))
+ && can_create_pseudo_p ()
+ && (!TARGET_V32 || !REG_P (operands[1])))
operands[1] = copy_to_mode_reg (DImode, operands[1]);
/* Some other ports (as of 2001-09-10 for example mcore and romp) also
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 208561996e7..c6130f12386 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -7786,7 +7786,6 @@
operands[6] = GEN_INT (exact_log2 (INTVAL (operands[1]) + 1));
operands[7] = operands[2];
}")
-
(define_peephole2
[(set (cc0) (compare (match_operand:SI 0 "register_operand" "")
(match_operand:SI 1 "pow2_m1_operand" "")))
@@ -7804,3 +7803,23 @@
(match_dup 2) (match_dup 3)))]
"{ operands[4] = GEN_INT (exact_log2 (INTVAL (operands[1]) + 1)); }")
+;; When optimizing for size or for the original 68000 or 68010, we can
+;; improve some relational tests against 65536 (which get canonicalized
+;; internally against 65535).
+;; The rotate in the output pattern will turn into a swap.
+(define_peephole2
+ [(set (cc0) (compare (match_operand:SI 0 "register_operand" "")
+ (const_int 65535)))
+ (set (pc) (if_then_else (match_operator 1 "swap_peephole_relational_operator"
+ [(cc0) (const_int 0)])
+ (match_operand 2 "pc_or_label_operand")
+ (match_operand 3 "pc_or_label_operand")))]
+ "peep2_reg_dead_p (1, operands[0])
+ && (operands[2] == pc_rtx || operands[3] == pc_rtx)
+ && (optimize_size || TUNE_68000_10)
+ && DATA_REG_P (operands[0])"
+ [(set (match_dup 0) (rotate:SI (match_dup 0) (const_int 16)))
+ (set (cc0) (compare (subreg:HI (match_dup 0) 2) (const_int 0)))
+ (set (pc) (if_then_else (match_op_dup 1 [(cc0) (const_int 0)])
+ (match_dup 2) (match_dup 3)))]
+ "")
diff --git a/gcc/config/m68k/predicates.md b/gcc/config/m68k/predicates.md
index bfb548ab86f..be32ef60db3 100644
--- a/gcc/config/m68k/predicates.md
+++ b/gcc/config/m68k/predicates.md
@@ -279,3 +279,6 @@
;; Used to detect (pc) or (label_ref) in some jumping patterns to cut down
(define_predicate "pc_or_label_operand"
(match_code "pc,label_ref"))
+
+(define_predicate "swap_peephole_relational_operator"
+ (match_code "gtu,leu,gt,le"))
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index acd4a7e508b..f3d1d7156e3 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -3853,6 +3853,50 @@
}
[(set_attr "type" "insert")])
+(define_insn "*rotlsi3_insert_5"
+ [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+ (ior:SI (and:SI (match_operand:SI 1 "gpc_reg_operand" "0,r")
+ (match_operand:SI 2 "const_int_operand" "n,n"))
+ (and:SI (match_operand:SI 3 "gpc_reg_operand" "r,0")
+ (match_operand:SI 4 "const_int_operand" "n,n"))))]
+ "rs6000_is_valid_mask (operands[2], NULL, NULL, SImode)
+ && UINTVAL (operands[2]) != 0 && UINTVAL (operands[4]) != 0
+ && UINTVAL (operands[2]) + UINTVAL (operands[4]) + 1 == 0"
+ "@
+ rlwimi %0,%3,0,%4
+ rlwimi %0,%1,0,%2"
+ [(set_attr "type" "insert")])
+
+(define_insn "*rotldi3_insert_6"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (ior:DI (and:DI (match_operand:DI 1 "gpc_reg_operand" "0")
+ (match_operand:DI 2 "const_int_operand" "n"))
+ (and:DI (match_operand:DI 3 "gpc_reg_operand" "r")
+ (match_operand:DI 4 "const_int_operand" "n"))))]
+ "exact_log2 (-UINTVAL (operands[2])) > 0
+ && UINTVAL (operands[2]) + UINTVAL (operands[4]) + 1 == 0"
+{
+ operands[5] = GEN_INT (64 - exact_log2 (-UINTVAL (operands[2])));
+ return "rldimi %0,%3,0,%5";
+}
+ [(set_attr "type" "insert")
+ (set_attr "size" "64")])
+
+(define_insn "*rotldi3_insert_7"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (ior:DI (and:DI (match_operand:DI 3 "gpc_reg_operand" "r")
+ (match_operand:DI 4 "const_int_operand" "n"))
+ (and:DI (match_operand:DI 1 "gpc_reg_operand" "0")
+ (match_operand:DI 2 "const_int_operand" "n"))))]
+ "exact_log2 (-UINTVAL (operands[2])) > 0
+ && UINTVAL (operands[2]) + UINTVAL (operands[4]) + 1 == 0"
+{
+ operands[5] = GEN_INT (64 - exact_log2 (-UINTVAL (operands[2])));
+ return "rldimi %0,%3,0,%5";
+}
+ [(set_attr "type" "insert")
+ (set_attr "size" "64")])
+
; This handles the important case of multiple-precision shifts. There is
; no canonicalization rule for ASHIFT vs. LSHIFTRT, so two patterns.
@@ -8118,10 +8162,10 @@
(define_insn "*movdi_internal32"
[(set (match_operand:DI 0 "rs6000_nonimmediate_operand"
- "=Y, r, r, ?m, ?*d, ?*d,
- r, ?wY, ?Z, ?*wb, ?*wv, ?wi,
- ?wo, ?wo, ?wv, ?wi, ?wi, ?wv,
- ?wv")
+ "=Y, r, r, ^m, ^d, ^d,
+ r, ^wY, $Z, ^wb, $wv, ^wi,
+ *wo, *wo, *wv, *wi, *wi, *wv,
+ *wv")
(match_operand:DI 1 "input_operand"
"r, Y, r, d, m, d,
@@ -8195,9 +8239,9 @@
(define_insn "*movdi_internal64"
[(set (match_operand:DI 0 "nonimmediate_operand"
"=Y, r, r, r, r, r,
- ?m, ?*d, ?*d, ?wY, ?Z, ?*wb,
- ?*wv, ?wi, ?wo, ?wo, ?wv, ?wi,
- ?wi, ?wv, ?wv, r, *h, *h,
+ ^m, ^d, ^d, ^Y, $Z, $wb,
+ $wv, ^wi, *wo, *wo, *wv, *wi,
+ *wi, *wv, *wv, r, *h, *h,
?*r, ?*wg, ?*r, ?*wj")
(match_operand:DI 1 "input_operand"
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ea07438cd2f..f5475ae75b1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR c++/71973
+ * decl.c (duplicate_decls): Warn when a built-in function is redefined.
+ Don't overload builtin functions with C++ functions.
+ Handle const_tm_ptr_type_node like file_ptr_node.
+ Copy the TREE_NOTHROW flag unmodified to the old decl.
+
2016-11-18 Jason Merrill <jason@redhat.com>
PR objc++/78418 - ICE in string tests on darwin
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 19550f3e16e..6893eae084a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1490,16 +1490,23 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
explicitly declared. */
if (DECL_ANTICIPATED (olddecl))
{
- /* Deal with fileptr_type_node. FILE type is not known
- at the time we create the builtins. */
tree t1, t2;
+ /* A new declaration doesn't match a built-in one unless it
+ is also extern "C". */
+ gcc_assert (DECL_IS_BUILTIN (olddecl));
+ gcc_assert (DECL_EXTERN_C_P (olddecl));
+ if (!DECL_EXTERN_C_P (newdecl))
+ return NULL_TREE;
+
for (t1 = TYPE_ARG_TYPES (TREE_TYPE (newdecl)),
t2 = TYPE_ARG_TYPES (TREE_TYPE (olddecl));
t1 || t2;
t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2))
if (!t1 || !t2)
break;
+ /* Deal with fileptr_type_node. FILE type is not known
+ at the time we create the builtins. */
else if (TREE_VALUE (t2) == fileptr_type_node)
{
tree t = TREE_VALUE (t1);
@@ -1520,8 +1527,34 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
TYPE_ARG_TYPES (TREE_TYPE (olddecl)) = oldargs;
}
}
+ /* Likewise for const struct tm*. */
+ else if (TREE_VALUE (t2) == const_tm_ptr_type_node)
+ {
+ tree t = TREE_VALUE (t1);
+
+ if (TYPE_PTR_P (t)
+ && TYPE_IDENTIFIER (TREE_TYPE (t))
+ == get_identifier ("tm")
+ && compparms (TREE_CHAIN (t1), TREE_CHAIN (t2)))
+ {
+ tree oldargs = TYPE_ARG_TYPES (TREE_TYPE (olddecl));
+
+ TYPE_ARG_TYPES (TREE_TYPE (olddecl))
+ = TYPE_ARG_TYPES (TREE_TYPE (newdecl));
+ types_match = decls_match (newdecl, olddecl);
+ if (types_match)
+ return duplicate_decls (newdecl, olddecl,
+ newdecl_is_friend);
+ TYPE_ARG_TYPES (TREE_TYPE (olddecl)) = oldargs;
+ }
+ }
else if (! same_type_p (TREE_VALUE (t1), TREE_VALUE (t2)))
break;
+
+ warning_at (DECL_SOURCE_LOCATION (newdecl),
+ OPT_Wbuiltin_declaration_mismatch,
+ "declaration of %q+#D conflicts with built-in "
+ "declaration %q#D", newdecl, olddecl);
}
else if ((DECL_EXTERN_C_P (newdecl)
&& DECL_EXTERN_C_P (olddecl))
@@ -1531,7 +1564,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
/* A near match; override the builtin. */
if (TREE_PUBLIC (newdecl))
- warning_at (DECL_SOURCE_LOCATION (newdecl), 0,
+ warning_at (DECL_SOURCE_LOCATION (newdecl),
+ OPT_Wbuiltin_declaration_mismatch,
"new declaration %q#D ambiguates built-in "
"declaration %q#D", newdecl, olddecl);
else
@@ -2243,6 +2277,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
TREE_TYPE (olddecl) = TREE_TYPE (newdecl);
TREE_READONLY (olddecl) = TREE_READONLY (newdecl);
TREE_THIS_VOLATILE (olddecl) = TREE_THIS_VOLATILE (newdecl);
+ TREE_NOTHROW (olddecl) = TREE_NOTHROW (newdecl);
TREE_SIDE_EFFECTS (olddecl) = TREE_SIDE_EFFECTS (newdecl);
}
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 78e385e9cf0..fe484c31c93 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1081,19 +1081,59 @@ sysv, aix.
@item --with-multilib-list=@var{list}
@itemx --without-multilib-list
-Specify what multilibs to build.
-Currently only implemented for arm*-*-*, sh*-*-* and x86-64-*-linux*.
+Specify what multilibs to build. @var{list} is a comma separated list of
+values, possibly consisting of a single value. Currently only implemented
+for arm*-*-*, sh*-*-* and x86-64-*-linux*. The accepted values and meaning
+for each target is given below.
@table @code
@item arm*-*-*
-@var{list} is either @code{default} or @code{aprofile}. Specifying
-@code{default} is equivalent to omitting this option while specifying
-@code{aprofile} builds multilibs for each combination of ISA (@code{-marm} or
-@code{-mthumb}), architecture (@code{-march=armv7-a}, @code{-march=armv7ve},
-or @code{-march=armv8-a}), FPU available (none, @code{-mfpu=vfpv3-d16},
-@code{-mfpu=neon}, @code{-mfpu=vfpv4-d16}, @code{-mfpu=neon-vfpv4} or
-@code{-mfpu=neon-fp-armv8} depending on architecture) and floating-point ABI
-(@code{-mfloat-abi=softfp} or @code{-mfloat-abi=hard}).
+@var{list} is one of@code{default}, @code{aprofile} or @code{rmprofile}.
+Specifying @code{default} is equivalent to omitting this option, ie. only the
+default runtime library will be enabled. Specifying @code{aprofile} or
+@code{rmprofile} builds multilibs for a combination of ISA, architecture,
+FPU available and floating-point ABI.
+
+The table below gives the combination of ISAs, architectures, FPUs and
+floating-point ABIs for which multilibs are built for each accepted value.
+
+@multitable @columnfractions .15 .28 .30
+@item Option @tab aprofile @tab rmprofile
+@item ISAs
+@tab @code{-marm} and @code{-mthumb}
+@tab @code{-mthumb}
+@item Architectures@*@*@*@*@*@*
+@tab default architecture@*
+@code{-march=armv7-a}@*
+@code{-march=armv7ve}@*
+@code{-march=armv8-a}@*@*@*
+@tab default architecture@*
+@code{-march=armv6s-m}@*
+@code{-march=armv7-m}@*
+@code{-march=armv7e-m}@*
+@code{-march=armv8-m.base}@*
+@code{-march=armv8-m.main}@*
+@code{-march=armv7}
+@item FPUs@*@*@*@*@*
+@tab none@*
+@code{-mfpu=vfpv3-d16}@*
+@code{-mfpu=neon}@*
+@code{-mfpu=vfpv4-d16}@*
+@code{-mfpu=neon-vfpv4}@*
+@code{-mfpu=neon-fp-armv8}
+@tab none@*
+@code{-mfpu=vfpv3-d16}@*
+@code{-mfpu=fpv4-sp-d16}@*
+@code{-mfpu=fpv5-sp-d16}@*
+@code{-mfpu=fpv5-d16}@*
+@item floating-point@/ ABIs@*@*
+@tab @code{-mfloat-abi=soft}@*
+@code{-mfloat-abi=softfp}@*
+@code{-mfloat-abi=hard}
+@tab @code{-mfloat-abi=soft}@*
+@code{-mfloat-abi=softfp}@*
+@code{-mfloat-abi=hard}
+@end multitable
@item sh*-*-*
@var{list} is a comma separated list of CPU names. These must be of the
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index e6c3dc267cf..e02665318b1 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -259,6 +259,7 @@ Objective-C and Objective-C++ Dialects}.
-Walloca -Walloca-larger-than=@var{n} @gol
-Wno-aggressive-loop-optimizations -Warray-bounds -Warray-bounds=@var{n} @gol
-Wno-attributes -Wbool-compare -Wbool-operation @gol
+-Wno-builtin-declaration-mismatch @gol
-Wno-builtin-macro-redefined -Wc90-c99-compat -Wc99-c11-compat @gol
-Wc++-compat -Wc++11-compat -Wc++14-compat -Wcast-align -Wcast-qual @gol
-Wchar-subscripts -Wclobbered -Wcomment -Wconditionally-supported @gol
@@ -380,11 +381,12 @@ Objective-C and Objective-C++ Dialects}.
-fmove-loop-invariants -fno-branch-count-reg @gol
-fno-defer-pop -fno-fp-int-builtin-inexact -fno-function-cse @gol
-fno-guess-branch-probability -fno-inline -fno-math-errno -fno-peephole @gol
--fno-peephole2 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
+-fno-peephole2 -fno-printf-return-value -fno-sched-interblock @gol
+-fno-sched-spec -fno-signed-zeros @gol
-fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
-fomit-frame-pointer -foptimize-sibling-calls @gol
-fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
--fprefetch-loop-arrays -fprintf-return-value @gol
+-fprefetch-loop-arrays @gol
-fprofile-correction @gol
-fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
-fprofile-reorder-functions @gol
@@ -620,7 +622,6 @@ Objective-C and Objective-C++ Dialects}.
@gccoptlist{-mapcs-frame -mno-apcs-frame @gol
-mabi=@var{name} @gol
-mapcs-stack-check -mno-apcs-stack-check @gol
--mapcs-float -mno-apcs-float @gol
-mapcs-reentrant -mno-apcs-reentrant @gol
-msched-prolog -mno-sched-prolog @gol
-mlittle-endian -mbig-endian @gol
@@ -5925,6 +5926,12 @@ unrecognized attributes, function attributes applied to variables,
etc. This does not stop errors for incorrect use of supported
attributes.
+@item -Wno-builtin-declaration-mismatch
+@opindex Wno-builtin-declaration-mismatch
+@opindex Wbuiltin-declaration-mismatch
+Warn if a built-in function is declared with the wrong signature.
+This warning is enabled by default.
+
@item -Wno-builtin-macro-redefined
@opindex Wno-builtin-macro-redefined
@opindex Wbuiltin-macro-redefined
@@ -8268,18 +8275,19 @@ dependent on the structure of loops within the source code.
Disabled at level @option{-Os}.
-@item -fprintf-return-value
-@opindex fprintf-return-value
-Substitute constants for known return value of formatted output functions
-such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and @code{vsnprintf}
-(but not @code{printf} of @code{fprintf}). This transformation allows GCC
-to optimize or even eliminate branches based on the known return value of
-these functions called with arguments that are either constant, or whose
-values are known to be in a range that makes determining the exact return
-value possible. For example, both the branch and the body of the @code{if}
-statement (but not the call to @code{snprint}) can be optimized away when
-@code{i} is a 32-bit or smaller integer because the return value is guaranteed
-to be at most 8.
+@item -fno-printf-return-value
+@opindex fno-printf-return-value
+Do not substitute constants for known return value of formatted output
+functions such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and
+@code{vsnprintf} (but not @code{printf} of @code{fprintf}). This
+transformation allows GCC to optimize or even eliminate branches based
+on the known return value of these functions called with arguments that
+are either constant, or whose values are known to be in a range that
+makes determining the exact return value possible. For example, when
+@option{-fprintf-return-value} is in effect, both the branch and the
+body of the @code{if} statement (but not the call to @code{snprint})
+can be optimized away when @code{i} is a 32-bit or smaller integer
+because the return value is guaranteed to be at most 8.
@smallexample
char buf[9];
@@ -8290,7 +8298,7 @@ if (snprintf (buf, "%08x", i) >= sizeof buf)
The @option{-fprintf-return-value} option relies on other optimizations
and yields best results with @option{-O2}. It works in tandem with the
@option{-Wformat-length} option. The @option{-fprintf-return-value}
-option is disabled by default.
+option is enabled by default.
@item -fno-peephole
@itemx -fno-peephole2
@@ -14885,16 +14893,6 @@ system is required to provide these functions. The default is
@option{-mno-apcs-stack-check}, since this produces smaller code.
@c not currently implemented
-@item -mapcs-float
-@opindex mapcs-float
-Pass floating-point arguments using the floating-point registers. This is
-one of the variants of the APCS@. This option is recommended if the
-target hardware has a floating-point unit or if a lot of floating-point
-arithmetic is going to be performed by the code. The default is
-@option{-mno-apcs-float}, since the size of integer-only code is
-slightly increased if @option{-mapcs-float} is used.
-
-@c not currently implemented
@item -mapcs-reentrant
@opindex mapcs-reentrant
Generate reentrant, position-independent code. The default is
diff --git a/gcc/expmed.c b/gcc/expmed.c
index a21a632ab18..fa710565f30 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -3994,11 +3994,10 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode,
op1_is_constant = CONST_INT_P (op1);
if (op1_is_constant)
{
- unsigned HOST_WIDE_INT ext_op1 = UINTVAL (op1);
- if (unsignedp)
- ext_op1 &= GET_MODE_MASK (mode);
- op1_is_pow2 = ((EXACT_POWER_OF_2_OR_ZERO_P (ext_op1)
- || (! unsignedp && EXACT_POWER_OF_2_OR_ZERO_P (-ext_op1))));
+ wide_int ext_op1 = rtx_mode_t (op1, mode);
+ op1_is_pow2 = (wi::popcount (ext_op1) == 1
+ || (! unsignedp
+ && wi::popcount (wi::neg (ext_op1)) == 1));
}
/*
@@ -4079,11 +4078,10 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode,
not straightforward to generalize this. Maybe we should make an array
of possible modes in init_expmed? Save this for GCC 2.7. */
- optab1 = ((op1_is_pow2 && op1 != const0_rtx)
+ optab1 = (op1_is_pow2
? (unsignedp ? lshr_optab : ashr_optab)
: (unsignedp ? udiv_optab : sdiv_optab));
- optab2 = ((op1_is_pow2 && op1 != const0_rtx)
- ? optab1
+ optab2 = (op1_is_pow2 ? optab1
: (unsignedp ? udivmod_optab : sdivmod_optab));
for (compute_mode = mode; compute_mode != VOIDmode;
@@ -4139,10 +4137,15 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode,
/* convert_modes may have placed op1 into a register, so we
must recompute the following. */
op1_is_constant = CONST_INT_P (op1);
- op1_is_pow2 = (op1_is_constant
- && ((EXACT_POWER_OF_2_OR_ZERO_P (INTVAL (op1))
- || (! unsignedp
- && EXACT_POWER_OF_2_OR_ZERO_P (-UINTVAL (op1))))));
+ if (op1_is_constant)
+ {
+ wide_int ext_op1 = rtx_mode_t (op1, compute_mode);
+ op1_is_pow2 = (wi::popcount (ext_op1) == 1
+ || (! unsignedp
+ && wi::popcount (wi::neg (ext_op1)) == 1));
+ }
+ else
+ op1_is_pow2 = 0;
}
/* If one of the operands is a volatile MEM, copy it into a register. */
@@ -4182,10 +4185,10 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode,
unsigned HOST_WIDE_INT mh, ml;
int pre_shift, post_shift;
int dummy;
- unsigned HOST_WIDE_INT d = (INTVAL (op1)
- & GET_MODE_MASK (compute_mode));
+ wide_int wd = rtx_mode_t (op1, compute_mode);
+ unsigned HOST_WIDE_INT d = wd.to_uhwi ();
- if (EXACT_POWER_OF_2_OR_ZERO_P (d))
+ if (wi::popcount (wd) == 1)
{
pre_shift = floor_log2 (d);
if (rem_flag)
@@ -4325,7 +4328,7 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode,
else if (d == -1)
quotient = expand_unop (compute_mode, neg_optab, op0,
tquotient, 0);
- else if (HOST_BITS_PER_WIDE_INT >= size
+ else if (size <= HOST_BITS_PER_WIDE_INT
&& abs_d == HOST_WIDE_INT_1U << (size - 1))
{
/* This case is not handled correctly below. */
@@ -4335,6 +4338,7 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode,
goto fail1;
}
else if (EXACT_POWER_OF_2_OR_ZERO_P (d)
+ && (size <= HOST_BITS_PER_WIDE_INT || d >= 0)
&& (rem_flag
? smod_pow2_cheap (speed, compute_mode)
: sdiv_pow2_cheap (speed, compute_mode))
@@ -4348,7 +4352,9 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode,
compute_mode)
!= CODE_FOR_nothing)))
;
- else if (EXACT_POWER_OF_2_OR_ZERO_P (abs_d))
+ else if (EXACT_POWER_OF_2_OR_ZERO_P (abs_d)
+ && (size <= HOST_BITS_PER_WIDE_INT
+ || abs_d != (unsigned HOST_WIDE_INT) d))
{
if (rem_flag)
{
@@ -4483,7 +4489,7 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode,
case FLOOR_DIV_EXPR:
case FLOOR_MOD_EXPR:
/* We will come here only for signed operations. */
- if (op1_is_constant && HOST_BITS_PER_WIDE_INT >= size)
+ if (op1_is_constant && size <= HOST_BITS_PER_WIDE_INT)
{
unsigned HOST_WIDE_INT mh, ml;
int pre_shift, lgup, post_shift;
@@ -4552,9 +4558,8 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode,
op0, constm1_rtx), NULL_RTX);
t2 = expand_binop (compute_mode, ior_optab, op0, t1, NULL_RTX,
0, OPTAB_WIDEN);
- nsign = expand_shift
- (RSHIFT_EXPR, compute_mode, t2,
- size - 1, NULL_RTX, 0);
+ nsign = expand_shift (RSHIFT_EXPR, compute_mode, t2,
+ size - 1, NULL_RTX, 0);
t3 = force_operand (gen_rtx_MINUS (compute_mode, t1, nsign),
NULL_RTX);
t4 = expand_divmod (0, TRUNC_DIV_EXPR, compute_mode, t3, op1,
@@ -4663,7 +4668,10 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode,
case CEIL_MOD_EXPR:
if (unsignedp)
{
- if (op1_is_constant && EXACT_POWER_OF_2_OR_ZERO_P (INTVAL (op1)))
+ if (op1_is_constant
+ && EXACT_POWER_OF_2_OR_ZERO_P (INTVAL (op1))
+ && (size <= HOST_BITS_PER_WIDE_INT
+ || INTVAL (op1) >= 0))
{
rtx t1, t2, t3;
unsigned HOST_WIDE_INT d = INTVAL (op1);
@@ -4876,7 +4884,7 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode,
break;
case EXACT_DIV_EXPR:
- if (op1_is_constant && HOST_BITS_PER_WIDE_INT >= size)
+ if (op1_is_constant && size <= HOST_BITS_PER_WIDE_INT)
{
HOST_WIDE_INT d = INTVAL (op1);
unsigned HOST_WIDE_INT ml;
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 109aca33261..48c533d1eaf 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2016-11-22 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/78443
+ * class.c (add_proc_comp): Add a vtype component for non-overridable
+ procedures that are overriding.
+
2016-11-20 Harald Anlauf <anlauf@gmx.de>
PR fortran/69741
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index 9db86b409b5..ba965c96114 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -751,7 +751,7 @@ add_proc_comp (gfc_symbol *vtype, const char *name, gfc_typebound_proc *tb)
{
gfc_component *c;
- if (tb->non_overridable)
+ if (tb->non_overridable && !tb->overridden)
return;
c = gfc_find_component (vtype, name, true, true, NULL);
diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c
index bd9ba28ee51..6e26484d667 100644
--- a/gcc/gimple-ssa-store-merging.c
+++ b/gcc/gimple-ssa-store-merging.c
@@ -199,17 +199,6 @@ dump_char_array (FILE *fd, unsigned char *ptr, unsigned int len)
fprintf (fd, "\n");
}
-/* Fill a byte array PTR of SZ elements with zeroes. This is to be used by
- encode_tree_to_bitpos to zero-initialize most likely small arrays but
- with a non-compile-time-constant size. */
-
-static inline void
-zero_char_buf (unsigned char *ptr, unsigned int sz)
-{
- for (unsigned int i = 0; i < sz; i++)
- ptr[i] = 0;
-}
-
/* Shift left the bytes in PTR of SZ elements by AMNT bits, carrying over the
bits between adjacent elements. AMNT should be within
[0, BITS_PER_UNIT).
@@ -224,14 +213,13 @@ shift_bytes_in_array (unsigned char *ptr, unsigned int sz, unsigned int amnt)
return;
unsigned char carry_over = 0U;
- unsigned char carry_mask = (~0U) << ((unsigned char)(BITS_PER_UNIT - amnt));
+ unsigned char carry_mask = (~0U) << (unsigned char) (BITS_PER_UNIT - amnt);
unsigned char clear_mask = (~0U) << amnt;
for (unsigned int i = 0; i < sz; i++)
{
unsigned prev_carry_over = carry_over;
- carry_over
- = (ptr[i] & carry_mask) >> (BITS_PER_UNIT - amnt);
+ carry_over = (ptr[i] & carry_mask) >> (BITS_PER_UNIT - amnt);
ptr[i] <<= amnt;
if (i != 0)
@@ -263,10 +251,9 @@ shift_bytes_in_array_right (unsigned char *ptr, unsigned int sz,
for (unsigned int i = 0; i < sz; i++)
{
unsigned prev_carry_over = carry_over;
- carry_over
- = (ptr[i] & carry_mask);
+ carry_over = ptr[i] & carry_mask;
- carry_over <<= ((unsigned char)BITS_PER_UNIT - amnt);
+ carry_over <<= (unsigned char) BITS_PER_UNIT - amnt;
ptr[i] >>= amnt;
ptr[i] |= prev_carry_over;
}
@@ -327,7 +314,7 @@ clear_bit_region (unsigned char *ptr, unsigned int start,
/* Second base case. */
else if ((start + len) <= BITS_PER_UNIT)
{
- unsigned char mask = (~0U) << ((unsigned char)(BITS_PER_UNIT - len));
+ unsigned char mask = (~0U) << (unsigned char) (BITS_PER_UNIT - len);
mask >>= BITS_PER_UNIT - (start + len);
ptr[0] &= ~mask;
@@ -346,8 +333,7 @@ clear_bit_region (unsigned char *ptr, unsigned int start,
unsigned int nbytes = len / BITS_PER_UNIT;
/* We could recurse on each byte but do the loop here to avoid
recursing too deep. */
- for (unsigned int i = 0; i < nbytes; i++)
- ptr[i] = 0U;
+ memset (ptr, '\0', nbytes);
/* Clear the remaining sub-byte region if there is one. */
if (len % BITS_PER_UNIT != 0)
clear_bit_region (ptr + nbytes, 0, len % BITS_PER_UNIT);
@@ -362,7 +348,7 @@ clear_bit_region (unsigned char *ptr, unsigned int start,
static bool
encode_tree_to_bitpos (tree expr, unsigned char *ptr, int bitlen, int bitpos,
- unsigned int total_bytes)
+ unsigned int total_bytes)
{
unsigned int first_byte = bitpos / BITS_PER_UNIT;
tree tmp_int = expr;
@@ -370,8 +356,8 @@ encode_tree_to_bitpos (tree expr, unsigned char *ptr, int bitlen, int bitpos,
|| mode_for_size (bitlen, MODE_INT, 0) == BLKmode;
if (!sub_byte_op_p)
- return native_encode_expr (tmp_int, ptr + first_byte, total_bytes, 0)
- != 0;
+ return (native_encode_expr (tmp_int, ptr + first_byte, total_bytes, 0)
+ != 0);
/* LITTLE-ENDIAN
We are writing a non byte-sized quantity or at a position that is not
@@ -381,7 +367,7 @@ encode_tree_to_bitpos (tree expr, unsigned char *ptr, int bitlen, int bitpos,
xxx xxxxxxxx xxx< bp>
|______EXPR____|
- First native_encode_expr EPXR into a temporary buffer and shift each
+ First native_encode_expr EXPR into a temporary buffer and shift each
byte in the buffer by 'bp' (carrying the bits over as necessary).
|00000000|00xxxxxx|xxxxxxxx| << bp = |000xxxxx|xxxxxxxx|xxx00000|
<------bitlen---->< bp>
@@ -400,7 +386,7 @@ encode_tree_to_bitpos (tree expr, unsigned char *ptr, int bitlen, int bitpos,
<bp >xxx xxxxxxxx xxx
|_____EXPR_____|
- First native_encode_expr EPXR into a temporary buffer and shift each
+ First native_encode_expr EXPR into a temporary buffer and shift each
byte in the buffer to the right by (carrying the bits over as necessary).
We shift by as much as needed to align the most significant bit of EXPR
with bitpos:
@@ -418,7 +404,7 @@ encode_tree_to_bitpos (tree expr, unsigned char *ptr, int bitlen, int bitpos,
/* Allocate an extra byte so that we have space to shift into. */
unsigned int byte_size = GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr))) + 1;
unsigned char *tmpbuf = XALLOCAVEC (unsigned char, byte_size);
- zero_char_buf (tmpbuf, byte_size);
+ memset (tmpbuf, '\0', byte_size);
/* The store detection code should only have allowed constants that are
accepted by native_encode_expr. */
if (native_encode_expr (expr, tmpbuf, byte_size, 0) == 0)
@@ -453,7 +439,7 @@ encode_tree_to_bitpos (tree expr, unsigned char *ptr, int bitlen, int bitpos,
}
/* Clear the bit region in PTR where the bits from TMPBUF will be
- inerted into. */
+ inserted into. */
if (BYTES_BIG_ENDIAN)
clear_bit_region_be (ptr + first_byte,
BITS_PER_UNIT - 1 - (bitpos % BITS_PER_UNIT), bitlen);
@@ -493,7 +479,11 @@ encode_tree_to_bitpos (tree expr, unsigned char *ptr, int bitlen, int bitpos,
/* Create the shifted version of EXPR. */
if (!BYTES_BIG_ENDIAN)
- shift_bytes_in_array (tmpbuf, byte_size, shift_amnt);
+ {
+ shift_bytes_in_array (tmpbuf, byte_size, shift_amnt);
+ if (shift_amnt == 0)
+ byte_size--;
+ }
else
{
gcc_assert (BYTES_BIG_ENDIAN);
@@ -648,8 +638,7 @@ merged_store_group::apply_stores ()
/* Create a buffer of a size that is 2 times the number of bytes we're
storing. That way native_encode_expr can write power-of-2-sized
chunks without overrunning. */
- buf_size
- = 2 * (ROUND_UP (width, BITS_PER_UNIT) / BITS_PER_UNIT);
+ buf_size = 2 * (ROUND_UP (width, BITS_PER_UNIT) / BITS_PER_UNIT);
val = XCNEWVEC (unsigned char, buf_size);
FOR_EACH_VEC_ELT (stores, i, info)
diff --git a/gcc/input.c b/gcc/input.c
index 728f4dd65d7..611e18b541e 100644
--- a/gcc/input.c
+++ b/gcc/input.c
@@ -1322,6 +1322,15 @@ get_substring_ranges_for_loc (cpp_reader *pfile,
if (strloc == UNKNOWN_LOCATION)
return "unknown location";
+ /* Reparsing the strings requires accurate location information.
+ If -ftrack-macro-expansion has been overridden from its default
+ of 2, then we might have a location of a macro expansion point,
+ rather than the location of the literal itself.
+ Avoid this by requiring that we have full macro expansion tracking
+ for substring locations to be available. */
+ if (cpp_get_options (pfile)->track_macro_expansion != 2)
+ return "track_macro_expansion != 2";
+
/* If string concatenation has occurred at STRLOC, get the locations
of all of the literal tokens making up the compound string.
Otherwise, just use STRLOC. */
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index 1ab67f316a4..212e406421c 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -131,27 +131,20 @@ symbol_compare_collection::symbol_compare_collection (symtab_node *node)
/* Constructor for key value pair, where _ITEM is key and _INDEX is a target. */
-sem_usage_pair::sem_usage_pair (sem_item *_item, unsigned int _index):
- item (_item), index (_index)
+sem_usage_pair::sem_usage_pair (sem_item *_item, unsigned int _index)
+: item (_item), index (_index)
{
}
-/* Semantic item constructor for a node of _TYPE, where STACK is used
- for bitmap memory allocation. */
-
-sem_item::sem_item (sem_item_type _type,
- bitmap_obstack *stack): type (_type), m_hash (0)
+sem_item::sem_item (sem_item_type _type, bitmap_obstack *stack)
+: type (_type), m_hash (-1), m_hash_set (false)
{
setup (stack);
}
-/* Semantic item constructor for a node of _TYPE, where STACK is used
- for bitmap memory allocation. The item is based on symtab node _NODE
- with computed _HASH. */
-
sem_item::sem_item (sem_item_type _type, symtab_node *_node,
- hashval_t _hash, bitmap_obstack *stack): type(_type),
- node (_node), m_hash (_hash)
+ bitmap_obstack *stack)
+: type (_type), node (_node), m_hash (-1), m_hash_set (false)
{
decl = node->decl;
setup (stack);
@@ -230,23 +223,20 @@ sem_item::target_supports_symbol_aliases_p (void)
void sem_item::set_hash (hashval_t hash)
{
m_hash = hash;
+ m_hash_set = true;
}
/* Semantic function constructor that uses STACK as bitmap memory stack. */
-sem_function::sem_function (bitmap_obstack *stack): sem_item (FUNC, stack),
- m_checker (NULL), m_compared_func (NULL)
+sem_function::sem_function (bitmap_obstack *stack)
+: sem_item (FUNC, stack), m_checker (NULL), m_compared_func (NULL)
{
bb_sizes.create (0);
bb_sorted.create (0);
}
-/* Constructor based on callgraph node _NODE with computed hash _HASH.
- Bitmap STACK is used for memory allocation. */
-sem_function::sem_function (cgraph_node *node, hashval_t hash,
- bitmap_obstack *stack):
- sem_item (FUNC, node, hash, stack),
- m_checker (NULL), m_compared_func (NULL)
+sem_function::sem_function (cgraph_node *node, bitmap_obstack *stack)
+: sem_item (FUNC, node, stack), m_checker (NULL), m_compared_func (NULL)
{
bb_sizes.create (0);
bb_sorted.create (0);
@@ -279,7 +269,7 @@ sem_function::get_bb_hash (const sem_bb *basic_block)
hashval_t
sem_function::get_hash (void)
{
- if (!m_hash)
+ if (!m_hash_set)
{
inchash::hash hstate;
hstate.add_int (177454); /* Random number for function type. */
@@ -1704,7 +1694,7 @@ sem_function::parse (cgraph_node *node, bitmap_obstack *stack)
|| DECL_STATIC_DESTRUCTOR (node->decl))
return NULL;
- sem_function *f = new sem_function (node, 0, stack);
+ sem_function *f = new sem_function (node, stack);
f->init ();
@@ -1807,19 +1797,12 @@ sem_function::bb_dict_test (vec<int> *bb_dict, int source, int target)
return (*bb_dict)[source] == target;
}
-
-/* Semantic variable constructor that uses STACK as bitmap memory stack. */
-
sem_variable::sem_variable (bitmap_obstack *stack): sem_item (VAR, stack)
{
}
-/* Constructor based on varpool node _NODE with computed hash _HASH.
- Bitmap STACK is used for memory allocation. */
-
-sem_variable::sem_variable (varpool_node *node, hashval_t _hash,
- bitmap_obstack *stack): sem_item(VAR,
- node, _hash, stack)
+sem_variable::sem_variable (varpool_node *node, bitmap_obstack *stack)
+: sem_item (VAR, node, stack)
{
gcc_checking_assert (node);
gcc_checking_assert (get_node ());
@@ -2104,7 +2087,7 @@ sem_variable::parse (varpool_node *node, bitmap_obstack *stack)
|| node->alias)
return NULL;
- sem_variable *v = new sem_variable (node, 0, stack);
+ sem_variable *v = new sem_variable (node, stack);
v->init ();
@@ -2116,7 +2099,7 @@ sem_variable::parse (varpool_node *node, bitmap_obstack *stack)
hashval_t
sem_variable::get_hash (void)
{
- if (m_hash)
+ if (m_hash_set)
return m_hash;
/* All WPA streamed in symbols should have their hashes computed at compile
@@ -2296,8 +2279,9 @@ sem_variable::dump_to_file (FILE *file)
unsigned int sem_item_optimizer::class_id = 0;
-sem_item_optimizer::sem_item_optimizer (): worklist (0), m_classes (0),
- m_classes_count (0), m_cgraph_node_hooks (NULL), m_varpool_node_hooks (NULL)
+sem_item_optimizer::sem_item_optimizer ()
+: worklist (0), m_classes (0), m_classes_count (0), m_cgraph_node_hooks (NULL),
+ m_varpool_node_hooks (NULL)
{
m_items.create (0);
bitmap_obstack_initialize (&m_bmstack);
@@ -2417,13 +2401,17 @@ sem_item_optimizer::read_section (lto_file_decl_data *file_data,
{
cgraph_node *cnode = dyn_cast <cgraph_node *> (node);
- m_items.safe_push (new sem_function (cnode, hash, &m_bmstack));
+ sem_function *fn = new sem_function (cnode, &m_bmstack);
+ fn->set_hash (hash);
+ m_items.safe_push (fn);
}
else
{
varpool_node *vnode = dyn_cast <varpool_node *> (node);
- m_items.safe_push (new sem_variable (vnode, hash, &m_bmstack));
+ sem_variable *var = new sem_variable (vnode, &m_bmstack);
+ var->set_hash (hash);
+ m_items.safe_push (var);
}
}
diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h
index d8de6555f99..e02381c5f70 100644
--- a/gcc/ipa-icf.h
+++ b/gcc/ipa-icf.h
@@ -151,10 +151,8 @@ public:
sem_item (sem_item_type _type, bitmap_obstack *stack);
/* Semantic item constructor for a node of _TYPE, where STACK is used
- for bitmap memory allocation. The item is based on symtab node _NODE
- with computed _HASH. */
- sem_item (sem_item_type _type, symtab_node *_node, hashval_t _hash,
- bitmap_obstack *stack);
+ for bitmap memory allocation. The item is based on symtab node _NODE. */
+ sem_item (sem_item_type _type, symtab_node *_node, bitmap_obstack *stack);
virtual ~sem_item ();
@@ -274,6 +272,9 @@ protected:
/* Hash of item. */
hashval_t m_hash;
+ /* Indicated whether a hash value has been set or not. */
+ bool m_hash_set;
+
private:
/* Initialize internal data structures. Bitmap STACK is used for
bitmap memory allocation process. */
@@ -286,9 +287,9 @@ public:
/* Semantic function constructor that uses STACK as bitmap memory stack. */
sem_function (bitmap_obstack *stack);
- /* Constructor based on callgraph node _NODE with computed hash _HASH.
+ /* Constructor based on callgraph node _NODE.
Bitmap STACK is used for memory allocation. */
- sem_function (cgraph_node *_node, hashval_t _hash, bitmap_obstack *stack);
+ sem_function (cgraph_node *_node, bitmap_obstack *stack);
~sem_function ();
@@ -394,10 +395,10 @@ public:
/* Semantic variable constructor that uses STACK as bitmap memory stack. */
sem_variable (bitmap_obstack *stack);
- /* Constructor based on callgraph node _NODE with computed hash _HASH.
+ /* Constructor based on callgraph node _NODE.
Bitmap STACK is used for memory allocation. */
- sem_variable (varpool_node *_node, hashval_t _hash, bitmap_obstack *stack);
+ sem_variable (varpool_node *_node, bitmap_obstack *stack);
inline virtual void init_wpa (void) {}
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 447c9698c15..732fc8a53ec 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,6 +1,11 @@
+2016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR c++/71973
+ * lto-lang.c (lto_init): Assert const_tm_ptr_type_node is sane.
+
2016-11-18 Richard Sandiford <richard.sandiford@arm.com>
- Alan Hayward <alan.hayward@arm.com>
- David Sherwood <david.sherwood@arm.com>
+ Alan Hayward <alan.hayward@arm.com>
+ David Sherwood <david.sherwood@arm.com>
* lto.c (offload_handle_link_vars): Use SET_DECL_MODE.
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 301cf2124a6..a5f04ba8e72 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -1266,6 +1266,10 @@ lto_init (void)
always use the C definition here in lto1. */
gcc_assert (fileptr_type_node == ptr_type_node);
gcc_assert (TYPE_MAIN_VARIANT (fileptr_type_node) == ptr_type_node);
+ /* Likewise for const struct tm*. */
+ gcc_assert (const_tm_ptr_type_node == const_ptr_type_node);
+ gcc_assert (TYPE_MAIN_VARIANT (const_tm_ptr_type_node)
+ == const_ptr_type_node);
ptrdiff_type_node = integer_type_node;
diff --git a/gcc/omp-simd-clone.c b/gcc/omp-simd-clone.c
index 15f80ab0766..7b8d2a9dc8a 100644
--- a/gcc/omp-simd-clone.c
+++ b/gcc/omp-simd-clone.c
@@ -630,8 +630,9 @@ simd_clone_adjust_argument_types (struct cgraph_node *node)
if (node->definition)
sc->args[i].simd_array
- = create_tmp_simd_array (IDENTIFIER_POINTER (DECL_NAME (parm)),
- parm_type, sc->simdlen);
+ = create_tmp_simd_array (DECL_NAME (parm)
+ ? IDENTIFIER_POINTER (DECL_NAME (parm))
+ : NULL, parm_type, sc->simdlen);
}
adjustments.safe_push (adj);
}
diff --git a/gcc/shrink-wrap.c b/gcc/shrink-wrap.c
index 6996d25db4a..8803200fbe0 100644
--- a/gcc/shrink-wrap.c
+++ b/gcc/shrink-wrap.c
@@ -1687,8 +1687,7 @@ try_shrink_wrapping_separate (basic_block first_bb)
the register for that component is in the IN or GEN or KILL set for
that block. */
df_scan->local_flags |= DF_SCAN_EMPTY_ENTRY_EXIT;
- df_update_entry_block_defs ();
- df_update_exit_block_uses ();
+ df_update_entry_exit_and_calls ();
df_live_add_problem ();
df_live_set_all_dirty ();
df_analyze ();
@@ -1756,8 +1755,7 @@ try_shrink_wrapping_separate (basic_block first_bb)
/* All done. */
df_scan->local_flags &= ~DF_SCAN_EMPTY_ENTRY_EXIT;
- df_update_entry_block_defs ();
- df_update_exit_block_uses ();
+ df_update_entry_exit_and_calls ();
df_live_set_all_dirty ();
df_analyze ();
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 37e840321a5..b125a5518a9 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,146 @@
+2016-11-22 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/78443
+ * gfortran.dg/typebound_proc_35.f90: New test case.
+
+2016-11-22 Georg-Johann Lay <avr@gjlay.de>
+
+ * gcc.c-torture/execute/pr30778.c (memset): Use size_t for 3rd
+ parameter in declaration.
+
+2016-11-22 Georg-Johann Lay <avr@gjlay.de>
+
+ * gcc.dg/loop-split.c: Require int32plus.
+ * gcc.dg/stack-layout-dynamic-1.c: Require ptr32plus.
+
+2016-11-22 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * gcc.target/arm/pr53447-5.c: Fix test expectations for neon-fpu.
+
+2016-11-22 Georg-Johann Lay <avr@gjlay.de>
+
+ * c-c++-common/builtin-shuffle-1.c (V): Use 4 * int in vector.
+
+2016-11-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/78439
+ * gcc.c-torture/compile/pr78439.c: New test.
+
+2016-11-22 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR target/77904
+ * gcc.target/arm/pr77904.c: New test.
+
+2016-11-22 Toma Tabacu <toma.tabacu@imgtec.com>
+
+ * gcc.target/mips/interrupt_handler-bug-1.c (dg-options): Add
+ isa_rev>=2.
+
+2016-11-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/78436
+ * gcc.c-torture/execute/pr78436.c: New test.
+
+ PR middle-end/78416
+ * gcc.dg/torture/pr78416.c: New test.
+
+ PR tree-optimization/78445
+ * gcc.dg/pr78445.c: New test.
+
+2016-11-22 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ PR libgfortran/78449
+ * gfortran.dg/ieee/ieee_8.f90 (aarch64*gnu, arm*gnu*): Mark xfail.
+
+2016-11-21 Jeff Law <law@redhat.com>
+
+ PR target/68538
+ * gcc.c-torture/compile/pr68538.c: New test.
+
+2016-11-21 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ * gcc.target/powerpc/ppc-round2.c: Allow XSCVDPSXWS and XSCVDPUXWS
+ to be generated instead of FCTIWUZ or FCTIWZ.
+
+2016-11-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/67335
+ * g++.dg/vect/simd-clone-7.cc: New test.
+
+ PR c++/71973
+ * g++.dg/torture/pr53321.C (size_t): Use __SIZE_TYPE__ instead of
+ long unsigned int.
+ * g++.dg/torture/pr63512.C (::strlen): Use __SIZE_TYPE__ instead of
+ unsigned long.
+
+2016-11-20 Jeff Law <law@redhat.com>
+
+ PR target/25128
+ * gcc.target/m68k/pr25128.c: New test.
+
+2016-11-21 Richard Sandiford <richard.sandiford@arm.com>
+
+ * gcc.dg/tree-ssa/tailcall-7.c: New test.
+
+2016-11-21 David Malcolm <dmalcolm@redhat.com>
+
+ PR preprocessor/78324
+ * gcc.dg/plugin/diagnostic-test-string-literals-1.c
+ (test_multitoken_macro): New function.
+ * gcc.dg/plugin/diagnostic-test-string-literals-3.c: New test
+ case.
+ * gcc.dg/plugin/diagnostic-test-string-literals-4.c: New test
+ case.
+ * gcc.dg/plugin/plugin.exp (plugin_test_list): Add the new test
+ cases.
+ * gcc.dg/tree-ssa/builtin-sprintf-warn-1.c (test_sprintf_note):
+ Move to...
+ * gcc.dg/tree-ssa/builtin-sprintf-warn-4.c: ...here. Drop
+ -ftrack-macro-expansion=0.
+ (test_sprintf_note): Remove "P" macro. Add
+ dg-begin/end-multiline-output directives.
+ (LINE, buffer, ptr): Copy from builtin-sprintf-warn-1.c.
+
+2016-11-21 Georg-Johann Lay <avr@gjlay.de>
+
+ * lib/target-supports.exp (check_effective_target_tiny) [avr]:
+ Return 1 for AVR_TINY.
+
+2016-11-21 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/71785
+ * gcc.target/powerpc/pr71785.c: New file.
+
+2016-11-21 Bin Cheng <bin.cheng@arm.com>
+
+ PR testsuite/78114
+ * gfortran.dg/vect/fast-math-mgrid-resid.f: Add additional
+ options. Refine test by checking predictive commining PHI
+ nodes in vectorized loop wrto vector factor.
+
+2016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR c++/71973
+ * g++.dg/pr71973-1.C: New test.
+ * g++.dg/pr71973-2.C: New test.
+ * g++.dg/pr71973-3.C: New test.
+ * g++.dg/lto/pr68811_0.C: Add -w to first lto-options.
+ * g++.dg/lookup/extern-c-redecl4.C: Adjust test expectations.
+ * g++.old-deja/g++.mike/p700.C: Add -Wno-builtin-declaration-mismatch
+ to dg-options.
+ * g++.old-deja/g++.other/realloc.C: Likewise.
+ * g++.old-deja/g++.other/builtins10.C: Adjust test expectations.
+
+2016-11-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR tree-optimization/78413
+ * gcc.dg/tree-ssa/pr78413.c: New test.
+
+2016-11-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ * gcc.target/arm/empty_fiq_handler.c: Skip if -mthumb is passed in and
+ target is Thumb-only.
+
2016-11-20 Jeff Law <law@redhat.com>
PR target/48551
diff --git a/gcc/testsuite/c-c++-common/builtin-shuffle-1.c b/gcc/testsuite/c-c++-common/builtin-shuffle-1.c
index 30fd69082dd..eae2cff54dc 100644
--- a/gcc/testsuite/c-c++-common/builtin-shuffle-1.c
+++ b/gcc/testsuite/c-c++-common/builtin-shuffle-1.c
@@ -1,7 +1,7 @@
/* PR c++/78089 */
/* { dg-do run } */
-typedef int V __attribute__((vector_size (16)));
+typedef int V __attribute__((vector_size (4 * __SIZEOF_INT__)));
V a, b, c;
int
diff --git a/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C b/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C
index c385ea701a2..f7fae78259c 100644
--- a/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C
+++ b/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C
@@ -3,7 +3,6 @@
// { dg-options "" }
// { dg-do compile }
-// { dg-final { scan-assembler "call\[\t \]+\[^\$\]*?_Z4forkv" { target i?86-*-* x86_64-*-* } } }
class frok
{
@@ -14,5 +13,5 @@ class frok
void
foo ()
{
- fork ();
+ fork (); // { dg-error "was not declared in this scope" }
}
diff --git a/gcc/testsuite/g++.dg/lto/pr68811_0.C b/gcc/testsuite/g++.dg/lto/pr68811_0.C
index 2ae4eb06b5e..807c803b347 100644
--- a/gcc/testsuite/g++.dg/lto/pr68811_0.C
+++ b/gcc/testsuite/g++.dg/lto/pr68811_0.C
@@ -1,5 +1,5 @@
// { dg-lto-do link }
-/* { dg-lto-options "-O2 -w" } */
+/* { dg-lto-options { { -O2 -w } { -w } } } */
// { dg-extra-ld-options "-r -nostdlib" }
extern "C" char *strcpy(char *, const char *);
char InitXPCOMGlue_lastSlash;
diff --git a/gcc/testsuite/g++.dg/pr71973-1.C b/gcc/testsuite/g++.dg/pr71973-1.C
new file mode 100644
index 00000000000..7da0bb5e706
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr71973-1.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// { dg-options "-Wall -fdump-tree-eh" }
+
+extern "C"
+void fork () // { dg-warning "conflicts with built-in declaration" }
+__attribute__ ((__nothrow__));
+
+void foo () throw ()
+{
+ fork ();
+}
+
+// { dg-final { scan-tree-dump-not "eh_dispatch" "eh" } }
+// { dg-final { scan-tree-dump-not "resx" "eh" } }
diff --git a/gcc/testsuite/g++.dg/pr71973-2.C b/gcc/testsuite/g++.dg/pr71973-2.C
new file mode 100644
index 00000000000..d8271b1d874
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr71973-2.C
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// { dg-options "-Wall -fdump-tree-eh" }
+
+typedef __SIZE_TYPE__ size_t;
+struct tm;
+
+extern "C"
+size_t strftime (char*, size_t, const char*, const struct tm*)
+__attribute__ ((__nothrow__));
+
+void foo () throw ()
+{
+ strftime (0,0,0,0); // { dg-warning "null argument where non-null required" }
+ // { dg-warning "too many arguments for format" "" { target *-*-* } .-1 }
+}
+
+// { dg-final { scan-tree-dump-not "eh_dispatch" "eh" } }
+// { dg-final { scan-tree-dump-not "resx" "eh" } }
diff --git a/gcc/testsuite/g++.dg/pr71973-3.C b/gcc/testsuite/g++.dg/pr71973-3.C
new file mode 100644
index 00000000000..12fd0dcea47
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr71973-3.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// { dg-options "-Wall -fdump-tree-eh" }
+
+extern "C"
+int execve (const char *__path, char *const __argv[], char *const __envp[])
+__attribute__ ((__nothrow__));
+
+void foo () throw ()
+{
+ execve (0,0,0);
+}
+
+// { dg-final { scan-tree-dump-not "eh_dispatch" "eh" } }
+// { dg-final { scan-tree-dump-not "resx" "eh" } }
diff --git a/gcc/testsuite/g++.dg/torture/pr53321.C b/gcc/testsuite/g++.dg/torture/pr53321.C
index 40a2de731d7..4dd5af8443d 100644
--- a/gcc/testsuite/g++.dg/torture/pr53321.C
+++ b/gcc/testsuite/g++.dg/torture/pr53321.C
@@ -2,7 +2,7 @@
// { dg-require-profiling "-fprofile-generate" }
// { dg-options "-fprofile-generate" }
-typedef long unsigned int size_t;
+typedef __SIZE_TYPE__ size_t;
extern "C"
{
diff --git a/gcc/testsuite/g++.dg/torture/pr63512.C b/gcc/testsuite/g++.dg/torture/pr63512.C
index 954901443fd..1c1899dc6d8 100644
--- a/gcc/testsuite/g++.dg/torture/pr63512.C
+++ b/gcc/testsuite/g++.dg/torture/pr63512.C
@@ -2,7 +2,7 @@
extern "C" {
void __assert_fail ();
-unsigned long strlen (const char *);
+__SIZE_TYPE__ strlen (const char *);
}
class A
{
diff --git a/gcc/testsuite/g++.dg/vect/simd-clone-7.cc b/gcc/testsuite/g++.dg/vect/simd-clone-7.cc
new file mode 100644
index 00000000000..fd5751b30bb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/simd-clone-7.cc
@@ -0,0 +1,10 @@
+// PR middle-end/67335
+// { dg-do compile }
+// { dg-additional-options "-fopenmp-simd" }
+
+#pragma omp declare simd notinbranch uniform(y)
+float
+bar (float x, float *y, int)
+{
+ return y[0] + y[1] * x;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p700.C b/gcc/testsuite/g++.old-deja/g++.mike/p700.C
index 531962197df..62247791775 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/p700.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p700.C
@@ -1,5 +1,5 @@
// { dg-do assemble }
-// { dg-options "-Wno-deprecated -Wno-register" }
+// { dg-options "-Wno-deprecated -Wno-register -Wno-builtin-declaration-mismatch" }
// { dg-error "limited range of data type" "16-bit target" { target xstormy16-*-* } 0 }
// prms-id: 700
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins10.C b/gcc/testsuite/g++.old-deja/g++.other/builtins10.C
index 07f74f8f6e5..e5ba8bf6a72 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/builtins10.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins10.C
@@ -1,7 +1,8 @@
// { dg-do assemble }
-// Test that built-in functions don't warn when prototyped without arguments.
+// Test that built-in functions do warn when prototyped without arguments.
// Origin: PR c++/9367
// Copyright (C) 2003 Free Software Foundation.
-extern "C" int snprintf();
+extern "C" int snprintf(); // { dg-warning "conflicts with built-in declaration" "" { target c++11 } }
+extern "C" int printf(); // { dg-warning "conflicts with built-in declaration" }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/realloc.C b/gcc/testsuite/g++.old-deja/g++.other/realloc.C
index 3e50aa80490..8b9c2c60887 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/realloc.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/realloc.C
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-options "-Wno-builtin-declaration-mismatch" }
extern "C" void realloc();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr68538.c b/gcc/testsuite/gcc.c-torture/compile/pr68538.c
new file mode 100644
index 00000000000..2822cdb6b58
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr68538.c
@@ -0,0 +1,52 @@
+struct percpu_counter {
+ signed long long count;
+};
+struct blkg_rwstat {
+ struct percpu_counter cpu_cnt[4];
+};
+struct cfq_group {
+ struct blkg_rwstat service_time;
+};
+struct cfq_queue {
+ struct cfq_group *group;
+};
+struct request {
+ struct cfq_queue *active_queue;
+ unsigned long long cmd_flags;
+ void *priv;
+};
+static void blkg_rwstat_add(struct blkg_rwstat *rwstat, int rw, unsigned long long val)
+{
+ struct percpu_counter *cnt;
+ if (rw & 1)
+ cnt = &rwstat->cpu_cnt[1];
+ else
+ cnt = &rwstat->cpu_cnt[0];
+ cnt->count += val;
+ if (rw & 2)
+ cnt = &rwstat->cpu_cnt[2];
+ else
+ cnt = &rwstat->cpu_cnt[3];
+ cnt->count += val;
+}
+extern unsigned long long rq_start_time_ns(void);
+extern unsigned long long rq_io_start_time_ns(void);
+extern int rq_is_sync(void);
+extern void cfq_arm_slice_timer(void);
+void cfq_completed_request(struct request *rq)
+{
+ struct cfq_queue *queue = rq->priv;
+ int sync = rq_is_sync();
+ struct cfq_group *group = queue->group;
+ long long start_time = rq_start_time_ns();
+ long long io_start_time = rq_io_start_time_ns();
+ int rw = rq->cmd_flags;
+
+ if (io_start_time < 1)
+ blkg_rwstat_add(&group->service_time, rw, 1 - io_start_time);
+ blkg_rwstat_add(0, rw, io_start_time - start_time);
+
+ if (rq->active_queue == queue && sync)
+ cfq_arm_slice_timer();
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr78439.c b/gcc/testsuite/gcc.c-torture/compile/pr78439.c
new file mode 100644
index 00000000000..a8af86bca34
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr78439.c
@@ -0,0 +1,56 @@
+/* PR target/78439. */
+
+enum demangle_component_type
+{
+ DEMANGLE_COMPONENT_THROW_SPEC
+};
+struct demangle_component
+{
+ enum demangle_component_type type;
+ struct
+ {
+ struct
+ {
+ struct demangle_component *left;
+ struct demangle_component *right;
+ };
+ };
+};
+
+int a, b;
+
+struct d_info
+{
+ struct demangle_component *comps;
+ int next_comp;
+ int num_comps;
+ struct demangle_component *subs;
+ int num_subs;
+ int is_conversion;
+};
+
+void
+fn1 (int p1, struct d_info *p2)
+{
+ p2->num_comps = 2 * p1;
+ p2->next_comp = p2->num_subs = p1;
+ p2->is_conversion = 0;
+}
+
+int fn3 (int *);
+void fn4 (struct d_info *, int);
+
+void
+fn2 ()
+{
+ int c;
+ struct d_info d;
+ b = 0;
+ c = fn3 (&a);
+ fn1 (c, &d);
+ struct demangle_component e[d.num_comps];
+ struct demangle_component *f[d.num_subs];
+ d.comps = e;
+ d.subs = (struct demangle_component *) f;
+ fn4 (&d, 1);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr30778.c b/gcc/testsuite/gcc.c-torture/execute/pr30778.c
index 1b05189f499..2a930e63f33 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr30778.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr30778.c
@@ -1,4 +1,4 @@
-extern void *memset (void *, int, unsigned long);
+extern void *memset (void *, int, __SIZE_TYPE__);
extern void abort (void);
struct reg_stat {
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr78436.c b/gcc/testsuite/gcc.c-torture/execute/pr78436.c
new file mode 100644
index 00000000000..ea03d3fa666
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr78436.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/78436 */
+
+struct S
+{
+ long int a : 24;
+ signed char b : 8;
+} s;
+
+__attribute__((noinline, noclone)) void
+foo ()
+{
+ s.b = 0;
+ s.a = -1193165L;
+}
+
+int
+main ()
+{
+ foo ();
+ if (s.b != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/loop-split.c b/gcc/testsuite/gcc.dg/loop-split.c
index 859e2ec3a9b..81fdb700f0a 100644
--- a/gcc/testsuite/gcc.dg/loop-split.c
+++ b/gcc/testsuite/gcc.dg/loop-split.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -fsplit-loops -fdump-tree-lsplit-details" } */
+/* { dg-require-effective-target int32plus } */
#ifdef __cplusplus
extern "C" int printf (const char *, ...);
diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c
index 3e449360f75..76a085e9779 100644
--- a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c
+++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c
@@ -243,6 +243,22 @@ test_macro (void)
{ dg-end-multiline-output "" } */
}
+void
+test_multitoken_macro (void)
+{
+#define RANGE ("0123456789") /* { dg-error "unable to read substring location: macro expansion" } */
+ __emit_string_literal_range (RANGE, 4, 3, 6);
+/* { dg-begin-multiline-output "" }
+ #define RANGE ("0123456789")
+ ^
+ { dg-end-multiline-output "" } */
+/* { dg-begin-multiline-output "" }
+ __emit_string_literal_range (RANGE, 4, 3, 6);
+ ^~~~~
+ { dg-end-multiline-output "" } */
+#undef RANGE
+}
+
/* Verify that the location of the closing quote is used
for the location of the null terminating character. */
diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-3.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-3.c
new file mode 100644
index 00000000000..95b78bc6aeb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-3.c
@@ -0,0 +1,43 @@
+/* Similar to diagnostic-test-string-literals-1.c, but with
+ -ftrack-macro-expansion=0. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -ftrack-macro-expansion=0" } */
+
+extern void __emit_string_literal_range (const void *literal, int caret_idx,
+ int start_idx, int end_idx);
+
+void
+test_simple_string_literal (void)
+{
+ __emit_string_literal_range ("0123456789", /* { dg-error "unable to read substring location: track_macro_expansion != 2" } */
+ 6, 6, 7);
+}
+
+void
+test_concatenated_string_literal (void)
+{
+ __emit_string_literal_range ("01234" "56789", /* { dg-error "unable to read substring location: track_macro_expansion != 2" } */
+ 4, 3, 6);
+}
+
+/* To reproduce PR preprocessor/78324, the macro name should start
+ with the letter 'R'. */
+
+void
+test_macro (void)
+{
+#define RANGE "01234"
+ __emit_string_literal_range (RANGE /* { dg-error "unable to read substring location: track_macro_expansion != 2" } */
+ "56789",
+ 4, 3, 6);
+#undef RANGE
+}
+
+void
+test_multitoken_macro (void)
+{
+#define RANGE ("0123456789")
+ __emit_string_literal_range (RANGE, 4, 3, 6); /* { dg-error "unable to read substring location: track_macro_expansion != 2" } */
+#undef RANGE
+}
diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-4.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-4.c
new file mode 100644
index 00000000000..d47818a7269
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-4.c
@@ -0,0 +1,43 @@
+/* Similar to diagnostic-test-string-literals-1.c, but with
+ -ftrack-macro-expansion=1. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -ftrack-macro-expansion=1" } */
+
+extern void __emit_string_literal_range (const void *literal, int caret_idx,
+ int start_idx, int end_idx);
+
+void
+test_simple_string_literal (void)
+{
+ __emit_string_literal_range ("0123456789", /* { dg-error "unable to read substring location: track_macro_expansion != 2" } */
+ 6, 6, 7);
+}
+
+void
+test_concatenated_string_literal (void)
+{
+ __emit_string_literal_range ("01234" "56789", /* { dg-error "unable to read substring location: track_macro_expansion != 2" } */
+ 4, 3, 6);
+}
+
+/* To reproduce PR preprocessor/78324, the macro name should start
+ with the letter 'R'. */
+
+void
+test_macro (void)
+{
+#define RANGE "01234" /* { dg-error "unable to read substring location: track_macro_expansion != 2" } */
+ __emit_string_literal_range (RANGE
+ "56789",
+ 4, 3, 6);
+#undef RANGE
+}
+
+void
+test_multitoken_macro (void)
+{
+#define RANGE ("0123456789") /* { dg-error "unable to read substring location: track_macro_expansion != 2" } */
+ __emit_string_literal_range (RANGE, 4, 3, 6);
+#undef RANGE
+}
diff --git a/gcc/testsuite/gcc.dg/plugin/plugin.exp b/gcc/testsuite/gcc.dg/plugin/plugin.exp
index 32ca748e2cb..eb15a66391e 100644
--- a/gcc/testsuite/gcc.dg/plugin/plugin.exp
+++ b/gcc/testsuite/gcc.dg/plugin/plugin.exp
@@ -73,7 +73,9 @@ set plugin_test_list [list \
diagnostic-test-show-trees-1.c } \
{ diagnostic_plugin_test_string_literals.c \
diagnostic-test-string-literals-1.c \
- diagnostic-test-string-literals-2.c } \
+ diagnostic-test-string-literals-2.c \
+ diagnostic-test-string-literals-3.c \
+ diagnostic-test-string-literals-4.c } \
{ location_overflow_plugin.c \
location-overflow-test-1.c \
location-overflow-test-2.c } \
diff --git a/gcc/testsuite/gcc.dg/pr78445.c b/gcc/testsuite/gcc.dg/pr78445.c
new file mode 100644
index 00000000000..bb5327b9f70
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr78445.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/78445 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-if-convert -ftree-vectorize" } */
+/* { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } } */
+
+int a;
+
+void
+foo (int x, int *y)
+{
+ while (a != 0)
+ if (x != 0)
+ {
+ *y = a;
+ x = *y;
+ }
+ else
+ x = a;
+}
diff --git a/gcc/testsuite/gcc.dg/stack-layout-dynamic-1.c b/gcc/testsuite/gcc.dg/stack-layout-dynamic-1.c
index 6dc17afc5a5..9f2d37daa8b 100644
--- a/gcc/testsuite/gcc.dg/stack-layout-dynamic-1.c
+++ b/gcc/testsuite/gcc.dg/stack-layout-dynamic-1.c
@@ -2,6 +2,7 @@
in one pass together with normal local variables. */
/* { dg-do compile } */
/* { dg-options "-O0 -fomit-frame-pointer" } */
+/* { dg-require-effective-target ptr32plus } */
extern void bar (void *, void *, void *);
void foo (void)
diff --git a/gcc/testsuite/gcc.dg/torture/pr78416.c b/gcc/testsuite/gcc.dg/torture/pr78416.c
new file mode 100644
index 00000000000..5028156f4fa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr78416.c
@@ -0,0 +1,17 @@
+/* PR middle-end/78416 */
+/* { dg-do run { target int128 } } */
+
+int
+main ()
+{
+ unsigned __int128 x;
+ x = 0xFFFFFFFFFFFFFFFFULL;
+ x /= ~0x7FFFFFFFFFFFFFFFLL;
+ if (x != 0)
+ __builtin_abort ();
+ x = ~0x7FFFFFFFFFFFFFFELL;
+ x /= ~0x7FFFFFFFFFFFFFFFLL;
+ if (x != 1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-1.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-1.c
index 5779a95f8df..a24889bb0e9 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-1.c
@@ -170,35 +170,6 @@ void test_sprintf_zero_length_array (void *p, int i)
__builtin_sprintf (buffer (1), "%s", s [i].a);
}
-/* Verify that the note printed along with the diagnostic mentions
- the correct sizes and refers to the location corresponding to
- the affected directive. */
-
-void test_sprintf_note (void)
-{
-#define P __builtin_sprintf
-
- /* Diagnostic column numbers are 1-based. */
-
- P (buffer (0), /* { dg-message "format output 4 bytes into a destination of size 0" } */
- "%c%s%i", '1', "2", 3); /* { dg-warning "7:.%c. directive writing 1 byte into a region of size 0" } */
-
- P (buffer (1), /* { dg-message "format output 6 bytes into a destination of size 1" } */
- "%c%s%i", '1', "23", 45); /* { dg-warning "9:.%s. directive writing 2 bytes into a region of size 0" } */
-
- P (buffer (2), /* { dg-message "format output 6 bytes into a destination of size 2" } */
- "%c%s%i", '1', "2", 345); /* { dg-warning "11:.%i. directive writing 3 bytes into a region of size 0" } */
-
- /* It would be nice if the caret in the location range for the format
- string below could be made to point at the closing quote of the format
- string, like so:
- sprintf (d, "%c%s%i", '1', "2", 3456);
- ~~~~~~^
- Unfortunately, that doesn't work with the current setup. */
- P (buffer (6), /* { dg-message "format output 7 bytes into a destination of size 6" } */
- "%c%s%i", '1', "2", 3456); /* { dg-warning "writing a terminating nul past the end of the destination" } */
-}
-
#undef T
#define T(size, fmt, ...) \
__builtin___sprintf_chk (buffer (size), 0, objsize (size), fmt, \
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c
index faa5806aa52..3b3fb68b40d 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-Wformat -Wformat-length=1 -fdiagnostics-show-caret -ftrack-macro-expansion=0" } */
+/* { dg-options "-Wformat -Wformat-length=1 -fdiagnostics-show-caret" } */
extern int sprintf (char*, const char*, ...);
@@ -91,3 +91,81 @@ void test (void)
}
/* { dg-prune-output "too many arguments for format" } */
+
+/* When debugging, define LINE to the line number of the test case to exercise
+ and avoid exercising any of the others. The buffer macro
+ below makes use of LINE to avoid warnings for other lines. */
+#ifndef LINE
+# define LINE 0
+#endif
+
+char buffer [256];
+extern char *ptr;
+
+/* Evaluate to an array of SIZE characters when non-negative and LINE
+ is not set or set to the line the macro is on, or to a pointer to
+ an unknown object otherwise. */
+#define buffer(size) \
+ (0 <= size && (!LINE || __LINE__ == LINE) \
+ ? buffer + sizeof buffer - size : ptr)
+
+/* Verify that the note printed along with the diagnostic mentions
+ the correct sizes and refers to the location corresponding to
+ the affected directive. */
+
+void test_sprintf_note (void)
+{
+ /* Diagnostic column numbers are 1-based. */
+
+ __builtin_sprintf (buffer (0), "%c%s%i", '1', "2", 3);
+ /* { dg-warning "35: .%c. directive writing 1 byte into a region of size 0" "" { target *-*-* } .-1 }
+ { dg-begin-multiline-output "" }
+ __builtin_sprintf (buffer (0), "%c%s%i", '1', "2", 3);
+ ^~
+ { dg-end-multiline-output "" }
+
+ { dg-message "format output 4 bytes into a destination of size 0" "" { target *-*-* } .-7 }
+ { dg-begin-multiline-output "" }
+ __builtin_sprintf (buffer (0), "%c%s%i", '1', "2", 3);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ { dg-end-multiline-output "" } */
+
+ __builtin_sprintf (buffer (1), "%c%s%i", '1', "23", 45);
+ /* { dg-warning "37: .%s. directive writing 2 bytes into a region of size 0" "" { target *-*-* } .-1 }
+ { dg-begin-multiline-output "" }
+ __builtin_sprintf (buffer (1), "%c%s%i", '1', "23", 45);
+ ^~ ~~~~
+ { dg-end-multiline-output "" }
+
+ { dg-message "format output 6 bytes into a destination of size 1" "" { target *-*-* } .-7 }
+ { dg-begin-multiline-output "" }
+ __builtin_sprintf (buffer (1), "%c%s%i", '1', "23", 45);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ { dg-end-multiline-output "" } */
+
+ __builtin_sprintf (buffer (2), "%c%s%i", '1', "2", 345);
+ /* { dg-warning "39: .%i. directive writing 3 bytes into a region of size 0" "" { target *-*-* } .-1 }
+ { dg-begin-multiline-output "" }
+ __builtin_sprintf (buffer (2), "%c%s%i", '1', "2", 345);
+ ^~
+ { dg-end-multiline-output "" }
+
+ { dg-message "format output 6 bytes into a destination of size 2" "" { target *-*-* } .-7 }
+ { dg-begin-multiline-output "" }
+ __builtin_sprintf (buffer (2), "%c%s%i", '1', "2", 345);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ { dg-end-multiline-output "" } */
+
+ __builtin_sprintf (buffer (6), "%c%s%i", '1', "2", 3456);
+ /* { dg-warning "41: writing a terminating nul past the end of the destination" "" { target *-*-* } .-1 }
+ { dg-begin-multiline-output "" }
+ __builtin_sprintf (buffer (6), "%c%s%i", '1', "2", 3456);
+ ~~~~~~^
+ { dg-end-multiline-output "" }
+
+ { dg-message "format output 7 bytes into a destination of size 6" "" { target *-*-* } .-7 }
+ { dg-begin-multiline-output "" }
+ __builtin_sprintf (buffer (6), "%c%s%i", '1', "2", 3456);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ { dg-end-multiline-output "" } */
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr78413.c b/gcc/testsuite/gcc.dg/tree-ssa/pr78413.c
new file mode 100644
index 00000000000..049ecd79d4c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr78413.c
@@ -0,0 +1,35 @@
+/* PR78413. These previously failed in tree if-conversion due to a loop
+ latch with multiple predecessors that the code did not anticipate. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -fno-strict-aliasing" } */
+
+extern long long int llrint(double x);
+int a;
+double b;
+__attribute__((cold)) void decode_init() {
+ int c, d = 0;
+ for (; d < 12; d++) {
+ if (d)
+ b = 0;
+ c = 0;
+ for (; c < 6; c++)
+ a = b ? llrint(b) : 0;
+ }
+}
+
+struct S {
+ _Bool bo;
+};
+int a, bb, c, d;
+void fn1() {
+ do
+ do
+ do {
+ struct S *e = (struct S *)1;
+ do
+ bb = a / (e->bo ? 2 : 1);
+ while (bb);
+ } while (0);
+ while (d);
+ while (c);
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/tailcall-7.c b/gcc/testsuite/gcc.dg/tree-ssa/tailcall-7.c
new file mode 100644
index 00000000000..eabf1a86dd3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/tailcall-7.c
@@ -0,0 +1,89 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-tailc-details" } */
+
+struct s { int x; };
+struct s f (int);
+struct s global;
+void callit (void (*) (void));
+
+/* Tail call. */
+void
+g1 (void)
+{
+ f (1);
+}
+
+/* Not a tail call. */
+void
+g2 (void)
+{
+ global = f (2);
+}
+
+/* Not a tail call. */
+void
+g3 (struct s *ptr)
+{
+ *ptr = f (3);
+}
+
+/* Tail call. */
+struct s
+g4 (struct s param)
+{
+ param = f (4);
+ return param;
+}
+
+/* Tail call. */
+struct s
+g5 (void)
+{
+ struct s local = f (5);
+ return local;
+}
+
+/* Tail call. */
+struct s
+g6 (void)
+{
+ return f (6);
+}
+
+/* Not a tail call. */
+struct s
+g7 (void)
+{
+ struct s local = f (7);
+ global = local;
+ return local;
+}
+
+/* Not a tail call. */
+struct s
+g8 (struct s *ptr)
+{
+ struct s local = f (8);
+ *ptr = local;
+ return local;
+}
+
+/* Not a tail call. */
+int
+g9 (struct s param)
+{
+ void inner (void) { param = f (9); }
+ callit (inner);
+ return 9;
+}
+
+/* Tail call. */
+int
+g10 (int param)
+{
+ void inner (void) { f (param); }
+ callit (inner);
+ return 10;
+}
+
+/* { dg-final { scan-tree-dump-times "Found tail call" 5 "tailc" } } */
diff --git a/gcc/testsuite/gcc.target/arm/empty_fiq_handler.c b/gcc/testsuite/gcc.target/arm/empty_fiq_handler.c
index bbcfd0e32f9..8313f219912 100644
--- a/gcc/testsuite/gcc.target/arm/empty_fiq_handler.c
+++ b/gcc/testsuite/gcc.target/arm/empty_fiq_handler.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-skip-if "" { ! arm_cortex_m } { "-mthumb" } } */
/* Below code used to trigger an ICE due to missing constraints for
sp = fp + cst pattern. */
diff --git a/gcc/testsuite/gcc.target/arm/pr53447-5.c b/gcc/testsuite/gcc.target/arm/pr53447-5.c
index 35988f404f9..da91811710a 100644
--- a/gcc/testsuite/gcc.target/arm/pr53447-5.c
+++ b/gcc/testsuite/gcc.target/arm/pr53447-5.c
@@ -15,5 +15,8 @@ void foo(long long* p)
p[9] -= p[10];
}
-/* { dg-final { scan-assembler-times "ldrd" 10 } } */
-/* { dg-final { scan-assembler-times "strd" 9 } } */
+/* We accept neon instructions vldr.64 and vstr.64 as well.
+ Note: DejaGnu counts patterns with alternatives twice,
+ so actually there are only 10 loads and 9 stores. */
+/* { dg-final { scan-assembler-times "(ldrd|vldr\\.64)" 20 } } */
+/* { dg-final { scan-assembler-times "(strd|vstr\\.64)" 18 } } */
diff --git a/gcc/testsuite/gcc.target/arm/pr77904.c b/gcc/testsuite/gcc.target/arm/pr77904.c
new file mode 100644
index 00000000000..76728c07e73
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr77904.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+__attribute__ ((noinline, noclone)) void
+clobber_sp (void)
+{
+ __asm volatile ("" : : : "sp");
+}
+
+int
+main (void)
+{
+ int ret;
+
+ __asm volatile ("mov\tr4, #0xf4\n\t"
+ "mov\tr5, #0xf5\n\t"
+ "mov\tr6, #0xf6\n\t"
+ "mov\tr7, #0xf7\n\t"
+ "mov\tr0, #0xf8\n\t"
+ "mov\tr8, r0\n\t"
+ "mov\tr0, #0xfa\n\t"
+ "mov\tr10, r0"
+ : : : "r0", "r4", "r5", "r6", "r7", "r8", "r10");
+ clobber_sp ();
+
+ __asm volatile ("cmp\tr4, #0xf4\n\t"
+ "bne\tfail\n\t"
+ "cmp\tr5, #0xf5\n\t"
+ "bne\tfail\n\t"
+ "cmp\tr6, #0xf6\n\t"
+ "bne\tfail\n\t"
+ "cmp\tr7, #0xf7\n\t"
+ "bne\tfail\n\t"
+ "mov\tr0, r8\n\t"
+ "cmp\tr0, #0xf8\n\t"
+ "bne\tfail\n\t"
+ "mov\tr0, r10\n\t"
+ "cmp\tr0, #0xfa\n\t"
+ "bne\tfail\n\t"
+ "mov\t%0, #1\n"
+ "fail:\n\t"
+ "sub\tr0, #1"
+ : "=r" (ret) : :);
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.target/m68k/pr25128.c b/gcc/testsuite/gcc.target/m68k/pr25128.c
new file mode 100644
index 00000000000..f99f817d426
--- /dev/null
+++ b/gcc/testsuite/gcc.target/m68k/pr25128.c
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+/* { dg-final { scan-assembler-times "swap" 4 } } */
+/* { dg-final { scan-assembler-times "tst.w" 4 } } */
+/* { dg-final { scan-assembler-not "cmp.l" } } */
+
+
+unsigned int bar (void);
+void
+foo1 (void)
+{
+ unsigned int a = bar ();
+ if (0x10000 <= a)
+ bar ();
+}
+
+
+void
+foo2 (void)
+{
+ unsigned int a = bar ();
+ if (0x10000 > a)
+ bar ();
+}
+
+
+void
+foo3 (void)
+{
+ int a = bar ();
+ if (0x10000 <= a)
+ bar ();
+}
+
+
+void
+foo4 (void)
+{
+ int a = bar ();
+ if (0x10000 > a)
+ bar ();
+}
+
+
+
+
+
diff --git a/gcc/testsuite/gcc.target/mips/interrupt_handler-bug-1.c b/gcc/testsuite/gcc.target/mips/interrupt_handler-bug-1.c
index 2784705b176..083e1524450 100644
--- a/gcc/testsuite/gcc.target/mips/interrupt_handler-bug-1.c
+++ b/gcc/testsuite/gcc.target/mips/interrupt_handler-bug-1.c
@@ -1,4 +1,4 @@
-/* { dg-options "-funroll-loops" } */
+/* { dg-options "-funroll-loops isa_rev>=2" } */
int foo;
int bar;
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-round2.c b/gcc/testsuite/gcc.target/powerpc/ppc-round2.c
index 39375a0e9d5..1890fca10be 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-round2.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-round2.c
@@ -5,8 +5,8 @@
/* { dg-options "-O2 -mcpu=power8" } */
/* { dg-final { scan-assembler-times "fcfid " 2 } } */
/* { dg-final { scan-assembler-times "fcfids " 2 } } */
-/* { dg-final { scan-assembler-times "fctiwuz " 2 } } */
-/* { dg-final { scan-assembler-times "fctiwz " 2 } } */
+/* { dg-final { scan-assembler-times "fctiwuz \|xscvdpuxws " 2 } } */
+/* { dg-final { scan-assembler-times "fctiwz \|xscvdpsxws " 2 } } */
/* { dg-final { scan-assembler-times "mfvsrd " 4 } } */
/* { dg-final { scan-assembler-times "mtvsrwa " 2 } } */
/* { dg-final { scan-assembler-times "mtvsrwz " 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr71785.c b/gcc/testsuite/gcc.target/powerpc/pr71785.c
new file mode 100644
index 00000000000..613dcd1a937
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr71785.c
@@ -0,0 +1,52 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not {\mb\M} } } */
+
+/* Check that all computed gotos in this testcase end up unfactored completely.
+ If some is not there will be a unconditional jump left; if all works fine,
+ all are gone. */
+
+typedef enum opcode
+{
+ OP_A,
+ OP_B,
+ OP_END
+} opcode;
+
+typedef struct op
+{
+ opcode opcode;
+ int arg;
+} op;
+
+extern void do_stuff_b(int arg);
+extern void do_stuff_c(int arg);
+
+extern int someglobal;
+
+void
+eval(op *op)
+{
+ static const void *dispatch_table[] = {
+ &&CASE_OP_A,
+ &&CASE_OP_B,
+ &&CASE_OP_C,
+ &&CASE_OP_END
+ };
+
+ goto *dispatch_table[op->opcode];
+CASE_OP_A:
+ someglobal++;
+ op++;
+ goto *dispatch_table[op->opcode];
+CASE_OP_B:
+ do_stuff_b(op->arg);
+ op++;
+ goto *dispatch_table[op->opcode];
+CASE_OP_C:
+ do_stuff_c(op->arg);
+ op++;
+ goto *dispatch_table[op->opcode];
+CASE_OP_END:
+ return;
+}
diff --git a/gcc/testsuite/gfortran.dg/ieee/ieee_8.f90 b/gcc/testsuite/gfortran.dg/ieee/ieee_8.f90
index 9806bcf9e18..7d0cdfd0e03 100644
--- a/gcc/testsuite/gfortran.dg/ieee/ieee_8.f90
+++ b/gcc/testsuite/gfortran.dg/ieee/ieee_8.f90
@@ -1,4 +1,5 @@
-! { dg-do run }
+! { dg-do run { xfail aarch64*-*-gnu arm*-*-gnueabi arm*-*-gnueabihf } }
+! XFAIL because of PR libfortran/78449.
module foo
use :: ieee_exceptions
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_35.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_35.f90
new file mode 100644
index 00000000000..18b1ed98668
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_proc_35.f90
@@ -0,0 +1,88 @@
+! { dg-do run }
+!
+! PR 78443: [OOP] Incorrect behavior with non_overridable keyword
+!
+! Contributed by federico <perini@wisc.edu>
+
+module types
+ implicit none
+
+
+ ! Abstract parent class and its child type
+ type, abstract :: P1
+ contains
+ procedure :: test => test1
+ procedure (square_interface), deferred :: square
+ endtype
+
+ ! Deferred procedure interface
+ abstract interface
+ function square_interface( this, x ) result( y )
+ import P1
+ class(P1) :: this
+ real :: x, y
+ end function square_interface
+ end interface
+
+ type, extends(P1) :: C1
+ contains
+ procedure, non_overridable :: square => C1_square
+ endtype
+
+ ! Non-abstract parent class and its child type
+ type :: P2
+ contains
+ procedure :: test => test2
+ procedure :: square => P2_square
+ endtype
+
+ type, extends(P2) :: C2
+ contains
+ procedure, non_overridable :: square => C2_square
+ endtype
+
+contains
+
+ real function test1( this, x )
+ class(P1) :: this
+ real :: x
+ test1 = this % square( x )
+ end function
+
+ real function test2( this, x )
+ class(P2) :: this
+ real :: x
+ test2 = this % square( x )
+ end function
+
+ function P2_square( this, x ) result( y )
+ class(P2) :: this
+ real :: x, y
+ y = -100. ! dummy
+ end function
+
+ function C1_square( this, x ) result( y )
+ class(C1) :: this
+ real :: x, y
+ y = x**2
+ end function
+
+ function C2_square( this, x ) result( y )
+ class(C2) :: this
+ real :: x, y
+ y = x**2
+ end function
+
+end module
+
+program main
+ use types
+ implicit none
+ type(P2) :: t1
+ type(C2) :: t2
+ type(C1) :: t3
+
+ if ( t1 % test( 2. ) /= -100.) call abort()
+ if ( t2 % test( 2. ) /= 4.) call abort()
+ if ( t3 % test( 2. ) /= 4.) call abort()
+end program
diff --git a/gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f b/gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f
index 88238f9b70e..54f1e9eac63 100644
--- a/gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f
+++ b/gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f
@@ -1,7 +1,7 @@
! { dg-do compile }
! { dg-require-effective-target vect_double }
-! { dg-options "-O3 -fpredictive-commoning -fdump-tree-pcom-details" }
-
+! { dg-options "-O3 --param vect-max-peeling-for-alignment=0 -fpredictive-commoning -fdump-tree-pcom-details" }
+! { dg-additional-options "-mprefer-avx128" { target { i?86-*-* x86_64-*-* } } }
******* RESID COMPUTES THE RESIDUAL: R = V - AU
*
@@ -38,8 +38,8 @@ C
RETURN
END
! we want to check that predictive commoning did something on the
-! vectorized loop.
-! { dg-final { scan-tree-dump-times "Executing predictive commoning without unrolling" 1 "pcom" { target lp64 } } }
-! { dg-final { scan-tree-dump-times "Executing predictive commoning without unrolling" 2 "pcom" { target ia32 } } }
-! { dg-final { scan-tree-dump-times "Predictive commoning failed: no suitable chains" 0 "pcom" } }
-! { dg-final { scan-tree-dump-times "Loop iterates only 1 time, nothing to do" 1 "pcom" } }
+! vectorized loop. If vector factor is 2, the vectorized loop can
+! be predictive commoned, we check if predictive commoning PHI node
+! is created with vector(2) type.
+! { dg-final { scan-tree-dump "Executing predictive commoning without unrolling" "pcom" } }
+! { dg-final { scan-tree-dump "vectp_u.*__lsm.* = PHI <.*vectp_u.*__lsm" "pcom" } }
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 8a2abd2c4cc..201bbf393d0 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -7864,7 +7864,7 @@ proc check_effective_target_fenv_exceptions {} {
proc check_effective_target_tiny {} {
global et_target_tiny_saved
- if [info exists et_target_tine_saved] {
+ if [info exists et_target_tiny_saved] {
verbose "check_effective_target_tiny: using cached result" 2
} else {
set et_target_tiny_saved 0
@@ -7872,6 +7872,10 @@ proc check_effective_target_tiny {} {
&& [check_effective_target_aarch64_tiny] } {
set et_target_tiny_saved 1
}
+ if { [istarget avr-*-*]
+ && [check_effective_target_avr_tiny] } {
+ set et_target_tiny_saved 1
+ }
}
return $et_target_tiny_saved
diff --git a/gcc/tree-core.h b/gcc/tree-core.h
index 3e3f31e2726..a3d220df246 100644
--- a/gcc/tree-core.h
+++ b/gcc/tree-core.h
@@ -618,6 +618,7 @@ enum tree_index {
TI_VA_LIST_FPR_COUNTER_FIELD,
TI_BOOLEAN_TYPE,
TI_FILEPTR_TYPE,
+ TI_CONST_TM_PTR_TYPE,
TI_POINTER_SIZED_TYPE,
TI_POINTER_BOUNDS_TYPE,
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 1235faf81b6..13e12c63e1e 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -2575,6 +2575,8 @@ version_loop_for_if_conversion (struct loop *loop)
- The loop has a single exit.
- The loop header has a single successor, which is the inner
loop header.
+ - Each of the inner and outer loop latches have a single
+ predecessor.
- The loop exit block has a single predecessor, which is the
inner loop's exit block. */
@@ -2586,7 +2588,9 @@ versionable_outer_loop_p (struct loop *loop)
|| loop->inner->next
|| !single_exit (loop)
|| !single_succ_p (loop->header)
- || single_succ (loop->header) != loop->inner->header)
+ || single_succ (loop->header) != loop->inner->header
+ || !single_pred_p (loop->latch)
+ || !single_pred_p (loop->inner->latch))
return false;
basic_block outer_exit = single_pred (loop->latch);
@@ -2804,15 +2808,20 @@ tree_if_conversion (struct loop *loop)
goto cleanup;
/* Since we have no cost model, always version loops unless the user
- specified -ftree-loop-if-convert. Either version this loop, or if
- the pattern is right for outer-loop vectorization, version the
- outer loop. In the latter case we will still if-convert the
- original inner loop. */
- if (flag_tree_loop_if_convert != 1
- && !version_loop_for_if_conversion
- (versionable_outer_loop_p (loop_outer (loop))
- ? loop_outer (loop) : loop))
- goto cleanup;
+ specified -ftree-loop-if-convert or unless versioning is required.
+ Either version this loop, or if the pattern is right for outer-loop
+ vectorization, version the outer loop. In the latter case we will
+ still if-convert the original inner loop. */
+ if (any_pred_load_store
+ || any_complicated_phi
+ || flag_tree_loop_if_convert != 1)
+ {
+ struct loop *vloop
+ = (versionable_outer_loop_p (loop_outer (loop))
+ ? loop_outer (loop) : loop);
+ if (!version_loop_for_if_conversion (vloop))
+ goto cleanup;
+ }
/* Now all statements are if-convertible. Combine all the basic
blocks into one huge basic block doing the if-conversion
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index 43ee85aae92..0a2ee5ea25f 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -48,10 +48,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h"
#include "tree-data-ref.h"
-
-/* FIXME: Needed for optabs, but this should all be moved to a TBD interface
- between the GIMPLE and RTL worlds. */
-
/* This pass inserts prefetch instructions to optimize cache usage during
accesses to arrays in loops. It processes loops sequentially and:
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index 0436f0f04a6..f97541d35a5 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -269,7 +269,7 @@ process_assignment (gassign *stmt, gimple_stmt_iterator call, tree *m,
conversions that can never produce extra code between the function
call and the function return. */
if ((rhs_class == GIMPLE_SINGLE_RHS || gimple_assign_cast_p (stmt))
- && (TREE_CODE (src_var) == SSA_NAME))
+ && src_var == *ass_var)
{
/* Reject a tailcall if the type conversion might need
additional code. */
@@ -287,9 +287,6 @@ process_assignment (gassign *stmt, gimple_stmt_iterator call, tree *m,
return false;
}
- if (src_var != *ass_var)
- return false;
-
*ass_var = dest;
return true;
}
@@ -428,6 +425,13 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
break;
}
+ /* Allow simple copies between local variables, even if they're
+ aggregates. */
+ if (is_gimple_assign (stmt)
+ && auto_var_in_fn_p (gimple_assign_lhs (stmt), cfun->decl)
+ && auto_var_in_fn_p (gimple_assign_rhs1 (stmt), cfun->decl))
+ continue;
+
/* If the statement references memory or volatile operands, fail. */
if (gimple_references_memory_p (stmt)
|| gimple_has_volatile_ops (stmt))
@@ -444,18 +448,20 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
return;
}
- /* If the LHS of our call is not just a simple register, we can't
- transform this into a tail or sibling call. This situation happens,
- in (e.g.) "*p = foo()" where foo returns a struct. In this case
- we won't have a temporary here, but we need to carry out the side
- effect anyway, so tailcall is impossible.
+ /* If the LHS of our call is not just a simple register or local
+ variable, we can't transform this into a tail or sibling call.
+ This situation happens, in (e.g.) "*p = foo()" where foo returns a
+ struct. In this case we won't have a temporary here, but we need
+ to carry out the side effect anyway, so tailcall is impossible.
??? In some situations (when the struct is returned in memory via
invisible argument) we could deal with this, e.g. by passing 'p'
itself as that argument to foo, but it's too early to do this here,
and expand_call() will not handle it anyway. If it ever can, then
we need to revisit this here, to allow that situation. */
- if (ass_var && !is_gimple_reg (ass_var))
+ if (ass_var
+ && !is_gimple_reg (ass_var)
+ && !auto_var_in_fn_p (ass_var, cfun->decl))
return;
/* We found the call, check whether it is suitable. */
@@ -888,7 +894,7 @@ eliminate_tail_call (struct tailcall *t)
call = gsi_stmt (t->call_gsi);
rslt = gimple_call_lhs (call);
- if (rslt != NULL_TREE)
+ if (rslt != NULL_TREE && TREE_CODE (rslt) == SSA_NAME)
{
/* Result of the call will no longer be defined. So adjust the
SSA_NAME_DEF_STMT accordingly. */
diff --git a/gcc/tree.c b/gcc/tree.c
index adf140fe94c..a4c5b1b968d 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -6006,6 +6006,7 @@ free_lang_data (void)
/* Create gimple variants for common types. */
ptrdiff_type_node = integer_type_node;
fileptr_type_node = ptr_type_node;
+ const_tm_ptr_type_node = const_ptr_type_node;
/* Reset some langhooks. Do not reset types_compatible_p, it may
still be used indirectly via the get_alias_set langhook. */
@@ -10332,6 +10333,7 @@ build_common_tree_nodes (bool signed_char)
const_ptr_type_node
= build_pointer_type (build_type_variant (void_type_node, 1, 0));
fileptr_type_node = ptr_type_node;
+ const_tm_ptr_type_node = const_ptr_type_node;
pointer_sized_int_node = build_nonstandard_integer_type (POINTER_SIZE, 1);
diff --git a/gcc/tree.h b/gcc/tree.h
index b0b3f05570c..b4ec3fd0690 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -3672,6 +3672,8 @@ tree_operand_check_code (const_tree __t, enum tree_code __code, int __i,
#define va_list_fpr_counter_field global_trees[TI_VA_LIST_FPR_COUNTER_FIELD]
/* The C type `FILE *'. */
#define fileptr_type_node global_trees[TI_FILEPTR_TYPE]
+/* The C type `const struct tm *'. */
+#define const_tm_ptr_type_node global_trees[TI_CONST_TM_PTR_TYPE]
#define pointer_sized_int_node global_trees[TI_POINTER_SIZED_TYPE]
#define boolean_type_node global_trees[TI_BOOLEAN_TYPE]
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index d82aaa4aff5..29d6eb7b711 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,74 @@
+2016-11-22 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/78465
+ * testsuite/29_atomics/headers/atomic/macros.cc: Replace runtime tests
+ with preprocessor conditions.
+
+2016-11-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Update comments.
+ (__CORRECT_ISO_CPP11_MATH_H_PROTO): Rename to ...
+ (__CORRECT_ISO_CPP11_MATH_H_PROTO_FP): ... this.
+ Add test for C++11 <math.h> integral overloads.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+
+ * include/c_global/cmath [__cplusplus >= 201103L]: Reflect
+ __CORRECT_ISO_CPP11_MATH_H_PROTO to
+ __CORRECT_ISO_CPP11_MATH_H_PROTO_FP rename.
+ * include/c_global/cmath [_GLIBCXX_USE_C99_MATH &&
+ !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC && __cplusplus >= 201103L]
+ (std::fpclassify): Wrap in !__CORRECT_ISO_CPP11_MATH_H_PROTO_INT.
+ (std::isfinite): Likewise.
+ (std::isinf): Likewise.
+ (std::isnan): Likewise.
+ (std::isnormal): Likewise.
+ (std::signbit): Likewise.
+ (std::isgreater): Likewise.
+ (std::isgreaterequal): Likewise.
+ (std::isless): Likewise.
+ (std::islessequal): Likewise.
+ (std::islessgreater): Likewise.
+ (std::isunordered): Likewise.
+ [__cplusplus >= 201103L && _GLIBCXX_USE_C99_MATH_TR1]
+ (std::acosh): Likewise.
+ (std::asinh): Likewise.
+ (std::atanh): Likewise.
+ (std::cbrt): Likewise.
+ (std::copysign): Likewise.
+ (std::erf): Likewise.
+ (std::erfc): Likewise.
+ (std::exp2): Likewise.
+ (std::expm1): Likewise.
+ (std::fdim): Likewise.
+ (std::fma): Likewise.
+ (std::fmax): Likewise.
+ (std::fmin): Likewise.
+ (std::hypot): Likewise.
+ (std::ilogb): Likewise.
+ (std::lgamma): Likewise.
+ (std::llrint): Likewise.
+ (std::llround): Likewise.
+ (std::log1p): Likewise.
+ (std::log2): Likewise.
+ (std::logb): Likewise.
+ (std::lrint): Likewise.
+ (std::lround): Likewise.
+ (std::nearbyint): Likewise.
+ (std::nextafter): Likewise.
+ (std::nexttoward): Likewise.
+ (std::remainder): Likewise.
+ (std::remquo): Likewise.
+ (std::rint): Likewise.
+ (std::round): Likewise.
+ (std::scalbln): Likewise.
+ (std::scalbn): Likewise.
+ (std::tgamma): Likewise.
+ (std::trunc): Likewise.
+ * include/tr1/cmath [_GLIBCXX_USE_C99_MATH_TR1 && __cplusplus >=
+ 201103L]: Reflect __CORRECT_ISO_CPP11_MATH_H_PROTO to
+ __CORRECT_ISO_CPP11_MATH_H_PROTO_FP rename.
+
2016-11-15 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/59406
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 1fc4de16e21..c88e4732d0b 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2181,7 +2181,8 @@ AC_DEFUN([GLIBCXX_CHECK_STDIO_PROTO], [
])
dnl
-dnl Check whether required C++11 overloads are present in <math.h>.
+dnl Check whether required C++11 overloads for floating point and integral
+dnl types are present in <math.h>.
dnl
AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [
@@ -2192,10 +2193,10 @@ AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [
case "$host" in
*-*-solaris2.*)
- # Solaris 12 introduced the C++11 <math.h> overloads. A backport to
- # a Solaris 11.3 SRU is likely, maybe even a Solaris 10 patch.
- AC_MSG_CHECKING([for C++11 <math.h> overloads])
- AC_CACHE_VAL(glibcxx_cv_math11_overload, [
+ # Solaris 12 Build 86, Solaris 11.3 SRU 3.6, and Solaris 10 Patch
+ # 11996[67]-02 introduced the C++11 <math.h> floating point overloads.
+ AC_MSG_CHECKING([for C++11 <math.h> floating point overloads])
+ AC_CACHE_VAL(glibcxx_cv_math11_fp_overload, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[#include <math.h>
#undef isfinite
@@ -2204,21 +2205,73 @@ AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [
{ return __builtin_isfinite(__x); }
}
])],
- [glibcxx_cv_math11_overload=no],
- [glibcxx_cv_math11_overload=yes]
+ [glibcxx_cv_math11_fp_overload=no],
+ [glibcxx_cv_math11_fp_overload=yes]
)])
# autoheader cannot handle indented templates.
- AH_VERBATIM([__CORRECT_ISO_CPP11_MATH_H_PROTO],
- [/* Define if all C++11 overloads are available in <math.h>. */
+ AH_VERBATIM([__CORRECT_ISO_CPP11_MATH_H_PROTO_FP],
+ [/* Define if all C++11 floating point overloads are available in <math.h>. */
#if __cplusplus >= 201103L
-#undef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
#endif])
- if test $glibcxx_cv_math11_overload = yes; then
- AC_DEFINE(__CORRECT_ISO_CPP11_MATH_H_PROTO)
+ if test $glibcxx_cv_math11_fp_overload = yes; then
+ AC_DEFINE(__CORRECT_ISO_CPP11_MATH_H_PROTO_FP)
fi
- AC_MSG_RESULT([$glibcxx_cv_math11_overload])
+ AC_MSG_RESULT([$glibcxx_cv_math11_fp_overload])
+
+ # Solaris 12 Build 90, Solaris 11.3 SRU 5.6, and Solaris 10 Patch
+ # 11996[67]-02 introduced the C++11 <math.h> integral type overloads.
+ AC_MSG_CHECKING([for C++11 <math.h> integral type overloads])
+ AC_CACHE_VAL(glibcxx_cv_math11_int_overload, [
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+ [#include <math.h>
+ namespace std {
+ template<typename _Tp>
+ struct __is_integer;
+ template<>
+ struct __is_integer<int>
+ {
+ enum { __value = 1 };
+ };
+ }
+ namespace __gnu_cxx {
+ template<bool, typename>
+ struct __enable_if;
+ template<typename _Tp>
+ struct __enable_if<true, _Tp>
+ { typedef _Tp __type; };
+ }
+ namespace std {
+ template<typename _Tp>
+ constexpr typename __gnu_cxx::__enable_if
+ <__is_integer<_Tp>::__value, double>::__type
+ log2(_Tp __x)
+ { return __builtin_log2(__x); }
+ }
+ int
+ main (void)
+ {
+ int i = 1000;
+ return std::log2(i);
+ }
+ ])],
+ [glibcxx_cv_math11_int_overload=no],
+ [glibcxx_cv_math11_int_overload=yes]
+ )])
+
+ # autoheader cannot handle indented templates.
+ AH_VERBATIM([__CORRECT_ISO_CPP11_MATH_H_PROTO_INT],
+ [/* Define if all C++11 integral type overloads are available in <math.h>. */
+#if __cplusplus >= 201103L
+#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
+#endif])
+
+ if test $glibcxx_cv_math11_int_overload = yes; then
+ AC_DEFINE(__CORRECT_ISO_CPP11_MATH_H_PROTO_INT)
+ fi
+ AC_MSG_RESULT([$glibcxx_cv_math11_int_overload])
;;
*)
# If <math.h> defines the obsolete isinf(double) and isnan(double)
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index 63996709ad4..09ddfeb7993 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -977,9 +977,14 @@
/* Define to 1 if mutex_timedlock is available. */
#undef _GTHREAD_USE_MUTEX_TIMEDLOCK
-/* Define if all C++11 overloads are available in <math.h>. */
+/* Define if all C++11 floating point overloads are available in <math.h>. */
#if __cplusplus >= 201103L
-#undef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
+#endif
+
+/* Define if all C++11 integral type overloads are available in <math.h>. */
+#if __cplusplus >= 201103L
+#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
#endif
#if defined (HAVE__ACOSF) && ! defined (HAVE_ACOSF)
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 55de4badd83..f32197e0fab 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -18236,11 +18236,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
case "$host" in
*-*-solaris2.*)
- # Solaris 12 introduced the C++11 <math.h> overloads. A backport to
- # a Solaris 11.3 SRU is likely, maybe even a Solaris 10 patch.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++11 <math.h> overloads" >&5
-$as_echo_n "checking for C++11 <math.h> overloads... " >&6; }
- if test "${glibcxx_cv_math11_overload+set}" = set; then :
+ # Solaris 12 Build 86, Solaris 11.3 SRU 3.6, and Solaris 10 Patch
+ # 11996[67]-02 introduced the C++11 <math.h> floating point overloads.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++11 <math.h> floating point overloads" >&5
+$as_echo_n "checking for C++11 <math.h> floating point overloads... " >&6; }
+ if test "${glibcxx_cv_math11_fp_overload+set}" = set; then :
$as_echo_n "(cached) " >&6
else
@@ -18255,9 +18255,9 @@ else
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
- glibcxx_cv_math11_overload=no
+ glibcxx_cv_math11_fp_overload=no
else
- glibcxx_cv_math11_overload=yes
+ glibcxx_cv_math11_fp_overload=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -18267,12 +18267,74 @@ fi
# autoheader cannot handle indented templates.
- if test $glibcxx_cv_math11_overload = yes; then
- $as_echo "#define __CORRECT_ISO_CPP11_MATH_H_PROTO 1" >>confdefs.h
+ if test $glibcxx_cv_math11_fp_overload = yes; then
+ $as_echo "#define __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 1" >>confdefs.h
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_math11_overload" >&5
-$as_echo "$glibcxx_cv_math11_overload" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_math11_fp_overload" >&5
+$as_echo "$glibcxx_cv_math11_fp_overload" >&6; }
+
+ # Solaris 12 Build 90, Solaris 11.3 SRU 5.6, and Solaris 10 Patch
+ # 11996[67]-02 introduced the C++11 <math.h> integral type overloads.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++11 <math.h> integral type overloads" >&5
+$as_echo_n "checking for C++11 <math.h> integral type overloads... " >&6; }
+ if test "${glibcxx_cv_math11_int_overload+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <math.h>
+ namespace std {
+ template<typename _Tp>
+ struct __is_integer;
+ template<>
+ struct __is_integer<int>
+ {
+ enum { __value = 1 };
+ };
+ }
+ namespace __gnu_cxx {
+ template<bool, typename>
+ struct __enable_if;
+ template<typename _Tp>
+ struct __enable_if<true, _Tp>
+ { typedef _Tp __type; };
+ }
+ namespace std {
+ template<typename _Tp>
+ constexpr typename __gnu_cxx::__enable_if
+ <__is_integer<_Tp>::__value, double>::__type
+ log2(_Tp __x)
+ { return __builtin_log2(__x); }
+ }
+ int
+ main (void)
+ {
+ int i = 1000;
+ return std::log2(i);
+ }
+
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ glibcxx_cv_math11_int_overload=no
+else
+ glibcxx_cv_math11_int_overload=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+ # autoheader cannot handle indented templates.
+
+
+ if test $glibcxx_cv_math11_int_overload = yes; then
+ $as_echo "#define __CORRECT_ISO_CPP11_MATH_H_PROTO_INT 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_math11_int_overload" >&5
+$as_echo "$glibcxx_cv_math11_int_overload" >&6; }
;;
*)
# If <math.h> defines the obsolete isinf(double) and isnan(double)
diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath
index 24ce811adf2..bea9b18ef58 100644
--- a/libstdc++-v3/include/c_global/cmath
+++ b/libstdc++-v3/include/c_global/cmath
@@ -539,7 +539,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus >= 201103L
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr int
fpclassify(float __x)
{ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
@@ -556,13 +556,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
FP_SUBNORMAL, FP_ZERO, __x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
int>::__type
fpclassify(_Tp __x)
{ return __x != 0 ? FP_NORMAL : FP_ZERO; }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr bool
isfinite(float __x)
{ return __builtin_isfinite(__x); }
@@ -576,13 +578,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_isfinite(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
bool>::__type
isfinite(_Tp __x)
{ return true; }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr bool
isinf(float __x)
{ return __builtin_isinf(__x); }
@@ -601,13 +605,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_isinf(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
bool>::__type
isinf(_Tp __x)
{ return false; }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr bool
isnan(float __x)
{ return __builtin_isnan(__x); }
@@ -626,13 +632,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_isnan(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
bool>::__type
isnan(_Tp __x)
{ return false; }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr bool
isnormal(float __x)
{ return __builtin_isnormal(__x); }
@@ -646,13 +654,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_isnormal(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
bool>::__type
isnormal(_Tp __x)
{ return __x != 0 ? true : false; }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
// Note: middle-end/36757 is fixed, __builtin_signbit is type-generic.
constexpr bool
signbit(float __x)
@@ -667,13 +677,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_signbit(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
bool>::__type
signbit(_Tp __x)
{ return __x < 0 ? true : false; }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr bool
isgreater(float __x, float __y)
{ return __builtin_isgreater(__x, __y); }
@@ -687,6 +699,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_isgreater(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename
__gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
@@ -696,8 +709,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return __builtin_isgreater(__type(__x), __type(__y));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr bool
isgreaterequal(float __x, float __y)
{ return __builtin_isgreaterequal(__x, __y); }
@@ -711,6 +725,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_isgreaterequal(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename
__gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
@@ -720,8 +735,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return __builtin_isgreaterequal(__type(__x), __type(__y));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr bool
isless(float __x, float __y)
{ return __builtin_isless(__x, __y); }
@@ -735,6 +751,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_isless(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename
__gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
@@ -744,8 +761,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return __builtin_isless(__type(__x), __type(__y));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr bool
islessequal(float __x, float __y)
{ return __builtin_islessequal(__x, __y); }
@@ -759,6 +777,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_islessequal(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename
__gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
@@ -768,8 +787,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return __builtin_islessequal(__type(__x), __type(__y));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr bool
islessgreater(float __x, float __y)
{ return __builtin_islessgreater(__x, __y); }
@@ -783,6 +803,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_islessgreater(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename
__gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
@@ -792,8 +813,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return __builtin_islessgreater(__type(__x), __type(__y));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr bool
isunordered(float __x, float __y)
{ return __builtin_isunordered(__x, __y); }
@@ -807,6 +829,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_isunordered(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename
__gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
@@ -816,6 +839,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return __builtin_isunordered(__type(__x), __type(__y));
}
+#endif
#else
@@ -1196,7 +1220,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::truncl;
/// Additional overloads.
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
acosh(float __x)
{ return __builtin_acoshf(__x); }
@@ -1206,13 +1230,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_acoshl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
acosh(_Tp __x)
{ return __builtin_acosh(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
asinh(float __x)
{ return __builtin_asinhf(__x); }
@@ -1222,13 +1248,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_asinhl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
asinh(_Tp __x)
{ return __builtin_asinh(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
atanh(float __x)
{ return __builtin_atanhf(__x); }
@@ -1238,13 +1266,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_atanhl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
atanh(_Tp __x)
{ return __builtin_atanh(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
cbrt(float __x)
{ return __builtin_cbrtf(__x); }
@@ -1254,13 +1284,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_cbrtl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
cbrt(_Tp __x)
{ return __builtin_cbrt(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
copysign(float __x, float __y)
{ return __builtin_copysignf(__x, __y); }
@@ -1270,6 +1302,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_copysignl(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
copysign(_Tp __x, _Up __y)
@@ -1277,8 +1310,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return copysign(__type(__x), __type(__y));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
erf(float __x)
{ return __builtin_erff(__x); }
@@ -1288,13 +1322,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_erfl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
erf(_Tp __x)
{ return __builtin_erf(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
erfc(float __x)
{ return __builtin_erfcf(__x); }
@@ -1304,13 +1340,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_erfcl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
erfc(_Tp __x)
{ return __builtin_erfc(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
exp2(float __x)
{ return __builtin_exp2f(__x); }
@@ -1320,13 +1358,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_exp2l(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
exp2(_Tp __x)
{ return __builtin_exp2(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
expm1(float __x)
{ return __builtin_expm1f(__x); }
@@ -1336,13 +1376,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_expm1l(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
expm1(_Tp __x)
{ return __builtin_expm1(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
fdim(float __x, float __y)
{ return __builtin_fdimf(__x, __y); }
@@ -1352,6 +1394,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fdiml(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
fdim(_Tp __x, _Up __y)
@@ -1359,8 +1402,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return fdim(__type(__x), __type(__y));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
fma(float __x, float __y, float __z)
{ return __builtin_fmaf(__x, __y, __z); }
@@ -1370,6 +1414,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fmal(__x, __y, __z); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up, typename _Vp>
constexpr typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
fma(_Tp __x, _Up __y, _Vp __z)
@@ -1377,8 +1422,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
return fma(__type(__x), __type(__y), __type(__z));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
fmax(float __x, float __y)
{ return __builtin_fmaxf(__x, __y); }
@@ -1388,6 +1434,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fmaxl(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
fmax(_Tp __x, _Up __y)
@@ -1395,8 +1442,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return fmax(__type(__x), __type(__y));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
fmin(float __x, float __y)
{ return __builtin_fminf(__x, __y); }
@@ -1406,6 +1454,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fminl(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
fmin(_Tp __x, _Up __y)
@@ -1413,8 +1462,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return fmin(__type(__x), __type(__y));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
hypot(float __x, float __y)
{ return __builtin_hypotf(__x, __y); }
@@ -1424,6 +1474,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_hypotl(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
hypot(_Tp __x, _Up __y)
@@ -1431,8 +1482,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return hypot(__type(__x), __type(__y));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr int
ilogb(float __x)
{ return __builtin_ilogbf(__x); }
@@ -1442,14 +1494,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_ilogbl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr
typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
int>::__type
ilogb(_Tp __x)
{ return __builtin_ilogb(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
lgamma(float __x)
{ return __builtin_lgammaf(__x); }
@@ -1459,13 +1513,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_lgammal(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
lgamma(_Tp __x)
{ return __builtin_lgamma(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr long long
llrint(float __x)
{ return __builtin_llrintf(__x); }
@@ -1475,13 +1531,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_llrintl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
long long>::__type
llrint(_Tp __x)
{ return __builtin_llrint(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr long long
llround(float __x)
{ return __builtin_llroundf(__x); }
@@ -1491,13 +1549,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_llroundl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
long long>::__type
llround(_Tp __x)
{ return __builtin_llround(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
log1p(float __x)
{ return __builtin_log1pf(__x); }
@@ -1507,13 +1567,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_log1pl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
log1p(_Tp __x)
{ return __builtin_log1p(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
// DR 568.
constexpr float
log2(float __x)
@@ -1524,13 +1586,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_log2l(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
log2(_Tp __x)
{ return __builtin_log2(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
logb(float __x)
{ return __builtin_logbf(__x); }
@@ -1540,13 +1604,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_logbl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
logb(_Tp __x)
{ return __builtin_logb(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr long
lrint(float __x)
{ return __builtin_lrintf(__x); }
@@ -1556,13 +1622,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_lrintl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
long>::__type
lrint(_Tp __x)
{ return __builtin_lrint(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr long
lround(float __x)
{ return __builtin_lroundf(__x); }
@@ -1572,13 +1640,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_lroundl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
long>::__type
lround(_Tp __x)
{ return __builtin_lround(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
nearbyint(float __x)
{ return __builtin_nearbyintf(__x); }
@@ -1588,13 +1658,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_nearbyintl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
nearbyint(_Tp __x)
{ return __builtin_nearbyint(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
nextafter(float __x, float __y)
{ return __builtin_nextafterf(__x, __y); }
@@ -1604,6 +1676,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_nextafterl(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
nextafter(_Tp __x, _Up __y)
@@ -1611,8 +1684,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return nextafter(__type(__x), __type(__y));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
nexttoward(float __x, long double __y)
{ return __builtin_nexttowardf(__x, __y); }
@@ -1622,13 +1696,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_nexttowardl(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
nexttoward(_Tp __x, long double __y)
{ return __builtin_nexttoward(__x, __y); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
remainder(float __x, float __y)
{ return __builtin_remainderf(__x, __y); }
@@ -1638,6 +1714,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_remainderl(__x, __y); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
remainder(_Tp __x, _Up __y)
@@ -1645,8 +1722,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return remainder(__type(__x), __type(__y));
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
remquo(float __x, float __y, int* __pquo)
{ return __builtin_remquof(__x, __y, __pquo); }
@@ -1656,6 +1734,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_remquol(__x, __y, __pquo); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
remquo(_Tp __x, _Up __y, int* __pquo)
@@ -1663,8 +1742,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return remquo(__type(__x), __type(__y), __pquo);
}
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
rint(float __x)
{ return __builtin_rintf(__x); }
@@ -1674,13 +1754,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_rintl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
rint(_Tp __x)
{ return __builtin_rint(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
round(float __x)
{ return __builtin_roundf(__x); }
@@ -1690,13 +1772,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_roundl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
round(_Tp __x)
{ return __builtin_round(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
scalbln(float __x, long __ex)
{ return __builtin_scalblnf(__x, __ex); }
@@ -1706,13 +1790,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_scalblnl(__x, __ex); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
scalbln(_Tp __x, long __ex)
{ return __builtin_scalbln(__x, __ex); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
scalbn(float __x, int __ex)
{ return __builtin_scalbnf(__x, __ex); }
@@ -1722,13 +1808,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_scalbnl(__x, __ex); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
scalbn(_Tp __x, int __ex)
{ return __builtin_scalbn(__x, __ex); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
tgamma(float __x)
{ return __builtin_tgammaf(__x); }
@@ -1738,13 +1826,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_tgammal(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
tgamma(_Tp __x)
{ return __builtin_tgamma(__x); }
+#endif
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr float
trunc(float __x)
{ return __builtin_truncf(__x); }
@@ -1754,11 +1844,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_truncl(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
trunc(_Tp __x)
{ return __builtin_trunc(__x); }
+#endif
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
diff --git a/libstdc++-v3/include/tr1/cmath b/libstdc++-v3/include/tr1/cmath
index 7f77a2b01ad..9a4a1764ca1 100644
--- a/libstdc++-v3/include/tr1/cmath
+++ b/libstdc++-v3/include/tr1/cmath
@@ -490,7 +490,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// In C++03 we need to provide the additional overloads.
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
acosh(float __x)
{ return __builtin_acoshf(__x); }
@@ -506,7 +506,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
acosh(_Tp __x)
{ return __builtin_acosh(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
asinh(float __x)
{ return __builtin_asinhf(__x); }
@@ -522,7 +522,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
asinh(_Tp __x)
{ return __builtin_asinh(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
atanh(float __x)
{ return __builtin_atanhf(__x); }
@@ -538,7 +538,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
atanh(_Tp __x)
{ return __builtin_atanh(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
cbrt(float __x)
{ return __builtin_cbrtf(__x); }
@@ -554,7 +554,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
cbrt(_Tp __x)
{ return __builtin_cbrt(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
copysign(float __x, float __y)
{ return __builtin_copysignf(__x, __y); }
@@ -572,7 +572,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return copysign(__type(__x), __type(__y));
}
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
erf(float __x)
{ return __builtin_erff(__x); }
@@ -588,7 +588,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
erf(_Tp __x)
{ return __builtin_erf(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
erfc(float __x)
{ return __builtin_erfcf(__x); }
@@ -604,7 +604,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
erfc(_Tp __x)
{ return __builtin_erfc(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
exp2(float __x)
{ return __builtin_exp2f(__x); }
@@ -620,7 +620,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
exp2(_Tp __x)
{ return __builtin_exp2(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
expm1(float __x)
{ return __builtin_expm1f(__x); }
@@ -636,7 +636,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
expm1(_Tp __x)
{ return __builtin_expm1(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
fdim(float __x, float __y)
{ return __builtin_fdimf(__x, __y); }
@@ -654,7 +654,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return fdim(__type(__x), __type(__y));
}
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
fma(float __x, float __y, float __z)
{ return __builtin_fmaf(__x, __y, __z); }
@@ -672,7 +672,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return fma(__type(__x), __type(__y), __type(__z));
}
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
fmax(float __x, float __y)
{ return __builtin_fmaxf(__x, __y); }
@@ -690,7 +690,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return fmax(__type(__x), __type(__y));
}
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
fmin(float __x, float __y)
{ return __builtin_fminf(__x, __y); }
@@ -708,7 +708,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return fmin(__type(__x), __type(__y));
}
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
hypot(float __x, float __y)
{ return __builtin_hypotf(__x, __y); }
@@ -726,7 +726,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return hypot(__type(__y), __type(__x));
}
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline int
ilogb(float __x)
{ return __builtin_ilogbf(__x); }
@@ -742,7 +742,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
ilogb(_Tp __x)
{ return __builtin_ilogb(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
lgamma(float __x)
{ return __builtin_lgammaf(__x); }
@@ -758,7 +758,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
lgamma(_Tp __x)
{ return __builtin_lgamma(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline long long
llrint(float __x)
{ return __builtin_llrintf(__x); }
@@ -774,7 +774,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
llrint(_Tp __x)
{ return __builtin_llrint(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline long long
llround(float __x)
{ return __builtin_llroundf(__x); }
@@ -790,7 +790,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
llround(_Tp __x)
{ return __builtin_llround(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
log1p(float __x)
{ return __builtin_log1pf(__x); }
@@ -807,7 +807,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_log1p(__x); }
// DR 568.
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
log2(float __x)
{ return __builtin_log2f(__x); }
@@ -823,7 +823,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
log2(_Tp __x)
{ return __builtin_log2(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
logb(float __x)
{ return __builtin_logbf(__x); }
@@ -841,7 +841,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __builtin_logb(__x);
}
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline long
lrint(float __x)
{ return __builtin_lrintf(__x); }
@@ -857,7 +857,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
lrint(_Tp __x)
{ return __builtin_lrint(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline long
lround(float __x)
{ return __builtin_lroundf(__x); }
@@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
lround(_Tp __x)
{ return __builtin_lround(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
nearbyint(float __x)
{ return __builtin_nearbyintf(__x); }
@@ -889,7 +889,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
nearbyint(_Tp __x)
{ return __builtin_nearbyint(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
nextafter(float __x, float __y)
{ return __builtin_nextafterf(__x, __y); }
@@ -907,7 +907,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return nextafter(__type(__x), __type(__y));
}
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
nexttoward(float __x, long double __y)
{ return __builtin_nexttowardf(__x, __y); }
@@ -923,7 +923,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
nexttoward(_Tp __x, long double __y)
{ return __builtin_nexttoward(__x, __y); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
remainder(float __x, float __y)
{ return __builtin_remainderf(__x, __y); }
@@ -941,7 +941,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return remainder(__type(__x), __type(__y));
}
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
remquo(float __x, float __y, int* __pquo)
{ return __builtin_remquof(__x, __y, __pquo); }
@@ -959,7 +959,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return remquo(__type(__x), __type(__y), __pquo);
}
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
rint(float __x)
{ return __builtin_rintf(__x); }
@@ -975,7 +975,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
rint(_Tp __x)
{ return __builtin_rint(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
round(float __x)
{ return __builtin_roundf(__x); }
@@ -991,7 +991,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
round(_Tp __x)
{ return __builtin_round(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
scalbln(float __x, long __ex)
{ return __builtin_scalblnf(__x, __ex); }
@@ -1007,7 +1007,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
scalbln(_Tp __x, long __ex)
{ return __builtin_scalbln(__x, __ex); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
scalbn(float __x, int __ex)
{ return __builtin_scalbnf(__x, __ex); }
@@ -1023,7 +1023,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
scalbn(_Tp __x, int __ex)
{ return __builtin_scalbn(__x, __ex); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
tgamma(float __x)
{ return __builtin_tgammaf(__x); }
@@ -1039,7 +1039,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
tgamma(_Tp __x)
{ return __builtin_tgamma(__x); }
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
trunc(float __x)
{ return __builtin_truncf(__x); }
@@ -1084,7 +1084,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// the discussion about this issue here:
// http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01278.html
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
pow(float __x, float __y)
{ return std::pow(__x, __y); }
@@ -1112,7 +1112,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// to std::fabs.
#ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
-#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
inline float
fabs(float __x)
{ return __builtin_fabsf(__x); }
diff --git a/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc b/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc
index 9ef8c788c75..4cb3e1ae988 100644
--- a/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc
+++ b/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++11 } }
+// { dg-do preprocess { target c++11 } }
// Copyright (C) 2008-2016 Free Software Foundation, Inc.
//
@@ -21,42 +21,61 @@
#ifndef ATOMIC_BOOL_LOCK_FREE
# error "ATOMIC_BOOL_LOCK_FREE must be a macro"
+#elif ATOMIC_BOOL_LOCK_FREE != 1 && ATOMIC_BOOL_LOCK_FREE != 2
+# error "ATOMIC_BOOL_LOCK_FREE must be 1 or 2"
#endif
#ifndef ATOMIC_CHAR_LOCK_FREE
# error "ATOMIC_CHAR_LOCK_FREE must be a macro"
+#elif ATOMIC_CHAR_LOCK_FREE != 1 && ATOMIC_CHAR_LOCK_FREE != 2
+# error "ATOMIC_CHAR_LOCK_FREE must be 1 or 2"
#endif
#ifndef ATOMIC_CHAR16_T_LOCK_FREE
# error "ATOMIC_CHAR16_T_LOCK_FREE must be a macro"
+#elif ATOMIC_CHAR16_T_LOCK_FREE != 1 && ATOMIC_CHAR16_T_LOCK_FREE != 2
#endif
#ifndef ATOMIC_CHAR32_T_LOCK_FREE
# error "ATOMIC_CHAR32_T_LOCK_FREE must be a macro"
+#elif ATOMIC_CHAR32_T_LOCK_FREE != 1 && ATOMIC_CHAR32_T_LOCK_FREE != 2
+# error "ATOMIC_CHAR32_T_LOCK_FREE must be 1 or 2"
#endif
#ifndef ATOMIC_WCHAR_T_LOCK_FREE
# error "ATOMIC_WCHAR_T_LOCK_FREE must be a macro"
+#elif ATOMIC_WCHAR_T_LOCK_FREE != 1 && ATOMIC_WCHAR_T_LOCK_FREE != 2
+# error "ATOMIC_WCHAR_T_LOCK_FREE must be 1 or 2"
#endif
#ifndef ATOMIC_SHORT_LOCK_FREE
# error "ATOMIC_SHORT_LOCK_FREE must be a macro"
+#elif ATOMIC_SHORT_LOCK_FREE != 1 && ATOMIC_SHORT_LOCK_FREE != 2
+# error "ATOMIC_SHORT_LOCK_FREE must be 1 or 2"
#endif
#ifndef ATOMIC_INT_LOCK_FREE
# error "ATOMIC_INT_LOCK_FREE must be a macro"
+#elif ATOMIC_INT_LOCK_FREE != 1 && ATOMIC_INT_LOCK_FREE != 2
+# error "ATOMIC_INT_LOCK_FREE must be 1 or 2"
#endif
#ifndef ATOMIC_LONG_LOCK_FREE
# error "ATOMIC_LONG_LOCK_FREE must be a macro"
+#elif ATOMIC_LONG_LOCK_FREE != 1 && ATOMIC_LONG_LOCK_FREE != 2
+# error "ATOMIC_LONG_LOCK_FREE must be 1 or 2"
#endif
#ifndef ATOMIC_LLONG_LOCK_FREE
# error "ATOMIC_LLONG_LOCK_FREE must be a macro"
+#elif ATOMIC_LLONG_LOCK_FREE != 1 && ATOMIC_LLONG_LOCK_FREE != 2
+# error "ATOMIC_LLONG_LOCK_FREE must be 1 or 2"
#endif
#ifndef ATOMIC_POINTER_LOCK_FREE
# error "ATOMIC_POINTER_LOCK_FREE must be a macro"
+#elif ATOMIC_POINTER_LOCK_FREE != 1 && ATOMIC_POINTER_LOCK_FREE != 2
+# error "ATOMIC_POINTER_LOCK_FREE must be 1 or 2"
#endif
#ifndef ATOMIC_FLAG_INIT
@@ -66,49 +85,3 @@
#ifndef ATOMIC_VAR_INIT
#error "ATOMIC_VAR_INIT_must_be_a_macro"
#endif
-
-
-extern void abort(void);
-
-int main ()
-{
-#if (ATOMIC_BOOL_LOCK_FREE != 1 && ATOMIC_BOOL_LOCK_FREE != 2)
- abort ();
-#endif
-
-#if (ATOMIC_CHAR_LOCK_FREE != 1 && ATOMIC_CHAR_LOCK_FREE != 2)
- abort ();
-#endif
-
-#if (ATOMIC_CHAR16_T_LOCK_FREE != 1 && ATOMIC_CHAR16_T_LOCK_FREE != 2)
- abort ();
-#endif
-
-#if (ATOMIC_CHAR32_T_LOCK_FREE != 1 && ATOMIC_CHAR32_T_LOCK_FREE != 2)
- abort ();
-#endif
-
-#if (ATOMIC_WCHAR_T_LOCK_FREE != 1 && ATOMIC_WCHAR_T_LOCK_FREE != 2)
- abort ();
-#endif
-
-#if (ATOMIC_SHORT_LOCK_FREE != 1 && ATOMIC_SHORT_LOCK_FREE != 2)
- abort ();
-#endif
-
-#if (ATOMIC_INT_LOCK_FREE != 1 && ATOMIC_INT_LOCK_FREE != 2)
- abort ();
-#endif
-
-#if (ATOMIC_LONG_LOCK_FREE != 1 && ATOMIC_LONG_LOCK_FREE != 2)
- abort ();
-#endif
-
-#if (ATOMIC_LLONG_LOCK_FREE != 1 && ATOMIC_LLONG_LOCK_FREE != 2)
- abort ();
-#endif
-
-#if (ATOMIC_POINTER_LOCK_FREE != 1 && ATOMIC_POINTER_LOCK_FREE != 2)
- abort ();
-#endif
-}