diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d66171228101..8a6a3c0c893d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,98 @@ +2020-09-27 Jakub Jelinek + + Backported from master: + 2020-09-27 Jakub Jelinek + + PR middle-end/97073 + * optabs.c (expand_binop, expand_absneg_bit, expand_unop, + expand_copysign_bit): Check reg_overlap_mentioned_p between target + and operand(s) and if it returns true, force a pseudo as target. + +2020-09-25 Vladimir N. Makarov + + Backported from master: + 2020-06-04 Vladimir Makarov + + PR middle-end/95464 + * lra.c (lra_emit_move): Add processing STRICT_LOW_PART. + * lra-constraints.c (match_reload): Use STRICT_LOW_PART in output + reload if the original insn has it too. + +2020-09-25 Joe Ramsay + + Backported from master: + 2020-08-20 Joe Ramsay + + PR target/96683 + * config/arm/mve.md (mve_vst1q_f): Require MVE memory operand for + destination. + (mve_vst1q_): Likewise. + +2020-09-24 H.J. Lu + + Backported from master: + 2020-09-16 H.J. Lu + + PR target/97032 + * cfgexpand.c (asm_clobber_reg_kind): Set sp_is_clobbered_by_asm + to true if the stack pointer is clobbered by asm statement. + * emit-rtl.h (rtl_data): Add sp_is_clobbered_by_asm. + * config/i386/i386.c (ix86_get_drap_rtx): Set need_drap to true + if the stack pointer is clobbered by asm statement. + +2020-09-24 Alan Modra + + Backported from master: + 2020-09-24 Alan Modra + + PR target/97166 + * config/rs6000/rs6000-c.c (rs6000_target_modify_macros): + Conditionally define __PCREL__. + +2020-09-24 Andrea Corallo + + Backported from master: + 2020-09-21 Andrea Corallo + + * config/aarch64/aarch64-builtins.c + (aarch64_general_expand_builtin): Use expand machinery not to + alter the value of an rtx returned by force_reg. + +2020-09-24 Alex Coplan + + * config/aarch64/aarch64-cores.def: Add Neoverse V1. + * config/aarch64/aarch64-tune.md: Regenerate. + * doc/invoke.texi: Document support for Neoverse V1. + +2020-09-22 David Faust + + Backported from master: + 2020-09-22 David Faust + + * config/bpf/bpf.md: Add defines for signed div and mod operators. + +2020-09-20 John David Anglin < danglin@gcc.gnu.org> + + * config/pa/pa-hpux11.h (LINK_GCC_C_SEQUENCE_SPEC): Delete. + * config/pa/pa64-hpux.h (LINK_GCC_C_SEQUENCE_SPEC): Likewise. + (ENDFILE_SPEC): Link with libgcc_stub.a and mill.a. + * config/pa/pa32-linux.h (ENDFILE_SPEC): Link with libgcc.a. + +2020-09-17 Marek Polacek + + Backported from master: + 2020-09-16 Marek Polacek + + PR preprocessor/96935 + * input.c (get_substring_ranges_for_loc): Return if start.column + is less than 1. + +2020-09-17 liuhongt + + * common/config/i386/i386-common.c + (OPTION_MASK_ISA_AVX_UNSET): Remove OPTION_MASK_ISA_XSAVE_UNSET. + (OPTION_MASK_ISA_XSAVE_UNSET): Add OPTION_MASK_ISA_AVX_UNSET. + 2020-09-16 Jakub Jelinek Backported from master: diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index fae3fa1fac63..0c0687f326cd 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20200917 +20200928 diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 599b7d33701e..64335119dc2b 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -232,7 +232,7 @@ static tree build_position_list (tree, bool, tree, tree, unsigned int, tree); static vec build_subst_list (Entity_Id, Entity_Id, bool); static vec build_variant_list (tree, vec, vec); -static tree maybe_saturate_size (tree); +static tree maybe_saturate_size (tree, unsigned int align); static tree validate_size (Uint, tree, Entity_Id, enum tree_code, bool, bool, const char *, const char *); static void set_rm_size (Uint, tree, Entity_Id); @@ -4375,7 +4375,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) /* If the size is self-referential, annotate the maximum value after saturating it, if need be, to avoid a No_Uint value. */ if (CONTAINS_PLACEHOLDER_P (gnu_size)) - gnu_size = maybe_saturate_size (max_size (gnu_size, true)); + { + const unsigned int align + = UI_To_Int (Alignment (gnat_entity)) * BITS_PER_UNIT; + gnu_size + = maybe_saturate_size (max_size (gnu_size, true), align); + } /* If we are just annotating types and the type is tagged, the tag and the parent components are not generated by the front-end so @@ -4411,7 +4416,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) gnu_size = size_binop (PLUS_EXPR, gnu_size, offset); } - gnu_size = maybe_saturate_size (round_up (gnu_size, align)); + gnu_size + = maybe_saturate_size (round_up (gnu_size, align), align); Set_Esize (gnat_entity, annotate_value (gnu_size)); /* Tagged types are Strict_Alignment so RM_Size = Esize. */ @@ -8851,15 +8857,21 @@ build_variant_list (tree qual_union_type, vec subst_list, } /* If SIZE has overflowed, return the maximum valid size, which is the upper - bound of the signed sizetype in bits; otherwise return SIZE unmodified. */ + bound of the signed sizetype in bits, rounded down to ALIGN. Otherwise + return SIZE unmodified. */ static tree -maybe_saturate_size (tree size) +maybe_saturate_size (tree size, unsigned int align) { if (TREE_CODE (size) == INTEGER_CST && TREE_OVERFLOW (size)) - size = size_binop (MULT_EXPR, - fold_convert (bitsizetype, TYPE_MAX_VALUE (ssizetype)), - build_int_cst (bitsizetype, BITS_PER_UNIT)); + { + size + = size_binop (MULT_EXPR, + fold_convert (bitsizetype, TYPE_MAX_VALUE (ssizetype)), + build_int_cst (bitsizetype, BITS_PER_UNIT)); + size = round_down (size, align); + } + return size; } diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index c534cb31a472..122a5ff7b65a 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -2868,11 +2868,15 @@ asm_clobber_reg_is_valid (int regno, int nregs, const char *regname) as it was before, so no asm can validly clobber the stack pointer in the usual sense. Adding the stack pointer to the clobber list has traditionally had some undocumented and somewhat obscure side-effects. */ - if (overlaps_hard_reg_set_p (regset, Pmode, STACK_POINTER_REGNUM) - && warning (OPT_Wdeprecated, "listing the stack pointer register" - " %qs in a clobber list is deprecated", regname)) - inform (input_location, "the value of the stack pointer after an %" - " statement must be the same as it was before the statement"); + if (overlaps_hard_reg_set_p (regset, Pmode, STACK_POINTER_REGNUM)) + { + crtl->sp_is_clobbered_by_asm = true; + if (warning (OPT_Wdeprecated, "listing the stack pointer register" + " %qs in a clobber list is deprecated", regname)) + inform (input_location, "the value of the stack pointer after" + " an % statement must be the same as it was before" + " the statement"); + } return is_valid; } diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c index 8407a34b5948..b8d301f00e22 100644 --- a/gcc/config/aarch64/aarch64-builtins.c +++ b/gcc/config/aarch64/aarch64-builtins.c @@ -1976,14 +1976,14 @@ aarch64_general_expand_builtin (unsigned int fcode, tree exp, rtx target, return target; case AARCH64_JSCVT: - arg0 = CALL_EXPR_ARG (exp, 0); - op0 = force_reg (DFmode, expand_normal (arg0)); - if (!target) - target = gen_reg_rtx (SImode); - else - target = force_reg (SImode, target); - emit_insn (GEN_FCN (CODE_FOR_aarch64_fjcvtzs) (target, op0)); - return target; + { + expand_operand ops[2]; + create_output_operand (&ops[0], target, SImode); + op0 = expand_normal (CALL_EXPR_ARG (exp, 0)); + create_input_operand (&ops[1], op0, DFmode); + expand_insn (CODE_FOR_aarch64_fjcvtzs, 2, ops); + return ops[0].value; + } case AARCH64_SIMD_BUILTIN_FCMLA_LANEQ0_V2SF: case AARCH64_SIMD_BUILTIN_FCMLA_LANEQ90_V2SF: diff --git a/gcc/config/aarch64/aarch64-cores.def b/gcc/config/aarch64/aarch64-cores.def index a7dde38d7687..a3bd56f5b43f 100644 --- a/gcc/config/aarch64/aarch64-cores.def +++ b/gcc/config/aarch64/aarch64-cores.def @@ -134,6 +134,7 @@ AARCH64_CORE("thunderx3t110", thunderx3t110, thunderx3t110, 8_3A, AARCH64_FL_ /* Arm ('A') cores. */ AARCH64_CORE("zeus", zeus, cortexa57, 8_4A, AARCH64_FL_FOR_ARCH8_4 | AARCH64_FL_SVE | AARCH64_FL_RCPC | AARCH64_FL_I8MM | AARCH64_FL_BF16 | AARCH64_FL_F16 | AARCH64_FL_PROFILE | AARCH64_FL_SSBS | AARCH64_FL_RNG, neoversen1, 0x41, 0xd40, -1) +AARCH64_CORE("neoverse-v1", neoversev1, cortexa57, 8_4A, AARCH64_FL_FOR_ARCH8_4 | AARCH64_FL_SVE | AARCH64_FL_RCPC | AARCH64_FL_I8MM | AARCH64_FL_BF16 | AARCH64_FL_F16 | AARCH64_FL_PROFILE | AARCH64_FL_SSBS | AARCH64_FL_RNG, neoversen1, 0x41, 0xd40, -1) /* Qualcomm ('Q') cores. */ AARCH64_CORE("saphira", saphira, saphira, 8_4A, AARCH64_FL_FOR_ARCH8_4 | AARCH64_FL_CRYPTO | AARCH64_FL_RCPC, saphira, 0x51, 0xC01, -1) diff --git a/gcc/config/aarch64/aarch64-simd-builtins.def b/gcc/config/aarch64/aarch64-simd-builtins.def index 332a0b6b1eae..a1d88d0caead 100644 --- a/gcc/config/aarch64/aarch64-simd-builtins.def +++ b/gcc/config/aarch64/aarch64-simd-builtins.def @@ -334,12 +334,11 @@ BUILTIN_VHSDF (UNOP, nearbyint, 2) BUILTIN_VHSDF (UNOP, rint, 2) BUILTIN_VHSDF (UNOP, round, 2) - BUILTIN_VHSDF_DF (UNOP, frintn, 2) + BUILTIN_VHSDF_HSDF (UNOP, frintn, 2) VAR1 (UNOP, btrunc, 2, hf) VAR1 (UNOP, ceil, 2, hf) VAR1 (UNOP, floor, 2, hf) - VAR1 (UNOP, frintn, 2, hf) VAR1 (UNOP, nearbyint, 2, hf) VAR1 (UNOP, rint, 2, hf) VAR1 (UNOP, round, 2, hf) diff --git a/gcc/config/aarch64/aarch64-tune.md b/gcc/config/aarch64/aarch64-tune.md index ebf97c38fbda..8e38052d6cfa 100644 --- a/gcc/config/aarch64/aarch64-tune.md +++ b/gcc/config/aarch64/aarch64-tune.md @@ -1,5 +1,5 @@ ;; -*- buffer-read-only: t -*- ;; Generated automatically by gentune.sh from aarch64-cores.def (define_attr "tune" - "cortexa34,cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,thunderx,thunderxt88p1,thunderxt88,octeontx,octeontxt81,octeontxt83,thunderxt81,thunderxt83,emag,xgene1,falkor,qdf24xx,exynosm1,phecda,thunderx2t99p1,vulcan,thunderx2t99,cortexa55,cortexa75,cortexa76,cortexa76ae,cortexa77,cortexa65,cortexa65ae,ares,neoversen1,neoversee1,octeontx2,octeontx2t98,octeontx2t96,octeontx2t93,octeontx2f95,octeontx2f95n,octeontx2f95mm,a64fx,tsv110,thunderx3t110,zeus,saphira,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53,cortexa75cortexa55,cortexa76cortexa55" + "cortexa34,cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,thunderx,thunderxt88p1,thunderxt88,octeontx,octeontxt81,octeontxt83,thunderxt81,thunderxt83,emag,xgene1,falkor,qdf24xx,exynosm1,phecda,thunderx2t99p1,vulcan,thunderx2t99,cortexa55,cortexa75,cortexa76,cortexa76ae,cortexa77,cortexa65,cortexa65ae,ares,neoversen1,neoversee1,octeontx2,octeontx2t98,octeontx2t96,octeontx2t93,octeontx2f95,octeontx2f95n,octeontx2f95mm,a64fx,tsv110,thunderx3t110,zeus,neoversev1,saphira,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53,cortexa75cortexa55,cortexa76cortexa55" (const (symbol_ref "((enum attr_tune) aarch64_tune)"))) diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index 50f8b23bc17b..9a970e7ed1e3 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -6088,6 +6088,20 @@ vreinterpretq_u32_p128 (poly128_t __a) return (uint32x4_t)__a; } +__extension__ extern __inline float64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vreinterpretq_f64_p128 (poly128_t __a) +{ + return (float64x2_t) __a; +} + +__extension__ extern __inline poly128_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vreinterpretq_p128_f64 (float64x2_t __a) +{ + return (poly128_t) __a; +} + /* vset_lane */ __extension__ extern __inline float16x4_t @@ -12670,6 +12684,13 @@ vceqq_u64 (uint64x2_t __a, uint64x2_t __b) return (__a == __b); } +__extension__ extern __inline uint64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vceqq_p64 (poly64x2_t __a, poly64x2_t __b) +{ + return (__a == __b); +} + /* vceq - scalar. */ __extension__ extern __inline uint32_t @@ -12779,6 +12800,13 @@ vceqz_u64 (uint64x1_t __a) return (__a == __AARCH64_UINT64_C (0)); } +__extension__ extern __inline uint64x1_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vceqz_p64 (poly64x1_t __a) +{ + return (__a == __AARCH64_UINT64_C (0)); +} + __extension__ extern __inline uint32x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vceqzq_f32 (float32x4_t __a) @@ -12856,6 +12884,13 @@ vceqzq_u64 (uint64x2_t __a) return (__a == __AARCH64_UINT64_C (0)); } +__extension__ extern __inline uint64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vceqzq_p64 (poly64x2_t __a) +{ + return (__a == __AARCH64_UINT64_C (0)); +} + /* vceqz - scalar. */ __extension__ extern __inline uint32_t @@ -14054,6 +14089,48 @@ vclsq_s32 (int32x4_t __a) return __builtin_aarch64_clrsbv4si (__a); } +__extension__ extern __inline int8x8_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vcls_u8 (uint8x8_t __a) +{ + return __builtin_aarch64_clrsbv8qi ((int8x8_t) __a); +} + +__extension__ extern __inline int16x4_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vcls_u16 (uint16x4_t __a) +{ + return __builtin_aarch64_clrsbv4hi ((int16x4_t) __a); +} + +__extension__ extern __inline int32x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vcls_u32 (uint32x2_t __a) +{ + return __builtin_aarch64_clrsbv2si ((int32x2_t) __a); +} + +__extension__ extern __inline int8x16_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vclsq_u8 (uint8x16_t __a) +{ + return __builtin_aarch64_clrsbv16qi ((int8x16_t) __a); +} + +__extension__ extern __inline int16x8_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vclsq_u16 (uint16x8_t __a) +{ + return __builtin_aarch64_clrsbv8hi ((int16x8_t) __a); +} + +__extension__ extern __inline int32x4_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vclsq_u32 (uint32x4_t __a) +{ + return __builtin_aarch64_clrsbv4si ((int32x4_t) __a); +} + /* vclz. */ __extension__ extern __inline int8x8_t @@ -19613,6 +19690,13 @@ vld4q_p64 (const poly64_t * __a) return ret; } +__extension__ extern __inline poly128_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vldrq_p128 (const poly128_t * __ptr) +{ + return *__ptr; +} + /* vldn_dup */ __extension__ extern __inline int8x8x2_t @@ -26003,6 +26087,13 @@ vrndmq_f64 (float64x2_t __a) /* vrndn */ +__extension__ extern __inline float32_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vrndns_f32 (float32_t __a) +{ + return __builtin_aarch64_frintnsf (__a); +} + __extension__ extern __inline float32x2_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vrndn_f32 (float32x2_t __a) @@ -30104,6 +30195,13 @@ vst4q_p64 (poly64_t * __a, poly64x2x4_t __val) __builtin_aarch64_st4v2di ((__builtin_aarch64_simd_di *) __a, __o); } +__extension__ extern __inline void +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vstrq_p128 (poly128_t * __ptr, poly128_t __val) +{ + *__ptr = __val; +} + /* vsub */ __extension__ extern __inline int64_t @@ -30491,6 +30589,17 @@ vtrn1q_u32 (uint32x4_t __a, uint32x4_t __b) #endif } +__extension__ extern __inline poly64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vtrn1q_p64 (poly64x2_t __a, poly64x2_t __b) +{ +#ifdef __AARCH64EB__ + return __builtin_shuffle (__a, __b, (poly64x2_t) {3, 1}); +#else + return __builtin_shuffle (__a, __b, (poly64x2_t) {0, 2}); +#endif +} + __extension__ extern __inline uint64x2_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vtrn1q_u64 (uint64x2_t __a, uint64x2_t __b) @@ -30761,6 +30870,18 @@ vtrn2q_u64 (uint64x2_t __a, uint64x2_t __b) #endif } + +__extension__ extern __inline poly64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vtrn2q_p64 (poly64x2_t __a, poly64x2_t __b) +{ +#ifdef __AARCH64EB__ + return __builtin_shuffle (__a, __b, (poly64x2_t) {2, 0}); +#else + return __builtin_shuffle (__a, __b, (poly64x2_t) {1, 3}); +#endif +} + __extension__ extern __inline float16x4x2_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vtrn_f16 (float16x4_t __a, float16x4_t __b) @@ -31407,6 +31528,17 @@ vuzp1q_u64 (uint64x2_t __a, uint64x2_t __b) #endif } +__extension__ extern __inline poly64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vuzp1q_p64 (poly64x2_t __a, poly64x2_t __b) +{ +#ifdef __AARCH64EB__ + return __builtin_shuffle (__a, __b, (poly64x2_t) {3, 1}); +#else + return __builtin_shuffle (__a, __b, (poly64x2_t) {0, 2}); +#endif +} + __extension__ extern __inline float16x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vuzp2_f16 (float16x4_t __a, float16x4_t __b) @@ -31666,6 +31798,17 @@ vuzp2q_u64 (uint64x2_t __a, uint64x2_t __b) #endif } +__extension__ extern __inline poly64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vuzp2q_p64 (poly64x2_t __a, poly64x2_t __b) +{ +#ifdef __AARCH64EB__ + return __builtin_shuffle (__a, __b, (poly64x2_t) {2, 0}); +#else + return __builtin_shuffle (__a, __b, (poly64x2_t) {1, 3}); +#endif +} + __INTERLEAVE_LIST (uzp) /* vzip */ @@ -31934,6 +32077,17 @@ vzip1q_u64 (uint64x2_t __a, uint64x2_t __b) #endif } +__extension__ extern __inline poly64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vzip1q_p64 (poly64x2_t __a, poly64x2_t __b) +{ +#ifdef __AARCH64EB__ + return __builtin_shuffle (__a, __b, (poly64x2_t) {3, 1}); +#else + return __builtin_shuffle (__a, __b, (poly64x2_t) {0, 2}); +#endif +} + __extension__ extern __inline float16x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vzip2_f16 (float16x4_t __a, float16x4_t __b) @@ -32198,6 +32352,17 @@ vzip2q_u64 (uint64x2_t __a, uint64x2_t __b) #endif } +__extension__ extern __inline poly64x2_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vzip2q_p64 (poly64x2_t __a, poly64x2_t __b) +{ +#ifdef __AARCH64EB__ + return __builtin_shuffle (__a, __b, (poly64x2_t) {2, 0}); +#else + return __builtin_shuffle (__a, __b, (poly64x2_t) {1, 3}); +#endif +} + __INTERLEAVE_LIST (zip) #undef __INTERLEAVE_LIST @@ -35659,6 +35824,55 @@ vusmmlaq_s32 (int32x4_t __r, uint8x16_t __a, int8x16_t __b) #pragma GCC pop_options +__extension__ extern __inline poly8x8_t +__attribute ((__always_inline__, __gnu_inline__, __artificial__)) +vadd_p8 (poly8x8_t __a, poly8x8_t __b) +{ + return __a ^ __b; +} + +__extension__ extern __inline poly16x4_t +__attribute ((__always_inline__, __gnu_inline__, __artificial__)) +vadd_p16 (poly16x4_t __a, poly16x4_t __b) +{ + return __a ^ __b; +} + +__extension__ extern __inline poly64x1_t +__attribute ((__always_inline__, __gnu_inline__, __artificial__)) +vadd_p64 (poly64x1_t __a, poly64x1_t __b) +{ + return __a ^ __b; +} + +__extension__ extern __inline poly8x16_t +__attribute ((__always_inline__, __gnu_inline__, __artificial__)) +vaddq_p8 (poly8x16_t __a, poly8x16_t __b) +{ + return __a ^ __b; +} + +__extension__ extern __inline poly16x8_t +__attribute ((__always_inline__, __gnu_inline__, __artificial__)) +vaddq_p16 (poly16x8_t __a, poly16x8_t __b) +{ + return __a ^__b; +} + +__extension__ extern __inline poly64x2_t +__attribute ((__always_inline__, __gnu_inline__, __artificial__)) +vaddq_p64 (poly64x2_t __a, poly64x2_t __b) +{ + return __a ^ __b; +} + +__extension__ extern __inline poly128_t +__attribute ((__always_inline__, __gnu_inline__, __artificial__)) +vaddq_p128 (poly128_t __a, poly128_t __b) +{ + return __a ^ __b; +} + #undef __aarch64_vget_lane_any #undef __aarch64_vdup_lane_any diff --git a/gcc/config/arm/mve.md b/gcc/config/arm/mve.md index 9758862ac2bb..465b39a51b3a 100644 --- a/gcc/config/arm/mve.md +++ b/gcc/config/arm/mve.md @@ -9330,7 +9330,7 @@ [(set_attr "length" "4")]) (define_expand "mve_vst1q_f" - [(match_operand: 0 "memory_operand") + [(match_operand: 0 "mve_memory_operand") (unspec: [(match_operand:MVE_0 1 "s_register_operand")] VST1Q_F) ] "TARGET_HAVE_MVE || TARGET_HAVE_MVE_FLOAT" @@ -9340,7 +9340,7 @@ }) (define_expand "mve_vst1q_" - [(match_operand:MVE_2 0 "memory_operand") + [(match_operand:MVE_2 0 "mve_memory_operand") (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand")] VST1Q) ] "TARGET_HAVE_MVE" diff --git a/gcc/config/bpf/bpf.md b/gcc/config/bpf/bpf.md index 769d8ea00969..8e7cf508ccff 100644 --- a/gcc/config/bpf/bpf.md +++ b/gcc/config/bpf/bpf.md @@ -165,6 +165,16 @@ "div\t%0,%2" [(set_attr "type" "")]) +;; However, xBPF does provide a signed division operator, sdiv. + +(define_insn "div3" + [(set (match_operand:AM 0 "register_operand" "=r,r") + (div:AM (match_operand:AM 1 "register_operand" " 0,0") + (match_operand:AM 2 "reg_or_imm_operand" "r,I")))] + "TARGET_XBPF" + "sdiv\t%0,%2" + [(set_attr "type" "")]) + ;;; Modulus ;; Note that eBPF doesn't provide instructions for signed integer @@ -178,6 +188,16 @@ "mod\t%0,%2" [(set_attr "type" "")]) +;; Again, xBPF provides a signed version, smod. + +(define_insn "mod3" + [(set (match_operand:AM 0 "register_operand" "=r,r") + (mod:AM (match_operand:AM 1 "register_operand" " 0,0") + (match_operand:AM 2 "reg_or_imm_operand" "r,I")))] + "TARGET_XBPF" + "smod\t%0,%2" + [(set_attr "type" "")]) + ;;; Logical AND (define_insn "and3" [(set (match_operand:AM 0 "register_operand" "=r,r") diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index c61eac559a34..7ecaecfab250 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6965,10 +6965,12 @@ ix86_update_stack_boundary (void) static rtx ix86_get_drap_rtx (void) { - /* We must use DRAP if there are outgoing arguments on stack and + /* We must use DRAP if there are outgoing arguments on stack or + the stack pointer register is clobbered by asm statment and ACCUMULATE_OUTGOING_ARGS is false. */ if (ix86_force_drap - || (cfun->machine->outgoing_args_on_stack + || ((cfun->machine->outgoing_args_on_stack + || crtl->sp_is_clobbered_by_asm) && !ACCUMULATE_OUTGOING_ARGS)) crtl->need_drap = true; diff --git a/gcc/config/pa/pa-hpux11.h b/gcc/config/pa/pa-hpux11.h index 794bf8e29640..28207202e424 100644 --- a/gcc/config/pa/pa-hpux11.h +++ b/gcc/config/pa/pa-hpux11.h @@ -154,11 +154,6 @@ along with GCC; see the file COPYING3. If not see %{!mt:%{!pthread:-a shared -lc -a archive}}}}\ %{shared:%{mt|pthread:-lpthread}}" -/* The libgcc_stub.a library needs to come last. */ -#undef LINK_GCC_C_SEQUENCE_SPEC -#define LINK_GCC_C_SEQUENCE_SPEC \ - "%G %{!nolibc:%L} %G %{!nostdlib:%{!nodefaultlibs:%{!shared:-lgcc_stub}}}" - #undef STARTFILE_SPEC #define STARTFILE_SPEC \ "%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}} \ diff --git a/gcc/config/pa/pa32-linux.h b/gcc/config/pa/pa32-linux.h index f271bbf51a25..970722ad528c 100644 --- a/gcc/config/pa/pa32-linux.h +++ b/gcc/config/pa/pa32-linux.h @@ -57,6 +57,11 @@ call_ ## FUNC (void) \ } #endif +/* We need to link against libgcc.a for __canonicalize_funcptr_for_compare + and $$dyncall. */ +#undef ENDFILE_SPEC +#define ENDFILE_SPEC GNU_USER_TARGET_ENDFILE_SPEC "libgcc.a%s" + #undef WCHAR_TYPE #define WCHAR_TYPE "long int" diff --git a/gcc/config/pa/pa64-hpux.h b/gcc/config/pa/pa64-hpux.h index c7d127f76ace..096aa4bd4ee9 100644 --- a/gcc/config/pa/pa64-hpux.h +++ b/gcc/config/pa/pa64-hpux.h @@ -103,12 +103,6 @@ along with GCC; see the file COPYING3. If not see %{shared:%{mt|pthread:-lpthread}}" #endif -/* The libgcc_stub.a and milli.a libraries need to come last. */ -#undef LINK_GCC_C_SEQUENCE_SPEC -#define LINK_GCC_C_SEQUENCE_SPEC "\ - %G %{!nolibc:%L} %G %{!nostdlib:%{!nodefaultlibs:%{!shared:-lgcc_stub}\ - milli.a%s}}" - /* Under hpux11, the normal location of the `ld' and `as' programs is the /usr/ccs/bin directory. */ @@ -335,8 +329,12 @@ do { \ %{static:crtbeginT%O%s} %{!static:%{!shared:crtbegin%O%s} \ %{shared:crtbeginS%O%s}}" #endif + +/* The libgcc_stub.a and milli.a libraries must come last. We need + to link with these libraries whenever start files are needed. */ #undef ENDFILE_SPEC -#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}" +#define ENDFILE_SPEC \ + "%{!shared:crtend%O%s libgcc_stub.a%s} %{shared:crtendS%O%s} milli.a%s" /* Since HP uses the .init and .fini sections for array initializers and finalizers, we need different defines for INIT_SECTION_ASM_OP diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index fcf36fc622e8..7e211fdbf316 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -597,6 +597,9 @@ rs6000_target_modify_macros (bool define_p, HOST_WIDE_INT flags, /* Tell the user if we support the MMA instructions. */ if ((flags & OPTION_MASK_MMA) != 0) rs6000_define_or_undefine_macro (define_p, "__MMA__"); + /* Whether pc-relative code is being generated. */ + if ((flags & OPTION_MASK_PCREL) != 0) + rs6000_define_or_undefine_macro (define_p, "__PCREL__"); } void diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 8960e7dfb8ce..fe04b4d8e6a1 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -17022,8 +17022,8 @@ performance of the code. Permissible values for this option are: @samp{cortex-a76}, @samp{cortex-a76ae}, @samp{cortex-a77}, @samp{cortex-a65}, @samp{cortex-a65ae}, @samp{cortex-a34}, @samp{ares}, @samp{exynos-m1}, @samp{emag}, @samp{falkor}, -@samp{neoverse-e1},@samp{neoverse-n1},@samp{qdf24xx}, @samp{saphira}, -@samp{phecda}, @samp{xgene1}, @samp{vulcan}, @samp{octeontx}, +@samp{neoverse-e1},@samp{neoverse-n1},@samp{neoverse-v1},@samp{qdf24xx}, +@samp{saphira}, @samp{phecda}, @samp{xgene1}, @samp{vulcan}, @samp{octeontx}, @samp{octeontx81}, @samp{octeontx83}, @samp{octeontx2}, @samp{octeontx2t98}, @samp{octeontx2t96} @samp{octeontx2t93}, @samp{octeontx2f95}, @samp{octeontx2f95n}, diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h index a878efe3cf7e..0c96c52fc7b3 100644 --- a/gcc/emit-rtl.h +++ b/gcc/emit-rtl.h @@ -275,6 +275,9 @@ struct GTY(()) rtl_data { pass_stack_ptr_mod has run. */ bool sp_is_unchanging; + /* True if the stack pointer is clobbered by asm statement. */ + bool sp_is_clobbered_by_asm; + /* Nonzero if function being compiled doesn't contain any calls (ignoring the prologue and epilogue). This is set prior to register allocation in IRA and is valid for the remaining diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5ee063bc0c90..7597b1cb559a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,41 @@ +2020-09-27 Mark Eggleston + + Backported from master: + 2020-09-27 Steven G. Kargl + Mark Eggleston + + PR fortran/95614 + * decl.c (gfc_get_common): Use gfc_match_common_name instead + of match_common_name. + * decl.c (gfc_bind_idents): Use gfc_match_common_name instead + of match_common_name. + * match.c : Rename match_common_name to gfc_match_common_name. + * match.c (gfc_match_common): Use gfc_match_common_name instead + of match_common_name. + * match.h : Rename match_common_name to gfc_match_common_name. + * resolve.c (resolve_common_vars): Check each symbol in a + common block has a global symbol. If there is a global symbol + issue an error if the symbol type is known as is not a common + block name. + +2020-09-18 Tobias Burnus + + Backported from master: + 2020-09-17 Tobias Burnus + + PR fortran/96041 + PR fortran/93423 + * decl.c (gfc_match_submod_proc): Avoid later double-free + in the error case. + +2020-09-18 Harald Anlauf + + Backported from master: + 2020-07-02 Harald Anlauf + + PR fortran/93423 + * resolve.c (resolve_symbol): Avoid NULL pointer dereference. + 2020-09-11 Jakub Jelinek Backported from master: diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index e6c500bf8d21..c1a15f1a84ae 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -9801,6 +9801,15 @@ gfc_match_submod_proc (void) if (gfc_match_eos () != MATCH_YES) { + /* Unset st->n.sym. Note: in reject_statement (), the symbol changes are + undone, such that the st->n.sym->formal points to the original symbol; + if now this namespace is finalized, the formal namespace is freed, + but it might be still needed in the parent namespace. */ + gfc_symtree *st = gfc_find_symtree (gfc_current_ns->sym_root, sym->name); + st->n.sym = NULL; + gfc_free_symbol (sym->tlink); + sym->tlink = NULL; + sym->refs--; gfc_syntax_error (ST_MODULE_PROC); return MATCH_ERROR; } diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 0bb7422bf8ce..c9dfcc474336 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -15926,7 +15926,7 @@ resolve_symbol (gfc_symbol *sym) if (formal) { sym->formal_ns = formal->sym->ns; - if (sym->ns != formal->sym->ns) + if (sym->formal_ns && sym->ns != formal->sym->ns) sym->formal_ns->refs++; } } diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index bf6d4a2fd4bf..421c453997b5 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -1071,6 +1071,8 @@ match_reload (signed char out, signed char *ins, signed char *outs, if (find_reg_note (curr_insn, REG_UNUSED, out_rtx) == NULL_RTX) { start_sequence (); + if (out >= 0 && curr_static_id->operand[out].strict_low) + out_rtx = gen_rtx_STRICT_LOW_PART (VOIDmode, out_rtx); lra_emit_move (out_rtx, copy_rtx (new_out_reg)); emit_insn (*after); *after = get_insns (); diff --git a/gcc/lra.c b/gcc/lra.c index 5e8b75b1fdae..3543ce3993c2 100644 --- a/gcc/lra.c +++ b/gcc/lra.c @@ -490,13 +490,16 @@ void lra_emit_move (rtx x, rtx y) { int old; - + rtx_insn *insn; + if (GET_CODE (y) != PLUS) { if (rtx_equal_p (x, y)) return; old = max_reg_num (); - rtx_insn *insn = emit_move_insn (x, y); + + insn = (GET_CODE (x) != STRICT_LOW_PART + ? emit_move_insn (x, y) : emit_insn (gen_rtx_SET (x, y))); /* The move pattern may require scratch registers, so convert them into real registers now. */ if (insn != NULL_RTX) diff --git a/gcc/optabs.c b/gcc/optabs.c index d85ce47f7624..049a18ceb7c1 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1395,6 +1395,8 @@ expand_binop (machine_mode mode, optab binoptab, rtx op0, rtx op1, if (target == 0 || target == op0 || target == op1 + || reg_overlap_mentioned_p (target, op0) + || reg_overlap_mentioned_p (target, op1) || !valid_multiword_target_p (target)) target = gen_reg_rtx (int_mode); @@ -1475,6 +1477,8 @@ expand_binop (machine_mode mode, optab binoptab, rtx op0, rtx op1, if (target == 0 || target == op0 || target == op1 + || reg_overlap_mentioned_p (target, op0) + || reg_overlap_mentioned_p (target, op1) || !valid_multiword_target_p (target)) target = gen_reg_rtx (int_mode); @@ -1533,6 +1537,8 @@ expand_binop (machine_mode mode, optab binoptab, rtx op0, rtx op1, || target == op0 || target == op1 || !REG_P (target) + || reg_overlap_mentioned_p (target, op0) + || reg_overlap_mentioned_p (target, op1) || !valid_multiword_target_p (target)) target = gen_reg_rtx (int_mode); @@ -2670,6 +2676,7 @@ expand_absneg_bit (enum rtx_code code, scalar_float_mode mode, if (target == 0 || target == op0 + || reg_overlap_mentioned_p (target, op0) || (nwords > 1 && !valid_multiword_target_p (target))) target = gen_reg_rtx (mode); @@ -2948,7 +2955,10 @@ expand_unop (machine_mode mode, optab unoptab, rtx op0, rtx target, int i; rtx_insn *insns; - if (target == 0 || target == op0 || !valid_multiword_target_p (target)) + if (target == 0 + || target == op0 + || reg_overlap_mentioned_p (target, op0) + || !valid_multiword_target_p (target)) target = gen_reg_rtx (int_mode); start_sequence (); @@ -3469,6 +3479,8 @@ expand_copysign_bit (scalar_float_mode mode, rtx op0, rtx op1, rtx target, if (target == 0 || target == op0 || target == op1 + || reg_overlap_mentioned_p (target, op0) + || reg_overlap_mentioned_p (target, op1) || (nwords > 1 && !valid_multiword_target_p (target))) target = gen_reg_rtx (mode); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0c68157929fe..355e8147d1fa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,79 @@ +2020-09-27 Jakub Jelinek + + Backported from master: + 2020-09-27 Jakub Jelinek + + PR middle-end/97073 + * gcc.c-torture/execute/pr97073.c: New test. + +2020-09-27 Mark Eggleston + + Backported from master: + 2020-09-27 Steven G. Kargl + Mark Eggleston + + PR fortran/95614 + * gfortran.dg/pr95614_1.f90: New test. + * gfortran.dg/pr95614_2.f90: New test. + +2020-09-25 Vladimir N. Makarov + + Backported from master: + 2020-06-04 Vladimir Makarov + + PR middle-end/95464 + * gcc.target/i386/pr95464.c: New. + +2020-09-25 Joe Ramsay + + Backported from master: + 2020-08-20 Joe Ramsay + + PR target/96683 + * gcc.target/arm/mve/intrinsics/vst1q_f16.c: New test. + * gcc.target/arm/mve/intrinsics/vst1q_s16.c: New test. + * gcc.target/arm/mve/intrinsics/vst1q_s8.c: New test. + * gcc.target/arm/mve/intrinsics/vst1q_u16.c: New test. + * gcc.target/arm/mve/intrinsics/vst1q_u8.c: New test. + +2020-09-24 H.J. Lu + + Backported from master: + 2020-09-16 H.J. Lu + + PR target/97032 + * gcc.target/i386/pr97032.c: New test. + +2020-09-22 David Faust + + Backported from master: + 2020-09-22 David Faust + + * gcc.target/bpf/diag-sdiv.c: New test. + * gcc.target/bpf/diag-smod.c: New test. + * gcc.target/bpf/xbpf-sdiv-1.c: New test. + * gcc.target/bpf/xbpf-smod-1.c: New test. + +2020-09-18 Harald Anlauf + + Backported from master: + 2020-07-02 Harald Anlauf + + PR fortran/93423 + * gfortran.dg/pr93423.f90: New file. + +2020-09-17 Marek Polacek + + Backported from master: + 2020-09-16 Marek Polacek + + PR preprocessor/96935 + * gcc.dg/format/pr96935.c: New test. + +2020-09-17 liuhongt + + * gcc.target/i386/xsave-avx-1.c: New test. + 2020-09-16 Jakub Jelinek Backported from master: diff --git a/gcc/testsuite/gcc.c-torture/execute/pr97073.c b/gcc/testsuite/gcc.c-torture/execute/pr97073.c new file mode 100644 index 000000000000..1955e6b8bd25 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr97073.c @@ -0,0 +1,21 @@ +/* PR middle-end/97073 */ +/* { dg-additional-options "-mno-stv" { target i?86-*-* x86_64-*-* } } */ + +typedef unsigned long long L; +union U { L i; struct T { unsigned k; L l; } j; } u; + +__attribute__((noinline,noclone)) void +foo (L x) +{ + u.j.l = u.i & x; +} + +int +main () +{ + u.i = 5; + foo (-1ULL); + if (u.j.l != 5) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/arm-neon-ref.h b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/arm-neon-ref.h index fde6029b7fc1..791972c737e7 100644 --- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/arm-neon-ref.h +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/arm-neon-ref.h @@ -460,6 +460,8 @@ static void clean_results (void) #endif CLEAN(result, float, 32, 4); + AARCH64_ONLY(CLEAN(result, float, 64, 2)); + #if defined(__aarch64__) /* On AArch64, make sure to return DefaultNaN to have the same results as on AArch32. */ @@ -544,7 +546,8 @@ static void clean_results (void) DECL_VARIABLE(VAR, poly, 16, 8); \ DECL_VARIABLE_CRYPTO(VAR, poly, 64, 2); \ DECL_VARIABLE(VAR, float, 16, 8); \ - DECL_VARIABLE(VAR, float, 32, 4) + DECL_VARIABLE(VAR, float, 32, 4); \ + AARCH64_ONLY(DECL_VARIABLE(VAR, float, 64, 2)) #else #define DECL_VARIABLE_128BITS_VARIANTS(VAR) \ DECL_VARIABLE_128BITS_SIGNED_VARIANTS(VAR); \ @@ -552,7 +555,8 @@ static void clean_results (void) DECL_VARIABLE(VAR, poly, 8, 16); \ DECL_VARIABLE(VAR, poly, 16, 8); \ DECL_VARIABLE_CRYPTO(VAR, poly, 64, 2); \ - DECL_VARIABLE(VAR, float, 32, 4) + DECL_VARIABLE(VAR, float, 32, 4); \ + AARCH64_ONLY(DECL_VARIABLE(VAR, float, 64, 2)) #endif /* Declare all variants. */ #define DECL_VARIABLE_ALL_VARIANTS(VAR) \ diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vreinterpret_p128.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vreinterpret_p128.c index 25b348223f3d..67f809c70651 100644 --- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vreinterpret_p128.c +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vreinterpret_p128.c @@ -33,6 +33,10 @@ VECT_VAR_DECL(vreint_expected_q_p128_f32,poly,64,2) [] = { 0xc1700000c1800000, 0xc1500000c1600000 }; VECT_VAR_DECL(vreint_expected_q_p128_f16,poly,64,2) [] = { 0xca80cb00cb80cc00, 0xc880c900c980ca00 }; +#ifdef __aarch64__ +VECT_VAR_DECL(vreint_expected_q_p128_f64,poly,64,2) [] = { 0xc030000000000000, + 0xc02e000000000000 }; +#endif /* Expected results: vreinterpretq_*_p128. */ VECT_VAR_DECL(vreint_expected_q_s8_p128,int,8,16) [] = { 0xf0, 0xff, 0xff, 0xff, @@ -75,6 +79,10 @@ VECT_VAR_DECL(vreint_expected_q_f16_p128,hfloat,16,8) [] = { 0xfff0, 0xffff, 0xffff, 0xffff, 0xfff1, 0xffff, 0xffff, 0xffff }; +#ifdef __aarch64__ +VECT_VAR_DECL(vreint_expected_q_f64_p128,hfloat,64,2) [] = { 0xfffffffffffffff0, + 0xfffffffffffffff1 }; +#endif int main (void) { @@ -90,6 +98,10 @@ int main (void) #endif VLOAD(vreint_vector, buffer, q, float, f, 32, 4); +#ifdef __aarch64__ + VLOAD(vreint_vector, buffer, q, float, f, 64, 2); +#endif + /* vreinterpretq_p128_* tests. */ #undef TEST_MSG #define TEST_MSG "VREINTERPRETQ_P128_*" @@ -121,6 +133,10 @@ int main (void) #endif TEST_VREINTERPRET128(q, poly, p, 128, 1, float, f, 32, 4, vreint_expected_q_p128_f32); +#ifdef __aarch64__ + TEST_VREINTERPRET128(q, poly, p, 128, 1, float, f, 64, 2, vreint_expected_q_p128_f64); +#endif + /* vreinterpretq_*_p128 tests. */ #undef TEST_MSG #define TEST_MSG "VREINTERPRETQ_*_P128" @@ -161,5 +177,8 @@ int main (void) #endif TEST_VREINTERPRET_FP_FROM_P128(q, float, f, 32, 4, poly, p, 128, 1, vreint_expected_q_f32_p128); +#ifdef __aarch64__ + TEST_VREINTERPRET_FP_FROM_P128(q, float, f, 64, 2, poly, p, 128, 1, vreint_expected_q_f64_p128); +#endif return 0; } diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vtrn_half.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vtrn_half.c index 63f820fbf5a9..25a0f1985182 100644 --- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vtrn_half.c +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vtrn_half.c @@ -73,11 +73,8 @@ void exec_vtrn_half (void) /* Input vector can only have 64 bits. */ DECL_VARIABLE_ALL_VARIANTS(vector); DECL_VARIABLE_ALL_VARIANTS(vector2); - DECL_VARIABLE(vector, float, 64, 2); - DECL_VARIABLE(vector2, float, 64, 2); DECL_VARIABLE_ALL_VARIANTS(vector_res); - DECL_VARIABLE(vector_res, float, 64, 2); clean_results (); /* We don't have vtrn1_T64x1, so set expected to the clean value. */ diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vuzp_half.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vuzp_half.c index 8706f248591a..2e6b666b71d3 100644 --- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vuzp_half.c +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vuzp_half.c @@ -70,11 +70,8 @@ void exec_vuzp_half (void) /* Input vector can only have 64 bits. */ DECL_VARIABLE_ALL_VARIANTS(vector); DECL_VARIABLE_ALL_VARIANTS(vector2); - DECL_VARIABLE(vector, float, 64, 2); - DECL_VARIABLE(vector2, float, 64, 2); DECL_VARIABLE_ALL_VARIANTS(vector_res); - DECL_VARIABLE(vector_res, float, 64, 2); clean_results (); /* We don't have vuzp1_T64x1, so set expected to the clean value. */ diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vzip_half.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vzip_half.c index 619d6b2e6ed3..ef42451c82e0 100644 --- a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vzip_half.c +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vzip_half.c @@ -73,11 +73,8 @@ void exec_vzip_half (void) /* Input vector can only have 64 bits. */ DECL_VARIABLE_ALL_VARIANTS(vector); DECL_VARIABLE_ALL_VARIANTS(vector2); - DECL_VARIABLE(vector, float, 64, 2); - DECL_VARIABLE(vector2, float, 64, 2); DECL_VARIABLE_ALL_VARIANTS(vector_res); - DECL_VARIABLE(vector_res, float, 64, 2); clean_results (); /* We don't have vzip1_T64x1, so set expected to the clean value. */ diff --git a/gcc/testsuite/gcc.target/aarch64/simd/trn_zip_p64_1.c b/gcc/testsuite/gcc.target/aarch64/simd/trn_zip_p64_1.c new file mode 100644 index 000000000000..a47321db80b0 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/trn_zip_p64_1.c @@ -0,0 +1,44 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +#include + +poly64x2_t +foo (poly64x2_t a, poly64x2_t b) +{ + return vtrn1q_p64 (a, b); +} + +poly64x2_t +foo1 (poly64x2_t a, poly64x2_t b) +{ + return vtrn2q_p64 (a, b); +} + +poly64x2_t +foo2 (poly64x2_t a, poly64x2_t b) +{ + return vuzp1q_p64 (a, b); +} + +poly64x2_t +foo3 (poly64x2_t a, poly64x2_t b) +{ + return vuzp2q_p64 (a, b); +} + +poly64x2_t +foo4 (poly64x2_t a, poly64x2_t b) +{ + return vzip1q_p64 (a, b); +} + +poly64x2_t +foo5 (poly64x2_t a, poly64x2_t b) +{ + return vzip2q_p64 (a, b); +} + +/* { dg-final { scan-assembler-times {zip1\tv0.2d, v0.2d, v1.2d} 3 } } */ +/* { dg-final { scan-assembler-times {zip2\tv0.2d, v0.2d, v1.2d} 3 } } */ + diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vadd_poly_1.c b/gcc/testsuite/gcc.target/aarch64/simd/vadd_poly_1.c new file mode 100644 index 000000000000..a5cdf290b0df --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/vadd_poly_1.c @@ -0,0 +1,50 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +#include + +poly8x8_t +foo (poly8x8_t a, poly8x8_t b) +{ + return vadd_p8 (a, b); +} + +poly16x4_t +foo16 (poly16x4_t a, poly16x4_t b) +{ + return vadd_p16 (a, b); +} + +poly64x1_t +foo64 (poly64x1_t a, poly64x1_t b) +{ + return vadd_p64 (a, b); +} + +poly8x16_t +fooq (poly8x16_t a, poly8x16_t b) +{ + return vaddq_p8 (a, b); +} + +poly16x8_t +fooq16 (poly16x8_t a, poly16x8_t b) +{ + return vaddq_p16 (a, b); +} + +poly64x2_t +fooq64 (poly64x2_t a, poly64x2_t b) +{ + return vaddq_p64 (a, b); +} + +poly128_t +fooq128 (poly128_t a, poly128_t b) +{ + return vaddq_p128 (a, b); +} + +/* { dg-final { scan-assembler-times "eor\\tv\[0-9\]+\.8b, v\[0-9\]+\.8b, v\[0-9\]+\.8b" 3 } } */ +/* { dg-final { scan-assembler-times "eor\\tv\[0-9\]+\.16b, v\[0-9\]+\.16b, v\[0-9\]+\.16b" 3 } } */ +/* { dg-final { scan-assembler-times "eor\\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+" 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vceq_poly_1.c b/gcc/testsuite/gcc.target/aarch64/simd/vceq_poly_1.c new file mode 100644 index 000000000000..7d43352266c2 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/vceq_poly_1.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +#include + +uint64x2_t +foo (poly64x2_t a, poly64x2_t b) +{ + return vceqq_p64 (a, b); +} + +/* { dg-final { scan-assembler-times "cmeq\\tv\[0-9\]+\.2d, v\[0-9\]+\.2d, v\[0-9\]+\.2d" 1 } } */ + +uint64x1_t +fooz (poly64x1_t a) +{ + return vceqz_p64 (a); +} + +/* { dg-final { scan-assembler-times "cmeq\\td\[0-9\]+, d\[0-9\]+, #0" 1 } } */ + +uint64x2_t +fooqz (poly64x2_t a) +{ + return vceqzq_p64 (a); +} + +/* { dg-final { scan-assembler-times "cmeq\\tv\[0-9\]+\.2d, v\[0-9\]+\.2d, #0" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vcls_unsigned_1.c b/gcc/testsuite/gcc.target/aarch64/simd/vcls_unsigned_1.c new file mode 100644 index 000000000000..f7078d1a67c9 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/vcls_unsigned_1.c @@ -0,0 +1,54 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +#include + +int16x8_t +test_16x8 (uint16x8_t a) +{ + return vclsq_u16 (a); +} + +/* { dg-final { scan-assembler-times "cls\\tv\[0-9\]+\.8h, v\[0-9\]+\.8h" 1 } } */ + + +int8x16_t +test_8x16 (uint8x16_t a) +{ + return vclsq_u8 (a); +} + +/* { dg-final { scan-assembler-times "cls\\tv\[0-9\]+\.16b, v\[0-9\]+\.16b" 1 } } */ + +int32x4_t +test_32x4 (uint32x4_t a) +{ + return vclsq_u32 (a); +} + +/* { dg-final { scan-assembler-times "cls\\tv\[0-9\]+\.4s, v\[0-9\]+\.4s" 1 } } */ + +int16x4_t +test_16x4 (uint16x4_t a) +{ + return vcls_u16 (a); +} + +/* { dg-final { scan-assembler-times "cls\\tv\[0-9\]+\.4h, v\[0-9\]+\.4h" 1 } } */ + +int8x8_t +test_8x8 (uint8x8_t a) +{ + return vcls_u8 (a); +} + +/* { dg-final { scan-assembler-times "cls\\tv\[0-9\]+\.8b, v\[0-9\]+\.8b" 1 } } */ + +int32x2_t +test32x2 (uint32x2_t a) +{ + return vcls_u32 (a); +} + +/* { dg-final { scan-assembler-times "cls\\tv\[0-9\]+\.2s, v\[0-9\]+\.2s" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vldrq_p128_1.c b/gcc/testsuite/gcc.target/aarch64/simd/vldrq_p128_1.c new file mode 100644 index 000000000000..9c7e01b9e103 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/vldrq_p128_1.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +#include + +poly128_t +test (poly128_t * p) +{ + return vldrq_p128 (p); +} + +/* { dg-final { scan-assembler-times {ldp.*x0,.*x1,.*[x0]} 1 } } */ + diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vrndns_f32_1.c b/gcc/testsuite/gcc.target/aarch64/simd/vrndns_f32_1.c new file mode 100644 index 000000000000..960e4f6f7688 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/vrndns_f32_1.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +#include + +float32_t +test (float32_t a) +{ + return vrndns_f32 (a); +} + +/* { dg-final { scan-assembler-times "frintn\\ts\[0-9\]+, s\[0-9\]+" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vstrq_p128_1.c b/gcc/testsuite/gcc.target/aarch64/simd/vstrq_p128_1.c new file mode 100644 index 000000000000..8d036fde0f15 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/vstrq_p128_1.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +#include + +void +test (poly128_t *ptr, poly128_t a) +{ + vstrq_p128 (ptr, a); +} + +/* { dg-final { scan-assembler-times {stp.*x2,.*x3,.*[x0]} 1 } } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_f16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_f16.c index 363b4caf472a..312b7464f17b 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_f16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_f16.c @@ -10,12 +10,16 @@ foo (float16_t * addr, float16x8_t value) vst1q_f16 (addr, value); } -/* { dg-final { scan-assembler "vstrh.16" } } */ - void foo1 (float16_t * addr, float16x8_t value) { vst1q (addr, value); } -/* { dg-final { scan-assembler "vstrh.16" } } */ +/* { dg-final { scan-assembler-times "vstrh.16" 2 } } */ + +void +foo2 (float16_t a, float16x8_t x) +{ + vst1q (&a, x); +} diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_s16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_s16.c index 37c4713f542e..cd14e2c408f1 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_s16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_s16.c @@ -10,12 +10,16 @@ foo (int16_t * addr, int16x8_t value) vst1q_s16 (addr, value); } -/* { dg-final { scan-assembler "vstrh.16" } } */ - void foo1 (int16_t * addr, int16x8_t value) { vst1q (addr, value); } -/* { dg-final { scan-assembler "vstrh.16" } } */ +/* { dg-final { scan-assembler-times "vstrh.16" 2 } } */ + +void +foo2 (int16_t a, int16x8_t x) +{ + vst1q (&a, x); +} diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_s8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_s8.c index fe5edea02f50..0004c80963ec 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_s8.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_s8.c @@ -10,12 +10,16 @@ foo (int8_t * addr, int8x16_t value) vst1q_s8 (addr, value); } -/* { dg-final { scan-assembler "vstrb.8" } } */ - void foo1 (int8_t * addr, int8x16_t value) { vst1q (addr, value); } -/* { dg-final { scan-assembler "vstrb.8" } } */ +/* { dg-final { scan-assembler-times "vstrb.8" 2 } } */ + +void +foo2 (int8_t a, int8x16_t x) +{ + vst1q (&a, x); +} diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_u16.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_u16.c index a4c8c1aabe7e..248e7ce82b09 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_u16.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_u16.c @@ -10,12 +10,16 @@ foo (uint16_t * addr, uint16x8_t value) vst1q_u16 (addr, value); } -/* { dg-final { scan-assembler "vstrh.16" } } */ - void foo1 (uint16_t * addr, uint16x8_t value) { vst1q (addr, value); } -/* { dg-final { scan-assembler "vstrh.16" } } */ +/* { dg-final { scan-assembler-times "vstrh.16" 2 } } */ + +void +foo2 (uint16_t a, uint16x8_t x) +{ + vst1q (&a, x); +} diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_u8.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_u8.c index bf20b6da7291..f8b48a69903a 100644 --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_u8.c +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vst1q_u8.c @@ -10,12 +10,16 @@ foo (uint8_t * addr, uint8x16_t value) vst1q_u8 (addr, value); } -/* { dg-final { scan-assembler "vstrb.8" } } */ - void foo1 (uint8_t * addr, uint8x16_t value) { vst1q (addr, value); } -/* { dg-final { scan-assembler "vstrb.8" } } */ +/* { dg-final { scan-assembler-times "vstrb.8" 2 } } */ + +void +foo2 (uint8_t a, uint8x16_t x) +{ + vst1q (&a, x); +} diff --git a/gcc/testsuite/gcc.target/bpf/diag-sdiv.c b/gcc/testsuite/gcc.target/bpf/diag-sdiv.c new file mode 100644 index 000000000000..db0c494a789c --- /dev/null +++ b/gcc/testsuite/gcc.target/bpf/diag-sdiv.c @@ -0,0 +1,12 @@ +/* Verify signed division does not produce 'sdiv' insn in eBPF. */ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +void +foo () +{ + signed int x = 5; + signed int y = 2; + signed int z = x / y; +} +/* { dg-final { scan-assembler-not "sdiv(32)?\t%r" } } */ diff --git a/gcc/testsuite/gcc.target/bpf/diag-smod.c b/gcc/testsuite/gcc.target/bpf/diag-smod.c new file mode 100644 index 000000000000..20234ee39cc7 --- /dev/null +++ b/gcc/testsuite/gcc.target/bpf/diag-smod.c @@ -0,0 +1,12 @@ +/* Verify signed modulo does not produce 'smod' insn in eBPF. */ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +void +foo () +{ + signed int x = 5; + signed int y = 2; + signed int z = x % y; +} +/* { dg-final { scan-assembler-not "smod(32)?\t%r" } } */ diff --git a/gcc/testsuite/gcc.target/bpf/xbpf-sdiv-1.c b/gcc/testsuite/gcc.target/bpf/xbpf-sdiv-1.c new file mode 100644 index 000000000000..f6c5c9e9f1c7 --- /dev/null +++ b/gcc/testsuite/gcc.target/bpf/xbpf-sdiv-1.c @@ -0,0 +1,14 @@ +/* Verify that sdiv instruction is used for xBPF. */ +/* { dg-do compile } */ +/* { dg-options "-O0 -mxbpf" } */ + +void +foo () +{ + signed int x = 5; + signed int y = 2; + signed int z = x / y; + signed int w = x / 3; +} + +/* { dg-final { scan-assembler "sdiv(32)?\t%r" } } */ diff --git a/gcc/testsuite/gcc.target/bpf/xbpf-smod-1.c b/gcc/testsuite/gcc.target/bpf/xbpf-smod-1.c new file mode 100644 index 000000000000..b3e5816b5cf4 --- /dev/null +++ b/gcc/testsuite/gcc.target/bpf/xbpf-smod-1.c @@ -0,0 +1,14 @@ +/* Verify that smod instruction is used for xBPF. */ +/* { dg-do compile } */ +/* { dg-options "-O0 -mxbpf" } */ + +void +foo () +{ + signed int x = 5; + signed int y = 2; + signed int z = x % y; + signed int w = x % 3; +} + +/* { dg-final { scan-assembler "smod(32)?\t%r" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr95464.c b/gcc/testsuite/gcc.target/i386/pr95464.c new file mode 100644 index 000000000000..33a8290e0cf8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr95464.c @@ -0,0 +1,64 @@ +/* { dg-options "-O2" } */ +/* { dg-do run { target { { *-*-linux* } && { ! ia32 } } } } */ + +struct S { unsigned a:1, b:1, c:1, d:1, e:14, f:14; }; + +__attribute__((noipa)) int +foo (struct S x) +{ + if (x.a != 0 || x.b != 1 || x.c != 0 || x.d != 1 + || x.e != 7239 || x.f != 6474) + __builtin_abort (); +} + +__attribute__((noipa)) void +bar (struct S x, struct S y) +{ + if (x.a != 0 || x.b != 1 || x.c != 0 || x.d != 1 + || x.e != 7239 || x.f != 6474) + __builtin_abort (); + if (y.a != 0 || y.b != 1 || y.c != 1 || y.d != 1 + || y.e != 16320 || y.f != 7315) + __builtin_abort (); +} + +__attribute__((noipa)) void +baz (struct S x) +{ + if (x.a != 1 || x.b != 1 || x.c != 1 || x.d != 1 + || x.e != 16320 || x.f != 7315) + __builtin_abort (); +} + +__attribute__((noipa)) void +qux (struct S x, struct S y, unsigned z) +{ + struct S a = x, b; + for (unsigned i = 0; i < z; ++i) + foo (x); + if (x.a && x.e == 16) + a.e = 32; + b = a; + b.c = y.c; + b.e = y.e; + b.f = y.f; + bar (a, b); + a = b; + __asm volatile ("" : : : "ax", "bx", "cx", "dx", "si", "di", +#ifdef __OPTIMIZE__ + "bp", +#endif + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"); + a.a = 1; + a.c = 1; + baz (a); +} + +int +main () +{ + struct S x = { 0, 1, 0, 1, 7239, 6474 }; + struct S y = { 1, 0, 1, 0, 16320, 7315 }; + qux (x, y, 1); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/pr97032.c b/gcc/testsuite/gcc.target/i386/pr97032.c new file mode 100644 index 000000000000..7cbbe9bc22aa --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr97032.c @@ -0,0 +1,23 @@ +/* { dg-do compile { target { ia32 && fstack_protector } } } */ +/* { dg-options "-O2 -mincoming-stack-boundary=2 -fstack-protector-all" } */ + +#include + +extern int *__errno_location (void); + +long +sys_socketcall (int op, ...) +{ + long int res; + va_list ap; + va_start (ap, op); + asm volatile ("push %%ebx; movl %2, %%ebx; int $0x80; pop %%ebx" + /* { dg-warning "listing the stack pointer register" "" { target *-*-* } .-1 } */ + : "=a" (res) : "0" (102), "ri" (16), "c" (ap) : "memory", "esp"); + if (__builtin_expect (res > 4294963200UL, 0)) + *__errno_location () = -res; + va_end (ap); + return res; +} + +/* { dg-final { scan-assembler "call\[ \t\]*_?__errno_location" } } */ diff --git a/gcc/testsuite/gfortran.dg/pr93423.f90 b/gcc/testsuite/gfortran.dg/pr93423.f90 new file mode 100644 index 000000000000..fed5914daba8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr93423.f90 @@ -0,0 +1,21 @@ +! { dg-do compile } +! PR fortran/93423 - ICE on invalid with argument list for module procedure + +module t + type :: b + contains + procedure :: p => bp + end type b + interface + module function bp(s) + class(b), intent(inout) :: s + integer, pointer :: bp + end function + end interface +end module t + +submodule (t) ts +contains + module procedure bp(s) ! { dg-error "must be in a generic module interface" } + end procedure bp ! { dg-error "Expecting END SUBMODULE statement" } +end submodule ts diff --git a/gcc/testsuite/gnat.dg/addr16.adb b/gcc/testsuite/gnat.dg/addr16.adb new file mode 100644 index 000000000000..8f09da023fb2 --- /dev/null +++ b/gcc/testsuite/gnat.dg/addr16.adb @@ -0,0 +1,14 @@ +-- { dg-do compile } + +with Addr16_Pkg; use Addr16_Pkg; + +procedure Addr16 (R : Rec) is + + pragma Unsuppress (Alignment_Check); + + B : Integer; + for B'Address use R.A'Address; + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/addr16_pkg.ads b/gcc/testsuite/gnat.dg/addr16_pkg.ads new file mode 100644 index 000000000000..9a1b9e3b21bd --- /dev/null +++ b/gcc/testsuite/gnat.dg/addr16_pkg.ads @@ -0,0 +1,9 @@ +package Addr16_Pkg is + + type Arr is array (Positive range <>) of Long_Long_Integer; + + type Rec (D : Positive) is record + A : Arr (1 .. D); + end record; + +end Addr16_Pkg; diff --git a/libffi/ChangeLog b/libffi/ChangeLog index 593e2cc7a29d..38b8e5ed8891 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,14 @@ +2020-09-24 Alan Modra + + Backported from master: + 2020-09-24 Alan Modra + + PR target/97166 + * src/powerpc/linux64.S (ffi_call_LINUX64): Don't emit global + entry when __PCREL__. Call using @notoc. Add nops. + * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise. + (ffi_go_closure_linux64): Likewise. + 2020-07-23 Release Manager * GCC 10.2.0 released. diff --git a/libffi/src/powerpc/linux64.S b/libffi/src/powerpc/linux64.S index b2ae60ead6e1..f0006fe90c5f 100644 --- a/libffi/src/powerpc/linux64.S +++ b/libffi/src/powerpc/linux64.S @@ -36,8 +36,10 @@ .cfi_startproc # if _CALL_ELF == 2 ffi_call_LINUX64: +# ifndef __PCREL__ addis %r2, %r12, .TOC.-ffi_call_LINUX64@ha addi %r2, %r2, .TOC.-ffi_call_LINUX64@l +# endif .localentry ffi_call_LINUX64, . - ffi_call_LINUX64 # else .section ".opd","aw" @@ -89,9 +91,15 @@ ffi_call_LINUX64: /* Call ffi_prep_args64. */ mr %r4, %r1 # if defined _CALL_LINUX || _CALL_ELF == 2 +# ifdef __PCREL__ + bl ffi_prep_args64@notoc +# else bl ffi_prep_args64 + nop +# endif # else bl .ffi_prep_args64 + nop # endif # if _CALL_ELF == 2 diff --git a/libffi/src/powerpc/linux64_closure.S b/libffi/src/powerpc/linux64_closure.S index 6487d2a2970a..5663bb402236 100644 --- a/libffi/src/powerpc/linux64_closure.S +++ b/libffi/src/powerpc/linux64_closure.S @@ -37,8 +37,10 @@ .cfi_startproc # if _CALL_ELF == 2 ffi_closure_LINUX64: +# ifndef __PCREL__ addis %r2, %r12, .TOC.-ffi_closure_LINUX64@ha addi %r2, %r2, .TOC.-ffi_closure_LINUX64@l +# endif .localentry ffi_closure_LINUX64, . - ffi_closure_LINUX64 # else .section ".opd","aw" @@ -143,7 +145,7 @@ ffi_closure_LINUX64: stfd %f12, -104+(11*8)(%r1) stfd %f13, -104+(12*8)(%r1) - # load up the pointer to the saved fpr registers */ + # load up the pointer to the saved fpr registers addi %r8, %r1, -104 # load up the pointer to the result storage @@ -155,11 +157,19 @@ ffi_closure_LINUX64: # make the call # if defined _CALL_LINUX || _CALL_ELF == 2 +# ifdef __PCREL__ + bl ffi_closure_helper_LINUX64@notoc +.Lret: +# else bl ffi_closure_helper_LINUX64 +.Lret: + nop +# endif # else bl .ffi_closure_helper_LINUX64 -# endif .Lret: + nop +# endif # now r3 contains the return type # so use it to look up in a table @@ -396,8 +406,10 @@ ffi_closure_LINUX64: .cfi_startproc # if _CALL_ELF == 2 ffi_go_closure_linux64: +# ifndef __PCREL__ addis %r2, %r12, .TOC.-ffi_go_closure_linux64@ha addi %r2, %r2, .TOC.-ffi_go_closure_linux64@l +# endif .localentry ffi_go_closure_linux64, . - ffi_go_closure_linux64 # else .section ".opd","aw" diff --git a/libgo/Makefile.am b/libgo/Makefile.am index dea09de592be..41b6da4cb0b2 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -614,7 +614,7 @@ s-zstdpkglist: Makefile echo 'package goroot' > zstdpkglist.go.tmp echo "" >> zstdpkglist.go.tmp echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp - echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's|[a-z0-9_./]*_c\.lo||g' | sed 's|\([a-z0-9_./]*\)\.lo|"\1": true,|g' >> zstdpkglist.go.tmp + echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's|[a-z0-9_./]*_c\.lo||g' | sed 's|golang\.org/[a-z0-9_./]*\.lo||g' | sed 's|\([a-z0-9_./]*\)\.lo|"\1": true,|g' >> zstdpkglist.go.tmp echo '}' >> zstdpkglist.go.tmp $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go $(STAMP) $@ diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 607b88c58781..020d6e6ccce9 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -2743,7 +2743,7 @@ s-zstdpkglist: Makefile echo 'package goroot' > zstdpkglist.go.tmp echo "" >> zstdpkglist.go.tmp echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp - echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's|[a-z0-9_./]*_c\.lo||g' | sed 's|\([a-z0-9_./]*\)\.lo|"\1": true,|g' >> zstdpkglist.go.tmp + echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's|[a-z0-9_./]*_c\.lo||g' | sed 's|golang\.org/[a-z0-9_./]*\.lo||g' | sed 's|\([a-z0-9_./]*\)\.lo|"\1": true,|g' >> zstdpkglist.go.tmp echo '}' >> zstdpkglist.go.tmp $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go $(STAMP) $@ diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 247a9dfaeb16..c2054dfcb917 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,81 @@ +2020-09-22 Jonathan Wakely + + Backported from master: + 2020-09-22 Jonathan Wakely + + PR libstdc++/97167 + * src/c++17/fs_path.cc (path::_Parser::root_path()): Check + for empty string before inspecting the first character. + * testsuite/27_io/filesystem/path/append/source.cc: Append + empty string_view to path. + +2020-09-22 Jonathan Wakely + + Backported from master: + 2020-09-22 Jonathan Wakely + + PR libstdc++/96803 + * include/std/tuple + (_Tuple_impl(allocator_arg_t, Alloc, const _Tuple_impl&)): + Use correct value category in __use_alloc call. + * testsuite/20_util/tuple/cons/96803.cc: Check with constructors + that require correct value category to be used. + +2020-09-22 Jonathan Wakely + + Backported from master: + 2020-08-26 Jonathan Wakely + + PR libstdc++/96803 + * include/std/tuple + (_Tuple_impl(allocator_arg_t, Alloc, const _Tuple_impl&)): + Replace parameter pack with a type parameter and a pack and pass + the first type to __use_alloc. + * testsuite/20_util/tuple/cons/96803.cc: New test. + +2020-09-21 Jonathan Wakely + + Backported from master: + 2020-08-10 Jonathan Wakely + + PR libstdc++/94681 + * src/c++17/fs_ops.cc (read_symlink): Use posix::lstat instead + of calling ::lstat directly. + * src/filesystem/ops.cc (read_symlink): Likewise. + +2020-09-21 Jonathan Wakely + + Backported from master: + 2020-08-10 Jonathan Wakely + + PR libstdc++/94681 + * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Do not depend on + $enable_libstdcxx_filesystem_ts. + * configure: Regenerate. + +2020-09-21 Jonathan Wakely + + Backported from master: + 2020-09-20 Jonathan Wakely + + PR libstdc++/97101 + * include/std/functional (bind_front): Fix order of parameters + in is_nothrow_constructible_v specialization. + * testsuite/20_util/function_objects/bind_front/97101.cc: New test. + +2020-09-21 Jonathan Wakely + + Backported from master: + 2020-09-10 Jonathan Wakely + + PR libstdc++/94160 + * src/c++17/memory_resource.cc (munge_options): Round + max_blocks_per_chunk to a multiple of four. + (__pool_resource::_M_alloc_pools()): Simplify slightly. + * testsuite/20_util/unsynchronized_pool_resource/allocate.cc: + Check that valid pointers are returned when small values are + used for max_blocks_per_chunk. + 2020-09-03 Jonathan Wakely Backported from master: diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index ee5e0336f2c3..55e9e6061c25 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -4536,7 +4536,8 @@ AC_DEFUN([GLIBCXX_ENABLE_FILESYSTEM_TS], [ ]) dnl -dnl Check whether the library calls required by the Filesystem TS are present. +dnl Check whether the library calls required by the C++17 Filesystem library +dnl and the Filesystem TS are present. dnl Defines: dnl HAVE_STRUCT_DIRENT_D_TYPE dnl _GLIBCXX_USE_REALPATH @@ -4551,226 +4552,224 @@ dnl HAVE_SYMLINK dnl AC_DEFUN([GLIBCXX_CHECK_FILESYSTEM_DEPS], [dnl dnl - if test $enable_libstdcxx_filesystem_ts = yes; then - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fno-exceptions" + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" dnl - AC_MSG_CHECKING([for struct dirent.d_type]) - AC_CACHE_VAL(glibcxx_cv_dirent_d_type, [dnl - GCC_TRY_COMPILE_OR_LINK( - [#include ], - [ - struct dirent d; - if (sizeof d.d_type) return 0; - ], - [glibcxx_cv_dirent_d_type=yes], - [glibcxx_cv_dirent_d_type=no]) - ]) - if test $glibcxx_cv_dirent_d_type = yes; then - AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1, [Define to 1 if `d_type' is a member of `struct dirent'.]) - fi - AC_MSG_RESULT($glibcxx_cv_dirent_d_type) -dnl - AC_MSG_CHECKING([for realpath]) - AC_CACHE_VAL(glibcxx_cv_realpath, [dnl - GCC_TRY_COMPILE_OR_LINK( - [ - #include - #include - #include - ], - [ - #if _XOPEN_VERSION < 500 - #error - #elif _XOPEN_VERSION >= 700 || defined(PATH_MAX) - char *tmp = realpath((const char*)NULL, (char*)NULL); - #else - #error - #endif - ], - [glibcxx_cv_realpath=yes], - [glibcxx_cv_realpath=no]) - ]) - if test $glibcxx_cv_realpath = yes; then - AC_DEFINE(_GLIBCXX_USE_REALPATH, 1, [Define if usable realpath is available in .]) - fi - AC_MSG_RESULT($glibcxx_cv_realpath) -dnl - AC_MSG_CHECKING([for utimensat]) - AC_CACHE_VAL(glibcxx_cv_utimensat, [dnl - GCC_TRY_COMPILE_OR_LINK( - [ - #include - #include - ], - [ - struct timespec ts[2] = { { 0, UTIME_OMIT }, { 1, 1 } }; - int i = utimensat(AT_FDCWD, "path", ts, 0); - ], - [glibcxx_cv_utimensat=yes], - [glibcxx_cv_utimensat=no]) - ]) - if test $glibcxx_cv_utimensat = yes; then - AC_DEFINE(_GLIBCXX_USE_UTIMENSAT, 1, [Define if utimensat and UTIME_OMIT are available in and AT_FDCWD in .]) - fi - AC_MSG_RESULT($glibcxx_cv_utimensat) -dnl - AC_MSG_CHECKING([for utime]) - AC_CACHE_VAL(glibcxx_cv_utime, [dnl - GCC_TRY_COMPILE_OR_LINK( - [ - #include - ], - [ - struct utimbuf t = { 1, 1 }; - int i = utime("path", &t); - ], - [glibcxx_cv_utime=yes], - [glibcxx_cv_utime=no]) - ]) - if test $glibcxx_cv_utime = yes; then - AC_DEFINE(_GLIBCXX_USE_UTIME, 1, [Define if utime is available in .]) - fi - AC_MSG_RESULT($glibcxx_cv_utime) -dnl - AC_MSG_CHECKING([for lstat]) - AC_CACHE_VAL(glibcxx_cv_lstat, [dnl - GCC_TRY_COMPILE_OR_LINK( - [ #include ], - [ - struct stat st; - int i = lstat("path", &st); - ], - [glibcxx_cv_lstat=yes], - [glibcxx_cv_lstat=no]) - ]) - if test $glibcxx_cv_lstat = yes; then - AC_DEFINE(_GLIBCXX_USE_LSTAT, 1, [Define if lstat is available in .]) - fi - AC_MSG_RESULT($glibcxx_cv_lstat) -dnl - AC_MSG_CHECKING([for struct stat.st_mtim.tv_nsec]) - AC_CACHE_VAL(glibcxx_cv_st_mtim, [dnl - GCC_TRY_COMPILE_OR_LINK( - [ #include ], - [ - struct stat st; - return st.st_mtim.tv_nsec; - ], - [glibcxx_cv_st_mtim=yes], - [glibcxx_cv_st_mtim=no]) - ]) - if test $glibcxx_cv_st_mtim = yes; then - AC_DEFINE(_GLIBCXX_USE_ST_MTIM, 1, [Define if struct stat has timespec members.]) - fi - AC_MSG_RESULT($glibcxx_cv_st_mtim) -dnl - AC_MSG_CHECKING([for fchmod]) - AC_CACHE_VAL(glibcxx_cv_fchmod, [dnl - GCC_TRY_COMPILE_OR_LINK( - [#include ], - [fchmod(1, S_IWUSR);], - [glibcxx_cv_fchmod=yes], - [glibcxx_cv_fchmod=no]) - ]) - if test $glibcxx_cv_fchmod = yes; then - AC_DEFINE(_GLIBCXX_USE_FCHMOD, 1, [Define if fchmod is available in .]) - fi - AC_MSG_RESULT($glibcxx_cv_fchmod) -dnl - AC_MSG_CHECKING([for fchmodat]) - AC_CACHE_VAL(glibcxx_cv_fchmodat, [dnl - GCC_TRY_COMPILE_OR_LINK( - [ - #include - #include - ], - [fchmodat(AT_FDCWD, "", 0, AT_SYMLINK_NOFOLLOW);], - [glibcxx_cv_fchmodat=yes], - [glibcxx_cv_fchmodat=no]) - ]) - if test $glibcxx_cv_fchmodat = yes; then - AC_DEFINE(_GLIBCXX_USE_FCHMODAT, 1, [Define if fchmodat is available in .]) - fi - AC_MSG_RESULT($glibcxx_cv_fchmodat) -dnl - AC_MSG_CHECKING([for sendfile that can copy files]) - AC_CACHE_VAL(glibcxx_cv_sendfile, [dnl - case "${target_os}" in - gnu* | linux* | solaris* | uclinux*) - GCC_TRY_COMPILE_OR_LINK( - [#include ], - [sendfile(1, 2, (off_t*)0, sizeof 1);], - [glibcxx_cv_sendfile=yes], - [glibcxx_cv_sendfile=no]) - ;; - *) - glibcxx_cv_sendfile=no - ;; - esac - ]) - if test $glibcxx_cv_sendfile = yes; then - AC_DEFINE(_GLIBCXX_USE_SENDFILE, 1, [Define if sendfile is available in .]) - fi - AC_MSG_RESULT($glibcxx_cv_sendfile) -dnl - AC_MSG_CHECKING([for link]) - AC_CACHE_VAL(glibcxx_cv_link, [dnl - GCC_TRY_COMPILE_OR_LINK( - [#include ], - [link("", "");], - [glibcxx_cv_link=yes], - [glibcxx_cv_link=no]) - ]) - if test $glibcxx_cv_link = yes; then - AC_DEFINE(HAVE_LINK, 1, [Define if link is available in .]) - fi - AC_MSG_RESULT($glibcxx_cv_link) -dnl - AC_MSG_CHECKING([for readlink]) - AC_CACHE_VAL(glibcxx_cv_readlink, [dnl - GCC_TRY_COMPILE_OR_LINK( - [#include ], - [char buf[32]; readlink("", buf, sizeof(buf));], - [glibcxx_cv_readlink=yes], - [glibcxx_cv_readlink=no]) - ]) - if test $glibcxx_cv_readlink = yes; then - AC_DEFINE(HAVE_READLINK, 1, [Define if readlink is available in .]) - fi - AC_MSG_RESULT($glibcxx_cv_readlink) -dnl - AC_MSG_CHECKING([for symlink]) - AC_CACHE_VAL(glibcxx_cv_symlink, [dnl - GCC_TRY_COMPILE_OR_LINK( - [#include ], - [symlink("", "");], - [glibcxx_cv_symlink=yes], - [glibcxx_cv_symlink=no]) - ]) - if test $glibcxx_cv_symlink = yes; then - AC_DEFINE(HAVE_SYMLINK, 1, [Define if symlink is available in .]) - fi - AC_MSG_RESULT($glibcxx_cv_symlink) -dnl - AC_MSG_CHECKING([for truncate]) - AC_CACHE_VAL(glibcxx_cv_truncate, [dnl - GCC_TRY_COMPILE_OR_LINK( - [#include ], - [truncate("", 99);], - [glibcxx_cv_truncate=yes], - [glibcxx_cv_truncate=no]) - ]) - if test $glibcxx_cv_truncate = yes; then - AC_DEFINE(HAVE_TRUNCATE, 1, [Define if truncate is available in .]) - fi - AC_MSG_RESULT($glibcxx_cv_truncate) -dnl - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE + AC_MSG_CHECKING([for struct dirent.d_type]) + AC_CACHE_VAL(glibcxx_cv_dirent_d_type, [dnl + GCC_TRY_COMPILE_OR_LINK( + [#include ], + [ + struct dirent d; + if (sizeof d.d_type) return 0; + ], + [glibcxx_cv_dirent_d_type=yes], + [glibcxx_cv_dirent_d_type=no]) + ]) + if test $glibcxx_cv_dirent_d_type = yes; then + AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1, [Define to 1 if `d_type' is a member of `struct dirent'.]) fi + AC_MSG_RESULT($glibcxx_cv_dirent_d_type) +dnl + AC_MSG_CHECKING([for realpath]) + AC_CACHE_VAL(glibcxx_cv_realpath, [dnl + GCC_TRY_COMPILE_OR_LINK( + [ + #include + #include + #include + ], + [ + #if _XOPEN_VERSION < 500 + #error + #elif _XOPEN_VERSION >= 700 || defined(PATH_MAX) + char *tmp = realpath((const char*)NULL, (char*)NULL); + #else + #error + #endif + ], + [glibcxx_cv_realpath=yes], + [glibcxx_cv_realpath=no]) + ]) + if test $glibcxx_cv_realpath = yes; then + AC_DEFINE(_GLIBCXX_USE_REALPATH, 1, [Define if usable realpath is available in .]) + fi + AC_MSG_RESULT($glibcxx_cv_realpath) +dnl + AC_MSG_CHECKING([for utimensat]) + AC_CACHE_VAL(glibcxx_cv_utimensat, [dnl + GCC_TRY_COMPILE_OR_LINK( + [ + #include + #include + ], + [ + struct timespec ts[2] = { { 0, UTIME_OMIT }, { 1, 1 } }; + int i = utimensat(AT_FDCWD, "path", ts, 0); + ], + [glibcxx_cv_utimensat=yes], + [glibcxx_cv_utimensat=no]) + ]) + if test $glibcxx_cv_utimensat = yes; then + AC_DEFINE(_GLIBCXX_USE_UTIMENSAT, 1, [Define if utimensat and UTIME_OMIT are available in and AT_FDCWD in .]) + fi + AC_MSG_RESULT($glibcxx_cv_utimensat) +dnl + AC_MSG_CHECKING([for utime]) + AC_CACHE_VAL(glibcxx_cv_utime, [dnl + GCC_TRY_COMPILE_OR_LINK( + [ + #include + ], + [ + struct utimbuf t = { 1, 1 }; + int i = utime("path", &t); + ], + [glibcxx_cv_utime=yes], + [glibcxx_cv_utime=no]) + ]) + if test $glibcxx_cv_utime = yes; then + AC_DEFINE(_GLIBCXX_USE_UTIME, 1, [Define if utime is available in .]) + fi + AC_MSG_RESULT($glibcxx_cv_utime) +dnl + AC_MSG_CHECKING([for lstat]) + AC_CACHE_VAL(glibcxx_cv_lstat, [dnl + GCC_TRY_COMPILE_OR_LINK( + [ #include ], + [ + struct stat st; + int i = lstat("path", &st); + ], + [glibcxx_cv_lstat=yes], + [glibcxx_cv_lstat=no]) + ]) + if test $glibcxx_cv_lstat = yes; then + AC_DEFINE(_GLIBCXX_USE_LSTAT, 1, [Define if lstat is available in .]) + fi + AC_MSG_RESULT($glibcxx_cv_lstat) +dnl + AC_MSG_CHECKING([for struct stat.st_mtim.tv_nsec]) + AC_CACHE_VAL(glibcxx_cv_st_mtim, [dnl + GCC_TRY_COMPILE_OR_LINK( + [ #include ], + [ + struct stat st; + return st.st_mtim.tv_nsec; + ], + [glibcxx_cv_st_mtim=yes], + [glibcxx_cv_st_mtim=no]) + ]) + if test $glibcxx_cv_st_mtim = yes; then + AC_DEFINE(_GLIBCXX_USE_ST_MTIM, 1, [Define if struct stat has timespec members.]) + fi + AC_MSG_RESULT($glibcxx_cv_st_mtim) +dnl + AC_MSG_CHECKING([for fchmod]) + AC_CACHE_VAL(glibcxx_cv_fchmod, [dnl + GCC_TRY_COMPILE_OR_LINK( + [#include ], + [fchmod(1, S_IWUSR);], + [glibcxx_cv_fchmod=yes], + [glibcxx_cv_fchmod=no]) + ]) + if test $glibcxx_cv_fchmod = yes; then + AC_DEFINE(_GLIBCXX_USE_FCHMOD, 1, [Define if fchmod is available in .]) + fi + AC_MSG_RESULT($glibcxx_cv_fchmod) +dnl + AC_MSG_CHECKING([for fchmodat]) + AC_CACHE_VAL(glibcxx_cv_fchmodat, [dnl + GCC_TRY_COMPILE_OR_LINK( + [ + #include + #include + ], + [fchmodat(AT_FDCWD, "", 0, AT_SYMLINK_NOFOLLOW);], + [glibcxx_cv_fchmodat=yes], + [glibcxx_cv_fchmodat=no]) + ]) + if test $glibcxx_cv_fchmodat = yes; then + AC_DEFINE(_GLIBCXX_USE_FCHMODAT, 1, [Define if fchmodat is available in .]) + fi + AC_MSG_RESULT($glibcxx_cv_fchmodat) +dnl + AC_MSG_CHECKING([for sendfile that can copy files]) + AC_CACHE_VAL(glibcxx_cv_sendfile, [dnl + case "${target_os}" in + gnu* | linux* | solaris* | uclinux*) + GCC_TRY_COMPILE_OR_LINK( + [#include ], + [sendfile(1, 2, (off_t*)0, sizeof 1);], + [glibcxx_cv_sendfile=yes], + [glibcxx_cv_sendfile=no]) + ;; + *) + glibcxx_cv_sendfile=no + ;; + esac + ]) + if test $glibcxx_cv_sendfile = yes; then + AC_DEFINE(_GLIBCXX_USE_SENDFILE, 1, [Define if sendfile is available in .]) + fi + AC_MSG_RESULT($glibcxx_cv_sendfile) +dnl + AC_MSG_CHECKING([for link]) + AC_CACHE_VAL(glibcxx_cv_link, [dnl + GCC_TRY_COMPILE_OR_LINK( + [#include ], + [link("", "");], + [glibcxx_cv_link=yes], + [glibcxx_cv_link=no]) + ]) + if test $glibcxx_cv_link = yes; then + AC_DEFINE(HAVE_LINK, 1, [Define if link is available in .]) + fi + AC_MSG_RESULT($glibcxx_cv_link) +dnl + AC_MSG_CHECKING([for readlink]) + AC_CACHE_VAL(glibcxx_cv_readlink, [dnl + GCC_TRY_COMPILE_OR_LINK( + [#include ], + [char buf[32]; readlink("", buf, sizeof(buf));], + [glibcxx_cv_readlink=yes], + [glibcxx_cv_readlink=no]) + ]) + if test $glibcxx_cv_readlink = yes; then + AC_DEFINE(HAVE_READLINK, 1, [Define if readlink is available in .]) + fi + AC_MSG_RESULT($glibcxx_cv_readlink) +dnl + AC_MSG_CHECKING([for symlink]) + AC_CACHE_VAL(glibcxx_cv_symlink, [dnl + GCC_TRY_COMPILE_OR_LINK( + [#include ], + [symlink("", "");], + [glibcxx_cv_symlink=yes], + [glibcxx_cv_symlink=no]) + ]) + if test $glibcxx_cv_symlink = yes; then + AC_DEFINE(HAVE_SYMLINK, 1, [Define if symlink is available in .]) + fi + AC_MSG_RESULT($glibcxx_cv_symlink) +dnl + AC_MSG_CHECKING([for truncate]) + AC_CACHE_VAL(glibcxx_cv_truncate, [dnl + GCC_TRY_COMPILE_OR_LINK( + [#include ], + [truncate("", 99);], + [glibcxx_cv_truncate=yes], + [glibcxx_cv_truncate=no]) + ]) + if test $glibcxx_cv_truncate = yes; then + AC_DEFINE(HAVE_TRUNCATE, 1, [Define if truncate is available in .]) + fi + AC_MSG_RESULT($glibcxx_cv_truncate) +dnl + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE ]) dnl diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 9f9c5a2419aa..b9c9b844c278 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -75962,22 +75962,21 @@ $as_echo_n "checking whether to build Filesystem TS support... " >&6; } $as_echo "$enable_libstdcxx_filesystem_ts" >&6; } - if test $enable_libstdcxx_filesystem_ts = yes; then - ac_ext=cpp + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fno-exceptions" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent.d_type" >&5 + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent.d_type" >&5 $as_echo_n "checking for struct dirent.d_type... " >&6; } - if ${glibcxx_cv_dirent_d_type+:} false; then : + if ${glibcxx_cv_dirent_d_type+:} false; then : $as_echo_n "(cached) " >&6 else - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -75985,8 +75984,8 @@ int main () { - struct dirent d; - if (sizeof d.d_type) return 0; + struct dirent d; + if (sizeof d.d_type) return 0; ; return 0; @@ -76009,8 +76008,8 @@ int main () { - struct dirent d; - if (sizeof d.d_type) return 0; + struct dirent d; + if (sizeof d.d_type) return 0; ; return 0; @@ -76027,37 +76026,37 @@ fi fi - if test $glibcxx_cv_dirent_d_type = yes; then + if test $glibcxx_cv_dirent_d_type = yes; then $as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_dirent_d_type" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_dirent_d_type" >&5 $as_echo "$glibcxx_cv_dirent_d_type" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for realpath" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for realpath" >&5 $as_echo_n "checking for realpath... " >&6; } - if ${glibcxx_cv_realpath+:} false; then : + if ${glibcxx_cv_realpath+:} false; then : $as_echo_n "(cached) " >&6 else - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include - #include + #include + #include + #include int main () { - #if _XOPEN_VERSION < 500 - #error - #elif _XOPEN_VERSION >= 700 || defined(PATH_MAX) - char *tmp = realpath((const char*)NULL, (char*)NULL); - #else - #error - #endif + #if _XOPEN_VERSION < 500 + #error + #elif _XOPEN_VERSION >= 700 || defined(PATH_MAX) + char *tmp = realpath((const char*)NULL, (char*)NULL); + #else + #error + #endif ; return 0; @@ -76076,21 +76075,21 @@ fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include - #include + #include + #include + #include int main () { - #if _XOPEN_VERSION < 500 - #error - #elif _XOPEN_VERSION >= 700 || defined(PATH_MAX) - char *tmp = realpath((const char*)NULL, (char*)NULL); - #else - #error - #endif + #if _XOPEN_VERSION < 500 + #error + #elif _XOPEN_VERSION >= 700 || defined(PATH_MAX) + char *tmp = realpath((const char*)NULL, (char*)NULL); + #else + #error + #endif ; return 0; @@ -76107,31 +76106,31 @@ fi fi - if test $glibcxx_cv_realpath = yes; then + if test $glibcxx_cv_realpath = yes; then $as_echo "#define _GLIBCXX_USE_REALPATH 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_realpath" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_realpath" >&5 $as_echo "$glibcxx_cv_realpath" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for utimensat" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for utimensat" >&5 $as_echo_n "checking for utimensat... " >&6; } - if ${glibcxx_cv_utimensat+:} false; then : + if ${glibcxx_cv_utimensat+:} false; then : $as_echo_n "(cached) " >&6 else - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include + #include + #include int main () { - struct timespec ts[2] = { { 0, UTIME_OMIT }, { 1, 1 } }; - int i = utimensat(AT_FDCWD, "path", ts, 0); + struct timespec ts[2] = { { 0, UTIME_OMIT }, { 1, 1 } }; + int i = utimensat(AT_FDCWD, "path", ts, 0); ; return 0; @@ -76150,15 +76149,15 @@ fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include + #include + #include int main () { - struct timespec ts[2] = { { 0, UTIME_OMIT }, { 1, 1 } }; - int i = utimensat(AT_FDCWD, "path", ts, 0); + struct timespec ts[2] = { { 0, UTIME_OMIT }, { 1, 1 } }; + int i = utimensat(AT_FDCWD, "path", ts, 0); ; return 0; @@ -76175,30 +76174,30 @@ fi fi - if test $glibcxx_cv_utimensat = yes; then + if test $glibcxx_cv_utimensat = yes; then $as_echo "#define _GLIBCXX_USE_UTIMENSAT 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_utimensat" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_utimensat" >&5 $as_echo "$glibcxx_cv_utimensat" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for utime" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for utime" >&5 $as_echo_n "checking for utime... " >&6; } - if ${glibcxx_cv_utime+:} false; then : + if ${glibcxx_cv_utime+:} false; then : $as_echo_n "(cached) " >&6 else - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include + #include int main () { - struct utimbuf t = { 1, 1 }; - int i = utime("path", &t); + struct utimbuf t = { 1, 1 }; + int i = utime("path", &t); ; return 0; @@ -76217,14 +76216,14 @@ fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include + #include int main () { - struct utimbuf t = { 1, 1 }; - int i = utime("path", &t); + struct utimbuf t = { 1, 1 }; + int i = utime("path", &t); ; return 0; @@ -76241,19 +76240,19 @@ fi fi - if test $glibcxx_cv_utime = yes; then + if test $glibcxx_cv_utime = yes; then $as_echo "#define _GLIBCXX_USE_UTIME 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_utime" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_utime" >&5 $as_echo "$glibcxx_cv_utime" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lstat" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lstat" >&5 $as_echo_n "checking for lstat... " >&6; } - if ${glibcxx_cv_lstat+:} false; then : + if ${glibcxx_cv_lstat+:} false; then : $as_echo_n "(cached) " >&6 else - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -76261,8 +76260,8 @@ int main () { - struct stat st; - int i = lstat("path", &st); + struct stat st; + int i = lstat("path", &st); ; return 0; @@ -76285,8 +76284,8 @@ int main () { - struct stat st; - int i = lstat("path", &st); + struct stat st; + int i = lstat("path", &st); ; return 0; @@ -76303,19 +76302,19 @@ fi fi - if test $glibcxx_cv_lstat = yes; then + if test $glibcxx_cv_lstat = yes; then $as_echo "#define _GLIBCXX_USE_LSTAT 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_lstat" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_lstat" >&5 $as_echo "$glibcxx_cv_lstat" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat.st_mtim.tv_nsec" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat.st_mtim.tv_nsec" >&5 $as_echo_n "checking for struct stat.st_mtim.tv_nsec... " >&6; } - if ${glibcxx_cv_st_mtim+:} false; then : + if ${glibcxx_cv_st_mtim+:} false; then : $as_echo_n "(cached) " >&6 else - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -76323,8 +76322,8 @@ int main () { - struct stat st; - return st.st_mtim.tv_nsec; + struct stat st; + return st.st_mtim.tv_nsec; ; return 0; @@ -76347,8 +76346,8 @@ int main () { - struct stat st; - return st.st_mtim.tv_nsec; + struct stat st; + return st.st_mtim.tv_nsec; ; return 0; @@ -76365,19 +76364,19 @@ fi fi - if test $glibcxx_cv_st_mtim = yes; then + if test $glibcxx_cv_st_mtim = yes; then $as_echo "#define _GLIBCXX_USE_ST_MTIM 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_st_mtim" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_st_mtim" >&5 $as_echo "$glibcxx_cv_st_mtim" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fchmod" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fchmod" >&5 $as_echo_n "checking for fchmod... " >&6; } - if ${glibcxx_cv_fchmod+:} false; then : + if ${glibcxx_cv_fchmod+:} false; then : $as_echo_n "(cached) " >&6 else - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -76421,24 +76420,24 @@ fi fi - if test $glibcxx_cv_fchmod = yes; then + if test $glibcxx_cv_fchmod = yes; then $as_echo "#define _GLIBCXX_USE_FCHMOD 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_fchmod" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_fchmod" >&5 $as_echo "$glibcxx_cv_fchmod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fchmodat" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fchmodat" >&5 $as_echo_n "checking for fchmodat... " >&6; } - if ${glibcxx_cv_fchmodat+:} false; then : + if ${glibcxx_cv_fchmodat+:} false; then : $as_echo_n "(cached) " >&6 else - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include + #include + #include int main () @@ -76461,8 +76460,8 @@ fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include + #include + #include int main () @@ -76483,21 +76482,21 @@ fi fi - if test $glibcxx_cv_fchmodat = yes; then + if test $glibcxx_cv_fchmodat = yes; then $as_echo "#define _GLIBCXX_USE_FCHMODAT 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_fchmodat" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_fchmodat" >&5 $as_echo "$glibcxx_cv_fchmodat" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sendfile that can copy files" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sendfile that can copy files" >&5 $as_echo_n "checking for sendfile that can copy files... " >&6; } - if ${glibcxx_cv_sendfile+:} false; then : + if ${glibcxx_cv_sendfile+:} false; then : $as_echo_n "(cached) " >&6 else - case "${target_os}" in - gnu* | linux* | solaris* | uclinux*) - if test x$gcc_no_link = xyes; then + case "${target_os}" in + gnu* | linux* | solaris* | uclinux*) + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -76538,27 +76537,27 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi - ;; - *) - glibcxx_cv_sendfile=no - ;; - esac + ;; + *) + glibcxx_cv_sendfile=no + ;; + esac fi - if test $glibcxx_cv_sendfile = yes; then + if test $glibcxx_cv_sendfile = yes; then $as_echo "#define _GLIBCXX_USE_SENDFILE 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sendfile" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sendfile" >&5 $as_echo "$glibcxx_cv_sendfile" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for link" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for link" >&5 $as_echo_n "checking for link... " >&6; } - if ${glibcxx_cv_link+:} false; then : + if ${glibcxx_cv_link+:} false; then : $as_echo_n "(cached) " >&6 else - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -76602,19 +76601,19 @@ fi fi - if test $glibcxx_cv_link = yes; then + if test $glibcxx_cv_link = yes; then $as_echo "#define HAVE_LINK 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_link" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_link" >&5 $as_echo "$glibcxx_cv_link" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readlink" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readlink" >&5 $as_echo_n "checking for readlink... " >&6; } - if ${glibcxx_cv_readlink+:} false; then : + if ${glibcxx_cv_readlink+:} false; then : $as_echo_n "(cached) " >&6 else - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -76658,19 +76657,19 @@ fi fi - if test $glibcxx_cv_readlink = yes; then + if test $glibcxx_cv_readlink = yes; then $as_echo "#define HAVE_READLINK 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_readlink" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_readlink" >&5 $as_echo "$glibcxx_cv_readlink" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symlink" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symlink" >&5 $as_echo_n "checking for symlink... " >&6; } - if ${glibcxx_cv_symlink+:} false; then : + if ${glibcxx_cv_symlink+:} false; then : $as_echo_n "(cached) " >&6 else - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -76714,19 +76713,19 @@ fi fi - if test $glibcxx_cv_symlink = yes; then + if test $glibcxx_cv_symlink = yes; then $as_echo "#define HAVE_SYMLINK 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_symlink" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_symlink" >&5 $as_echo "$glibcxx_cv_symlink" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for truncate" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for truncate" >&5 $as_echo_n "checking for truncate... " >&6; } - if ${glibcxx_cv_truncate+:} false; then : + if ${glibcxx_cv_truncate+:} false; then : $as_echo_n "(cached) " >&6 else - if test x$gcc_no_link = xyes; then + if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -76770,21 +76769,20 @@ fi fi - if test $glibcxx_cv_truncate = yes; then + if test $glibcxx_cv_truncate = yes; then $as_echo "#define HAVE_TRUNCATE 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_truncate" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_truncate" >&5 $as_echo "$glibcxx_cv_truncate" >&6; } - CXXFLAGS="$ac_save_CXXFLAGS" - ac_ext=c + CXXFLAGS="$ac_save_CXXFLAGS" + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - fi # For Networking TS. diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional index 2a9b2a003dbb..dc21c10b7ad8 100644 --- a/libstdc++-v3/include/std/functional +++ b/libstdc++-v3/include/std/functional @@ -905,8 +905,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template constexpr _Bind_front_t<_Fn, _Args...> bind_front(_Fn&& __fn, _Args&&... __args) - noexcept(is_nothrow_constructible_v, - _Fn, _Args...>) + noexcept(is_nothrow_constructible_v<_Bind_front_t<_Fn, _Args...>, + int, _Fn, _Args...>) { return _Bind_front_t<_Fn, _Args...>(0, std::forward<_Fn>(__fn), std::forward<_Args>(__args)...); diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index db4872d3a527..94b9e0335b19 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -285,14 +285,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Base(__use_alloc<_Head, _Alloc, _Head>(__a), std::forward<_Head>(_M_head(__in))) { } - template + template _GLIBCXX20_CONSTEXPR _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, - const _Tuple_impl<_Idx, _UElements...>& __in) + const _Tuple_impl<_Idx, _UHead, _UTails...>& __in) : _Inherited(__tag, __a, - _Tuple_impl<_Idx, _UElements...>::_M_tail(__in)), - _Base(__use_alloc<_Head, _Alloc, _Head>(__a), - _Tuple_impl<_Idx, _UElements...>::_M_head(__in)) { } + _Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in)), + _Base(__use_alloc<_Head, _Alloc, const _UHead&>(__a), + _Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in)) { } template _GLIBCXX20_CONSTEXPR @@ -417,7 +417,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX20_CONSTEXPR _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Tuple_impl<_Idx, _UHead>& __in) - : _Base(__use_alloc<_Head, _Alloc, _Head>(__a), + : _Base(__use_alloc<_Head, _Alloc, const _UHead&>(__a), _Tuple_impl<_Idx, _UHead>::_M_head(__in)) { } template diff --git a/libstdc++-v3/src/c++17/fs_ops.cc b/libstdc++-v3/src/c++17/fs_ops.cc index c685b1824f9d..2cb26e4605b8 100644 --- a/libstdc++-v3/src/c++17/fs_ops.cc +++ b/libstdc++-v3/src/c++17/fs_ops.cc @@ -1175,7 +1175,7 @@ fs::path fs::read_symlink(const path& p, error_code& ec) path result; #if defined(_GLIBCXX_HAVE_READLINK) && defined(_GLIBCXX_HAVE_SYS_STAT_H) stat_type st; - if (::lstat(p.c_str(), &st)) + if (posix::lstat(p.c_str(), &st)) { ec.assign(errno, std::generic_category()); return result; diff --git a/libstdc++-v3/src/c++17/fs_path.cc b/libstdc++-v3/src/c++17/fs_path.cc index 5ff17741f81a..edfb91fc6c5e 100644 --- a/libstdc++-v3/src/c++17/fs_path.cc +++ b/libstdc++-v3/src/c++17/fs_path.cc @@ -81,7 +81,7 @@ struct path::_Parser const size_t len = input.size(); // look for root name or root directory - if (is_dir_sep(input[0])) + if (len && is_dir_sep(input[0])) { #if SLASHSLASH_IS_ROOTNAME // look for root name, such as "//foo" diff --git a/libstdc++-v3/src/c++17/memory_resource.cc b/libstdc++-v3/src/c++17/memory_resource.cc index 95352b235378..75ae24e0a062 100644 --- a/libstdc++-v3/src/c++17/memory_resource.cc +++ b/libstdc++-v3/src/c++17/memory_resource.cc @@ -873,7 +873,18 @@ namespace pmr } else { - // TODO round to preferred granularity ? + // Round to preferred granularity. + if (opts.max_blocks_per_chunk < size_t(-4)) + { + // round up + opts.max_blocks_per_chunk += 3; + opts.max_blocks_per_chunk &= ~size_t(3); + } + else + { + // round down + opts.max_blocks_per_chunk &= ~size_t(3); + } } if (opts.max_blocks_per_chunk > chunk::max_blocks_per_chunk()) @@ -1013,11 +1024,9 @@ namespace pmr : pool_sizes[i]; // Decide on initial number of blocks per chunk. - // Always have at least 16 blocks per chunk: - const size_t min_blocks_per_chunk = 16; - // But for smaller blocks, use a larger initial size: - size_t blocks_per_chunk - = std::max(1024 / block_size, min_blocks_per_chunk); + // At least 16 blocks per chunk seems reasonable, + // more for smaller blocks: + size_t blocks_per_chunk = std::max(size_t(16), 1024 / block_size); // But don't exceed the requested max_blocks_per_chunk: blocks_per_chunk = std::min(blocks_per_chunk, _M_opts.max_blocks_per_chunk); diff --git a/libstdc++-v3/src/filesystem/ops.cc b/libstdc++-v3/src/filesystem/ops.cc index 8c8854bf28e8..a1138490b3ee 100644 --- a/libstdc++-v3/src/filesystem/ops.cc +++ b/libstdc++-v3/src/filesystem/ops.cc @@ -993,7 +993,7 @@ fs::path fs::read_symlink(const path& p [[gnu::unused]], error_code& ec) path result; #if defined(_GLIBCXX_HAVE_READLINK) && defined(_GLIBCXX_HAVE_SYS_STAT_H) stat_type st; - if (::lstat(p.c_str(), &st)) + if (posix::lstat(p.c_str(), &st)) { ec.assign(errno, std::generic_category()); return result; diff --git a/libstdc++-v3/testsuite/20_util/function_objects/bind_front/97101.cc b/libstdc++-v3/testsuite/20_util/function_objects/bind_front/97101.cc new file mode 100644 index 000000000000..b159eb025917 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/function_objects/bind_front/97101.cc @@ -0,0 +1,41 @@ +// Copyright (C) 2020 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// { dg-options "-std=gnu++2a" } +// { dg-do compile { target c++2a } } + +#include + +void +test01() +{ + struct F1 + { + void operator()() { } + }; + + struct F2 + { + F2() = default; + F2(const F2&) noexcept(false) { } + void operator()() { } + }; + + // PR libstdc++/97101 + static_assert( noexcept(std::bind_front(F1{})) ); + static_assert( ! noexcept(std::bind_front(F2{})) ); +} diff --git a/libstdc++-v3/testsuite/20_util/tuple/cons/96803.cc b/libstdc++-v3/testsuite/20_util/tuple/cons/96803.cc new file mode 100644 index 000000000000..867a42150e00 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/cons/96803.cc @@ -0,0 +1,62 @@ +// Copyright (C) 2020 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// { dg-do compile { target c++11 } } + +#include +#include + +struct X +{ + using allocator_type = std::allocator; + + X(X&&) { } + X(std::allocator_arg_t, const allocator_type&, X&&) { } + + explicit X(int) { } + explicit X(int, allocator_type) { } +}; + +void +test01() +{ + // PR libstdc++/96803 + // std::tuple chooses wrong constructor for uses-allocator construction + std::tuple o; + std::tuple nok(std::allocator_arg, std::allocator(), o); + + std::tuple oo; + std::tuple nn(std::allocator_arg, std::allocator(), oo); +} + +struct Y +{ + using allocator_type = std::allocator; + + Y(const X&) { } + Y(const X&, const allocator_type&) { } + + Y(X&&) { } + Y(std::allocator_arg_t, const allocator_type&, X&&) { } +}; + +void +test02() +{ + std::tuple o{1, 1}; + std::tuple oo(std::allocator_arg, std::allocator(), o); +} diff --git a/libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate.cc b/libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate.cc index 5bf20cf262c0..ef5f921211de 100644 --- a/libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate.cc +++ b/libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate.cc @@ -239,6 +239,25 @@ test06() } } +void +test08() +{ + std::pmr::pool_options opts; + opts.largest_required_pool_block = 64; + + // PR libstdc++/94160 + // max_blocks_per_chunk=1 causes pool resources to return null pointers + for (int i = 0; i < 8; ++i) + { + opts.max_blocks_per_chunk = i; + std::pmr::unsynchronized_pool_resource upr(opts); + auto* p = (int*)upr.allocate(4); + VERIFY( p != nullptr ); + *p = i; + upr.deallocate(p, 4); + } +} + int main() { @@ -248,4 +267,5 @@ main() test04(); test05(); test06(); + test08(); } diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc index 2fceee9b7741..dc7331945fe9 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/append/source.cc @@ -161,6 +161,15 @@ test06() test(p2, s.c_str()); } +void +test07() +{ + path p, p0; + std::string_view s; + p /= s; // PR libstdc++/97167 + compare_paths(p, p0); +} + int main() { @@ -170,4 +179,5 @@ main() test04(); test05(); test06(); + test07(); }