platform/upstream/gcc.git
5 years agoAdd testcase from PR71959
Nathan Sidwell [Thu, 10 Jan 2019 12:32:03 +0000 (12:32 +0000)]
Add testcase from PR71959

libgomp/

PR lto/71959
* testsuite/libgomp.oacc-c++/pr71959-aux.cc: New.
* testsuite/libgomp.oacc-c++/pr71959.C: New.

Co-Authored-By: Julian Brown <julian@codesourcery.com>
From-SVN: r267806

5 years agoARM: fix -masm-syntax-unified (PR88648)
Stefan Agner [Thu, 10 Jan 2019 11:36:42 +0000 (12:36 +0100)]
ARM: fix -masm-syntax-unified (PR88648)

This allows to use unified asm syntax when compiling for the
ARM instruction. This matches documentation and seems what the
initial patch was intended doing when the flag got added.

2019-01-10  Stefan Agner  <stefan@agner.ch>

PR target/88648
* config/arm/arm.c (arm_option_override_internal): Force
opts->x_inline_asm_unified to true only if TARGET_THUMB2_P.

* gcc.target/arm/pr88648-asm-syntax-unified.c: Add test to
check if -masm-syntax-unified gets applied properly.

From-SVN: r267804

5 years agoInclude name of test in filesystem-test.XXXXXX filenames
Jonathan Wakely [Thu, 10 Jan 2019 11:12:00 +0000 (11:12 +0000)]
Include name of test in filesystem-test.XXXXXX filenames

Also fix some tests that were not cleaning up after themselves, as
identified by the change to nonexistent_path.

* testsuite/util/testsuite_fs.h (nonexistent_path): Include name
of the source file containing the caller.
* testsuite/27_io/filesystem/iterators/directory_iterator.cc: Remove
directories created by test.
* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
Likewise.
* testsuite/experimental/filesystem/iterators/directory_iterator.cc:
Likewise.
* testsuite/experimental/filesystem/iterators/
recursive_directory_iterator.cc: Likewise.

From-SVN: r267801

5 years agore PR tree-optimization/88775 (Optimize std::string assignment)
Jakub Jelinek [Thu, 10 Jan 2019 10:56:56 +0000 (11:56 +0100)]
re PR tree-optimization/88775 (Optimize std::string assignment)

PR tree-optimization/88775
* include/bits/stl_function.h (greater<_Tp*>::operator(),
less<_Tp*>::operator(), greater_equal<_Tp*>::operator(),
less_equal<_Tp*>::operator()): Use __builtin_is_constant_evaluated
instead of __builtin_constant_p if available.  Don't bother with
the pointer comparison in C++11 and earlier.

From-SVN: r267800

5 years agore PR c/88568 ('dllimport' no longer implies 'extern' in C)
Jakub Jelinek [Thu, 10 Jan 2019 10:44:46 +0000 (11:44 +0100)]
re PR c/88568 ('dllimport' no longer implies 'extern' in C)

PR c/88568
* attribs.c (handle_dll_attribute): Clear TREE_STATIC after setting
DECL_EXTERNAL.

* gcc.dg/pr88568.c: New test.

From-SVN: r267799

5 years agoFix formatting
Eric Botcazou [Thu, 10 Jan 2019 07:21:35 +0000 (07:21 +0000)]
Fix formatting

From-SVN: r267797

5 years agoarm-builtins.c (enum arm_type_qualifiers): Add qualifier_lane_pair_index.
Tamar Christina [Thu, 10 Jan 2019 03:34:06 +0000 (03:34 +0000)]
arm-builtins.c (enum arm_type_qualifiers): Add qualifier_lane_pair_index.

2019-01-10  Tamar Christina  <tamar.christina@arm.com>

* config/arm/arm-builtins.c
(enum arm_type_qualifiers): Add qualifier_lane_pair_index.
(MAC_LANE_PAIR_QUALIFIERS): New.
(arm_expand_builtin_args): Use it.
(arm_expand_builtin_1): Likewise.
* config/arm/arm-protos.h (neon_vcmla_lane_prepare_operands): New.
* config/arm/arm.c (neon_vcmla_lane_prepare_operands): New.
* config/arm/arm-c.c (arm_cpu_builtins): Add __ARM_FEATURE_COMPLEX.
* config/arm/arm_neon.h:
(vcadd_rot90_f16): New.
(vcaddq_rot90_f16): New.
(vcadd_rot270_f16): New.
(vcaddq_rot270_f16): New.
(vcmla_f16): New.
(vcmlaq_f16): New.
(vcmla_lane_f16): New.
(vcmla_laneq_f16): New.
(vcmlaq_lane_f16): New.
(vcmlaq_laneq_f16): New.
(vcmla_rot90_f16): New.
(vcmlaq_rot90_f16): New.
(vcmla_rot90_lane_f16): New.
(vcmla_rot90_laneq_f16): New.
(vcmlaq_rot90_lane_f16): New.
(vcmlaq_rot90_laneq_f16): New.
(vcmla_rot180_f16): New.
(vcmlaq_rot180_f16): New.
(vcmla_rot180_lane_f16): New.
(vcmla_rot180_laneq_f16): New.
(vcmlaq_rot180_lane_f16): New.
(vcmlaq_rot180_laneq_f16): New.
(vcmla_rot270_f16): New.
(vcmlaq_rot270_f16): New.
(vcmla_rot270_lane_f16): New.
(vcmla_rot270_laneq_f16): New.
(vcmlaq_rot270_lane_f16): New.
(vcmlaq_rot270_laneq_f16): New.
(vcadd_rot90_f32): New.
(vcaddq_rot90_f32): New.
(vcadd_rot270_f32): New.
(vcaddq_rot270_f32): New.
(vcmla_f32): New.
(vcmlaq_f32): New.
(vcmla_lane_f32): New.
(vcmla_laneq_f32): New.
(vcmlaq_lane_f32): New.
(vcmlaq_laneq_f32): New.
(vcmla_rot90_f32): New.
(vcmlaq_rot90_f32): New.
(vcmla_rot90_lane_f32): New.
(vcmla_rot90_laneq_f32): New.
(vcmlaq_rot90_lane_f32): New.
(vcmlaq_rot90_laneq_f32): New.
(vcmla_rot180_f32): New.
(vcmlaq_rot180_f32): New.
(vcmla_rot180_lane_f32): New.
(vcmla_rot180_laneq_f32): New.
(vcmlaq_rot180_lane_f32): New.
(vcmlaq_rot180_laneq_f32): New.
(vcmla_rot270_f32): New.
(vcmlaq_rot270_f32): New.
(vcmla_rot270_lane_f32): New.
(vcmla_rot270_laneq_f32): New.
(vcmlaq_rot270_lane_f32): New.
(vcmlaq_rot270_laneq_f32): New.
* config/arm/arm_neon_builtins.def (vcadd90, vcadd270, vcmla0, vcmla90,
vcmla180, vcmla270, vcmla_lane0, vcmla_lane90, vcmla_lane180, vcmla_lane270,
vcmla_laneq0, vcmla_laneq90, vcmla_laneq180, vcmla_laneq270,
vcmlaq_lane0, vcmlaq_lane90, vcmlaq_lane180, vcmlaq_lane270): New.
* config/arm/neon.md (neon_vcmla_lane<rot><mode>,
neon_vcmla_laneq<rot><mode>, neon_vcmlaq_lane<rot><mode>): New.
* config/arm/arm.c (arm_arch8_3, arm_arch8_4): New.
* config/arm/arm.h (TARGET_COMPLEX, arm_arch8_3, arm_arch8_4): New.
(arm_option_reconfigure_globals): Use them.
* config/arm/iterators.md (VDF, VQ_HSF): New.
(VCADD, VCMLA): New.
(VF_constraint, rot, rotsplit1, rotsplit2): Add V4HF and V8HF.
* config/arm/neon.md (neon_vcadd<rot><mode>, neon_vcmla<rot><mode>): New.
* config/arm/unspecs.md (UNSPEC_VCADD90, UNSPEC_VCADD270,
UNSPEC_VCMLA, UNSPEC_VCMLA90, UNSPEC_VCMLA180, UNSPEC_VCMLA270): New.

gcc/testsuite/ChangeLog:

2019-01-10  Tamar Christina  <tamar.christina@arm.com>

* gcc.target/aarch64/advsimd-intrinsics/vector-complex.c: Add AArch32 regexpr.
* gcc.target/aarch64/advsimd-intrinsics/vector-complex_f16.c: Likewise.

From-SVN: r267796

5 years agoaarch64-builtins.c (enum aarch64_type_qualifiers): Add qualifier_lane_pair_index.
Tamar Christina [Thu, 10 Jan 2019 03:30:59 +0000 (03:30 +0000)]
aarch64-builtins.c (enum aarch64_type_qualifiers): Add qualifier_lane_pair_index.

gcc/ChangeLog:

2019-01-10  Tamar Christina  <tamar.christina@arm.com>

* config/aarch64/aarch64-builtins.c (enum aarch64_type_qualifiers): Add qualifier_lane_pair_index.
(emit-rtl.h): Include.
(TYPES_QUADOP_LANE_PAIR): New.
(aarch64_simd_expand_args): Use it.
(aarch64_simd_expand_builtin): Likewise.
(AARCH64_SIMD_FCMLA_LANEQ_BUILTINS, aarch64_fcmla_laneq_builtin_datum): New.
(FCMLA_LANEQ_BUILTIN, AARCH64_SIMD_FCMLA_LANEQ_BUILTIN_BASE,
AARCH64_SIMD_FCMLA_LANEQ_BUILTINS, aarch64_fcmla_lane_builtin_data,
aarch64_init_fcmla_laneq_builtins, aarch64_expand_fcmla_builtin): New.
(aarch64_init_builtins): Add aarch64_init_fcmla_laneq_builtins.
(aarch64_expand_buildin): Add AARCH64_SIMD_BUILTIN_FCMLA_LANEQ0_V2SF,
AARCH64_SIMD_BUILTIN_FCMLA_LANEQ90_V2SF, AARCH64_SIMD_BUILTIN_FCMLA_LANEQ180_V2SF,
  AARCH64_SIMD_BUILTIN_FCMLA_LANEQ2700_V2SF, AARCH64_SIMD_BUILTIN_FCMLA_LANEQ0_V4HF,
AARCH64_SIMD_BUILTIN_FCMLA_LANEQ90_V4HF, AARCH64_SIMD_BUILTIN_FCMLA_LANEQ180_V4HF,
AARCH64_SIMD_BUILTIN_FCMLA_LANEQ270_V4HF.
* config/aarch64/iterators.md (FCMLA_maybe_lane): New.
* config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Add __ARM_FEATURE_COMPLEX.
* config/aarch64/aarch64-simd-builtins.def (fcadd90, fcadd270, fcmla0, fcmla90,
fcmla180, fcmla270, fcmla_lane0, fcmla_lane90, fcmla_lane180, fcmla_lane270,
fcmla_laneq0, fcmla_laneq90, fcmla_laneq180, fcmla_laneq270,
fcmlaq_lane0, fcmlaq_lane90, fcmlaq_lane180, fcmlaq_lane270): New.
* config/aarch64/aarch64-simd.md (aarch64_fcmla_lane<rot><mode>,
aarch64_fcmla_laneq<rot>v4hf, aarch64_fcmlaq_lane<rot><mode>,aarch64_fcadd<rot><mode>,
aarch64_fcmla<rot><mode>): New.
* config/aarch64/arm_neon.h:
(vcadd_rot90_f16): New.
(vcaddq_rot90_f16): New.
(vcadd_rot270_f16): New.
(vcaddq_rot270_f16): New.
(vcmla_f16): New.
(vcmlaq_f16): New.
(vcmla_lane_f16): New.
(vcmla_laneq_f16): New.
(vcmlaq_lane_f16): New.
(vcmlaq_rot90_lane_f16): New.
(vcmla_rot90_laneq_f16): New.
(vcmla_rot90_lane_f16): New.
(vcmlaq_rot90_f16): New.
(vcmla_rot90_f16): New.
(vcmlaq_laneq_f16): New.
(vcmla_rot180_laneq_f16): New.
(vcmla_rot180_lane_f16): New.
(vcmlaq_rot180_f16): New.
(vcmla_rot180_f16): New.
(vcmlaq_rot90_laneq_f16): New.
(vcmlaq_rot270_laneq_f16): New.
(vcmlaq_rot270_lane_f16): New.
(vcmla_rot270_laneq_f16): New.
(vcmlaq_rot270_f16): New.
(vcmla_rot270_f16): New.
(vcmlaq_rot180_laneq_f16): New.
(vcmlaq_rot180_lane_f16): New.
(vcmla_rot270_lane_f16): New.
(vcadd_rot90_f32): New.
(vcaddq_rot90_f32): New.
(vcaddq_rot90_f64): New.
(vcadd_rot270_f32): New.
(vcaddq_rot270_f32): New.
(vcaddq_rot270_f64): New.
(vcmla_f32): New.
(vcmlaq_f32): New.
(vcmlaq_f64): New.
(vcmla_lane_f32): New.
(vcmla_laneq_f32): New.
(vcmlaq_lane_f32): New.
(vcmlaq_laneq_f32): New.
(vcmla_rot90_f32): New.
(vcmlaq_rot90_f32): New.
(vcmlaq_rot90_f64): New.
(vcmla_rot90_lane_f32): New.
(vcmla_rot90_laneq_f32): New.
(vcmlaq_rot90_lane_f32): New.
(vcmlaq_rot90_laneq_f32): New.
(vcmla_rot180_f32): New.
(vcmlaq_rot180_f32): New.
(vcmlaq_rot180_f64): New.
(vcmla_rot180_lane_f32): New.
(vcmla_rot180_laneq_f32): New.
(vcmlaq_rot180_lane_f32): New.
(vcmlaq_rot180_laneq_f32): New.
(vcmla_rot270_f32): New.
(vcmlaq_rot270_f32): New.
(vcmlaq_rot270_f64): New.
(vcmla_rot270_lane_f32): New.
(vcmla_rot270_laneq_f32): New.
(vcmlaq_rot270_lane_f32): New.
(vcmlaq_rot270_laneq_f32): New.
* config/aarch64/aarch64.h (TARGET_COMPLEX): New.
* config/aarch64/iterators.md (UNSPEC_FCADD90, UNSPEC_FCADD270,
UNSPEC_FCMLA, UNSPEC_FCMLA90, UNSPEC_FCMLA180, UNSPEC_FCMLA270): New.
(FCADD, FCMLA): New.
(rot): New.
* config/arm/types.md (neon_fcadd, neon_fcmla): New.

gcc/testsuite/ChangeLog:

2019-01-10  Tamar Christina  <tamar.christina@arm.com>

* gcc.target/aarch64/advsimd-intrinsics/vector-complex.c: New test.
* gcc.target/aarch64/advsimd-intrinsics/vector-complex_f16.c: New test.

From-SVN: r267795

5 years agotarget-supports.exp (check_effective_target_arm_v8_3a_complex_neon_ok_nocache, [...
Tamar Christina [Thu, 10 Jan 2019 03:27:13 +0000 (03:27 +0000)]
target-supports.exp (check_effective_target_arm_v8_3a_complex_neon_ok_nocache, [...]): New.

gcc/testsuite/ChangeLog:

2019-01-10  Tamar Christina  <tamar.christina@arm.com>

* lib/target-supports.exp
(check_effective_target_arm_v8_3a_complex_neon_ok_nocache,
check_effective_target_arm_v8_3a_complex_neon_ok,
add_options_for_arm_v8_3a_complex_neon,
check_effective_target_arm_v8_3a_complex_neon_hw,
check_effective_target_vect_complex_rot_N): New.

From-SVN: r267794

5 years agore PR fortran/88376 (ICE in is_illegal_recursion, at fortran/resolve.c:1689)
Steven G. Kargl [Thu, 10 Jan 2019 01:11:51 +0000 (01:11 +0000)]
re PR fortran/88376 (ICE in is_illegal_recursion, at fortran/resolve.c:1689)

2019-01-09  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/88376
* resolve.c (is_illegal_recursion): Remove an assert().

2019-01-09  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/88376
* gfortran.dg/pr88376.f90: New test.

From-SVN: r267793

5 years agoDaily bump.
GCC Administrator [Thu, 10 Jan 2019 00:16:43 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r267792

5 years agore PR go/86343 (types built by GO share TYPE_FIELDS in unsupported way)
Ian Lance Taylor [Wed, 9 Jan 2019 23:38:55 +0000 (23:38 +0000)]
re PR go/86343 (types built by GO share TYPE_FIELDS in unsupported way)

PR go/86343
* go-gcc.cc (Gcc_backend::set_placeholder_struct_type): Go back to
build_distinct_type_copy, but copy the fields so that they have
the right DECL_CONTEXT.

From-SVN: r267789

5 years agolibphobos: Merge phobos upstream b022e552a
Iain Buclaw [Wed, 9 Jan 2019 23:04:20 +0000 (23:04 +0000)]
libphobos: Merge phobos upstream b022e552a

This removes updates the removal date of all deprecations in phobos.
Many of the marked functions have passed their end dates, and are now
absent in upstream.

Reviewed-on: https://github.com/dlang/phobos/pull/6828

From-SVN: r267788

5 years agoPR other/16615 [5/5]
Sandra Loosemore [Wed, 9 Jan 2019 21:46:45 +0000 (16:46 -0500)]
PR other/16615 [5/5]

2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>

PR other/16615 [5/5]

gcc/po/
* gcc.pot: Regenerate.

From-SVN: r267787

5 years agoPR other/16615 [4/5]
Sandra Loosemore [Wed, 9 Jan 2019 21:44:56 +0000 (16:44 -0500)]
PR other/16615 [4/5]

2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>

PR other/16615 [4/5]

gcc/
* config/pa/pa.c: Change "can not" to "cannot".
* gimple-ssa-evrp-analyze.c: Likewise.
* ipa-icf.c: Likewise.
* ipa-polymorphic-call.c: Likewise.
* ipa-pure-const.c: Likewise.
* lra-constraints.c: Likewise.
* lra-remat.c: Likewise.
* reload1.c: Likewise.
* reorg.c: Likewise.
* tree-ssa-uninit.c: Likewise.

gcc/ada/
* exp_ch11.adb: Change "can not" to "cannot".
* sem_ch4.adb: Likewise.

gcc/fortran/
* expr.c: Change "can not" to "cannot".

libobjc/
* objc/runtime.h: Change "can not" to "cannot".

From-SVN: r267786

5 years agoPR other/16615 [3/5]
Sandra Loosemore [Wed, 9 Jan 2019 21:41:36 +0000 (16:41 -0500)]
PR other/16615 [3/5]

2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>

PR other/16615 [3/5]

gcc/testsuite/
* g++.dg/lto/odr-1_1.C: Update diagnostic message patterns to replace
"can not" with "cannot".
* gfortran.dg/common_15.f90: Likewise.
* gfortran.dg/derived_result_2.f90: Likewise.
* gfortran.dg/do_check_6.f90: Likewise.
* gfortran.dg/namelist_args.f90: Likewise.
* gfortran.dg/negative_unit_check.f90: Likewise.
* gfortran.dg/pure_formal_3.f90: Likewise.
* obj-c++.dg/attributes/method-attribute-2.mm: Likewise.
* obj-c++.dg/exceptions-3.mm: Likewise.
* obj-c++.dg/exceptions-4.mm: Likewise.
* obj-c++.dg/exceptions-5.mm: Likewise.
* obj-c++.dg/property/at-property-23.mm: Likewise.
* obj-c++.dg/property/dotsyntax-17.mm: Likewise.
* obj-c++.dg/property/property-neg-7.mm: Likewise.
* objc.dg/attributes/method-attribute-2.m: Likewise.
* objc.dg/exceptions-3.m: Likewise.
* objc.dg/exceptions-4.m: Likewise.
* objc.dg/exceptions-5.m: Likewise.
* objc.dg/param-1.m: Likewise.
* objc.dg/property/at-property-23.m: Likewise.
* objc.dg/property/dotsyntax-17.m: Likewise.
* objc.dg/property/property-neg-7.m: Likewise.

From-SVN: r267785

5 years agoPR other/16615 [2/5]
Sandra Loosemore [Wed, 9 Jan 2019 21:39:49 +0000 (16:39 -0500)]
PR other/16615 [2/5]

2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>

PR other/16615 [2/5]

include/
* libiberty.h: Mechanically replace "can not" with "cannot".
* plugin-api.h: Likewise.

libiberty/
* cp-demangle.c: Mechanically replace "can not" with "cannot".
* floatformat.c: Likewise.
* strerror.c: Likewise.

From-SVN: r267784

5 years agoPR other/16615 [1/5]
Sandra Loosemore [Wed, 9 Jan 2019 21:37:45 +0000 (16:37 -0500)]
PR other/16615 [1/5]

2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>

PR other/16615 [1/5]

contrib/
* mklog: Mechanically replace "can not" with "cannot".

gcc/
* Makefile.in: Mechanically replace "can not" with "cannot".
* alias.c: Likewise.
* builtins.c: Likewise.
* calls.c: Likewise.
* cgraph.c: Likewise.
* cgraph.h: Likewise.
* cgraphclones.c: Likewise.
* cgraphunit.c: Likewise.
* combine-stack-adj.c: Likewise.
* combine.c: Likewise.
* common/config/i386/i386-common.c: Likewise.
* config/aarch64/aarch64.c: Likewise.
* config/alpha/sync.md: Likewise.
* config/arc/arc.c: Likewise.
* config/arc/predicates.md: Likewise.
* config/arm/arm-c.c: Likewise.
* config/arm/arm.c: Likewise.
* config/arm/arm.h: Likewise.
* config/arm/arm.md: Likewise.
* config/arm/cortex-r4f.md: Likewise.
* config/csky/csky.c: Likewise.
* config/csky/csky.h: Likewise.
* config/darwin-f.c: Likewise.
* config/epiphany/epiphany.md: Likewise.
* config/i386/i386.c: Likewise.
* config/i386/sol2.h: Likewise.
* config/m68k/m68k.c: Likewise.
* config/mcore/mcore.h: Likewise.
* config/microblaze/microblaze.md: Likewise.
* config/mips/20kc.md: Likewise.
* config/mips/sb1.md: Likewise.
* config/nds32/nds32.c: Likewise.
* config/nds32/predicates.md: Likewise.
* config/pa/pa.c: Likewise.
* config/rs6000/e300c2c3.md: Likewise.
* config/rs6000/rs6000.c: Likewise.
* config/s390/s390.h: Likewise.
* config/sh/sh.c: Likewise.
* config/sh/sh.md: Likewise.
* config/spu/vmx2spu.h: Likewise.
* cprop.c: Likewise.
* dbxout.c: Likewise.
* df-scan.c: Likewise.
* doc/cfg.texi: Likewise.
* doc/extend.texi: Likewise.
* doc/fragments.texi: Likewise.
* doc/gty.texi: Likewise.
* doc/invoke.texi: Likewise.
* doc/lto.texi: Likewise.
* doc/md.texi: Likewise.
* doc/objc.texi: Likewise.
* doc/rtl.texi: Likewise.
* doc/tm.texi: Likewise.
* dse.c: Likewise.
* emit-rtl.c: Likewise.
* emit-rtl.h: Likewise.
* except.c: Likewise.
* expmed.c: Likewise.
* expr.c: Likewise.
* fold-const.c: Likewise.
* genautomata.c: Likewise.
* gimple-fold.c: Likewise.
* hard-reg-set.h: Likewise.
* ifcvt.c: Likewise.
* ipa-comdats.c: Likewise.
* ipa-cp.c: Likewise.
* ipa-devirt.c: Likewise.
* ipa-fnsummary.c: Likewise.
* ipa-icf.c: Likewise.
* ipa-inline-transform.c: Likewise.
* ipa-inline.c: Likewise.
* ipa-polymorphic-call.c: Likewise.
* ipa-profile.c: Likewise.
* ipa-prop.c: Likewise.
* ipa-pure-const.c: Likewise.
* ipa-reference.c: Likewise.
* ipa-split.c: Likewise.
* ipa-visibility.c: Likewise.
* ipa.c: Likewise.
* ira-build.c: Likewise.
* ira-color.c: Likewise.
* ira-conflicts.c: Likewise.
* ira-costs.c: Likewise.
* ira-int.h: Likewise.
* ira-lives.c: Likewise.
* ira.c: Likewise.
* ira.h: Likewise.
* loop-invariant.c: Likewise.
* loop-unroll.c: Likewise.
* lower-subreg.c: Likewise.
* lra-assigns.c: Likewise.
* lra-constraints.c: Likewise.
* lra-eliminations.c: Likewise.
* lra-lives.c: Likewise.
* lra-remat.c: Likewise.
* lra-spills.c: Likewise.
* lra.c: Likewise.
* lto-cgraph.c: Likewise.
* lto-streamer-out.c: Likewise.
* postreload-gcse.c: Likewise.
* predict.c: Likewise.
* profile-count.h: Likewise.
* profile.c: Likewise.
* recog.c: Likewise.
* ree.c: Likewise.
* reload.c: Likewise.
* reload1.c: Likewise.
* reorg.c: Likewise.
* resource.c: Likewise.
* rtl.def: Likewise.
* rtl.h: Likewise.
* rtlanal.c: Likewise.
* sched-deps.c: Likewise.
* sched-ebb.c: Likewise.
* sched-rgn.c: Likewise.
* sel-sched-ir.c: Likewise.
* sel-sched.c: Likewise.
* shrink-wrap.c: Likewise.
* simplify-rtx.c: Likewise.
* symtab.c: Likewise.
* target.def: Likewise.
* toplev.c: Likewise.
* tree-call-cdce.c: Likewise.
* tree-cfg.c: Likewise.
* tree-complex.c: Likewise.
* tree-core.h: Likewise.
* tree-eh.c: Likewise.
* tree-inline.c: Likewise.
* tree-loop-distribution.c: Likewise.
* tree-nrv.c: Likewise.
* tree-profile.c: Likewise.
* tree-sra.c: Likewise.
* tree-ssa-alias.c: Likewise.
* tree-ssa-dce.c: Likewise.
* tree-ssa-dom.c: Likewise.
* tree-ssa-forwprop.c: Likewise.
* tree-ssa-loop-im.c: Likewise.
* tree-ssa-loop-ivcanon.c: Likewise.
* tree-ssa-loop-ivopts.c: Likewise.
* tree-ssa-loop-niter.c: Likewise.
* tree-ssa-phionlycprop.c: Likewise.
* tree-ssa-phiopt.c: Likewise.
* tree-ssa-propagate.c: Likewise.
* tree-ssa-threadedge.c: Likewise.
* tree-ssa-threadupdate.c: Likewise.
* tree-ssa-uninit.c: Likewise.
* tree-ssanames.c: Likewise.
* tree-streamer-out.c: Likewise.
* tree.c: Likewise.
* tree.h: Likewise.
* vr-values.c: Likewise.

gcc/ada/
* exp_ch9.adb: Mechanically replace "can not" with "cannot".
* libgnat/s-regpat.ads: Likewise.
* par-ch4.adb: Likewise.
* set_targ.adb: Likewise.
* types.ads: Likewise.

gcc/cp/
* cp-tree.h: Mechanically replace "can not" with "cannot".
* parser.c: Likewise.
* pt.c: Likewise.

gcc/fortran/
* class.c: Mechanically replace "can not" with "cannot".
* decl.c: Likewise.
* expr.c: Likewise.
* gfc-internals.texi: Likewise.
* intrinsic.texi: Likewise.
* invoke.texi: Likewise.
* io.c: Likewise.
* match.c: Likewise.
* parse.c: Likewise.
* primary.c: Likewise.
* resolve.c: Likewise.
* symbol.c: Likewise.
* trans-array.c: Likewise.
* trans-decl.c: Likewise.
* trans-intrinsic.c: Likewise.
* trans-stmt.c: Likewise.

gcc/go/
* go-backend.c: Mechanically replace "can not" with "cannot".
* go-gcc.cc: Likewise.

gcc/lto/
* lto-partition.c: Mechanically replace "can not" with "cannot".
* lto-symtab.c: Likewise.
* lto.c: Likewise.

gcc/objc/
* objc-act.c: Mechanically replace "can not" with "cannot".

libbacktrace/
* backtrace.h: Mechanically replace "can not" with "cannot".

libgcc/
* config/c6x/libunwind.S: Mechanically replace "can not" with
"cannot".
* config/tilepro/atomic.h: Likewise.
* config/vxlib-tls.c: Likewise.
* generic-morestack-thread.c: Likewise.
* generic-morestack.c: Likewise.
* mkmap-symver.awk: Likewise.

libgfortran/
* caf/single.c: Mechanically replace "can not" with "cannot".
* io/unit.c: Likewise.

libobjc/
* class.c: Mechanically replace "can not" with "cannot".
* objc/runtime.h: Likewise.
* sendmsg.c: Likewise.

liboffloadmic/
* include/coi/common/COIResult_common.h: Mechanically replace
"can not" with "cannot".
* include/coi/source/COIBuffer_source.h: Likewise.

libstdc++-v3/
* include/ext/bitmap_allocator.h: Mechanically replace "can not"
with "cannot".

From-SVN: r267783

5 years agore PR fortran/68426 (Simplification of SPREAD with a derived type element is unimplem...
Thomas Koenig [Wed, 9 Jan 2019 20:31:07 +0000 (20:31 +0000)]
re PR fortran/68426 (Simplification of SPREAD with a derived type element is unimplemented)

2019-01-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/68426
* simplify.c (gfc_simplify_spread): Also simplify if the
type of source is an EXPR_STRUCTURE.

2019-01-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/68426
* gfortran.dg/spread_simplify_1.f90: New test.

From-SVN: r267781

5 years agoi386-protos.h (ix86_expand_xorsign): New prototype.
Uros Bizjak [Wed, 9 Jan 2019 19:16:02 +0000 (20:16 +0100)]
i386-protos.h (ix86_expand_xorsign): New prototype.

* config/i386/i386-protos.h (ix86_expand_xorsign): New prototype.
(ix86_split_xorsign): Ditto.
* config/i386/i386.c (ix86_expand_xorsign): New function.
(ix86_split_xorsign): Ditto.
* config/i386/i386.md (UNSPEC_XORSIGN): New unspec.
(xorsign<mode>3): New expander.
(xorsign<mode>3_1): New insn_and_split pattern.
* config/i386/sse.md (xorsign<mode>3): New expander.

testsuite/ChangeLog:

* lib/target-supports.exp
(check_effective_target_xorsign): Add i?86-*-* and x86_64-*-* targets.
* gcc.target/i386/xorsign.c: New test.

From-SVN: r267779

5 years agoMerge dmd upstream 6d5b853d3
Iain Buclaw [Wed, 9 Jan 2019 17:59:55 +0000 (17:59 +0000)]
Merge dmd upstream 6d5b853d3

Updates the copyright years of all d/dmd sources.

Reviewed-on: https://github.com/dlang/dmd/pull/9181

From-SVN: r267778

5 years agosparc.md (*tablejump_sp32): Merge into...
Eric Botcazou [Wed, 9 Jan 2019 14:47:32 +0000 (14:47 +0000)]
sparc.md (*tablejump_sp32): Merge into...

* config/sparc/sparc.md (*tablejump_sp32): Merge into...
(*tablejump_sp64): Likewise.
(*tablejump<P:mode>): ...this.
(*call_address_sp32): Merge into...
(*call_address_sp64): Likewise.
(*call_address<P:mode>): ...this.
(*call_symbolic_sp32): Merge into...
(*call_symbolic_sp64): Likewise.
(*call_symbolic<P:mode>): ...this.
(call_value): Remove constraint and add predicate.
(*call_value_address_sp32): Merge into...
(*call_value_address_sp64): Likewise.
(*call_value_address<P:mode>): ...this.
(*call_value_symbolic_sp32): Merge into...
(*call_value_symbolic_sp64): Likewise.
(*call_value_symbolic<P:mode>): ...this.
(*sibcall_symbolic_sp32): Merge into...
(*sibcall_symbolic_sp64): Likewise.
(*sibcall_symbolic<P:mode>): ...this.
(sibcall_value): Remove constraint and add predicate.
(*sibcall_value_symbolic_sp32): Merge into...
(*sibcall_value_symbolic_sp64): Likewise.
(*sibcall_value_symbolic<P:mode>): ...this.
(window_save): Minor tweak.
(*branch_sp32): Merge into...
(*branch_sp64): Likewise.
(*branch<P:mode>): ...this.

From-SVN: r267774

5 years agore PR target/84010 (problematic TLS code generation on 64-bit SPARC)
Eric Botcazou [Wed, 9 Jan 2019 14:34:20 +0000 (14:34 +0000)]
re PR target/84010 (problematic TLS code generation on 64-bit SPARC)

PR target/84010
* config/sparc/sparc.c (sparc_legitimize_tls_address): Only use Pmode
consistently in TLS address generation and adjust code to the renaming
of patterns.  Mark calls to __tls_get_addr as const.
* config/sparc/sparc.md (tgd_hi22): Turn into...
(tgd_hi22<P:mode>): ...this and use Pmode throughout.
(tgd_lo10): Turn into...
(tgd_lo10<P:mode>): ...this and use Pmode throughout.
(tgd_add32): Merge into...
(tgd_add64): Likewise.
(tgd_add<P:mode>): ...this and use Pmode throughout.
(tldm_hi22): Turn into...
(tldm_hi22<P:mode>): ...this and use Pmode throughout.
(tldm_lo10): Turn into...
(tldm_lo10<P:mode>): ...this and use Pmode throughout.
(tldm_add32): Merge into...
(tldm_add64): Likewise.
(tldm_add<P:mode>): ...this and use Pmode throughout.
(tldm_call32): Merge into...
(tldm_call64): Likewise.
(tldm_call<P:mode>): ...this and use Pmode throughout.
(tldo_hix22): Turn into...
(tldo_hix22<P:mode>): ...this and use Pmode throughout.
(tldo_lox10): Turn into...
(tldo_lox10<P:mode>): ...this and use Pmode throughout.
(tldo_add32): Merge into...
(tldo_add64): Likewise.
(tldo_add<P:mode>): ...this and use Pmode throughout.
(tie_hi22): Turn into...
(tie_hi22<P:mode>): ...this and use Pmode throughout.
(tie_lo10): Turn into...
(tie_lo10<P:mode>): ...this and use Pmode throughout.
(tie_ld64): Use DImode throughout.
(tie_add32): Merge into...
(tie_add64): Likewise.
(tie_add<P:mode>): ...this and use Pmode throughout.
(tle_hix22_sp32): Merge into...
(tle_hix22_sp64): Likewise.
(tle_hix22<P:mode>): ...this and use Pmode throughout.
(tle_lox22_sp32): Merge into...
(tle_lox22_sp64): Likewise.
(tle_lox22<P:mode>): ...this and use Pmode throughout.
(*tldo_ldub_sp32): Merge into...
(*tldo_ldub_sp64): Likewise.
(*tldo_ldub<P:mode>): ...this and use Pmode throughout.
(*tldo_ldub1_sp32): Merge into...
(*tldo_ldub1_sp64): Likewise.
(*tldo_ldub1<P:mode>): ...this and use Pmode throughout.
(*tldo_ldub2_sp32): Merge into...
(*tldo_ldub2_sp64): Likewise.
(*tldo_ldub2<P:mode>): ...this and use Pmode throughout.
(*tldo_ldsb1_sp32): Merge into...
(*tldo_ldsb1_sp64): Likewise.
(*tldo_ldsb1<P:mode>): ...this and use Pmode throughout.
(*tldo_ldsb2_sp32): Merge into...
(*tldo_ldsb2_sp64): Likewise.
(*tldo_ldsb2<P:mode>): ...this and use Pmode throughout.
(*tldo_ldub3_sp64): Use DImode throughout.
(*tldo_ldsb3_sp64): Likewise.
(*tldo_lduh_sp32): Merge into...
(*tldo_lduh_sp64): Likewise.
(*tldo_lduh<P:mode>): ...this and use Pmode throughout.
(*tldo_lduh1_sp32): Merge into...
(*tldo_lduh1_sp64): Likewise.
(*tldo_lduh1<P:mode>): ...this and use Pmode throughout.
(*tldo_ldsh1_sp32): Merge into...
(*tldo_ldsh1_sp64): Likewise.
(*tldo_ldsh1<P:mode>): ...this and use Pmode throughout.
(*tldo_lduh2_sp64): Use DImode throughout.
(*tldo_ldsh2_sp64): Likewise.
(*tldo_lduw_sp32): Merge into...
(*tldo_lduw_sp64): Likewise.
(*tldo_lduw<P:mode>): ...this and use Pmode throughout.
(*tldo_lduw1_sp64): Use DImode throughout.
(*tldo_ldsw1_sp64): Likewise.
(*tldo_ldx_sp64): Likewise.
(*tldo_stb_sp32): Merge into...
(*tldo_stb_sp64): Likewise.
(*tldo_stb<P:mode>): ...this and use Pmode throughout.
(*tldo_sth_sp32): Merge into...
(*tldo_sth_sp64): Likewise.
(*tldo_sth<P:mode>): ...this and use Pmode throughout.
(*tldo_stw_sp32): Merge into...
(*tldo_stw_sp64): Likewise.
(*tldo_stw<P:mode>): ...this and use Pmode throughout.
(*tldo_stx_sp64): Use DImode throughout.

From-SVN: r267771

5 years ago[AArch64, 6/6] Enable BTI: Add configure option.
Sudakshina Das [Wed, 9 Jan 2019 14:32:06 +0000 (14:32 +0000)]
[AArch64, 6/6] Enable BTI: Add configure option.

This patch is part of a series that enables ARMv8.5-A in GCC and
adds Branch Target Identification Mechanism.

This patch is adding a new configure option for enabling BTI and
Return Address Signing by default.

*** gcc/ChangeLog ***

2018-01-09  Sudakshina Das  <sudi.das@arm.com>

* config/aarch64/aarch64.c (aarch64_override_options): Add case to
check configure option to set BTI and Return Address Signing.
* configure.ac: Add --enable-standard-branch-protection and
--disable-standard-branch-protection.
* configure: Regenerated.
* doc/install.texi: Document the same.

*** gcc/testsuite/ChangeLog ***

2018-01-09  Sudakshina Das  <sudi.das@arm.com>

* gcc.target/aarch64/bti-1.c: Update test to not add command line
option when configure with bti.
* gcc.target/aarch64/bti-2.c: Likewise.
* lib/target-supports.exp
(check_effective_target_default_branch_protection):
Add configure check for --enable-standard-branch-protection.

From-SVN: r267770

5 years ago[AArch64, 5/6] Enable BTI : Add new pass for BTI.
Sudakshina Das [Wed, 9 Jan 2019 14:21:22 +0000 (14:21 +0000)]
[AArch64, 5/6] Enable BTI : Add new pass for BTI.

This patch is part of a series that enables ARMv8.5-A in GCC and
adds Branch Target Identification Mechanism.

This patch adds a new pass called "bti" which is triggered by the command
line argument -mbranch-protection whenever "bti" is turned on.

The pass iterates through the instructions and adds appropriated BTI
instructions based on the following:
  * Add a new "BTI C" at the beginning of a function, unless its already
    protected by a "PACIASP". We exempt the functions that are only called
    directly.
  * Add a new "BTI J" for every target of an indirect jump, jump table
    targets, non-local goto targets or labels that might be referenced by
    variables, constant pools, etc (NOTE_INSN_DELETED_LABEL).

Since we have already changed the use of indirect tail calls to only x16 and
x17, we do not have to use "BTI JC".
(check patch 3/6).

*** gcc/ChangeLog ***

2018-01-09  Sudakshina Das  <sudi.das@arm.com>
    Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

* config.gcc (aarch64*-*-*): Add aarch64-bti-insert.o.
* gcc/config/aarch64/aarch64.h: Update comment for TRAMPOLINE_SIZE.
* config/aarch64/aarch64.c (aarch64_asm_trampoline_template): Update
if bti is enabled.
* config/aarch64/aarch64-bti-insert.c: New file.
* config/aarch64/aarch64-passes.def (INSERT_PASS_BEFORE): Insert bti
pass.
* config/aarch64/aarch64-protos.h (make_pass_insert_bti): Declare the
new bti pass.
* config/aarch64/aarch64.md (unspecv): Add UNSPECV_BTI_NOARG,
UNSPECV_BTI_C, UNSPECV_BTI_J and UNSPECV_BTI_JC.
(bti_noarg, bti_j, bti_c, bti_jc): New define_insns.
* config/aarch64/t-aarch64: Add rule for aarch64-bti-insert.o.

*** gcc/testsuite/ChangeLog ***

2018-01-09  Sudakshina Das  <sudi.das@arm.com>

* gcc.target/aarch64/bti-1.c: New test.
* gcc.target/aarch64/bti-2.c: New test.
* gcc.target/aarch64/bti-3.c: New test.
* lib/target-supports.exp
(check_effective_target_aarch64_bti_hw): Add new check for BTI hw.

Co-Authored-By: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
From-SVN: r267769

5 years ago[AArch64, 4/6] Enable BTI: Add new <type> to -mbranch-protection.
Sudakshina Das [Wed, 9 Jan 2019 14:14:28 +0000 (14:14 +0000)]
[AArch64, 4/6] Enable BTI: Add new <type> to -mbranch-protection.

This patch is part of a series that enables ARMv8.5-A in GCC and
adds Branch Target Identification Mechanism.

This pass updates the CLI of -mbranch-protection to add "bti" as a new
type of branch protection and also add it its definition of "none" and
"standard". The option does not really do anything functional.
The functional changes are in the next patch. I am initializing the target
variable aarch64_enable_bti to 2 since I am also adding a configure option
in a later patch and a value different from 0 and 1 would help identify if its
already been updated.

*** gcc/ChangeLog ***

2018-01-09  Sudakshina Das  <sudi.das@arm.com>

* config/aarch64/aarch64-protos.h (aarch64_bti_enabled): Declare.
* config/aarch64/aarch64.c (aarch64_handle_no_branch_protection):
Disable bti for -mbranch-protection=none.
(aarch64_handle_standard_branch_protection): Enable bti for
-mbranch-protection=standard.
(aarch64_handle_bti_protection): Enable bti for "bti" in the string to
-mbranch-protection.
(aarch64_bti_enabled): Check if bti is enabled.
* config/aarch64/aarch64.opt: Declare target variable.
* doc/invoke.texi: Add bti to the -mbranch-protection documentation.

From-SVN: r267768

5 years ago[AArch64, 3/6] Restrict indirect tail calls to x16 and x17
Sudakshina Das [Wed, 9 Jan 2019 14:10:58 +0000 (14:10 +0000)]
[AArch64, 3/6] Restrict indirect tail calls to x16 and x17

This patch is part of a series that enables ARMv8.5-A in GCC and
adds Branch Target Identification Mechanism.

This patch changes the registers that are allowed for indirect tail calls.
We are choosing to restrict these to only x16 or x17.

Indirect tail calls are special in a way that they convert a call statement
(BLR instruction) to a jump statement (BR instruction). For the best possible
use of Branch Target Identification Mechanism, we would like to place a
"BTI C" (call) at the beginning of the function which is only
compatible with BLRs and BR X16/X17. In order to make indirect tail calls
compatible with this scenario, we are restricting the TAILCALL_ADDR_REGS.

In order to use x16/x17 for this purpose, we also had to change the use
of these registers in the epilogue/prologue handling. For this purpose
we are now using x12 and x13 named as EP0_REGNUM and EP1_REGNUM as
scratch registers for epilogue and prologue.

*** gcc/ChangeLog***

2018-01-09  Sudakshina Das  <sudi.das@arm.com>

* config/aarch64/aarch64.c (aarch64_expand_prologue): Use new
epilogue/prologue scratch registers EP0_REGNUM and EP1_REGNUM.
(aarch64_expand_epilogue): Likewise.
(aarch64_output_mi_thunk): Likewise
* config/aarch64/aarch64.h (REG_CLASS_CONTENTS): Change
TAILCALL_ADDR_REGS to x16 and x17.
* config/aarch64/aarch64.md: Define EP0_REGNUM and EP1_REGNUM.

*** gcc/testsuite/ChangeLog ***

2018-01-09  Sudakshina Das  <sudi.das@arm.com>

* gcc.target/aarch64/test_frame_17.c: Update to check for EP0_REGNUM
instead of IP0_REGNUM and add test case.

From-SVN: r267767

5 years ago[AArch64, 2/6] Add new arch command line feaures from ARMv8.5-A
Sudakshina Das [Wed, 9 Jan 2019 14:08:01 +0000 (14:08 +0000)]
[AArch64, 2/6] Add new arch command line feaures from ARMv8.5-A

This patch is part of a series that enables ARMv8.5-A in GCC and
adds Branch Target Identification Mechanism.

This patch add all the command line feature that are added by ARMv8.5.
Optional extensions to armv8.5-a:
+rng : Random number Generation Instructions.
+memtag : Memory Tagging Extension.

ARMv8.5-A features that are optional to older arch:
+sb : Speculation barrier instruction.
+ssbs: Speculative Store Bypass Safe instruction.
+predres: Execution and Data Prediction Restriction instructions.

All of the above only effect the assembler and have already gone in the
trunk of binutils.

*** gcc/ChangeLog ***

2018-01-09  Sudakshina Das  <sudi.das@arm.com>

* config/aarch64/aarch64-option-extensions.def: Define
AARCH64_OPT_EXTENSION for memtag, rng, sb, ssbs and predres.
* gcc/config/aarch64/aarch64.h (AARCH64_FL_RNG): New.
(AARCH64_FL_MEMTAG, ARCH64_FL_SB, AARCH64_FL_SSBS): New.
(AARCH64_FL_PREDRES): New.
(AARCH64_FL_FOR_ARCH8_5): Add AARCH64_FL_SB, AARCH64_FL_SSBS and
AARCH64_FL_PREDRES by default.
* gcc/doc/invoke.texi: Document rng, memtag, sb, ssbs and predres.

From-SVN: r267766

5 years ago[AArch64, 1/6] Enable ARMv8.5-A in gcc
Sudakshina Das [Wed, 9 Jan 2019 14:05:55 +0000 (14:05 +0000)]
[AArch64, 1/6] Enable ARMv8.5-A in gcc

This patch is part of a series that enables ARMv8.5-A in GCC and
adds Branch Target Identification Mechanism.

*** gcc/ChangeLog ***

2018-01-09  Sudakshina Das  <sudi.das@arm.com>

* config/aarch64/aarch64-arches.def: Define AARCH64_ARCH for
ARMv8.5-A.
* gcc/config/aarch64/aarch64.h (AARCH64_FL_V8_5): New.
(AARCH64_FL_FOR_ARCH8_5, AARCH64_ISA_V8_5): New.
* gcc/doc/invoke.texi: Document ARMv8.5-A.

From-SVN: r267765

5 years ago[Aarch64][SVE] Add copysign and xorsign support
Alejandro Martinez [Wed, 9 Jan 2019 13:57:06 +0000 (13:57 +0000)]
[Aarch64][SVE] Add copysign and xorsign support

This patch adds support for copysign and xorsign builtins to SVE. With the new
expands, they can be vectorized using bitwise logical operations.

I tested this patch in an aarch64 machine bootstrapping the compiler and
running the checks.

2019-01-09  Alejandro Martinez  <alejandro.martinezvicente@arm.com>

* config/aarch64/aarch64-sve.md (copysign<mode>3): New define_expand.
(xorsign<mode>3): Likewise.

2019-01-09  Alejandro Martinez  <alejandro.martinezvicente@arm.com>

* gcc.target/aarch64/sve/copysign_1.c: New test for SVE vectorized
copysign.
* gcc.target/aarch64/sve/copysign_1_run.c: Likewise.
* gcc.target/aarch64/sve/xorsign_1.c: New test for SVE vectorized
xorsign.
* gcc.target/aarch64/sve/xorsign_1_run.c: Likewise.

From-SVN: r267764

5 years agoFix failing prettyprinter test
Jonathan Wakely [Wed, 9 Jan 2019 10:46:52 +0000 (10:46 +0000)]
Fix failing prettyprinter test

The failure for "p2" went unnoticed due to the pre-existing failures for
variables with similar names, like "p" and "q". This fixes the failure,
and gives the filesystem::path variables better names.

* testsuite/libstdc++-prettyprinters/cxx17.cc: Fix expected output
for filesystem::path. Give variables more distinctive names.

From-SVN: r267762

5 years agoRemove some more code duplication in std::optional
Jonathan Wakely [Wed, 9 Jan 2019 10:40:49 +0000 (10:40 +0000)]
Remove some more code duplication in std::optional

Hoist the duplicated code from the _Optional_payload partial
specializations into the _Optional_payload_base base class.

* include/std/optional (_Optional_payload_base::_M_copy_assign): New
member function to perform non-trivial assignment.
(_Optional_payload_base::_M_move_assign): Likewise.
(_Optional_payload<T, true, false, true>::operator=)
(_Optional_payload<T, true, true, false>::operator=)
(_Optional_payload<T, true, false, false>::operator=): Call
_M_copy_assign and/or _M_move_assign to do non-trivial assignments.

From-SVN: r267761

5 years agore PR middle-end/88758 (186.crafty in SPEC CPU 2000 failed to build)
Jakub Jelinek [Wed, 9 Jan 2019 10:24:43 +0000 (11:24 +0100)]
re PR middle-end/88758 (186.crafty in SPEC CPU 2000 failed to build)

PR middle-end/88758
* tree.c (initializer_each_zero_or_onep) <case VECTOR_CST>: Use
vector_cst_elt instead of VECTOR_CST_ENCODED_ELT.

From-SVN: r267760

5 years agore PR rtl-optimization/88331 (ICE in rtl_verify_bb_layout, at cfgrtl.c:2987)
Jakub Jelinek [Wed, 9 Jan 2019 10:16:10 +0000 (11:16 +0100)]
re PR rtl-optimization/88331 (ICE in rtl_verify_bb_layout, at cfgrtl.c:2987)

PR rtl-optimization/88331
* function.c (assign_stack_local_1): Don't set dynamic_align_addr if
not currently_expanding_to_rtl.

* gcc.target/i386/pr88331.c: New test.

From-SVN: r267758

5 years agoPR libstdc++/88204 disable std::complex<long double> tests
Jonathan Wakely [Wed, 9 Jan 2019 09:37:34 +0000 (09:37 +0000)]
PR libstdc++/88204 disable std::complex<long double> tests

The IBM128 long double format isn't foldable in constant expressions, so
conditionally skip the std::complex<long double> cases when they'll
fail.

PR libstdc++/88204
* testsuite/26_numerics/complex/operators/more_constexpr.cc: Do not
test std::complex<long double> if long double format is IBM128.
* testsuite/26_numerics/complex/requirements/more_constexpr.cc:
Likewise.

From-SVN: r267757

5 years agodecl.c (grok_reference_init): Improve error location.
Paolo Carlini [Wed, 9 Jan 2019 08:52:38 +0000 (08:52 +0000)]
decl.c (grok_reference_init): Improve error location.

/cp
2019-01-08  Paolo Carlini  <paolo.carlini@oracle.com>

* decl.c (grok_reference_init): Improve error location.
(grokdeclarator): Likewise, improve two locations.

/testsuite
2019-01-08  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/diagnostic/constexpr2.C: New.
* g++.dg/diagnostic/ref3.C: Likewise.

From-SVN: r267756

5 years agoinvoke.texi (-Os): Remove trailing spaces.
Eric Botcazou [Wed, 9 Jan 2019 08:25:14 +0000 (08:25 +0000)]
invoke.texi (-Os): Remove trailing spaces.

* doc/invoke.texi (-Os): Remove trailing spaces.
(-finline-functions): Remove reference to -O2.

From-SVN: r267753

5 years agolibgomp: Reduce copy and paste for RTEMS
Sebastian Huber [Wed, 9 Jan 2019 06:16:05 +0000 (06:16 +0000)]
libgomp: Reduce copy and paste for RTEMS

libgomp/

* config/rtems/bar.c: Include "../linux/bar.c" and delete copy
and paste code.

From-SVN: r267752

5 years agolibgomp: Avoid complex dependencies for RTEMS
Sebastian Huber [Wed, 9 Jan 2019 06:14:15 +0000 (06:14 +0000)]
libgomp: Avoid complex dependencies for RTEMS

libgomp/

* config/rtems/affinity-fmt.c: New file.  Include affinity-fmt.c,
undefining HAVE_GETPID and HAVE_GETHOSTNAME, and mapping fwrite to
write.

From-SVN: r267751

5 years agoDaily bump.
GCC Administrator [Wed, 9 Jan 2019 00:16:18 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r267750

5 years ago[libgomp, testsuite, openacc] Don't use const int for dimensions
Tom de Vries [Wed, 9 Jan 2019 00:07:55 +0000 (00:07 +0000)]
[libgomp, testsuite, openacc] Don't use const int for dimensions

Const int is handled differently at -O0 for -xc and -xc++, which can cause noise
in testsuite/libgomp.oacc-c-c++-common test-cases (which are both run for c and
c++) if const int is used for launch dimensions.

Fix this by using #defines instead.

2019-01-09  Tom de Vries  <tdevries@suse.de>

PR target/88756
* testsuite/libgomp.oacc-c-c++-common/reduction-1.c (ng, nw, vl): Use
#define instead of "const int".
* testsuite/libgomp.oacc-c-c++-common/reduction-2.c (ng, nw, vl): Same.
* testsuite/libgomp.oacc-c-c++-common/reduction-3.c (ng, nw, vl): Same.
* testsuite/libgomp.oacc-c-c++-common/reduction-4.c (ng, nw, vl): Same.
* testsuite/libgomp.oacc-c-c++-common/reduction-5.c (ng, nw, vl): Same.

From-SVN: r267747

5 years ago[nvptx, libgomp] Don't launch with num_workers == 0
Tom de Vries [Wed, 9 Jan 2019 00:07:45 +0000 (00:07 +0000)]
[nvptx, libgomp] Don't launch with num_workers == 0

When using a compiler build with:
...
+#define PTX_DEFAULT_VECTOR_LENGTH PTX_CTA_SIZE
+#define PTX_MAX_VECTOR_LENGTH PTX_CTA_SIZE
...
and running the libgomp testsuite, we run into an execution failure in
parallel-loop-1.c, due to a cuda launch failure:
...
  nvptx_exec: kernel f6_none_none$_omp_fn$0: launch gangs=480, workers=0, \
    vectors=1024

libgomp: cuLaunchKernel error: invalid argument
...
because workers == 0.

The workers variable is set to 0 here in nvptx_exec:
...
                workers = blocks / actual_vectors;
...
because actual_vectors is 1024, and blocks is 768:
...
cuOccupancyMaxPotentialBlockSize: grid = 10, block = 768
...

Fix this by ensuring that workers is at least one.

2019-01-09  Tom de Vries  <tdevries@suse.de>

* plugin/plugin-nvptx.c (nvptx_exec): Make sure to launch with at least
one worker.

From-SVN: r267746

5 years agocompiler: use int type for len & cap in slice value
Ian Lance Taylor [Wed, 9 Jan 2019 00:05:12 +0000 (00:05 +0000)]
compiler: use int type for len & cap in slice value

    Slice value expression has backend type a struct of a pointer and
    two ints. Make sure the len and cap are converted to int when
    creating slice value expression.

    Reviewed-on: https://go-review.googlesource.com/c/156897

From-SVN: r267745

5 years agore PR c++/88744 (class non-type template parameters doesn't work with default templat...
Marek Polacek [Tue, 8 Jan 2019 23:54:47 +0000 (23:54 +0000)]
re PR c++/88744 (class non-type template parameters doesn't work with default template parameters)

PR c++/88744
* g++.dg/cpp2a/nontype-class12.C: New test.

From-SVN: r267744

5 years agoPretty printer test fixes and improvements
Jonathan Wakely [Tue, 8 Jan 2019 23:15:49 +0000 (23:15 +0000)]
Pretty printer test fixes and improvements

Test that StdUniquePtrPrinter correctly prints std::unique_ptr objects
using the old layout, prior to the PR libstdc++/77990 changes.

The printer test for a valueless std::variant started to fail because
the PR libstdc++/87431 fix meant it no longer became valueless. Change
the test to use a type that is not trivially copyable, so that the
exception causes it to become valueless.

* testsuite/libstdc++-prettyprinters/compat.cc: Test printer support
for old std::unique_ptr layout.
* testsuite/libstdc++-prettyprinters/cxx17.cc: Fix std::variant test
to become valueless. Add filesystem::path tests.

From-SVN: r267743

5 years agoPR libstdc++/87855 fix optional for types with non-trivial copy/move
Jonathan Wakely [Tue, 8 Jan 2019 23:00:46 +0000 (23:00 +0000)]
PR libstdc++/87855 fix optional for types with non-trivial copy/move

When the contained value is not trivially copy (or move) constructible
the union's copy (or move) constructor will be deleted, and so the
_Optional_payload delegating constructors are invalid. G++ fails to
diagnose this because it incorrectly performs copy elision in the
delegating constructors. Clang does diagnose it (llvm.org/PR40245).

The solution is to avoid performing any copy (or move) when the
contained value's copy (or move) constructor isn't trivial. Instead the
contained value can be constructed by calling _M_construct. This is OK,
because the relevant constructor doesn't need to be constexpr when the
contained value isn't trivially copy (or move) constructible.

Additionally, this patch removes a lot of code duplication in the
_Optional_payload partial specializations and the _Optional_base partial
specialization, by hoisting it into common base classes.

The Python pretty printer for std::optional needs to be adjusted to
support the new layout. Retain support for the old layout, and add a
test to verify that the support still works.

PR libstdc++/87855
* include/std/optional (_Optional_payload_base): New class template
for common code hoisted from _Optional_payload specializations. Use
a template for the union, to allow a partial specialization for
types with non-trivial destructors. Add constructors for in-place
initialization to the union.
(_Optional_payload(bool, const _Optional_payload&)): Use _M_construct
to perform non-trivial copy construction, instead of relying on
non-standard copy elision in a delegating constructor.
(_Optional_payload(bool, _Optional_payload&&)): Likewise for
non-trivial move construction.
(_Optional_payload): Derive from _Optional_payload_base and use it
for everything except the non-trivial assignment operators, which are
defined as needed.
(_Optional_payload<false, C, M>): Derive from the specialization
_Optional_payload<true, false, false> and add a destructor.
(_Optional_base_impl::_M_destruct, _Optional_base_impl::_M_reset):
Forward to corresponding members of _Optional_payload.
(_Optional_base_impl::_M_is_engaged, _Optional_base_impl::_M_get):
Hoist common members from _Optional_base.
(_Optional_base): Make all members and base class public.
(_Optional_base::_M_get, _Optional_base::_M_is_engaged): Move to
_Optional_base_impl.
* python/libstdcxx/v6/printers.py (StdExpOptionalPrinter): Add
support for new std::optional layout.
* testsuite/libstdc++-prettyprinters/compat.cc: New test.

From-SVN: r267742

5 years agoPR c++/88538 - braced-init-list in template-argument-list.
Marek Polacek [Tue, 8 Jan 2019 22:33:04 +0000 (22:33 +0000)]
PR c++/88538 - braced-init-list in template-argument-list.

* parser.c (cp_parser_template_argument): Handle braced-init-list when
in C++20.

* g++.dg/cpp2a/nontype-class11.C: New test.

From-SVN: r267741

5 years agore PR rtl-optimization/79593 (Poor/Worse code generation for FPU on versions after 6)
Jakub Jelinek [Tue, 8 Jan 2019 22:29:56 +0000 (23:29 +0100)]
re PR rtl-optimization/79593 (Poor/Worse code generation for FPU on versions after 6)

PR rtl-optimization/79593
* config/i386/i386.md (reg = mem; mem = reg): New define_peephole2.

From-SVN: r267740

5 years agore PR target/88457 (ICE: Max. number of generated reload insns per insn is achieved...
Jakub Jelinek [Tue, 8 Jan 2019 21:36:21 +0000 (22:36 +0100)]
re PR target/88457 (ICE: Max. number of generated reload insns per insn is achieved (90))

PR target/88457
* gcc.target/powerpc/pr88457.c: Remove -m32, -c and -mcpu=e300c3 from
dg-options.  Require ppc_cpu_supports_hw effective target instead of
powerpc64*-*-*.

From-SVN: r267739

5 years agors6000.c (rs6000_delegitimize_address): Delegitimize UNSPEC_FUSION_GPR to its argument.
Jakub Jelinek [Tue, 8 Jan 2019 21:35:38 +0000 (22:35 +0100)]
rs6000.c (rs6000_delegitimize_address): Delegitimize UNSPEC_FUSION_GPR to its argument.

* config/rs6000/rs6000.c (rs6000_delegitimize_address): Delegitimize
UNSPEC_FUSION_GPR to its argument.  Formatting fixes.

From-SVN: r267738

5 years agore PR fortran/88047 (ICE in gfc_find_vtab, at fortran/class.c:2843)
Janus Weil [Tue, 8 Jan 2019 19:29:01 +0000 (20:29 +0100)]
re PR fortran/88047 (ICE in gfc_find_vtab, at fortran/class.c:2843)

2019-01-08  Janus Weil  <janus@gcc.gnu.org>

PR fortran/88047
* class.c (gfc_find_vtab): For polymorphic typespecs, the components of
the class container may not be available (in case of invalid code).

2019-01-08  Janus Weil  <janus@gcc.gnu.org>

PR fortran/88047
* gfortran.dg/class_69.f90: New test case.

From-SVN: r267735

5 years agore PR bootstrap/88721 (-Wmaybe-uninitialized warnings in sparc.c)
Eric Botcazou [Tue, 8 Jan 2019 19:09:52 +0000 (19:09 +0000)]
re PR bootstrap/88721 (-Wmaybe-uninitialized warnings in sparc.c)

PR bootstrap/88721
* config/sparc/sparc.c (function_arg_slotno): Set *PPREGNO & *PPADDING
to -1 on entry.

PR debug/88723
* config/sparc/sparc.c (sparc_delegitimize_address): Deal with naked
UNSPECs and UNSPEC_MOVE_GOTDATA specifically.

From-SVN: r267734

5 years agox86: Don't generate vzeroupper if caller passes AVX/AVX512 registers
H.J. Lu [Tue, 8 Jan 2019 17:40:18 +0000 (17:40 +0000)]
x86: Don't generate vzeroupper if caller passes AVX/AVX512 registers

There is no need to generate vzeroupper if caller passes arguments in
AVX/AVX512 registers.

Tested on i686 and x86-64 with and without --with-arch=native.

gcc/

PR target/88717
* config/i386/i386.c (ix86_avx_u128_mode_exit): Call
ix86_avx_u128_mode_entry.

gcc/testsuite/

PR target/88717
* gcc.target/i386/pr88717.c: New test.

From-SVN: r267732

5 years agoPR c++/88548 - this accepted in static member functions.
Marek Polacek [Tue, 8 Jan 2019 17:37:51 +0000 (17:37 +0000)]
PR c++/88548 - this accepted in static member functions.

* parser.c (cp_debug_parser): Adjust printing of
local_variables_forbidden_p.
(cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
(cp_parser_primary_expression): When checking
local_variables_forbidden_p, use THIS_FORBIDDEN or
LOCAL_VARS_FORBIDDEN.
(cp_parser_lambda_body): Update the type of
local_variables_forbidden_p.  Set it to 0 rather than false.
(cp_parser_condition): Adjust call to cp_parser_declarator.
(cp_parser_explicit_instantiation): Likewise.
(cp_parser_init_declarator): Likewise.
(cp_parser_declarator): New parameter.  Use it.
(cp_parser_direct_declarator): New parameter.  Use it to set
local_variables_forbidden_p.  Adjust call to cp_parser_declarator.
(cp_parser_type_id_1): Adjust call to cp_parser_declarator.
(cp_parser_parameter_declaration): Likewise.
(cp_parser_default_argument): Update the type of
local_variables_forbidden_p.  Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
rather than true.
(cp_parser_member_declaration): Tell cp_parser_declarator if we saw
'static' or 'friend'.
(cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
(cp_parser_late_parsing_default_args): Update the type of
local_variables_forbidden_p.  Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
rather than true.
(cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
(cp_parser_objc_class_ivars): Likewise.
(cp_parser_objc_struct_declaration): Likewise.
(cp_parser_omp_for_loop_init): Likewise.
* parser.h (cp_parser): Change the type of local_variables_forbidden_p
to unsigned char.
(LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
Define.

* g++.dg/cpp0x/this1.C: New test.

From-SVN: r267731

5 years agoUse proper type in linear transformation in tree-switch-conversion (PR tree-optimizat...
Martin Liska [Tue, 8 Jan 2019 14:45:28 +0000 (15:45 +0100)]
Use proper type in linear transformation in tree-switch-conversion (PR tree-optimization/88753).

2019-01-08  Martin Liska  <mliska@suse.cz>

PR tree-optimization/88753
* tree-switch-conversion.c (switch_conversion::build_one_array):
Come up with local variable constructor.  Convert first to
type of constructor values.
2019-01-08  Martin Liska  <mliska@suse.cz>

PR tree-optimization/88753
* gcc.dg/tree-ssa/pr88753.c: New test.

From-SVN: r267728

5 years agoPR libstdc++/88066 use <> for includes not ""
Jonathan Wakely [Tue, 8 Jan 2019 13:25:19 +0000 (13:25 +0000)]
PR libstdc++/88066 use <> for includes not ""

Using #include "..." to include a header in the same directory fails if
the user compiles with -I-, so always use something like <bits/...> for
internal headers.

I haven't added tests for this, because dg-options adds options to the
end, and the position of -I- matters (if it's at the end then the tests
won't find any headers in the build tree, as they're specified by -I
options earlier in the flags). It's been manually tested though.

PR libstdc++/88066
* include/bits/locale_conv.h: Use <> for includes not "".
* include/ext/random: Likewise.
* include/ext/vstring.h: Likewise.

From-SVN: r267726

5 years agore PR middle-end/86554 (Incorrect code generation with signed/unsigned comparison)
Richard Biener [Tue, 8 Jan 2019 13:05:47 +0000 (13:05 +0000)]
re PR middle-end/86554 (Incorrect code generation with signed/unsigned comparison)

2019-01-08  Richard Biener  <rguenther@suse.de>

PR tree-optimization/86554
* tree-ssa-sccvn.c (eliminate_dom_walker, rpo_elim,
rpo_avail): Move earlier.
(visit_nary_op): When value-numbering to expressions
with different overflow behavior make sure there's an
available expression on the path.

* gcc.dg/torture/pr86554-1.c: New testcase.
* gcc.dg/torture/pr86554-2.c: Likewise.

From-SVN: r267725

5 years agoFix libstdc++.so link on Solaris with C++17 std::basic_string member functions
Rainer Orth [Tue, 8 Jan 2019 12:04:38 +0000 (12:04 +0000)]
Fix libstdc++.so link on Solaris with C++17 std::basic_string member functions

* config/abi/pre/gnu.ver (GLIBCXX_3.4): Tighten existing patterns.
(GLIBCXX_3.4.21): Likewise.

From-SVN: r267723

5 years agothread1.C: Tweak expected error #line 13 to cover target variance.
Paolo Carlini [Tue, 8 Jan 2019 11:52:46 +0000 (11:52 +0000)]
thread1.C: Tweak expected error #line 13 to cover target variance.

2019-01-08  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/diagnostic/thread1.C: Tweak expected error #line 13 to
cover target variance.

From-SVN: r267722

5 years agore PR fortran/88611 (ICE in eliminate_stmt, at tree-ssa-sccvn.c:5011)
Richard Biener [Tue, 8 Jan 2019 10:46:04 +0000 (10:46 +0000)]
re PR fortran/88611 (ICE in eliminate_stmt, at tree-ssa-sccvn.c:5011)

2019-01-08  Richard Biener  <rguenther@suse.de>

PR fortran/88611
* trans-expr.c (gfc_conv_initializer): For ISOCBINDING_NULL_*
directly build the expected GENERIC tree.

* gfortran.dg/pr88611.f90: New testcase.

From-SVN: r267721

5 years ago[PATCH 2/3][GCC][AARCH64] Add new -mbranch-protection option to combine pointer signi...
Sam Tebbs [Tue, 8 Jan 2019 10:31:11 +0000 (10:31 +0000)]
[PATCH 2/3][GCC][AARCH64] Add new -mbranch-protection option to combine pointer signing and BTI

gcc/ChangeLog:

2019-01-08  Sam Tebbs  <sam.tebbs@arm.com>

* config/aarch64/aarch64.c (BRANCH_PROTECT_STR_MAX,
aarch64_parse_branch_protection,
struct aarch64_branch_protect_type,
aarch64_handle_no_branch_protection,
aarch64_handle_standard_branch_protection,
aarch64_validate_mbranch_protection,
aarch64_handle_pac_ret_protection,
aarch64_handle_attr_branch_protection,
accepted_branch_protection_string,
aarch64_pac_ret_subtypes,
aarch64_branch_protect_types,
aarch64_handle_pac_ret_leaf): Define.
(aarch64_override_options_after_change_1, aarch64_override_options):
Add check for accepted_branch_protection_string.
(aarch64_option_save): Save accepted_branch_protection_string.
(aarch64_option_restore): Save accepted_branch_protection_string.
* config/aarch64/aarch64.c (aarch64_attributes): Add branch-protection.
* config/aarch64/aarch64.opt: Add mbranch-protection. Deprecate
msign-return-address.
* doc/invoke.texi: Add mbranch-protection.

gcc/testsuite/Changelog:

2019-01-08  Sam Tebbs  <sam.tebbs@arm.com>

* gcc.target/aarch64/(return_address_sign_1.c,
return_address_sign_2.c, return_address_sign_3.c (__attribute__)):
Change option to -mbranch-protection.
* gcc.target/aarch64/(branch-protection-option.c,
branch-protection-option-2.c, branch-protection-attr.c,
branch-protection-attr-2.c): New file.

From-SVN: r267717

5 years agoPR libstdc++/88749 fix build failure in src/filesystem/ops.cc
Jonathan Wakely [Tue, 8 Jan 2019 10:18:54 +0000 (10:18 +0000)]
PR libstdc++/88749 fix build failure in src/filesystem/ops.cc

PR libstdc++/88749
* src/filesystem/ops.cc (last_write_time): Fix preprocessor condition
to match the one that controls whether utimbuf and utime are declared.

From-SVN: r267705

5 years ago[Ada] Bump copyright years to 2019
Pierre-Marie de Rodat [Tue, 8 Jan 2019 09:54:04 +0000 (09:54 +0000)]
[Ada] Bump copyright years to 2019

From-SVN: r267683

5 years ago[Ada] Revert recent changes in the generation of deps in ali files
Justin Squirek [Tue, 8 Jan 2019 09:52:32 +0000 (09:52 +0000)]
[Ada] Revert recent changes in the generation of deps in ali files

Following the discovery of regressions in GPRbuild, this reverts both
r263100 and r264608:

2019-01-08  Justin Squirek  <squirek@adacore.com>

Revert:

2018-07-31  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* lib-writ.adb (Write_With_Lines): Modfiy the generation
of dependencies within ali files so that source unit
bodies are properly listed even if said bodies are
missing.  Perform legacy behavior in GNATprove mode.
* lib-writ.ads: Modify documentation to reflect current
behavior.

and:

2018-09-26  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* lib-writ.adb, lib-writ.ads (Write_With_Lines): Add
documentation and an extra conditional check for RCI
units so that generated ali files will list the spec
only instead of a body when a body is not found.

From-SVN: r267680

5 years agodecl.c (start_decl): Improve permerror location.
Paolo Carlini [Tue, 8 Jan 2019 09:41:36 +0000 (09:41 +0000)]
decl.c (start_decl): Improve permerror location.

/cp
2019-01-08  Paolo Carlini  <paolo.carlini@oracle.com>

* decl.c (start_decl): Improve permerror location.

/testsuite
2019-01-08  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/diagnostic/out-of-class-redeclaration.C: New.

From-SVN: r267675

5 years agoteststuite - avoid parts of builtin-has-attribute tests requireing alias support.
Iain Sandoe [Tue, 8 Jan 2019 09:26:29 +0000 (09:26 +0000)]
teststuite - avoid parts of builtin-has-attribute tests requireing alias support.

2019-01-08  Iain Sandoe  <iain@sandoe.co.uk>

gcc/testsuite/

* c-c++-common/builtin-has-attribute-3.c: Skip tests requiring symbol
alias support.
* c-c++-common/builtin-has-attribute-4.c: Likewise.
Append match for warning that â€˜protected’ attribute is not supported.

From-SVN: r267674

5 years agotestsuite - Require alias support for three tests.
Iain Sandoe [Tue, 8 Jan 2019 09:15:34 +0000 (09:15 +0000)]
testsuite - Require alias support for three tests.

2019-01-08  Iain Sandoe  <iain@sandoe.co.uk>

gcc/testsuite/

* gcc.dg/Wmissing-attributes.c: Require alias support.
* gcc.dg/attr-copy-2.c: Likewise.
* gcc.dg/attr-copy-5.c: Likewise.

From-SVN: r267673

5 years agore PR c++/88554 (Segfault ICE when falling off the end of a reference-returning frien...
Jonathan Wakely [Tue, 8 Jan 2019 08:57:58 +0000 (08:57 +0000)]
re PR c++/88554 (Segfault ICE when falling off the end of a reference-returning friend operator)

PR c++/88554
* decl.c (finish_function): For -Wreturn-type don't add a return *this;
fixit hint if current_class_ref is NULL.  Use a single if instead of
two nested ones.

* g++.dg/warn/Wreturn-type-11.C: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r267672

5 years agoFix jit test case (PR jit/88747)
David Malcolm [Tue, 8 Jan 2019 01:39:09 +0000 (01:39 +0000)]
Fix jit test case (PR jit/88747)

Amongst other changes, r266077 updated value_range_base::dump so
that it additionally prints the type.  This broke an assertion within
the jit testsuite, in jit.dg/test-sum-of-squares.c, which was checking
for:
  ": [-INF, n_"
but was now getting:
  ": signed int [-INF, n_"

The test is merely intended as a simple verification that we can read
dump files via gcc_jit_context_enable_dump.

This patch loosens the requirements on the dump so that it should work
with either version of value_range_base::dump.

gcc/testsuite/ChangeLog:
PR jit/88747
* jit.dg/test-sum-of-squares.c (verify_code): Update expected vrp
dump to reflect r266077.

From-SVN: r267671

5 years agoDaily bump.
GCC Administrator [Tue, 8 Jan 2019 00:16:40 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r267670

5 years agore PR c/88701 (Internal compiler error for valid program using compound literal with...
Jakub Jelinek [Mon, 7 Jan 2019 22:55:48 +0000 (23:55 +0100)]
re PR c/88701 (Internal compiler error for valid program using compound literal with variably modified type.)

PR c/88701
* c-decl.c (build_compound_literal): If not TREE_STATIC, only pushdecl
if current_function_decl is non-NULL.

* gcc.dg/pr88701.c: New test.

From-SVN: r267667

5 years agogenattrtab bit-rot, and if_then_else in values
Alan Modra [Mon, 7 Jan 2019 22:54:40 +0000 (09:24 +1030)]
genattrtab bit-rot, and if_then_else in values

This patch started off just by adding if_then_else support in
write_attr_value to be able to write a saner expression for powerpc
tls_gdld_nomark length.  Then I noticed bit-rot in functions used to
calculate insn_default_length, insn_min_length, and length_unit_log
(which are used by the shorten_branches pass).  These functions
don't handle a const_int length value and return an "unknown" status
that isn't used, or in the case of or_attr_value, doesn't need to be
used.  min_attr_value also attempts to return INT_MAX for the
unhandled rtl case, but this can get lost in recursive calls.  I fixed
that problem by returning INT_MIN instead, and translating that to
INT_MAX in the only caller of min_attr_value.

PR target/88614
* genattrtab.c (max_attr_value, min_attr_value, or_attr_value):
Delete "unknownp" parameter.  Adjust callers.  Handle
CONST_INT, PLUS, MINUS, and MULT.
(attr_value_aligned): Renamed from or_attr_value.
(min_attr_value): Return INT_MIN for unhandled rtl case..
(min_fn): ..and translate to INT_MAX here.
(write_length_unit_log): Modify to cope without "unknown".
(write_attr_value): Handle IF_THEN_ELSE.

From-SVN: r267666

5 years agoFix diagnostics for never-defined inline and nested functions (PR c/88720, PR c/88726).
Joseph Myers [Mon, 7 Jan 2019 22:39:43 +0000 (22:39 +0000)]
Fix diagnostics for never-defined inline and nested functions (PR c/88720, PR c/88726).

Bugs 88720 and 88726 report issues where a function is declared inline
in an inner scope, resulting in spurious diagnostics about it being
declared but never defined when that scope is left (possibly in some
cases also wrongly referring to the function as a nested function).
These are regressions that were introduced with the support for C99
inline semantics in 4.3 (they don't appear with 4.2; it's possible
some aspects of the bugs might have been introduced later than 4.3).

For the case of functions being wrongly referred to as nested,
DECL_EXTERNAL was not the right condition for a function being
non-nested; TREE_PUBLIC is appropriate for the case of non-nested
functions with external linkage, while !b->nested means this is the
outermost scope in which the function was declared and so avoids
catching the case of a file-scope static being redeclared inline
inside a function.

For the non-nested, external-linkage case, the code attempts to avoid
duplicate diagnostics by diagnosing only when scope != external_scope,
but actually scope == external_scope is more appropriate, as it's only
when the file and external scopes are popped that the code can
actually tell whether a function ended up being defined, and all such
functions will appear in the (GCC-internal) external scope.

Bootstrapped with no regressions on x86_64-pc-linux-gnu.

PR c/88720
PR c/88726
gcc/c:
* c-decl.c (pop_scope): Use TREE_PUBLIC and b->nested to determine
whether a function is nested, not DECL_EXTERNAL.  Diagnose inline
functions declared but never defined only for external scope, not
for other scopes.

gcc/testsuite:
* gcc.dg/inline-40.c, gcc.dg/inline-41.c: New tests.

From-SVN: r267665

5 years ago* es.po: Update.
Joseph Myers [Mon, 7 Jan 2019 22:32:55 +0000 (22:32 +0000)]
* es.po: Update.

From-SVN: r267663

5 years agodecl.c (start_decl): Improve two error_at locations.
Paolo Carlini [Mon, 7 Jan 2019 22:28:30 +0000 (22:28 +0000)]
decl.c (start_decl): Improve two error_at locations.

/cp
2019-01-07  Paolo Carlini  <paolo.carlini@oracle.com>

* decl.c (start_decl): Improve two error_at locations.
(expand_static_init): Likewise.

/testsuite
2019-01-07  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/diagnostic/constexpr1.C: New.
* g++.dg/diagnostic/thread1.C: Likewise.

From-SVN: r267662

5 years agoruntime: in doscanstackswitch, set gp->m before gogo
Ian Lance Taylor [Mon, 7 Jan 2019 22:07:26 +0000 (22:07 +0000)]
runtime: in doscanstackswitch, set gp->m before gogo

    This is following CL 156038. doscanstackswitch uses the same
    mechanism of switching goroutines as getTraceback, and so has
    the same problem as described in issue golang/go#29448. This CL
    applies the same fix.

    Reviewed-on: https://go-review.googlesource.com/c/156697

From-SVN: r267661

5 years agocompiler: move slice construction to callers of makeslice
Ian Lance Taylor [Mon, 7 Jan 2019 21:44:06 +0000 (21:44 +0000)]
compiler: move slice construction to callers of makeslice

    This is the gccgo version of https://golang.org/cl/141822:

        Only return a pointer p to the new slices backing array from makeslice.
        Makeslice callers then construct sliceheader{p, len, cap} explictly
        instead of makeslice returning the slice.

    This change caused the GCC backend to break the runtime/pprof test by
    merging together the identical functions allocateReflectTransient and
    allocateTransient2M.  This caused the traceback to be other than
    expected.  Fix that by making the functions not identical.

    This is a step toward updating libgo to the Go1.12beta1 release.

    Reviewed-on: https://go-review.googlesource.com/c/155937

From-SVN: r267660

5 years agoruntime: in getTraceback, set gp->m before gogo
Ian Lance Taylor [Mon, 7 Jan 2019 20:12:39 +0000 (20:12 +0000)]
runtime: in getTraceback, set gp->m before gogo

    Currently, when collecting a traceback for another goroutine,
    getTraceback calls gogo(gp) switching to gp, which will resume in
    mcall, which will call gtraceback, which will set up gp->m. There
    is a gap between setting the current running g to gp and setting
    gp->m. If a profiling signal arrives in between, sigtramp will
    see a non-nil gp with a nil m, and will seg fault. Fix this by
    setting up gp->m first.

    Fixes golang/go#29448.

    Reviewed-on: https://go-review.googlesource.com/c/156038

From-SVN: r267658

5 years agore PR fortran/45424 ([F08] Add IS_CONTIGUOUS intrinsic)
Thomas Koenig [Mon, 7 Jan 2019 19:30:28 +0000 (19:30 +0000)]
re PR fortran/45424 ([F08] Add IS_CONTIGUOUS intrinsic)

2019-01-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de>
Tobias Burnus <burnus@gcc.gnu.org>

PR fortran/45424
* check.c (gfc_check_is_contiguous): New function.
* expr.c (gfc_is_not_contiguous): New function.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IS_CONTIGUOUS.
Add prototype for gfc_is_not_contiguous.
* intrinsic.c (do_ts29113_check): Add GFC_ISYM_IS_CONTIGUOUS.
(add_function): Add is_contiguous.
* intrinsic.h: Add prototypes for gfc_check_is_contiguous,
gfc_simplify_is_contiguous and gfc_resolve_is_contiguous.
* intrinsic.texi: Add IS_CONTIGUOUS.
* iresolve.c (gfc_resolve_is_contiguous): New function.
* simplify.c (gfc_simplify_is_contiguous): New function.
* trans-decl.c (gfor_fncecl_is_contiguous0): New variable.
(gfc_build_intrinsic_function_decl): Add it.
* trans-intrinsic.c (gfc_conv_intrinsic_is_contiguous): New
function.
(gfc_conv_intrinsic_function): Handle GFC_ISYM_IS_CONTIGUOUS.

2019-01-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de>
Tobias Burnus <burnus@gcc.gnu.org>

PR fortran/45424
* Makefile.am: Add intrinsics/is_contiguous.c.
* Makefile.in: Regenerated.
* gfortran.map: Add _gfortran_is_contiguous0.
* intrinsics/is_contiguous.c: New file.
* libgfortran.h: Add prototype for is_contiguous0.

2019-01-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de>
Tobias Burnus <burnus@gcc.gnu.org>

* gfortran.dg/is_contiguous_1.f90: New test.
* gfortran.dg/is_contiguous_2.f90: New test.
* gfortran.dg/is_contiguous_3.f90: New test.

Co-Authored-By: Harald Anlauf <anlauf@gmx.de>
Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org>
From-SVN: r267657

5 years agoPR c++/88741 - wrong error with initializer-string.
Marek Polacek [Mon, 7 Jan 2019 19:25:41 +0000 (19:25 +0000)]
PR c++/88741 - wrong error with initializer-string.

* decl.c (cp_complete_array_type): Strip any location wrappers.

* g++.dg/init/array50.C: New test.

From-SVN: r267656

5 years agoFix IFN_MASK_STORE handling of IFN_GOMP_SIMD_LANE
Richard Sandiford [Mon, 7 Jan 2019 18:53:44 +0000 (18:53 +0000)]
Fix IFN_MASK_STORE handling of IFN_GOMP_SIMD_LANE

The IFN_GOMP_SIMD_LANE handling in vectorizable_store tries to use MEM_REF
offsets to maintain pointer disambiguation info.  This patch makes sure
that we don't try to do the same optimisation for IFN_MASK_STOREs, which
have no similar offset argument.

The patch fixes libgomp.c-c++-common/pr66199-*.c for SVE.  Previously
we had an ncopies==2 store and stored both halves to the same address.

2019-01-07  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-stmts.c (vectorizable_store): Don't use the dataref_offset
optimization for masked stores.

From-SVN: r267654

5 years agore PR c++/88261 (ICE: verify_gimple failed (error: non-trivial conversion at assignment))
Bernd Edlinger [Mon, 7 Jan 2019 17:08:51 +0000 (17:08 +0000)]
re PR c++/88261 (ICE: verify_gimple failed (error: non-trivial conversion at assignment))

        PR c++/88261
        PR c++/69338
        PR c++/69696
        PR c++/69697
        * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
        * typeck2.c (digest_init_r): Raise an error for non-static
        initialization of a flexible array member.
        (process_init_constructor, massage_init_elt,
        process_init_constructor_array, process_init_constructor_record,
        process_init_constructor_union, process_init_constructor): Add the
        flags parameter and pass it thru.
        (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
        digest_init_flags for static decls.

gcc/testsuite:
2019-01-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/88261
        PR c++/69338
        PR c++/69696
        PR c++/69697
        * gcc.dg/array-6.c: Move from here ...
        * c-c++-common/array-6.c: ... to here and add some more test coverage.
        * g++.dg/pr69338.C: New test.
        * g++.dg/pr69697.C: Likewise.
        * g++.dg/ext/flexary32.C: Likewise.
        * g++.dg/ext/flexary3.C: Adjust test.
        * g++.dg/ext/flexary12.C: Likewise.
        * g++.dg/ext/flexary13.C: Likewise.
        * g++.dg/ext/flexary15.C: Likewise.
        * g++.dg/warn/Wplacement-new-size-1.C: Likewise.
        * g++.dg/warn/Wplacement-new-size-2.C: Likewise.
        * g++.dg/warn/Wplacement-new-size-6.C: Likewise.

From-SVN: r267653

5 years agoFix ICE in get_initial_defs_for_reduction (PR 88567)
Richard Sandiford [Mon, 7 Jan 2019 16:00:52 +0000 (16:00 +0000)]
Fix ICE in get_initial_defs_for_reduction (PR 88567)

The use of "j" in:

      init = permute_results[number_of_vectors - j - 1];

was out-of-sync with the new flat loop structure.  Now that all that
reversing is gone, we can just use the result of duplicate_and_interleave
directly.

The other cases shouldn't be affected by postponing the insertion
of ctor_seq, since gimple_build* appends to the seq without clearing
it first (unlike some of the gimplify routines).

The ICE is already covered by gcc.dg/vect/pr63379.c.

2019-01-07  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR middle-end/88567
* tree-vect-loop.c (get_initial_defs_for_reduction): Pass the
output vector directly to duplicate_and_interleave instead of
going through a temporary.  Postpone insertion of ctor_seq to
the end of the loop.

From-SVN: r267652

5 years agoPR libstdc++/87787 avoid undefined null args to memcpy and memmove
Jonathan Wakely [Mon, 7 Jan 2019 14:58:44 +0000 (14:58 +0000)]
PR libstdc++/87787 avoid undefined null args to memcpy and memmove

The C++ char_traits and ctype APIs do not disallow null pointer
arguments, so we need explicit checks to ensure we don't forward null
pointers to memcpy or memmove.

PR libstdc++/87787
* include/bits/char_traits.h (char_traits::move): Do not pass null
pointers to memmove.
* include/bits/locale_facets.h
(ctype<char>::widen(const char*, const char*, char*)): Do not
pass null pointers to memcpy.
(ctype<char>::narrow(const char*, const char*, char, char*)):
Likewise.
(ctype<char>::do_widen(const char*, const char*, char*)):
Likewise.
(ctype<char>::do_narrow(const char*, const char*, char, char*)):
Likewise.

From-SVN: r267651

5 years agoInvestigating PR target/86891 revealed a number of issues with the way the...
Richard Earnshaw [Mon, 7 Jan 2019 14:49:00 +0000 (14:49 +0000)]
Investigating PR target/86891 revealed a number of issues with the way the...

Investigating PR target/86891 revealed a number of issues with the way
the AArch64 backend was handing overflow detection patterns.  Firstly,
expansion for signed and unsigned types is not the same as in one form
the overflow is detected via the C flag and in the other it is done
via the V flag in the PSR.  Secondly, particular care has to be taken
when describing overflow of signed types: the comparison has to be
performed conceptually on a value that cannot overflow and compared to
a value that might have overflowed.

It became apparent that some of the patterns were simply unmatchable
(they collapse to NEG in the RTL rather than subtracting from zero)
and a number of patterns were overly restrictive in terms of the
immediate constants that they supported.  I've tried to address all of
these issues as well.

gcc:

PR target/86891
* config/aarch64/aarch64.c (aarch64_expand_subvti): New parameter
unsigned_p.  Handle signed and unsigned overflow correction as
required.
* config/aarch64/aarch64-protos.h (aarch64_expand_subvti): Update
prototype.
* config/aarch64/aarch64.md (addv<mode>4): Use aarch64_plus_operand
for operand 2.
(add<mode>3_compareV_imm): Make this callable for expanding.
(subv<GPI:mode>4): Use register_operand for operand 1.  Use
aarch64_plus_operand for operand 2.
(subv<GPI:mode>_insn): New insn pattern.
(subv<GPI:mode>_imm): Likewise.
(negv<GPI:mode>3): New expand pattern.
(negv<GPI:mode>_insn): New insn pattern.
(negv<GPI:mode>_cmp_only): Likewise.
(cmpv<GPI:mode>_insn): Likewise.
(subvti4): Use register_operand for operand 1.  Update call to
aarch64_expand_subvti.
(usubvti4): Likewise.
(negvti3): New expand pattern.
(negdi_carryout): New insn pattern.
(negvdi_carryinV): New insn pattern.
(sub<mode3>_compare1_imm): Delete named insn pattern, make anonymous
version the named version.
(peepholes to convert to sub<mode3>_compare1_imm): Adjust order of
operands.
(usub<GPI:mode>3_carryinC, usub<GPI:mode>3_carryinC_z1): New insn
patterns.
(usub<GPI:mode>3_carryinC_z2, usub<GPI:mode>3_carryinC): New insn
patterns.
(sub<mode>3_carryinCV, sub<mode>3_carryinCV_z1_z2): Delete.
(sub<mode>3_carryinCV_z1, sub<mode>3_carryinCV_z2): Delete.
(sub<mode>3_carryinCV): Delete.
(sub<GPI:mode>3_carryinV): New expand pattern.
sub<mode>3_carryinV, sub<mode>3_carryinV_z2): New insn patterns.

testsuite:

* gcc.target/aarch64/subs_compare_2.c: Make '#' immediate prefix
optional in scan pattern.

From-SVN: r267650

5 years agotree-ssa-uncprop.c (ssa_equip_hash_traits): Remove in favor of tree_operand_hash.
Richard Biener [Mon, 7 Jan 2019 14:34:06 +0000 (14:34 +0000)]
tree-ssa-uncprop.c (ssa_equip_hash_traits): Remove in favor of tree_operand_hash.

2019-01-07  Richard Biener  <rguenther@suse.de>

* tree-ssa-uncprop.c (ssa_equip_hash_traits): Remove in favor
of tree_operand_hash.

From-SVN: r267649

5 years agoUpdate documentation for C++17 filesystem library
Jonathan Wakely [Mon, 7 Jan 2019 12:46:40 +0000 (12:46 +0000)]
Update documentation for C++17 filesystem library

* doc/xml/manual/spine.xml: Update copyright years.
* doc/xml/manual/status_cxx2017.xml: Adjust note about -lstdc++fs.
* doc/xml/manual/using.xml: Remove requirement to link with -lstdc++fs
for C++17 filesystem library.
* doc/html/*: Regenerate.

From-SVN: r267648

5 years agoFix build for systems without POSIX truncate
Jonathan Wakely [Mon, 7 Jan 2019 12:38:51 +0000 (12:38 +0000)]
Fix build for systems without POSIX truncate

Older versions of newlib do not provide truncate so add a configure
check for it, and provide a fallback definition.

There were also some missing exports in the linker script, which went
unnoticed because there are no tests for some functions. A new link-only
test checks that every filesystem operation function is defined by the
library.

* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for truncate.
* config.h.in: Regenerate.
* config/abi/pre/gnu.ver: Order patterns for filesystem operations
alphabetically and add missing entries for copy_symlink,
hard_link_count, rename, and resize_file.
* configure: Regenerate.
* src/c++17/fs_ops.cc (resize_file): Remove #if so posix::truncate is
used unconditionally.
* src/filesystem/ops-common.h (__gnu_posix::truncate)
[!_GLIBCXX_HAVE_TRUNCATE]: Provide fallback definition that only
supports truncating to zero length.
* testsuite/27_io/filesystem/operations/all.cc: New test.
* testsuite/27_io/filesystem/operations/resize_file.cc: New test.

From-SVN: r267647

5 years ago[2/2] PR88598: Optimise reduc (bit_and)
Richard Sandiford [Mon, 7 Jan 2019 12:17:10 +0000 (12:17 +0000)]
[2/2] PR88598: Optimise reduc (bit_and)

This patch folds certain reductions of X & CST to X[I] & CST[I] if I is
the only nonzero element of CST.  This includes the motivating case in
which CST[I] is -1.

We could do the same for REDUC_MAX on unsigned types, but I wasn't sure
that that special case was worth it.

2019-01-07  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR tree-optimization/88598
* tree.h (single_nonzero_element): Declare.
* tree.c (single_nonzero_element): New function.
* match.pd: Fold certain reductions of X & CST to X[I] & CST[I]
if I is the only nonzero element of CST.

gcc/testsuite/
PR tree-optimization/88598
* gcc.dg/vect/pr88598-1.c: New test.
* gcc.dg/vect/pr88598-2.c: Likewise.
* gcc.dg/vect/pr88598-3.c: Likewise.
* gcc.dg/vect/pr88598-4.c: Likewise.
* gcc.dg/vect/pr88598-5.c: Likewise.
* gcc.dg/vect/pr88598-6.c: Likewise.

From-SVN: r267646

5 years ago[1/2] PR88598: Optimise x * { 0 or 1, 0 or 1, ... }
Richard Sandiford [Mon, 7 Jan 2019 12:16:30 +0000 (12:16 +0000)]
[1/2] PR88598: Optimise x * { 0 or 1, 0 or 1, ... }

The PR has:

    vect__6.24_42 = vect__5.23_41 * { 0.0, 1.0e+0, 0.0, 0.0 };

which for -fno-signed-zeros -fno-signaling-nans can be simplified to:

    vect__6.24_42 = vect__5.23_41 & { 0, -1, 0, 0 };

I deliberately didn't handle COMPLEX_CST or CONSTRUCTOR in
initializer_each_zero_or_onep since there are no current use cases.

The patch also makes (un)signed_type_for handle floating-point types.
I tried to audit all callers and the few that handle null returns would
be unaffected.

2019-01-07  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR tree-optimization/88598
* tree.h (initializer_each_zero_or_onep): Declare.
* tree.c (initializer_each_zero_or_onep): New function.
(signed_or_unsigned_type_for): Handle float types too.
(unsigned_type_for, signed_type_for): Update comments accordingly.
* match.pd: Fold x * { 0 or 1, 0 or 1, ...} to
x & { 0 or -1, 0 or -1, ... }.

gcc/testsuite/
PR tree-optimization/88598
* gcc.dg/pr88598-1.c: New test.
* gcc.dg/pr88598-2.c: Likewise.
* gcc.dg/pr88598-3.c: Likewise.
* gcc.dg/pr88598-4.c: Likewise.
* gcc.dg/pr88598-5.c: Likewise.

From-SVN: r267645

5 years agoReplace outdated references to x86_64-unknown-linux-gnu in docs
Jonathan Wakely [Mon, 7 Jan 2019 10:32:30 +0000 (10:32 +0000)]
Replace outdated references to x86_64-unknown-linux-gnu in docs

* doc/install.texi: Replace references to x86_64-unknown-linux-gnu
with x86_64-pc-linux-gnu.

From-SVN: r267643

5 years ago[nvptx] Force vl32 if calling vector-partitionable routines
Tom de Vries [Mon, 7 Jan 2019 10:01:49 +0000 (10:01 +0000)]
[nvptx] Force vl32 if calling vector-partitionable routines

With PTX_MAX_VECTOR_LENGTH set to larger than PTX_WARP_SIZE, routines can be
called from offloading regions with vector-size set to larger than warp size.
OTOH, vector-partitionable routines assume warp-sized vector length.

Detect if we're calling a vector-partitionable routine from an offloading
region, and if so, fall back to warp-sized vector length in that region.

2019-01-07  Tom de Vries  <tdevries@suse.de>

PR target/85486
* config/nvptx/nvptx.c (has_vector_partitionable_routine_calls_p): New
function.
(nvptx_goacc_validate_dims): Force vl32 if calling vector-partitionable
routines.

From-SVN: r267640

5 years agosse.md (vec_extract<mode><ssehalfvecmodelower>): Use V_256_512 iterator instead of...
Jakub Jelinek [Mon, 7 Jan 2019 09:52:29 +0000 (10:52 +0100)]
sse.md (vec_extract<mode><ssehalfvecmodelower>): Use V_256_512 iterator instead of V_512 and TARGET_AVX instead of...

* config/i386/sse.md (vec_extract<mode><ssehalfvecmodelower>): Use
V_256_512 iterator instead of V_512 and TARGET_AVX instead of
TARGET_AVX512F as condition.

From-SVN: r267639

5 years agore PR debug/88723 (PR debug/88635 patch breaks testsuite_shared.cc compilation)
Jakub Jelinek [Mon, 7 Jan 2019 09:51:46 +0000 (10:51 +0100)]
re PR debug/88723 (PR debug/88635 patch breaks testsuite_shared.cc compilation)

PR debug/88723
* dwarf2out.c (const_ok_for_output_1): Remove redundant call to
const_not_ok_for_debug_p target hook.
(mem_loc_descriptor) <case UNSPEC>: Only call const_ok_for_output_1
on UNSPEC and subexpressions thereof if all subexpressions of the
UNSPEC are CONSTANT_P.

From-SVN: r267638

5 years agore PR tree-optimization/88676 (missed opportunity in integer conditional)
Jakub Jelinek [Mon, 7 Jan 2019 08:51:59 +0000 (09:51 +0100)]
re PR tree-optimization/88676 (missed opportunity in integer conditional)

PR tree-optimization/88676
* tree-ssa-phiopt.c (two_value_replacement): New function.
(tree_ssa_phiopt_worker): Call it.

* gcc.dg/tree-ssa/pr88676.c: New test.
* gcc.dg/pr88676.c: New test.
* gcc.dg/tree-ssa/pr15826.c: Just verify there is no goto,
allow &.

From-SVN: r267634

5 years agore PR sanitizer/88619 (ICE in asan_emit_stack_protection, at asan.c:1574 since r266664)
Jakub Jelinek [Mon, 7 Jan 2019 08:50:57 +0000 (09:50 +0100)]
re PR sanitizer/88619 (ICE in asan_emit_stack_protection, at asan.c:1574 since r266664)

PR sanitizer/88619
* cfgexpand.c (expand_stack_vars): Only align prev_offset to
ASAN_MIN_RED_ZONE_SIZE, not to maximum of that and alignb.

* c-c++-common/asan/pr88619.c: New test.

From-SVN: r267633

5 years agore PR c++/85052 (Implement support for clang's __builtin_convertvector)
Jakub Jelinek [Mon, 7 Jan 2019 08:49:08 +0000 (09:49 +0100)]
re PR c++/85052 (Implement support for clang's __builtin_convertvector)

PR c++/85052
* tree-vect-generic.c: Include insn-config.h and recog.h.
(expand_vector_piecewise): Add defaulted ret_type argument,
if non-NULL, use that in preference to type for the result type.
(expand_vector_parallel): Formatting fix.
(do_vec_conversion, do_vec_narrowing_conversion,
expand_vector_conversion): New functions.
(expand_vector_operations_1): Call expand_vector_conversion
for VEC_CONVERT ifn calls.
* internal-fn.def (VEC_CONVERT): New internal function.
* internal-fn.c (expand_VEC_CONVERT): New function.
* fold-const-call.c (fold_const_vec_convert): New function.
(fold_const_call): Use it for CFN_VEC_CONVERT.
* doc/extend.texi (__builtin_convertvector): Document.
c-family/
* c-common.h (enum rid): Add RID_BUILTIN_CONVERTVECTOR.
(c_build_vec_convert): Declare.
* c-common.c (c_build_vec_convert): New function.
c/
* c-parser.c (c_parser_postfix_expression): Parse
__builtin_convertvector.
cp/
* cp-tree.h (cp_build_vec_convert): Declare.
* parser.c (cp_parser_postfix_expression): Parse
__builtin_convertvector.
* constexpr.c: Include fold-const-call.h.
(cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
(potential_constant_expression_1): Likewise.
* semantics.c (cp_build_vec_convert): New function.
* pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
IFN_VEC_CONVERT.
testsuite/
* c-c++-common/builtin-convertvector-1.c: New test.
* c-c++-common/torture/builtin-convertvector-1.c: New test.
* g++.dg/ext/builtin-convertvector-1.C: New test.
* g++.dg/cpp0x/constexpr-builtin4.C: New test.

From-SVN: r267632

5 years ago[nvptx] Handle large vector reductions
Tom de Vries [Mon, 7 Jan 2019 08:11:06 +0000 (08:11 +0000)]
[nvptx] Handle large vector reductions

Add support for vector reductions with openacc vector_length larger than
warp-size.

2019-01-07  Tom de Vries  <tdevries@suse.de>

* config/nvptx/nvptx-protos.h (nvptx_output_red_partition): Declare.
* config/nvptx/nvptx.c (vector_red_size, vector_red_align,
vector_red_partition, vector_red_sym): New global variables.
(nvptx_option_override): Initialize vector_red_sym.
(nvptx_declare_function_name): Restore red_partition register.
(nvptx_file_end): Emit code to declare the vector reduction variables.
(nvptx_output_red_partition): New function.
(nvptx_expand_shared_addr): Add vector argument. Use it to handle
large vector reductions.
(enum nvptx_builtins): Add NVPTX_BUILTIN_VECTOR_ADDR.
(nvptx_init_builtins): Add VECTOR_ADDR.
(nvptx_expand_builtin): Update call to nvptx_expand_shared_addr.
Handle nvptx_expand_shared_addr.
(nvptx_get_shared_red_addr): Add vector argument and handle large
vectors.
(nvptx_goacc_reduction_setup): Add offload_attrs argument and handle
large vectors.
(nvptx_goacc_reduction_init): Likewise.
(nvptx_goacc_reduction_fini): Likewise.
(nvptx_goacc_reduction_teardown): Likewise.
(nvptx_goacc_reduction): Update calls to nvptx_goacc_reduction_{setup,
init,fini,teardown}.
(nvptx_init_axis_predicate): Initialize vector_red_partition.
(nvptx_set_current_function): Init vector_red_partition.
* config/nvptx/nvptx.md (UNSPECV_RED_PART): New unspecv.
(nvptx_red_partition): New insn.
* config/nvptx/nvptx.h (struct machine_function): Add red_partition.

From-SVN: r267631

5 years ago[nvptx] Don't emit barriers for empty loops -- fix
Tom de Vries [Mon, 7 Jan 2019 08:10:56 +0000 (08:10 +0000)]
[nvptx] Don't emit barriers for empty loops -- fix

When compiling an empty loop:
...
  long long v1;
  #pragma acc parallel num_gangs (640) num_workers(1) vector_length (128)
  #pragma acc loop
    for (v1 = 0; v1 < 20; v1 += 2)
        ;
...
the compiler emits two subsequent bar.syncs.  This triggers some bug on my
quadro m1200 (I'm assuming in the ptxas/JIT compiler) that hangs the testcase.

This patch works around the bug by doing an optimization: we detect that this is
an empty loop (a forked immediately followed by a joining), and don't emit the
barriers.

The patch does not include the test-case yet, since vector_length (128) is not
yet supported at this point.

2019-01-07  Tom de Vries  <tdevries@suse.de>

PR target/85381
* config/nvptx/nvptx.c (nvptx_process_pars): Don't emit barriers for
empty loops.

From-SVN: r267630

5 years ago[nvptx] Add support for a per-worker broadcast buffer and barrier
Tom de Vries [Mon, 7 Jan 2019 08:10:47 +0000 (08:10 +0000)]
[nvptx] Add support for a per-worker broadcast buffer and barrier

Add support for a per-worker broadcast buffer and barrier, to be used for
openacc vector_length larger than warp-size.

2019-01-07  Tom de Vries  <tdevries@suse.de>

* config/nvptx/nvptx.c (oacc_bcast_partition): Declare.
(nvptx_option_override): Init oacc_bcast_partition.
(nvptx_init_oacc_workers): New function.
(nvptx_declare_function_name): Call nvptx_init_oacc_workers.
(nvptx_needs_shared_bcast): New function.
(nvptx_find_par): Generalize to enable vectors to use shared-memory
to propagate state.
(nvptx_shared_propagate): Initialize vector bcast partition and
synchronization state.
(nvptx_single):  Generalize to enable vectors to use shared-memory
to propagate state.
(nvptx_process_pars): Likewise.
(nvptx_set_current_function): Initialize oacc_broadcast_partition.
* config/nvptx/nvptx.h (struct machine_function): Add
bcast_partition and sync_bar members.

From-SVN: r267629