gcc.git
5 years agoiconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS.
Hafiz Abid Qadeer [Wed, 7 Nov 2018 22:41:21 +0000 (22:41 +0000)]
iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS.

2018-11-06  Hafiz Abid Qadeer  <abidh@codesourcery.com>

* config/iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS.
Append $INCICONV to it.

gcc/
* configure: Regenerated.

libcpp/
* configure: Likewise.

libstdc++-v3/
* configure: Likewise.

intl/
* configure: Likewise.

From-SVN: r265896

5 years agopr65595.c: Change type of "num" argument to memcpy from "unsigned long" to __SIZE_TYPE__.
Jozef Lawrynowicz [Wed, 7 Nov 2018 22:26:16 +0000 (22:26 +0000)]
pr65595.c: Change type of "num" argument to memcpy from "unsigned long" to __SIZE_TYPE__.

2018-11-07  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

* gcc.c-torture/compile/pr65595.c: Change type of "num" argument to
memcpy from "unsigned long" to __SIZE_TYPE__.

From-SVN: r265895

5 years agore PR c/87691 (transparent_union attribute does not work with MODE_PARTIAL_INT)
Jozef Lawrynowicz [Wed, 7 Nov 2018 22:06:26 +0000 (22:06 +0000)]
re PR c/87691 (transparent_union attribute does not work with MODE_PARTIAL_INT)

2018-11-07  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

PR c/87691

gcc/ChangeLog:
* stor-layout.c (compute_record_mode): Set TYPE_MODE of UNION_TYPE
to the mode of the widest field iff the widest field has mode class
MODE_INT, or MODE_PARTIAL_INT and the union would be passed by
reference.

gcc/testsuite/ChangeLog:
* gcc.target/msp430/pr87691.c: New test.

From-SVN: r265894

5 years agocommon.opt: Add -Wattribute-warning.
Nikolai Merinov [Wed, 7 Nov 2018 21:02:27 +0000 (21:02 +0000)]
common.opt: Add -Wattribute-warning.

         * common.opt: Add -Wattribute-warning.
         * doc/invoke.texi: Add documentation for -Wno-attribute-warning.
         * expr.c (expand_expr_real_1): Add new attribute to warning_at
         call to allow user configure behavior of "warning" attribute.

         * gcc.dg/Wno-attribute-warning.c: New test.

From-SVN: r265891

5 years agoFix linker script to use [jmy] to match size_t parameters
Jonathan Wakely [Wed, 7 Nov 2018 19:08:52 +0000 (19:08 +0000)]
Fix linker script to use [jmy] to match size_t parameters

* config/abi/pre/gnu.ver: Fix patterns for size_t parameters.

From-SVN: r265884

5 years agodoc: Use @: where needed
Segher Boessenkool [Wed, 7 Nov 2018 18:17:29 +0000 (19:17 +0100)]
doc: Use @: where needed

When an abbreviation ends with a dot followed by whitespace, Texinfo
thinks the dot ends a sentence, and applies spacing rules etc. based
on that.  To prevent this, there is the @: macro.

This patch puts @: after every vs., e.g., and i.e. where it is needed.
In a few cases there was "@ " already, or "@\n", but @: is slightly
better, and more consistent.

* target.def: Put @: after every vs., e.g., and i.e. where it is
followed by whitespace.
* doc/extend.texi: Ditto.
* doc/fragments.texi: Ditto.
* doc/gimple.texi: Ditto.
* doc/implement-c.texi: Ditto.
* doc/install.texi: Ditto.
* doc/invoke.texi: Ditto.
* doc/md.texi: Ditto.
* doc/plugins.texi: Ditto.
* doc/rtl.texi: Ditto.
* doc/sourcebuild.texi: Ditto.
* doc/tm.texi.in: Ditto.
* doc/ux.texi: Ditto.
* doc/tm.texi: Regenerate.

From-SVN: r265882

5 years ago[arm] Add support for Arm Ares
Kyrylo Tkachov [Wed, 7 Nov 2018 17:56:51 +0000 (17:56 +0000)]
[arm] Add support for Arm Ares

This adds support for the Arm Ares CPU for in the arm port.
It implements the Armv8.2-A architecture with the optional features
of statistical profiling, dot product and FP16 on by default.

Note: Ares is a codename to enable early adopters and in time
we will add the final product name once it's announced.

* config/arm/arm-cpus.in (ares): New entry.
* config/arm/arm-tables.opt: Regenerate.
* config/arm/arm-tune.md: Likewise.
* doc/invoke.texi (ARM Options): Document ares.

From-SVN: r265881

5 years ago[AArch64] Add -mcpu/-mtune support for Arm Ares
Kyrylo Tkachov [Wed, 7 Nov 2018 17:55:27 +0000 (17:55 +0000)]
[AArch64] Add -mcpu/-mtune support for Arm Ares

This adds support for the Arm Ares CPU for AArch64.
It implements the Armv8.2-A architecture with the optional features
of statistical profiling, dot product and FP16 on by default.

Note: Ares is a codename to enable early adopters and in time
we will add the final product name once it's announced.

* config/aarch64/aarch64-cores.def (ares): Define.
* config/aarch64/aarch64-tune.md: Regenerate.
* doc/invoke.texi (AArch64 Options): Document ares value for mtune.

From-SVN: r265880

5 years ago[PR C++/87904] lookup ICE
Nathan Sidwell [Wed, 7 Nov 2018 16:28:46 +0000 (16:28 +0000)]
[PR C++/87904] lookup ICE

https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00468.html
PR c++/87904
* cp-tree.h (struct tree_overload): Fix comment.
* tree.c (ovl_iterator::reveal_node): Propagate OVL_DEDUP_P.

PR c++/87904
* g++.dg/lookup/pr87904.C: New.

From-SVN: r265879

5 years agopr87874.c: Compile only for int128 effective target.
Uros Bizjak [Wed, 7 Nov 2018 15:46:55 +0000 (16:46 +0100)]
pr87874.c: Compile only for int128 effective target.

* gcc.dg/pr87874.c: Compile only for int128 effective target.

From-SVN: r265878

5 years agotree.c (fld_incomplete_type_of): Clear TREE_ADDRESSABLE.
Jan Hubicka [Wed, 7 Nov 2018 15:22:25 +0000 (16:22 +0100)]
tree.c (fld_incomplete_type_of): Clear TREE_ADDRESSABLE.

* tree.c (fld_incomplete_type_of): Clear TREE_ADDRESSABLE.
(free_lang_data_in_decl): Set TREE_ADDRESSABLE for public vars and
functions; clear TYPE_DECL_SUPPRESS_DEBUG and DECL_MODE for
TYPE_DECL.

From-SVN: r265877

5 years agore PR tree-optimization/87914 (gcc fails to vectorize bitreverse code)
Richard Biener [Wed, 7 Nov 2018 15:01:09 +0000 (15:01 +0000)]
re PR tree-optimization/87914 (gcc fails to vectorize bitreverse code)

2018-11-07  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87914
* tree-vect-loop.c (vect_is_simple_reduction): Improve detection
of nested cycles.
(vectorizable_reduction): Handle shifts and rotates by dispatching
to vectorizable_shift.
* tree-vect-stmts.c (vect_get_vec_def_for_operand_1): Handle
in-loop uses of vect_nested_cycle defs.  Merge cycle and internal
def cases.
(vectorizable_shift): Export and handle being called as
vect_nested_cycle.
(vect_analyze_stmt): Call vectorizable_shift after
vectorizable_reduction.
* tree-vectorizer.h (vectorizable_shift): Declare.

* lib/target-supports.exp (check_effective_target_vect_var_shift): New.
(check_avx2_available): Likewise.
* g++.dg/vect/pr87914.cc: New testcase.

From-SVN: r265876

5 years agoipa-devirt.c (odr_types_equivalent_p): Expect constants than const decls in TREE_VALU...
Jan Hubicka [Wed, 7 Nov 2018 14:12:20 +0000 (15:12 +0100)]
ipa-devirt.c (odr_types_equivalent_p): Expect constants than const decls in TREE_VALUE of enum.

* ipa-devirt.c (odr_types_equivalent_p): Expect constants
than const decls in TREE_VALUE of enum.
(dump_type_inheritance_graph): Improve duplicate dumping.
(free_enum_values): New.
(build_type_inheritance_graph): Use it.
* tree.c (free_lang_data_in_type): Free TYPE_VALUES of enums
which are not main variants or not ODR types.
(verify_type_variant): Expect variants to have no TYPE_VALUES.

From-SVN: r265875

5 years agoUpdate libquadmath fmaq from glibc, fix nanq issues.
Joseph Myers [Wed, 7 Nov 2018 13:49:03 +0000 (13:49 +0000)]
Update libquadmath fmaq from glibc, fix nanq issues.

This patch extends update-quadmath.py to update fmaq from glibc.

The issue in that function was that quadmath-imp.h had a struct in a
union with mant_high and mant_low fields (up to 64-bit) whereas glibc
has mantissa0, mantissa1, mantissa2 and mantissa3 (up to 32-bit).  The
patch changes those fields to be the same as in glibc, moving printf /
strtod code that also uses those fields back to closer to the glibc
form.  This allows fmaq to be updated automatically from glibc (which
brings in at least one bug fix from glibc from 2015).

nanq was also using the mant_high field name, and had other issues: it
only partly initialized the union from which a value was returned, and
setting mant_high to 1 meant a signaling NaN would be returned rather
than a quiet NaN.  This patch fixes those issues as part of updating
it to use the changed interfaces (but does not fix the issue of not
using the argument).

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

* quadmath-imp.h (ieee854_float128): Use mantissa0, mantissa1,
mantissa2 and mantissa3 fields instead of mant_high and mant_low.
Change nan field to ieee_nan.
* update-quadmath.py (update_sources): Also update fmaq.c.
* math/nanq.c (nanq): Use ieee_nan field of union.
Zero-initialize f.  Set quiet_nan field.
* printf/flt1282mpn.c, printf/printf_fphex.c, strtod/mpn2flt128.c,
strtod/strtoflt128.c: Use mantissa0, mantissa1, mantissa2 and
mantissa3 fields.  Use ieee_nan and quiet_nan field.
* math/fmaq.c: Regenerate from glibc sources with
update-quadmath.py.

From-SVN: r265874

5 years agoipa-inline.c (want_inline_small_function_p): Compute big_speedup_p lazily and last.
Richard Biener [Wed, 7 Nov 2018 13:18:36 +0000 (13:18 +0000)]
ipa-inline.c (want_inline_small_function_p): Compute big_speedup_p lazily and last.

2018-11-07  Richard Biener  <rguenther@suse.de>

* ipa-inline.c (want_inline_small_function_p): Compute
big_speedup_p lazily and last.

From-SVN: r265873

5 years agotree.c (fld_type_variant_equal_p): Skip TYPE_ALIGN check when building incomplete...
Jan Hubicka [Wed, 7 Nov 2018 12:25:35 +0000 (13:25 +0100)]
tree.c (fld_type_variant_equal_p): Skip TYPE_ALIGN check when building incomplete variant of complete type.

* tree.c (fld_type_variant_equal_p): Skip TYPE_ALIGN check when
building incomplete variant of complete type.
(fld_type_variant): Do not copy TYPE_ALIGN when building incomplete
variant of complete type.

From-SVN: r265872

5 years agoFix some typo and brain twister logical.
Chenghua Xu [Wed, 7 Nov 2018 10:29:52 +0000 (10:29 +0000)]
Fix some typo and brain twister logical.

gcc/
* config/mips/mips.c: Fix typo in documentation of
mips_loongson_ext2_prefetch_cookie.
(mips_option_override): fix brain twister logical.
* config/mips/mips.h: Fix typo in documentation of
ISA_HAS_CTZ_CTO and define pattern.
* config/mips/mips.md (prefetch): Hoist EXT2 above
the 2EF/EXT block.
(prefetch_indexed): Hoist EXT2 above the EXT block.

gcc/testsuite/
* gcc.target/mips/loongson-ctz.c: Fix typo.
* gcc.target/mips/loongson-dctz.c: Fix typo.

From-SVN: r265871

5 years agotree.c (free_lang_data_in_type): Add fld parameter; simplify return and parameter...
Jan Hubicka [Wed, 7 Nov 2018 10:13:15 +0000 (11:13 +0100)]
tree.c (free_lang_data_in_type): Add fld parameter; simplify return and parameter types of function and method types.

* tree.c (free_lang_data_in_type): Add fld parameter; simplify
return and parameter types of function and method types.
(free_lang_data_in_cgraph): Update.

From-SVN: r265870

5 years agoFix UBSAN in postreload-gcse.c (PR rtl-optimization/87868).
Martin Liska [Wed, 7 Nov 2018 09:33:22 +0000 (10:33 +0100)]
Fix UBSAN in postreload-gcse.c (PR rtl-optimization/87868).

2018-11-07  Martin Liska  <mliska@suse.cz>

PR rtl-optimization/87868
* postreload-gcse.c (eliminate_partially_redundant_load): Set
threshold to max_count if we would overflow.
* profile-count.h: Make max_count a public constant.

From-SVN: r265869

5 years agoFix GNU coding style (V2).
Martin Liska [Wed, 7 Nov 2018 09:16:14 +0000 (10:16 +0100)]
Fix GNU coding style (V2).

2018-11-07  Martin Liska  <mliska@suse.cz>

* mem-stats.h: Fix GNU coding style.

From-SVN: r265868

5 years agoAdd support for Loongson 2K1000 processor.
Chenghua Xu [Wed, 7 Nov 2018 08:58:05 +0000 (08:58 +0000)]
Add support for Loongson 2K1000 processor.

gcc/
* config/mips/gs264e.md: New.
* config/mips/mips-cpus.def: Define gs264e.
* config/mips/mips-tables.opt: Regenerate.
* config/mips/mips.c (mips_rtx_cost_data): Add DEFAULT_COSTS for
gs264e.
(mips_issue_rate): Add support for gs264e.
(mips_multipass_dfa_lookahead): Likewise.
* config/mips/mips.h: Define TARGET_GS264E and TUNE_GS264E.
(MIPS_ISA_LEVEL_SPEC): Infer mips64r2 from gs264e.
(MIPS_ASE_MSA_SPEC): New.
(BASE_DRIVER_SELF_SPECS): march=gs264e implies -mmsa.
(ISA_HAS_FUSED_MADD4): Enable for TARGET_GS264E.
(ISA_HAS_UNFUSED_MADD4): Exclude TARGET_GS264E.
* config/mips/mips.md: Include gs264e.md.
(processor): Add gs264e.
* config/mips/mips.opt (MSA): Use Mask instead of Var.
* doc/invoke.texi: Add gs264e to supported architectures.

From-SVN: r265867

5 years agoAdd support for Loongson 3A2000/3A3000 processor.
Chenghua Xu [Wed, 7 Nov 2018 08:53:42 +0000 (08:53 +0000)]
Add support for Loongson 3A2000/3A3000 processor.

gcc/
* config/mips/gs464e.md: New.
* config/mips/mips-cpus.def: Define gs464e.
* config/mips/mips-tables.opt: Regenerate.
* config/mips/mips.c (mips_rtx_cost_data): Add DEFAULT_COSTS for
gs464e.
(mips_issue_rate): Add support for gs464e.
(mips_multipass_dfa_lookahead): Likewise.
(mips_option_override): Enable MMI, EXT and EXT2 for gs464e.
* config/mips/mips.h: Define TARGET_GS464E and TUNE_GS464E.
(MIPS_ISA_LEVEL_SPEC): Infer mips64r2 from gs464e.
(ISA_HAS_FUSED_MADD4): Enable for TARGET_GS464E.
(ISA_HAS_UNFUSED_MADD4): Exclude TARGET_GS464E.
* config/mips/mips.md: Include gs464e.md.
(processor): Add gs464e.
* doc/invoke.texi: Add gs464e to supported architectures.

From-SVN: r265866

5 years agoAdd support for Loongson 3A1000 processor.
Chenghua Xu [Wed, 7 Nov 2018 08:47:21 +0000 (08:47 +0000)]
Add support for Loongson 3A1000 processor.

gcc/
* config/mips/loongson3a.md: Rename to ...
* config/mips/gs464.md: ... here.
* config/mips/mips-cpus.def: Define gs464; Add loongson3a
as an alias of gs464 processor.
* config/mips/mips-tables.opt: Regenerate.
* config/mips/mips.c (mips_issue_rate): Use PROCESSOR_GS464
instead of PROCESSOR_LOONGSON_3A.
(mips_multipass_dfa_lookahead): Use TUNE_GS464 instead of
TUNE_LOONGSON_3A.
(mips_option_override): Enable MMI and EXT for gs464.
* config/mips/mips.h: Rename TARGET_LOONGSON_3A to TARGET_GS464;
Rename TUNE_LOONGSON_3A to TUNE_GS464.
(MIPS_ISA_LEVEL_SPEC): Infer mips64r2 from gs464.
(ISA_HAS_ODD_SPREG, ISA_AVOID_DIV_HILO, ISA_HAS_FUSED_MADD4,
ISA_HAS_UNFUSED_MADD4): Use TARGET_GS464 instead of
TARGET_LOONGSON_3A.
* config/mips/mips.md: Include gs464.md instead of loongson3a.md.
(processor): Add gs464;
* doc/invoke.texi: Add gs464 to supported architectures.

From-SVN: r265865

5 years agoAdd support for Loongson EXT2 instructions.
Chenghua Xu [Wed, 7 Nov 2018 08:42:59 +0000 (08:42 +0000)]
Add support for Loongson EXT2 instructions.

gcc/
* config/mips/mips-protos.h
(mips_loongson_ext2_prefetch_cookie): New prototype.
* config/mips/mips.c (mips_loongson_ext2_prefetch_cookie): New.
(mips_option_override): Enable TARGET_LOONGSON_EXT when
TARGET_LOONGSON_EXT2 is true.
* config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Define
__mips_loongson_ext2, __mips_loongson_ext_rev=2.
(ISA_HAS_CTZ_CTO): New, true if TARGET_LOONGSON_EXT2.
(ISA_HAS_PREFETCH): Include TARGET_LOONGSON_EXT and
TARGET_LOONGSON_EXT2.
(ASM_SPEC): Add mloongson-ext2 and mno-loongson-ext2.
(define_insn "ctz<mode>2"): New insn pattern.
(define_insn "prefetch"): Include TARGET_LOONGSON_EXT2.
(define_insn "prefetch_indexed_<mode>"): Include
TARGET_LOONGSON_EXT and TARGET_LOONGSON_EXT2.
* config/mips/mips.opt (-mloongson-ext2): Add option.
* gcc/doc/invoke.texi (-mloongson-ext2): Document.

gcc/testsuite/
* gcc.target/mips/loongson-ctz.c: New test.
* gcc.target/mips/loongson-dctz.c: Likewise.
* gcc.target/mips/mips.exp (mips_option_groups): Add
-mloongson-ext2 option.

From-SVN: r265864

5 years agoAdd support for Loongson EXT instructions.
Chenghua Xu [Wed, 7 Nov 2018 08:35:54 +0000 (08:35 +0000)]
Add support for Loongson EXT instructions.

gcc/
* config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add
__mips_loongson_ext.
(MIPS_ASE_LOONGSON_EXT_SPEC): New.
(BASE_DRIVER_SELF_SPECS): march=loongson3a implies
-mloongson-ext.
(ASM_SPEC): Add mloongson-ext and mno-loongson-ext.
* config/mips/mips.md (mul<mode>3, mul<mode>3_mul3_nohilo,
<u>div<mode>3, <u>mod<mode>3, prefetch): Use TARGET_LOONGSON_EXT
instead of TARGET_LOONGSON_3A.
* config/mips/mips.opt (-mloongson-ext): Add option.
* gcc/doc/invoke.texi (-mloongson-ext): Document.

gcc/testsuite/
* gcc.target/mips/mips.exp (mips_option_groups): Add
-mloongson-ext option.
(mips-dg-options): Add mips_option_dependency options
"-mmicromips" vs "-mno-loongson-ext",

From-SVN: r265863

5 years agoAdd support for Loongson MMI instructions.
Chenghua Xu [Wed, 7 Nov 2018 08:25:17 +0000 (08:25 +0000)]
Add support for Loongson MMI instructions.

gcc/
* config.gcc (extra_headers): Add loongson-mmiintrin.h.
* config/mips/loongson.md: Move to ...
* config/mips/loongson-mmi.md: here; Adjustment.
* config/mips/loongson.h: Move to ...
State as deprecated. Include loongson-mmiintrin.h for back
compatibility and warning.
* config/mips/loongson-mmiintrin.h: ... here.
* config/mips/mips.c (mips_hard_regno_mode_ok_uncached,
mips_vector_mode_supported_p, AVAIL_NON_MIPS16): Use
TARGET_LOONGSON_MMI instead of TARGET_LOONGSON_VECTORS.
(mips_option_override): Make sure MMI use hard float;
(mips_shift_truncation_mask, mips_expand_vpc_loongson_even_odd,
mips_expand_vpc_loongson_pshufh, mips_expand_vpc_loongson_bcast,
mips_expand_vector_init): Use TARGET_LOONGSON_MMI instead of
TARGET_LOONGSON_VECTORS.
* gcc/config/mips/mips.h (TARGET_LOONGSON_VECTORS): Delete.
(TARGET_CPU_CPP_BUILTINS): Add __mips_loongson_mmi.
(MIPS_ASE_DSP_SPEC, MIPS_ASE_LOONGSON_MMI_SPEC): New.
(BASE_DRIVER_SELF_SPECS): march=loongson2e/2f/3a implies
-mloongson-mmi.
(SHIFT_COUNT_TRUNCATED): Use TARGET_LOONGSON_MMI instead of
TARGET_LOONGSON_VECTORS.
* gcc/config/mips/mips.md (MOVE64, MOVE128): Use
TARGET_LOONGSON_MMI instead of TARGET_LOONGSON_VECTORS.
(Loongson MMI patterns): Include loongson-mmi.md instead of
loongson.md.
* gcc/config/mips/mips.opt (-mloongson-mmi): New option.
* gcc/doc/invoke.texi (-mloongson-mmi): Document.

gcc/testsuite/
* gcc.target/mips/loongson-shift-count-truncated-1.c
(dg-options): Run under -mloongson-mmi option.
Include loongson-mmiintrin.h instead of loongson.h.
* gcc.target/mips/loongson-simd.c: Likewise.
* gcc.target/mips/mips.exp (mips_option_groups): Add
-mloongson-mmi option.
(mips-dg-options): Add mips_option_dependency options "-mips16" vs
"-mno-loongson-mmi", "-mmicromips" vs "-mno-loongson-mmi",
"-msoft-float" vs "-mno-loongson-mmi".
(mips-dg-init): Add -mloongson-mmi option.
* lib/target-supports.exp: Rename check_mips_loongson_hw_available
to check_mips_loongson_mmi_hw_available.
Rename check_effective_target_mips_loongson_runtime to
check_effective_target_mips_loongson_mmi_runtime.
(check_effective_target_vect_int): Use mips_loongson_mmi instead
of mips_loongson when check et-is-effective-target.
(add_options_for_mips_loongson_mmi): New proc.
Rename check_effective_target_mips_loongson to
check_effective_target_mips_loongson_mmi.
(check_effective_target_vect_shift,
check_effective_target_whole_vector_shift,
check_effective_target_vect_no_int_min_max,
check_effective_target_vect_no_align,
check_effective_target_vect_short_mult,
check_vect_support_and_set_flags):Use mips_loongson_mmi instead
of mips_loongson when check et-is-effective-target.

From-SVN: r265862

5 years agore PR lto/87906 (ICE in tree check: expected block, have function_decl in block_ultim...
Richard Biener [Wed, 7 Nov 2018 08:06:57 +0000 (08:06 +0000)]
re PR lto/87906 (ICE in tree check: expected block, have function_decl in block_ultimate_origin, at tree.c:12326 since r264734)

2018-11-07  Richard Biener  <rguenther@suse.de>

PR lto/87906
* tree-streamer-in.c (lto_input_ts_block_tree_pointers): Fixup
BLOCK_ABSTRACT_ORIGIN to be the ultimate origin.

* g++.dg/lto/pr87906_0.C: New testcase.
* g++.dg/lto/pr87906_1.C: Likewise.

From-SVN: r265861

5 years ago[PR87874] avoid const-wide-int subreg in LRA
Alexandre Oliva [Wed, 7 Nov 2018 06:25:30 +0000 (06:25 +0000)]
[PR87874] avoid const-wide-int subreg in LRA

Just like CONST_INT, CONST_WIDE_INT is VOIDmode, so LRA might be
tempted to build a SUBREG to "convert" it to the wanted mode.  That's
no use.  Test for CONST_SCALAR_INT_P instead of CONST_INT_P so that we
skip the subreg creation for both.

for  gcc/ChangeLog

PR rtl-optimization/87874
* lra.c (lra_substitute_pseudo): Do not create a subreg for
const wide ints.

for  gcc/testsuite/ChangeLog

PR rtl-optimization/87874
* gcc.dg/pr87874.c: New.

From-SVN: r265860

5 years agoDaily bump.
GCC Administrator [Wed, 7 Nov 2018 00:17:24 +0000 (00:17 +0000)]
Daily bump.

From-SVN: r265856

5 years agoImplement std::pmr::unsynchronized_pool_resource
Jonathan Wakely [Tue, 6 Nov 2018 21:35:27 +0000 (21:35 +0000)]
Implement std::pmr::unsynchronized_pool_resource

Implement std::pmr::unsynchronized_pool_resource
* config/abi/pre/gnu.ver: Add new symbols.
* include/std/memory_resource (std::pmr::__pool_resource): New class.
(std::pmr::unsynchronized_pool_resource): New class.
* src/c++17/Makefile.am: Add -fimplicit-templates to flags for
memory_resource.cc
* src/c++17/Makefile.in: Regenerate.
* src/c++17/memory_resource.cc (bitset, chunk, big_block): New
internal classes.
(__pool_resource::_Pool): Define new class.
(munge_options, pool_index, select_num_pools): New internal functions.
(__pool_resource::__pool_resource, __pool_resource::~__pool_resource)
(__pool_resource::allocate, __pool_resource::deallocate)
(__pool_resource::_M_alloc_pools): Define member functions.
(unsynchronized_pool_resource::unsynchronized_pool_resource)
(unsynchronized_pool_resource::~unsynchronized_pool_resource)
(unsynchronized_pool_resource::release)
(unsynchronized_pool_resource::_M_find_pool)
(unsynchronized_pool_resource::do_allocate)
(unsynchronized_pool_resource::do_deallocate): Define member
functions.
* testsuite/20_util/unsynchronized_pool_resource/allocate.cc: New
test.
* testsuite/20_util/unsynchronized_pool_resource/is_equal.cc: New
test.
* testsuite/20_util/unsynchronized_pool_resource/options.cc: New
test.
* testsuite/20_util/unsynchronized_pool_resource/release.cc: New
test.

From-SVN: r265853

5 years agors6000.md (bswap<mode>2): Force address into register if not in indexed or indirect...
Aaron Sawdey [Tue, 6 Nov 2018 21:21:10 +0000 (21:21 +0000)]
rs6000.md (bswap<mode>2): Force address into register if not in indexed or indirect form.

2018-11-06  Aaron Sawdey  <acsawdey@linux.ibm.com>

* config/rs6000/rs6000.md (bswap<mode>2): Force address into register
if not in indexed or indirect form.
(bswap<mode>2_load): Change predicate to indexed_or_indirect_operand.
(bswap<mode>2_store): Ditto.

From-SVN: r265852

5 years agore PR libstdc++/87872 (debug list::splice should not call _M_transfer_from_if on...
John Bytheway [Tue, 6 Nov 2018 20:20:06 +0000 (20:20 +0000)]
re PR libstdc++/87872 (debug list::splice should not call _M_transfer_from_if on self-splices)

2018-11-06  John Bytheway  <jbytheway@gmail.com>

PR libstdc++/87872
* include/debug/safe_sequence.tcc
(_Safe_sequence<>::_M_transfer_from_if): Skip transfer to self.

From-SVN: r265851

5 years agoaarch64 - Set the mode for the unspec in speculation_tracker insn.
Richard Earnshaw [Tue, 6 Nov 2018 17:18:37 +0000 (17:18 +0000)]
aarch64 - Set the mode for the unspec in speculation_tracker insn.

The speculation tracker insn in my recent patch set for CVE-2017-5753
was missing a mode on the UNSPEC.  Although this didn't break the
build, it did cause an unnecessary warning from the MD parsing
mechanism that I missed at the time.  It's a trivial fix, as follows:

* config/aarch64/aarch64.md (speculation_tracker): Set the mode for
the UNSPEC.

From-SVN: r265849

5 years agore PR tree-optimization/86850 (ubsan: runtime error: member call on null pointer)
Richard Biener [Tue, 6 Nov 2018 15:46:42 +0000 (15:46 +0000)]
re PR tree-optimization/86850 (ubsan: runtime error: member call on null pointer)

2018-11-06  Richard Biener  <rguenther@suse.de>

PR tree-optimization/86850
* vec.h (vec<T, va_heap, vl_ptr>::splice): Check src.length ()
instead of src.m_vec.

From-SVN: r265848

5 years agotree.c (fld_simplified_type_name): Break out form ...
Jan Hubicka [Tue, 6 Nov 2018 15:41:32 +0000 (16:41 +0100)]
tree.c (fld_simplified_type_name): Break out form ...

* tree.c (fld_simplified_type_name): Break out form ...
(free_lang_data_in_type): ... here.
(fld_type_variant_equal_p): Use it.

From-SVN: r265847

5 years agoFix D compilation on Solaris
Rainer Orth [Tue, 6 Nov 2018 15:08:46 +0000 (15:08 +0000)]
Fix D compilation on Solaris

* config/default-d.c: Include memmodel.h.

* config/sol2-d.c: New file.
* config/t-sol2 (sol2-d.o): New rule.
* config.gcc <*-*-solaris2*>: Set d_target_objs,
target_has_targetdm.

From-SVN: r265846

5 years agotree.c (fld_type_variant): Also copy alignment; be sure that new variant is equal.
Jan Hubicka [Tue, 6 Nov 2018 13:53:22 +0000 (14:53 +0100)]
tree.c (fld_type_variant): Also copy alignment; be sure that new variant is equal.

* tree.c (fld_type_variant): Also copy alignment; be sure that
new variant is equal.

From-SVN: r265845

5 years agoS/390: Introduce relative_long attribute
Ilya Leoshkevich [Tue, 6 Nov 2018 13:20:21 +0000 (13:20 +0000)]
S/390: Introduce relative_long attribute

In order to properly fix PR87762, we need to distinguish between
instructions which support relative addressing and instructions which
don't.  We could check whether the existing "type" attribute is equal to
"larl", but there are notable exceptions (lrl, for example), and
changing them makes scheduling worse on z10.  We could also check
whether the existing "op_type" attribute is equal to "RIL-b" or "RIL-c".
However, adding a new attribute provides more flexibility, since we
don't depend idiosyncrasies which might be introduced into PoP in the
future.

gcc/ChangeLog:

2018-11-06  Ilya Leoshkevich  <iii@linux.ibm.com>

PR target/87762
* config/s390/s390.md: Add relative_long attribute.

From-SVN: r265844

5 years agoS/390: Accept cdb in load-and-test-fp-1 testcase
Ilya Leoshkevich [Tue, 6 Nov 2018 13:16:41 +0000 (13:16 +0000)]
S/390: Accept cdb in load-and-test-fp-1 testcase

The compiler now generates cdb instead of cdbr for comparison with 0.0,
which looks like an improvement to me.

gcc/testsuite/ChangeLog:

2018-11-06  Ilya Leoshkevich  <iii@linux.ibm.com>

* gcc.target/s390/load-and-test-fp-1.c: Accept cdb.

From-SVN: r265843

5 years ago2018-11-06 Chung-Lin Tang <cltang@codesourcery.com>
Chung-Lin Tang [Tue, 6 Nov 2018 13:09:52 +0000 (13:09 +0000)]
2018-11-06  Chung-Lin Tang <cltang@codesourcery.com>

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
libgomp/
* oacc-mem.c (memcpy_tofrom_device): New function, combined from
acc_memcpy_to/from_device functions, now with async parameter.
(acc_memcpy_to_device): Modify to use memcpy_tofrom_device.
(acc_memcpy_from_device): Likewise.
(acc_memcpy_to_device_async): New API function.
(acc_memcpy_from_device_async): Likewise.
(present_create_copy): Add async parameter and async setting/unsetting.
(acc_create): Adjust present_create_copy call.
(acc_copyin): Likewise.
(acc_present_or_create): Likewise.
(acc_present_or_copyin): Likewise.
(acc_create_async): New API function.
(acc_copyin_async): New API function.
(delete_copyout): Add async parameter and async setting/unsetting.
(acc_delete): Adjust delete_copyout call.
(acc_copyout): Likewise.
(acc_delete_async): New API function.
(acc_copyout_async): Likewise.
(update_dev_host): Add async parameter and async setting/unsetting.
(acc_update_device): Adjust update_dev_host call.
(acc_update_self): Likewise.
(acc_update_device_async): New API function.
(acc_update_self_async): Likewise.
* openacc.h (acc_copyin_async): Declare new API function.
(acc_create_async): Likewise.
(acc_copyout_async): Likewise.
(acc_delete_async): Likewise.
(acc_update_device_async): Likewise.
(acc_update_self_async): Likewise.
(acc_memcpy_to_device_async): Likewise.
(acc_memcpy_from_device_async): Likewise.
* openacc_lib.h (acc_copyin_async_32_h): New subroutine.
(acc_copyin_async_64_h): New subroutine.
(acc_copyin_async_array_h): New subroutine.
(acc_create_async_32_h): New subroutine.
(acc_create_async_64_h): New subroutine.
(acc_create_async_array_h): New subroutine.
(acc_copyout_async_32_h): New subroutine.
(acc_copyout_async_64_h): New subroutine.
(acc_copyout_async_array_h): New subroutine.
(acc_delete_async_32_h): New subroutine.
(acc_delete_async_64_h): New subroutine.
(acc_delete_async_array_h): New subroutine.
(acc_update_device_async_32_h): New subroutine.
(acc_update_device_async_64_h): New subroutine.
(acc_update_device_async_array_h): New subroutine.
(acc_update_self_async_32_h): New subroutine.
(acc_update_self_async_64_h): New subroutine.
(acc_update_self_async_array_h): New subroutine.
* openacc.f90 (acc_copyin_async_32_h): New subroutine.
(acc_copyin_async_64_h): New subroutine.
(acc_copyin_async_array_h): New subroutine.
(acc_create_async_32_h): New subroutine.
(acc_create_async_64_h): New subroutine.
(acc_create_async_array_h): New subroutine.
(acc_copyout_async_32_h): New subroutine.
(acc_copyout_async_64_h): New subroutine.
(acc_copyout_async_array_h): New subroutine.
(acc_delete_async_32_h): New subroutine.
(acc_delete_async_64_h): New subroutine.
(acc_delete_async_array_h): New subroutine.
(acc_update_device_async_32_h): New subroutine.
(acc_update_device_async_64_h): New subroutine.
(acc_update_device_async_array_h): New subroutine.
(acc_update_self_async_32_h): New subroutine.
(acc_update_self_async_64_h): New subroutine.
(acc_update_self_async_array_h): New subroutine.
* libgomp.map (OACC_2.5): Add acc_copyin_async*, acc_copyout_async*,
acc_copyout_finalize_async*, acc_create_async*, acc_delete_async*,
acc_delete_finalize_async*, acc_memcpy_from_device_async*,
acc_memcpy_to_device_async*, acc_update_device_async*, and
acc_update_self_async* entries.
* testsuite/libgomp.oacc-c-c++-common/lib-94.c: New test.
* testsuite/libgomp.oacc-c-c++-common/lib-95.c: New test.
* testsuite/libgomp.oacc-fortran/lib-16.f90: New test.

From-SVN: r265842

5 years agoipa-pure-const.c (check_decl): Do not test TYPE_NEEDS_CONSTRUCTING.
Jan Hubicka [Tue, 6 Nov 2018 12:46:46 +0000 (13:46 +0100)]
ipa-pure-const.c (check_decl): Do not test TYPE_NEEDS_CONSTRUCTING.

* ipa-pure-const.c (check_decl): Do not test TYPE_NEEDS_CONSTRUCTING.
* lto-streamer-out.c (hash_tree): Do not hash TYPE_NEEDS_CONSTRUCTING.
* tree-streamer-in.c (unpack_ts_type_common_value_fields): Do not
stream TYPE_NEEDS_CONSTRUCTING.
* tree-streamer-out.c (pack_ts_type_common_value_fields): Likewise.
* tree.c (free_lang_data_in_type): Clear TYPE_NEEDS_CONSTRUCTING.

From-SVN: r265841

5 years agotree-vect-slp.c (vect_slp_bb): Move opening of vect_slp_analyze_bb dump-scope ...
Richard Biener [Tue, 6 Nov 2018 12:19:22 +0000 (12:19 +0000)]
tree-vect-slp.c (vect_slp_bb): Move opening of vect_slp_analyze_bb dump-scope ...

2018-11-06  Richard Biener  <rguenther@suse.de>

* tree-vect-slp.c (vect_slp_bb): Move opening of vect_slp_analyze_bb
dump-scope ...
(vect_slp_analyze_bb_1): ... here to avoid hiding optimized locations.

From-SVN: r265840

5 years agomsp430.h (REG_CLASS_CONTENTS): Add R0 to REG_CLASS_CONTENTS[GEN_REGS].
Jozef Lawrynowicz [Tue, 6 Nov 2018 11:49:54 +0000 (11:49 +0000)]
msp430.h (REG_CLASS_CONTENTS): Add R0 to REG_CLASS_CONTENTS[GEN_REGS].

2018-11-06  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

* gcc/config/msp430/msp430.h (REG_CLASS_CONTENTS): Add R0 to
REG_CLASS_CONTENTS[GEN_REGS].
(REGNO_REG_CLASS): Return NO_REGS for R2 and R3.

* gcc/testsuite/gcc.target/msp430/special-regs.c: New test.

From-SVN: r265839

5 years ago* tree.c (fld_simplified_type_of): Clear TYPELESS_STORAGE flag.
Jan Hubicka [Tue, 6 Nov 2018 11:36:21 +0000 (12:36 +0100)]
* tree.c (fld_simplified_type_of): Clear TYPELESS_STORAGE flag.

From-SVN: r265838

5 years agoEnable libsanitizer on Solaris (PR sanitizer/80953)
Rainer Orth [Tue, 6 Nov 2018 10:49:34 +0000 (10:49 +0000)]
Enable libsanitizer on Solaris (PR sanitizer/80953)

gcc:
PR sanitizer/80953
* config/sol2.h (ASAN_CC1_SPEC): Define.
(LD_WHOLE_ARCHIVE_OPTION): Define.
(LD_NO_WHOLE_ARCHIVE_OPTION): Define.
(ASAN_REJECT_SPEC): Provide default.
(LIBASAN_EARLY_SPEC): Define.
(LIBTSAN_EARLY_SPEC): Define.
(LIBLSAN_EARLY_SPEC): Define.
* config/i386/sol2.h (CC1_SPEC): Redefine.
(ASAN_REJECT_SPEC): Define.

* config/sparc/sparc.c (sparc_asan_shadow_offset): Declare.
(TARGET_ASAN_SHADOW_OFFSET): Define.
(sparc_asan_shadow_offset): New function.
* config/sparc/sol2.h (CC1_SPEC): Append ASAN_CC1_SPEC.
(ASAN_REJECT_SPEC): Define.

gcc/testsuite:
PR sanitizer/80953
* c-c++-common/asan/alloca_loop_unpoisoning.c: Require alloca
support.
(foo): Use __builtin_alloca.

libsanitizer:
PR sanitizer/80953
* configure.tgt (sparc*-*-solaris2.11*): Enable.
(x86_64-*-solaris2.11* | i?86-*-solaris2.11*): Enable.

From-SVN: r265837

5 years agoCherry-pick Solaris sanitizer fixes (PR sanitizer/80953)
Rainer Orth [Tue, 6 Nov 2018 10:42:05 +0000 (10:42 +0000)]
Cherry-pick Solaris sanitizer fixes (PR sanitizer/80953)

PR sanitizer/80953
* sanitizer_common/sanitizer_internal_defs.h,
sanitizer_common/sanitizer_platform_limits_solaris.h,
sanitizer_common/sanitizer_procmaps_solaris.cc,
sanitizer_common/sanitizer_solaris.cc: Cherry-pick compiler-rt
revision 346153.
* sanitizer_common/sanitizer_stacktrace.h,
sanitizer_common/sanitizer_stacktrace_sparc.cc: Cherry-pick
compiler-rt revision 346155.

From-SVN: r265836

5 years agotbaa-1.c: New testcase.
Jan Hubicka [Tue, 6 Nov 2018 10:26:44 +0000 (11:26 +0100)]
tbaa-1.c: New testcase.

* gcc.dg/lto/tbaa-1.c: New testcase.

* tree.c (fld_type_variant): Copy canonical type.
(fld_incomplete_type_of): Check that canonical types looks sane;
copy canonical type.
(verify_type): Accept when incomplete type has complete canonical type.

From-SVN: r265835

5 years agotree.c (free_lang_data): Reset overwite_assembler_name...
Jan Hubicka [Tue, 6 Nov 2018 10:25:25 +0000 (11:25 +0100)]
tree.c (free_lang_data): Reset overwite_assembler_name...

* tree.c (free_lang_data): Reset overwite_assembler_name,
print_xnode, print_decl, print_type and print_identifier of
langhooks.

From-SVN: r265834

5 years agore PR tree-optimization/87889 (CPU2000 177.mesa failed to build)
Richard Biener [Tue, 6 Nov 2018 10:23:30 +0000 (10:23 +0000)]
re PR tree-optimization/87889 (CPU2000 177.mesa failed to build)

2018-11-06  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87889
* tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges):
Do nothing if old and new arg are the same

* gcc.dg/pr87894.c: New testcase.

From-SVN: r265833

5 years agoS/390: Fix PR87723
Andreas Krebbel [Tue, 6 Nov 2018 10:22:05 +0000 (10:22 +0000)]
S/390: Fix PR87723

gcc/ChangeLog:

2018-11-06  Andreas Krebbel  <krebbel@linux.ibm.com>

PR target/87723
* config/s390/s390.md ("*r<noxa>sbg_di_rotl"): Remove mode
attributes for operands 3 and 4.

gcc/testsuite/ChangeLog:

2018-11-06  Andreas Krebbel  <krebbel@linux.ibm.com>

PR target/87723
* gcc.target/s390/pr87723.c: New test.

From-SVN: r265832

5 years agore PR ada/81878 (--disable-bootstrap --enable-languages=ada fails)
Eric Botcazou [Tue, 6 Nov 2018 08:42:56 +0000 (08:42 +0000)]
re PR ada/81878 (--disable-bootstrap --enable-languages=ada fails)

PR ada/81878
Revert
2018-10-29  Tamar Christina  <tamar.christina@arm.com>

PR ada/81878
* Makefile.in (TOOLS_FLAGS_TO_PASS_NATIVE): Add -B ../../.

2017-08-17  Richard Biener  <rguenther@suse.de>

PR ada/81878
* Makefile.in (CXX_LFLAGS): Remove.
(TOOLS_FLAGS_TO_PASS_NATIVE): Pass $(CXX) as CXX.
(TOOLS_FLAGS_TO_PASS_RE): Likewise.

From-SVN: r265830

5 years agore PR middle-end/18041 (OR of two single-bit bitfields is inefficient)
Richard Biener [Tue, 6 Nov 2018 08:09:03 +0000 (08:09 +0000)]
re PR middle-end/18041 (OR of two single-bit bitfields is inefficient)

2018-11-06  Richard Biener  <rguenther@suse.de>

PR middle-end/18041
* simplify-rtx.c (simplify_binary_operation_1): Add pattern
matching bitfield insertion.

* gcc.target/i386/pr18041-1.c: New testcase.
* gcc.target/i386/pr18041-2.c: Likewise.

From-SVN: r265829

5 years agogOlogy: fix debug binds in auto-inc-dec
Alexandre Oliva [Tue, 6 Nov 2018 05:33:40 +0000 (05:33 +0000)]
gOlogy: fix debug binds in auto-inc-dec

As auto_inc_dec pass combines incs and mems from different insns, it
often causes regs to temporarily hold a value different from the one
it would before the transformation.  Debug insns within that range
would therefore end up binding to the wrong expression after the
transformation.

This patch adjusts debug binds in the affected range.

for  gcc/ChangeLog

* auto-inc-dec.c: Include valtrack.h.  Improve comments.
(reg_next_debug_use): New.
(attempt_change): Propagate adjusted expression into affected
debug insns.
(merge_in_block): Track uses in debug insns.
(pass_inc_dec::execute): Allocate and release
reg_next_debug_use.

From-SVN: r265828

5 years agoavx512fintrin.h: Update VFIXUPIMM* intrinsics.
Wei Xiao [Tue, 6 Nov 2018 03:19:37 +0000 (03:19 +0000)]
avx512fintrin.h: Update VFIXUPIMM* intrinsics.

gcc/
2018-11-06 Wei Xiao <wei3.xiao@intel.com>

* config/i386/avx512fintrin.h: Update VFIXUPIMM* intrinsics.
(_mm512_fixupimm_round_pd): Update parameters and builtin.
(_mm512_maskz_fixupimm_round_pd): Ditto.
(_mm512_fixupimm_round_ps): Ditto.
(_mm512_maskz_fixupimm_round_ps): Ditto.
(_mm_fixupimm_round_sd): Ditto.
(_mm_maskz_fixupimm_round_sd): Ditto.
(_mm_fixupimm_round_ss): Ditto.
(_mm_maskz_fixupimm_round_ss): Ditto.
(_mm512_fixupimm_pd): Ditto.
(_mm512_maskz_fixupimm_pd): Ditto.
(_mm512_fixupimm_ps): Ditto.
(_mm512_maskz_fixupimm_ps): Ditto.
(_mm_fixupimm_sd): Ditto.
(_mm_maskz_fixupimm_sd): Ditto.
(_mm_fixupimm_ss): Ditto.
(_mm_maskz_fixupimm_ss): Ditto.
(_mm512_mask_fixupimm_round_pd): Update builtin.
(_mm512_mask_fixupimm_round_ps): Ditto.
(_mm_mask_fixupimm_round_sd): Ditto.
(_mm_mask_fixupimm_round_ss): Ditto.
(_mm512_mask_fixupimm_pd): Ditto.
(_mm512_mask_fixupimm_ps): Ditto.
(_mm_mask_fixupimm_sd): Ditto.
(_mm_mask_fixupimm_ss): Ditto.
* config/i386/avx512vlintrin.h:
(_mm256_fixupimm_pd): Update parameters and builtin.
(_mm256_maskz_fixupimm_pd): Ditto.
(_mm256_fixupimm_ps): Ditto.
(_mm256_maskz_fixupimm_ps): Ditto.
(_mm_fixupimm_pd): Ditto.
(_mm_maskz_fixupimm_pd): Ditto.
(_mm_fixupimm_ps): Ditto.
(_mm_maskz_fixupimm_ps): Ditto.
(_mm256_mask_fixupimm_pd): Update builtin.
(_mm256_mask_fixupimm_ps): Ditto.
(_mm_mask_fixupimm_pd): Ditto.
(_mm_mask_fixupimm_ps): Ditto.
* config/i386/i386-builtin-types.def: Add new types and remove useless ones.
* config/i386/i386-builtin.def: Update builtin definitions.
* config/i386/i386.c: Handle new builtin types and remove useless ones.
* config/i386/sse.md: Update VFIXUPIMM* patterns.
(<avx512>_fixupimm<mode>_maskz<round_saeonly_expand_name>): Update.
(<avx512>_fixupimm<mode><sd_maskz_name><round_saeonly_name>): Update.
(<avx512>_fixupimm<mode>_mask<round_saeonly_name>): Update.
(avx512f_sfixupimm<mode>_maskz<round_saeonly_expand_name>): Update.
(avx512f_sfixupimm<mode><sd_maskz_name><round_saeonly_name>): Update.
(avx512f_sfixupimm<mode>_mask<round_saeonly_name>): Update.
* config/i386/subst.md:
(round_saeonly_sd_mask_operand4): Add new subst_attr.
(round_saeonly_sd_mask_op4): Ditto.
(round_saeonly_expand_operand5): Ditto.
(round_saeonly_expand): Update.

gcc/testsuite/
2018-11-06 Wei Xiao <wei3.xiao@intel.com>

* gcc.target/i386/avx-1.c: Update tests for VFIXUPIMM* intrinsics.
* gcc.target/i386/avx512f-vfixupimmpd-1.c: Ditto.
* gcc.target/i386/avx512f-vfixupimmpd-2.c: Ditto.
* gcc.target/i386/avx512f-vfixupimmps-1.c: Ditto.
* gcc.target/i386/avx512f-vfixupimmsd-1.c: Ditto.
* gcc.target/i386/avx512f-vfixupimmsd-2.c: Ditto.
* gcc.target/i386/avx512f-vfixupimmss-1.c: Ditto.
* gcc.target/i386/avx512f-vfixupimmss-2.c: Ditto.
* gcc.target/i386/avx512vl-vfixupimmpd-1.c: Ditto.
* gcc.target/i386/avx512vl-vfixupimmps-1.c: Ditto.
* gcc.target/i386/sse-13.c: Ditto.
* gcc.target/i386/sse-14.c: Ditto.
* gcc.target/i386/sse-22.c: Ditto.
* gcc.target/i386/sse-23.c: Ditto.
* gcc.target/i386/testimm-10.c: Ditto.
* gcc.target/i386/testround-1.c: Ditto.

From-SVN: r265827

5 years agoDaily bump.
GCC Administrator [Tue, 6 Nov 2018 00:17:07 +0000 (00:17 +0000)]
Daily bump.

From-SVN: r265826

5 years agogcc: xtensa: don't force PIC for uclinux target
Max Filippov [Mon, 5 Nov 2018 23:58:13 +0000 (23:58 +0000)]
gcc: xtensa: don't force PIC for uclinux target

xtensa-uclinux uses bFLT executable file format that cannot relocate
fields representing offsets from data to code. C++ objects built as PIC
use offsets to encode FDE structures. As a result C++ exception handling
doesn't work correctly on xtensa-uclinux. Don't use PIC by default on
xtensa-uclinux.

gcc/
2018-11-05  Max Filippov  <jcmvbkbc@gmail.com>

* config/xtensa/uclinux.h (XTENSA_ALWAYS_PIC): Change to 0.

From-SVN: r265823

5 years agoUpdate most of libquadmath/math/ from glibc, automate update (PR libquadmath/68686).
Joseph Myers [Mon, 5 Nov 2018 23:03:55 +0000 (23:03 +0000)]
Update most of libquadmath/math/ from glibc, automate update (PR libquadmath/68686).

libquadmath sources are mostly based on glibc sources at present, but
derived from them by a manual editing / substitution process and with
subsequent manual merges.  The manual effort involved in merges means
they are sometimes incomplete and long-delayed.

Since libquadmath was first created, glibc's support for this format
has undergone significant changes so that it can also be used in glibc
to provide *f128 functions for the _Float128 type from TS 18661-3.
This makes it significantly easier to use it for libquadmath in a more
automated fashion, since glibc has a float128_private.h header that
redefines many identifiers as macros as needed for building *f128
functions.

Simply using float128_private.h directly in libquadmath, with
unmodified glibc sources except for changing function names in that
one header to be *q instead of *f128, would be tricky, given its
dependence on lots of other glibc-internal headers (whereas
libquadmath supports non-glibc systems), and also given how some libm
functions in glibc are built from type-generic templates using a
further set of macros rather than from separate function
implementations for each type.

So instead this patch adds a script update-quadmath.py to convert
glibc sources into libquadmath ones, and the script reads
float128_private.h to identify many of the substitutions it should
make.  quadmath-imp.h is updated with various new internal
definitions, taken from glibc as needed; this is the main place
expected to need updating manually when subsequent merges from glibc
are done using the script.  No attempt is made to make the script
output match the details of existing formatting, although the
differences are of a size that makes a rough comparison (ignoring
whitespace) possible.

Two new public interfaces are added to libquadmath, exp2q and
issignalingq, at a new QUADMATH_1.2 symbol version, since those
interfaces are used internally by some of the glibc sources being
merged into libquadmath; although there is a new symbol version, no
change however is made to the libtool version in the libtool-version
file.  Although there are various other interfaces now in glibc libm
but not in libquadmath, this patch does nothing to add such interfaces
(although adding many of them would in fact be easy to do, given the
script).

One internal file (not providing any public interfaces),
math/isinf_nsq.c, is removed, as no longer used by anything in
libquadmath after the merge.

Conditionals in individual source files on <fenv.h> availability or
features are moved into quadmath-imp.h (providing trivial macro
versions of the functions if real implementations aren't available),
to simplify the substitutions in individual source files.  Note
however that I haven't tested for any configurations lacking <fenv.h>,
so further changes could well be needed there.

Two files in libquadmath/math/ are based on glibc sources but not
updated in this patch: fmaq.c and rem_pio2q.c.  Both could be updated
after further changes to the script (and quadmath-imp.h as needed); in
the case of rem_pio2q.c, based on two separate glibc source files,
those separate files would naturally be split out into separate
libquadmath source files in the process (as done in this patch with
expq_table.h and tanq_kernel.c, where previously two glibc source
files had been merged into one libquadmath source file).  complex.c,
nanq.c and sqrtq.c are not based on glibc sources (though four of the
(trivial) functions in complex.c could readily be replaced by instead
using the four corresponding files from glibc, if desired).

libquadmath also has printf/ and strtod/ sources based on glibc, also
mostly not updated for a long time.  Again the script could no doubt
be made to generate those automatically, although that would be a
larger change (effectively some completely separate logic in the
script, not sharing much if anything with the existing code).

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

PR libquadmath/68686
* Makefile.am: (libquadmath_la_SOURCES): Remove math/isinf_nsq.c.
Add math/exp2q.c math/issignalingq.c math/lgammaq_neg.c
math/lgammaq_product.c math/tanq_kernel.c math/tgammaq_product.c
math/casinhq_kernel.c.
* Makefile.in: Regenerate.
* libquadmath.texi (exp2q, issignalingq): Document.
* quadmath-imp.h: Include <errno.h>, <limits.h>, <stdbool.h> and
<fenv.h>.
(HIGH_ORDER_BIT_IS_SET_FOR_SNAN, FIX_FLT128_LONG_CONVERT_OVERFLOW)
(FIX_FLT128_LLONG_CONVERT_OVERFLOW, __quadmath_kernel_tanq)
(__quadmath_gamma_productq, __quadmath_gammaq_r)
(__quadmath_lgamma_negq, __quadmath_lgamma_productq)
(__quadmath_lgammaq_r, __quadmath_kernel_casinhq, mul_splitq)
(math_check_force_underflow_complex, __glibc_likely)
(__glibc_unlikely, struct rm_ctx, SET_RESTORE_ROUNDF128)
(libc_feholdsetround_ctx, libc_feresetround_ctx): New.
(feraiseexcept, fenv_t, feholdexcept, fesetround, feupdateenv)
(fesetenv, fetestexcept, feclearexcept): Define if not supported
through <fenv.h>.
(__quadmath_isinf_nsq): Remove.
* quadmath.h (exp2q, issignalingq): New.
* quadmath.map (QUADMATH_1.2): New.
* quadmath_weak.h (exp2q, issignalingq): New.
* update-quadmath.py: New file.
* math/isinf_nsq.c: Remove file.
* math/casinhq_kernel.c, math/exp2q.c, math/expq_table.h,
math/issignalingq.c, math/lgammaq_neg.c, math/lgammaq_product.c,
math/tanq_kernel.c, math/tgammaq_product.c: New files.  Generated
from glibc sources with update-quadmath.py.
* math/acoshq.c, math/acosq.c, math/asinhq.c, math/asinq.c,
math/atan2q.c, math/atanhq.c, math/atanq.c, math/cacoshq.c,
math/cacosq.c, math/casinhq.c, math/casinq.c, math/catanhq.c,
math/catanq.c, math/cbrtq.c, math/ccoshq.c, math/ceilq.c,
math/cexpq.c, math/cimagq.c, math/clog10q.c, math/clogq.c,
math/conjq.c, math/copysignq.c, math/coshq.c, math/cosq.c,
math/cosq_kernel.c, math/cprojq.c, math/crealq.c, math/csinhq.c,
math/csinq.c, math/csqrtq.c, math/ctanhq.c, math/ctanq.c,
math/erfq.c, math/expm1q.c, math/expq.c, math/fabsq.c,
math/fdimq.c, math/finiteq.c, math/floorq.c, math/fmaxq.c,
math/fminq.c, math/fmodq.c, math/frexpq.c, math/hypotq.c,
math/ilogbq.c, math/isinfq.c, math/isnanq.c, math/j0q.c,
math/j1q.c, math/jnq.c, math/ldexpq.c, math/lgammaq.c,
math/llrintq.c, math/llroundq.c, math/log10q.c, math/log1pq.c,
math/log2q.c, math/logbq.c, math/logq.c, math/lrintq.c,
math/lroundq.c, math/modfq.c, math/nearbyintq.c,
math/nextafterq.c, math/powq.c, math/remainderq.c, math/remquoq.c,
math/rintq.c, math/roundq.c, math/scalblnq.c, math/scalbnq.c,
math/signbitq.c, math/sincos_table.c, math/sincosq.c,
math/sincosq_kernel.c, math/sinhq.c, math/sinq.c,
math/sinq_kernel.c, math/tanhq.c, math/tanq.c, math/tgammaq.c,
math/truncq.c, math/x2y2m1q.c: Regenerate from glibc sources with
update-quadmath.py.

From-SVN: r265822

5 years agocombine: Don't make an intermediate reg for assigning to sfp (PR87871)
Segher Boessenkool [Mon, 5 Nov 2018 21:18:22 +0000 (22:18 +0100)]
combine: Don't make an intermediate reg for assigning to sfp (PR87871)

The code with an intermediate register is perfectly fine, but LRA
apparently cannot handle the resulting code, or perhaps something else
is wrong.  In either case, making an extra temporary will not likely
help here, so let's just skip it.

PR rtl-optimization/87871
* combine.c (make_more_copies): Skip if dest is frame_pointer_rtx.

From-SVN: r265821

5 years agocompiler: handle abstract type in builtin numeric const value
Ian Lance Taylor [Mon, 5 Nov 2018 21:02:07 +0000 (21:02 +0000)]
compiler: handle abstract type in builtin numeric const value

    Builtin_call_expression::do_numeric_constant_value can be called by
    Array_type::verify_length before the determine types pass, so accept
    an abstract type.

    Test case is https://golang.org/cl/147537.

    Fixes golang/go#28601

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

From-SVN: r265820

5 years agoFix sanitizer frame unwind on 32-bit ABIs (again)
Segher Boessenkool [Mon, 5 Nov 2018 19:41:29 +0000 (20:41 +0100)]
Fix sanitizer frame unwind on 32-bit ABIs (again)

This re-applies r258525, and this time adds it to LOCAL_PATCHES.

libsanitizer/
* LOCAL_PATCHES: Add r258525.
* sanitizer_common/sanitizer_stacktrace.cc
(BufferedStackTrace::FastUnwindStack): Use the correct frame offset
for PowerPC SYSV ABI.

From-SVN: r265817

5 years agotarget-supports.exp: Add check for "inf" effective target keyword.
Paul Koning [Mon, 5 Nov 2018 19:36:16 +0000 (14:36 -0500)]
target-supports.exp: Add check for "inf" effective target keyword.

* lib/target-supports.exp: Add check for "inf" effective target
keyword.
* gcc.dg/builtins-44.c: Skip if no infinite support.
* gcc.dg/builtins-45.c: Ditto.
* gcc.dg/torture/builtin-complex-1.c: Ditto.
* gcc.dg/torture/builtin-cproj-1.c: Ditto.
* gcc.dg/torture/builtin-frexp-1.c: Ditto.
* gcc.dg/torture/builtin-ldexp-1.c: Ditto.
* gcc.dg/torture/builtin-logb-1.c: Ditto.
* gcc.dg/torture/builtin-math-2.c: Ditto.
* gcc.dg/torture/builtin-math-5.c: Ditto.
* gcc.dg/torture/builtin-math-7.c: Ditto.
* gcc.dg/torture/builtin-modf-1.c: Ditto.
* gcc.dg/torture/type-generic-1.c: Ditto.

From-SVN: r265816

5 years agosourcebuild.texi (target attributes): Document new "inf" effective target keyword.
Paul Koning [Mon, 5 Nov 2018 19:34:59 +0000 (14:34 -0500)]
sourcebuild.texi (target attributes): Document new "inf" effective target keyword.

* doc/sourcebuild.texi (target attributes): Document new "inf"
effective target keyword.

From-SVN: r265815

5 years agoS/390: Increase register move costs for CC_REGS
Robin Dapp [Mon, 5 Nov 2018 16:42:43 +0000 (16:42 +0000)]
S/390: Increase register move costs for CC_REGS

This increases the move costs for moves involving the CC
register which saves us some instructions in SPEC CPU2006.

gcc/ChangeLog:

2018-11-05  Robin Dapp  <rdapp@linux.ibm.com>

* config/s390/s390.c (s390_register_move_cost): Increase costs for
        moves involving the CC reg.

From-SVN: r265814

5 years agoS/390: Make tests expect column numbers in RTL output
Ilya Leoshkevich [Mon, 5 Nov 2018 16:34:32 +0000 (16:34 +0000)]
S/390: Make tests expect column numbers in RTL output

RTL output now includes column numbers in addition to line numbers,
like this:

  "gcc/testsuite/gcc.target/s390/md/andc-splitter-1.c":16:1

This confuses some S/390 tests.

gcc/testsuite/ChangeLog:

2018-11-05  Ilya Leoshkevich  <iii@linux.ibm.com>

* gcc.target/s390/md/andc-splitter-1.c: Add colon to
expectations.
* gcc.target/s390/md/andc-splitter-2.c: Likewise.
* gcc.target/s390/md/setmem_long-1.c: Likewise.

From-SVN: r265813

5 years agore PR tree-optimization/87873 (ICE: verify_gimple failed (error: incompatible types...
Richard Biener [Mon, 5 Nov 2018 14:55:53 +0000 (14:55 +0000)]
re PR tree-optimization/87873 (ICE: verify_gimple failed (error: incompatible types in PHI argument 0))

2018-11-05  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87873
* tree-ssa-loop-manip.h (split_loop_exit_edge): Add copy_constants_p
argument.
* tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
* tree-vect-loop.c (vect_transform_loop): When splitting the
loop exit also create forwarder PHIs for constants.
* tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges):
Handle constant to_arg, add extra checking we match up the correct
PHIs.

* gcc.dg/pr87873.c: New testcase.

From-SVN: r265812

5 years agoDo not use %zu format in libcpp.
Martin Liska [Mon, 5 Nov 2018 14:32:13 +0000 (15:32 +0100)]
Do not use %zu format in libcpp.

2018-11-05  Martin Liska  <mliska@suse.cz>

* symtab.c (ht_dump_statistics): Replace %zu with %lu format.

From-SVN: r265811

5 years agoFix printf call in symtab.c.
Martin Liska [Mon, 5 Nov 2018 14:25:37 +0000 (15:25 +0100)]
Fix printf call in symtab.c.

2018-11-05  Martin Liska  <mliska@suse.cz>

* symtab.c (ht_dump_statistics): Fix format and
pass missing argument.

From-SVN: r265810

5 years agoS/390: Add loc patterns for QImode and HImode
Robin Dapp [Mon, 5 Nov 2018 14:18:21 +0000 (14:18 +0000)]
S/390: Add loc patterns for QImode and HImode

This adds QImode and HImode support to load on condition.

gcc/ChangeLog:

2018-11-05  Robin Dapp  <rdapp@linux.ibm.com>

* config/s390/s390.md: QImode and HImode for load on condition.

gcc/testsuite/ChangeLog:

2018-11-05  Robin Dapp  <rdapp@linux.ibm.com>

* gcc.target/s390/ifcvt-one-insn-bool.c: New test.
* gcc.target/s390/ifcvt-one-insn-char.c: New test.

From-SVN: r265808

5 years agoS/390: Allow immediates in loc expander
Robin Dapp [Mon, 5 Nov 2018 14:09:28 +0000 (14:09 +0000)]
S/390: Allow immediates in loc expander

This allows immediate operands for load on condition.

gcc/ChangeLog:

2018-11-05  Robin Dapp  <rdapp@linux.ibm.com>

* config/s390/predicates.md: Fix typo.
* config/s390/s390.md: Allow immediates for load on condition.

gcc/testsuite/ChangeLog:

2018-11-05  Robin Dapp  <rdapp@linux.ibm.com>

* gcc.dg/loop-8.c: On s390, always run the test with -march=zEC12.

From-SVN: r265804

5 years agoCome up with SIZE_AMOUNT and use it in memory statistics and sort stats.
Martin Liska [Mon, 5 Nov 2018 13:36:29 +0000 (14:36 +0100)]
Come up with SIZE_AMOUNT and use it in memory statistics and sort stats.

2018-11-05  Martin Liska  <mliska@suse.cz>

* alloc-pool.h (struct pool_usage): Use SIZE_AMOUNT.
* bitmap.h (struct bitmap_usage): Likewise.
* ggc-common.c (SCALE): Remove.
(LABEL): Likewise.
(struct ggc_usage): Use SIZE_AMOUNT. And update
compare method.
* ggc-page.c (SCALE): Remove.
(STAT_LABEL): Remove.
(ggc_print_statistics): Use SIZE_AMOUNT.
* gimple.h (SCALE): Remove.
(LABEL): Likewise.
* input.c (ONE_K): Remove.
(ONE_M): Likewise.
(SCALE): Likewise.
(STAT_LABEL): Likewise.
(FORMAT_AMOUNT): Likewise.
(dump_line_table_statistics): Use SIZE_AMOUNT.
* mem-stats.h (struct mem_usage): Likewise.
* rtl.c (dump_rtx_statistics): Likewise.
(rtx_alloc_counts): Change type to size_t.
(rtx_alloc_sizes): Likewise.
(rtx_count_cmp): New.
(dump_rtx_statistics): Sort first based on counts.
* tree.c (tree_nodes_cmp): New.
(tree_codes_cmp): New.
(dump_tree_statistics): Sort first based on counts.
* system.h (ONE_K): New.
(ONE_M): Likewise.
(SIZE_SCALE): Likewise.
(SIZE_LABEL): Likewise.
(SIZE_AMOUNT): Likewise.
* tree-cfg.c (dump_cfg_stats): Use SIZE_AMOUNT.
* tree-dfa.c (dump_dfa_stats): Likewise.
* tree-phinodes.c (phinodes_print_statistics): Likewise.
* tree-ssanames.c (ssanames_print_statistics): Likewise.
* tree.c (dump_tree_statistics): Likewise.
* vec.c (struct vec_usage): Likewise.
* trans-mem.c (tm_mangle): Enlarge buffer in order to not
trigger a -Werror=format-overflow with
--enable-gather-detailed-stats.

From-SVN: r265800

5 years agoFix vector memory statistics.
Martin Liska [Mon, 5 Nov 2018 13:35:56 +0000 (14:35 +0100)]
Fix vector memory statistics.

2018-11-05  Martin Liska  <mliska@suse.cz>

* mem-stats.h (mem_alloc_description::release_instance_overhead):
Return T *.
* vec.c (struct vec_usage): Register m_element_size.
(vec_prefix::register_overhead): New arguments: elements and
element_size.
(vec_prefix::release_overhead): Subtract elements.
* vec.h (struct vec_prefix): Change signature.
(va_heap::reserve): Pass proper arguments.
(va_heap::release): Likewise.

From-SVN: r265799

5 years agoFix GNU coding style.
Martin Liska [Mon, 5 Nov 2018 13:35:38 +0000 (14:35 +0100)]
Fix GNU coding style.

2018-11-05  Martin Liska  <mliska@suse.cz>

* mem-stats.h (mem_alloc_description::get_list): Fix GNU coding
style.
* vec.c: Likewise.

From-SVN: r265798

5 years agoFix string pool statistics.
Martin Liska [Mon, 5 Nov 2018 13:35:09 +0000 (14:35 +0100)]
Fix string pool statistics.

2018-11-05  Martin Liska  <mliska@suse.cz>

* symtab.c (ht_dump_statistics): Make dump conditional
based on alloc_subobject.

From-SVN: r265797

5 years agoFix build on sparc64-linux-gnu.
Martin Liska [Mon, 5 Nov 2018 13:34:36 +0000 (14:34 +0100)]
Fix build on sparc64-linux-gnu.

2018-11-05  Martin Liska  <mliska@suse.cz>

PR sanitizer/87860
* sanitizer_common/sanitizer_linux.cc:  Cherry-pick upstream
r346129.

From-SVN: r265796

5 years agotree-scalar-evolution.h (final_value_replacement_loop): Update prototype.
Richard Biener [Mon, 5 Nov 2018 11:11:04 +0000 (11:11 +0000)]
tree-scalar-evolution.h (final_value_replacement_loop): Update prototype.

2018-11-05  Richard Biener  <rguenther@suse.de>

* tree-scalar-evolution.h (final_value_replacement_loop): Update
prototype.
* tree-scalar-evolution.c (final_value_replacement_loop): Return
whether anything was done.
(scev_const_prop): Remove constant propagation part, fold
remains into ...
* tree-ssa-loop.c (pass_scev_cprop::execute): ... here.
(pass_data_scev_cprop): TODO_cleanup_cfg is now done
conditionally.

* gcc.dg/pr41488.c: Scan ivcanon dump instead of sccp one.
* gcc.dg/tree-ssa/scev-7.c: Likewise.

From-SVN: r265795

5 years agore PR tree-optimization/87859 (store-merging miscompilation of mesa)
Jakub Jelinek [Mon, 5 Nov 2018 10:28:19 +0000 (11:28 +0100)]
re PR tree-optimization/87859 (store-merging miscompilation of mesa)

PR tree-optimization/87859
* gimple-ssa-store-merging.c (struct merged_store_group): Add
only_constants and first_nonmergeable_order members.
(merged_store_group::merged_store_group): Initialize them.
(merged_store_group::do_merge): Clear only_constants member if
adding something other than INTEGER_CST store.
(imm_store_chain_info::coalesce_immediate_stores): Don't merge
stores with order >= first_nonmergeable_order.  Use
merged_store->only_constants instead of always recomputing it.
Set merged_store->first_nonmergeable_order if we've skipped any
stores.  Attempt to merge overlapping INTEGER_CST stores that
we would otherwise skip.

* gcc.dg/store_merging_24.c: New test.
* gcc.dg/store_merging_25.c: New test.

From-SVN: r265794

5 years agore PR sanitizer/87837 (-O2 -fsanitize=signed-integer-overflow misses overflows on...
Jakub Jelinek [Mon, 5 Nov 2018 10:27:13 +0000 (11:27 +0100)]
re PR sanitizer/87837 (-O2 -fsanitize=signed-integer-overflow misses overflows on x86-64)

PR sanitizer/87837
* match.pd (X + Y < X): Don't optimize if TYPE_OVERFLOW_SANITIZED.

* c-c++-common/ubsan/pr87837.c: New test.

From-SVN: r265793

5 years agore PR target/87853 (_mm_cmpgt_epi8 broken with -funsigned-char)
Xuepeng Guo [Mon, 5 Nov 2018 09:51:09 +0000 (09:51 +0000)]
re PR target/87853 (_mm_cmpgt_epi8 broken with -funsigned-char)

2018-11-05  Xuepeng Guo  <xuepeng.guo@intel.com>

PR target/87853
* config/i386/emmintrin.h (__v16qs): New to cope with option
-funsigned-char.
(_mm_cmpeq_epi8): Replace __v16qi with __v16qs.
(_mm_cmplt_epi8): Likewise.
(_mm_cmpgt_epi8): Likewise.

From-SVN: r265792

5 years agore PR middle-end/87852 (FAIL: gcc.c-torture/execute/pr53465.c)
Richard Biener [Mon, 5 Nov 2018 08:04:49 +0000 (08:04 +0000)]
re PR middle-end/87852 (FAIL: gcc.c-torture/execute/pr53465.c)

2018-11-05  Richard Biener  <rguenther@suse.de>

PR rtl-optimization/87852
* fwprop.c (use_killed_between): Only consider single-defs of the
use whose definition statement dominates the use.

From-SVN: r265791

5 years agoImplement UDL changes from P0732R2.
Jason Merrill [Mon, 5 Nov 2018 07:47:05 +0000 (02:47 -0500)]
Implement UDL changes from P0732R2.

Implementing the UDL changes was pretty straightforward; I simplified
cp_parser_userdef_string_literal using the releasing_vec type from mangle.c.

While looking at this, I realized that the string UDL template taking a
character pack that we implemented for C++14 didn't actually make it into
C++14, so I've added a pedwarn for it and no longer suggest it in the
diagnostic about an invalid UDL template.

* cp-tree.h (struct releasing_vec): Move from mangle.c.
Add get_ref method.
* parser.c (cp_parser_userdef_string_literal): Use it.  Handle
passing the string to a single template parameter of class type.
(cp_parser_template_declaration_after_parameters): Allow it.
Pedwarn about the character pack template that was proposed but not
accepted for C++14, and don't suggest it.

From-SVN: r265790

5 years agoImplement P0732R2, class types in non-type template parameters.
Jason Merrill [Mon, 5 Nov 2018 07:47:02 +0000 (02:47 -0500)]
Implement P0732R2, class types in non-type template parameters.

There is one significant piece of this that is not implemented yet: the
reliance on defaulted operator<=>, which someone else has been working on.
So, for the moment those lines are commented out of the testcases.

One tricky bit was treating template parameters of classtype as const
lvalues without making their decltype const; for this I used a
VIEW_CONVERT_EXPR wrapper, which previously could only appear in templates
as location wrappers.

The user-defined literal parts of P0732R2 are in the next patch.

gcc/cp/
* error.c (dump_simple_decl): Look through a template parm object.
* mangle.c (write_template_arg): Likewise.
(mangle_template_parm_object): New.
* pt.c (template_parm_object_p, get_template_parm_object): New.
(invalid_tparm_referent_p): Factor from convert_nontype_argument.
(convert_nontype_argument, invalid_nontype_parm_type_p): Handle
class-type template arguments.
* tree.c (lvalue_kind): Likewise.
gcc/c-family/
* c-cppbuiltin.c (c_cpp_builtins): Add
__cpp_nontype_template_parameter_class.
libiberty/
* cp-demangle.c (d_dump, d_make_comp, d_count_templates_scopes)
(d_print_comp_inner): Handle DEMANGLE_COMPONENT_TPARM_OBJ.
(d_special_name): Handle TA.
(d_expresion_1): Fix demangling of brace-enclosed initializer list.
include/
* demangle.h (enum demangle_component_type): Add
DEMANGLE_COMPONENT_TPARM_OBJ.

From-SVN: r265789

5 years agoFix various latent issues revealed by P0732 work.
Jason Merrill [Mon, 5 Nov 2018 07:46:57 +0000 (02:46 -0500)]
Fix various latent issues revealed by P0732 work.

The initialized_type hunk fixes handling of void AGGR_INIT_EXPRs that call a
non-constructor; an AGGR_INIT_EXPR can have void type if its initialization
semantics are more complicated than just expanding the call.

The cxx_eval_vec_init_1 hunk corrects AGGR_INIT_EXPRs that were
nonsensically built to initialize an object of void type.  And the
build_aggr_init_expr hunk makes sure we don't do that again.

The ocp_convert and cxx_eval_outermost_constant_expr hunks deal with making
sure that a constant CONSTRUCTOR has the right type.

* cvt.c (ocp_convert): Don't wrap a CONSTRUCTOR in a NOP_EXPR.
* constexpr.c (initialized_type): Fix AGGR_INIT_EXPR handling.
(cxx_eval_vec_init_1): Correct type of AGGR_INIT_EXPR.
(cxx_eval_outermost_constant_expr): Make sure a CONSTRUCTOR has the
right type.  Don't wrap a CONSTRUCTOR if one was passed in.
* tree.c (build_aggr_init_expr): Check for void.

From-SVN: r265788

5 years agoPR c++/60503 - wrong lambda attribute syntax.
Jason Merrill [Mon, 5 Nov 2018 07:46:52 +0000 (02:46 -0500)]
PR c++/60503 - wrong lambda attribute syntax.

This patch fixes two issues with lambda attribute handling: First, it was in
the wrong place in the grammar.  Second, it was treating attributes as
applying to the whole declaration rather than to the function type, as
specified by the standard.

* parser.c (cp_parser_lambda_declarator_opt): Fix attribute
handling.

From-SVN: r265787

5 years agoRemove options that are not disabled with -Os (PR web/87829).
Martin Liska [Mon, 5 Nov 2018 07:33:58 +0000 (08:33 +0100)]
Remove options that are not disabled with -Os (PR web/87829).

2018-11-05  Martin Liska  <mliska@suse.cz>

PR web/87829
* doc/invoke.texi: Remove options that are
not disabled with -Os.

From-SVN: r265786

5 years agoVerify that last argument of __builtin_expect_with_probability is a real cst (PR...
Martin Liska [Mon, 5 Nov 2018 07:33:30 +0000 (08:33 +0100)]
Verify that last argument of __builtin_expect_with_probability is a real cst (PR c/87811).

2018-11-05  Martin Liska  <mliska@suse.cz>

PR c/87811
* predict.c (expr_expected_value_1): Verify
that last argument is a real constants and emit
error.
2018-11-05  Martin Liska  <mliska@suse.cz>

PR c/87811
* gcc.dg/pr87811.c: New test.
* gcc.dg/pr87811-2.c: Likewise.
* gcc.dg/pr87811-3.c: Likewise.
2018-11-05  Martin Liska  <mliska@suse.cz>

PR c/87811
* doc/extend.texi: Update constrain about the last argument
of __builtin_expect_with_probability.

From-SVN: r265785

5 years agoFix setting of hotness in non-LTO mode (PR gcov-profile/77698).
Martin Liska [Mon, 5 Nov 2018 07:32:48 +0000 (08:32 +0100)]
Fix setting of hotness in non-LTO mode (PR gcov-profile/77698).

2018-11-05  Martin Liska  <mliska@suse.cz>

PR gcov-profile/77698
* ipa-profile.c (ipa_profile): Adjust hotness threshold
only in LTO mode.
2018-11-05  Martin Liska  <mliska@suse.cz>

PR gcov-profile/77698
* gcc.dg/tree-prof/pr77698.c: New test.

From-SVN: r265784

5 years agoDaily bump.
GCC Administrator [Mon, 5 Nov 2018 00:16:57 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r265783

5 years agoMerge dmd upstream 6243fa6d2
Iain Buclaw [Sun, 4 Nov 2018 23:34:44 +0000 (23:34 +0000)]
Merge dmd upstream 6243fa6d2

This introduces a new header that pulls in system includes for use only
in the DMD front-end part of the compiler, fixing up uses of problematic
functions that are prevalent throughout the code.

Commits merged from dmd.

    Fix build of the D frontend on the Hurd and KFreeBSD.
    Initial patch from Matthias Klose.
    https://github.com/dlang/dmd/pull/8893

    Don't care about D/C++ compatibility in C++ port.
    Fixes build error in https://gcc.gnu.org/PR87788
    https://github.com/dlang/dmd/pull/8895

    Allow compiling front-end headers with strict warnings.
    https://github.com/dlang/dmd/pull/8909

    Add root/system.h header for wrapping system includes.
    Fixes https://gcc.gnu.org/PR87865
    https://github.com/dlang/dmd/pull/8910

    Move checkedint to dmd/root.
    https://github.com/dlang/dmd/pull/8912

    Use rmem instead of libc for malloc() and strdup().
    https://github.com/dlang/dmd/pull/8913

    Use align(8) for alignment of UnionExp, fixing several BUS errors
    due to alignment issues on SPARC.
    https://github.com/dlang/dmd/pull/8914

    Don't pass NULL pointer as format parameter to errorSupplemental.
    https://github.com/dlang/dmd/pull/8916

gcc/d/ChangeLog:

2018-11-05  Iain Buclaw  <ibuclaw@gdcproject.org>

PR d/87865
* d-system.h: New file.

From-SVN: r265780

5 years agore PR tree-optimization/86572 (unsafe strlen folding of const arguments with non...
Bernd Edlinger [Sun, 4 Nov 2018 19:51:09 +0000 (19:51 +0000)]
re PR tree-optimization/86572 (unsafe strlen folding of const arguments with non-const offset)

gcc:
2018-11-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR tree-optimization/86572
        * builtins.c (c_strlen): Handle negative offsets in a safe way.

testsuite:
2018-11-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR tree-optimization/86572
        * gcc.dg/pr86572.c: New test.

From-SVN: r265778

5 years agore PR tree-optimization/87672 (81512c36 causes ICE in bootstrap stage 3 using "-D_FOR...
Bernd Edlinger [Sun, 4 Nov 2018 19:46:08 +0000 (19:46 +0000)]
re PR tree-optimization/87672 (81512c36 causes ICE in bootstrap stage 3 using "-D_FORTIFY_SOURCE=2"   (invalid operand in unary operation, incorrect sharing of tree nodes, verify_gimple failed))

gcc:
2018-11-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR tree-optimization/87672
        * gimple-fold.c (gimple_fold_builtin_stxcpy_chk): Gimplify.
        * tree-ssa-strlen.c (handle_builtin_strcat): Adjust object size.

testsuite:
2018-11-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR tree-optimization/87672
        * gcc.dg/pr87672.c: New test.

From-SVN: r265777

5 years agore PR c++/58372 (internal compiler error: ix86_compute_frame_layout)
Uros Bizjak [Sun, 4 Nov 2018 19:22:50 +0000 (20:22 +0100)]
re PR c++/58372 (internal compiler error: ix86_compute_frame_layout)

PR middle-end/58372
* cfgexpand.c (pass_expand::execute): Move the call to
finish_eh_generation in front of the call to expand_stack_alignment.

testsuite/ChangeLog:

PR middle-end/58372
* g++.target/i386/pr58372.C: New test.

From-SVN: r265776

5 years agoEnable support for next generation AMD Zen CPU, via -march=znver2.
Venkataramanan Kumar [Sun, 4 Nov 2018 11:17:54 +0000 (11:17 +0000)]
Enable support for next generation AMD Zen CPU, via -march=znver2.

gcc/ChangeLog:
* common/config/i386/i386-common.c (processor_alias_table): Add znver2 entry.
* config.gcc (i[34567]86-*-linux* | ...): Add znver2.
(case ${target}): Add znver2.
* config/i386/driver-i386.c: (host_detect_local_cpu): Let
-march=native recognize znver2 processors.
* config/i386/i386-c.c (ix86_target_macros_internal): Add znver2.
* config/i386/i386.c (m_znver2): New definition.
(m_ZNVER): New definition.
(m_AMD_MULTIPLE): Includes m_znver2.
(processor_cost_table): Add znver2 entry.
(processor_target_table): Add znver2 entry.
(get_builtin_code_for_version): Set priority for
PROCESSOR_ZNVER2.
(processor_model): Add M_AMDFAM17H_ZNVER2.
(arch_names_table): Ditto.
(ix86_reassociation_width): Include znver2.
* config/i386/i386.h (TARGET_znver2): New definition.
(struct ix86_size_cost): Add TARGET_ZNVER2.
(enum processor_type): Add PROCESSOR_ZNVER2.
* config/i386/i386.md (define_attr "cpu"): Add znver2.
* config/i386/x86-tune-costs.h: (processor_costs) Add znver2 costs.
* config/i386/x86-tune-sched.c: (ix86_issue_rate): Add znver2.
(ix86_adjust_cost): Add znver2.
* config/i386/x86-tune.def:  Replace m_ZNVER1 by m_ZNVER
* gcc/doc/extend.texi: Add details about znver2.
* gcc/doc/invoke.texi: Add details about znver2.

libgcc/ChangeLog
* config/i386/cpuinfo.c: (get_amd_cpu): Add znver2.
* config/i386/cpuinfo.h(processor_subtypes): Ditto.

From-SVN: r265775

5 years agoMAINTAINERS (Write After Approval): Add myself.
Stafford Horne [Sun, 4 Nov 2018 09:07:48 +0000 (09:07 +0000)]
MAINTAINERS (Write After Approval): Add myself.

2018-11-04  Stafford Horne  <shorne@gmail.com>

* MAINTAINERS (Write After Approval): Add myself.

From-SVN: r265774

5 years agoDaily bump.
GCC Administrator [Sun, 4 Nov 2018 00:16:44 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r265773

5 years agore PR target/87079 (nios2 optimization for size - case of regression relatively to...
Sandra Loosemore [Sat, 3 Nov 2018 18:12:44 +0000 (14:12 -0400)]
re PR target/87079 (nios2 optimization for size - case of regression relatively to 5.3.0)

2018-11-03  Sandra Loosemore  <sandra@codesourcery.com>

PR target/87079

gcc/
* config/nios2/nios2.c (nios2_rtx_costs): Recognize <mul>sidi3
pattern.

gcc/testsuite/
* gcc.target/nios2/pr87079-1.c: New.
* gcc.target/nios2/pr87079-2.c: New.

From-SVN: r265770

5 years agoDaily bump.
GCC Administrator [Sat, 3 Nov 2018 00:17:46 +0000 (00:17 +0000)]
Daily bump.

From-SVN: r265766

5 years agore PR fortran/46020 (Improve error string for BIND(C) diagnostic for len>1 character...
Thomas Koenig [Fri, 2 Nov 2018 20:20:43 +0000 (20:20 +0000)]
re PR fortran/46020 (Improve error string for BIND(C) diagnostic for len>1 character return type)

2018-11-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/46020
    * decl.c (verify_bind_c_sym): Remove unnecessary space
    in error message.

From-SVN: r265757

5 years agoMove gcc.dg/compat dg-skip-if to *_main.c files
Rainer Orth [Fri, 2 Nov 2018 19:18:31 +0000 (19:18 +0000)]
Move gcc.dg/compat dg-skip-if to *_main.c files

* gcc.dg/compat/pr83487-1_y.c: Move dg-skip-if ...
* gcc.dg/compat/pr83487-1_main.c: ... here.
* gcc.dg/compat/struct-by-value-10_main.c,
gcc.dg/compat/struct-by-value-10_x.c,
gcc.dg/compat/struct-by-value-11_main.c,
gcc.dg/compat/struct-by-value-11_x.c,
gcc.dg/compat/struct-by-value-12_main.c,
gcc.dg/compat/struct-by-value-12_x.c,
gcc.dg/compat/struct-by-value-13_main.c,
gcc.dg/compat/struct-by-value-13_x.c,
gcc.dg/compat/struct-by-value-14_main.c,
gcc.dg/compat/struct-by-value-14_x.c,
gcc.dg/compat/struct-by-value-15_main.c,
gcc.dg/compat/struct-by-value-15_x.c,
gcc.dg/compat/struct-by-value-17_main.c,
gcc.dg/compat/struct-by-value-17_x.c,
gcc.dg/compat/struct-by-value-18_main.c,
gcc.dg/compat/struct-by-value-18_x.c,
gcc.dg/compat/struct-by-value-2_main.c,
gcc.dg/compat/struct-by-value-2_x.c,
gcc.dg/compat/struct-by-value-22_main.c,
gcc.dg/compat/struct-by-value-22_x.c,
gcc.dg/compat/struct-by-value-3_main.c,
gcc.dg/compat/struct-by-value-3_x.c,
gcc.dg/compat/struct-by-value-4_main.c,
gcc.dg/compat/struct-by-value-4_x.c,
gcc.dg/compat/struct-by-value-5b_main.c,
gcc.dg/compat/struct-by-value-5b_x.c,
gcc.dg/compat/struct-by-value-6b_main.c,
gcc.dg/compat/struct-by-value-6b_x.c,
gcc.dg/compat/struct-by-value-6b_main.c,
gcc.dg/compat/struct-by-value-7b_x.c,
gcc.dg/compat/struct-by-value-7b_main.c,
gcc.dg/compat/struct-by-value-8_main.c,
gcc.dg/compat/struct-by-value-8_x.c,
gcc.dg/compat/struct-by-value-9_main.c,
gcc.dg/compat/struct-by-value-9_x.c,
gcc.dg/compat/struct-return-2_main.c,
gcc.dg/compat/struct-return-2_x.c: Likewise.

From-SVN: r265755

5 years agors6000-string.c (expand_strncmp_gpr_sequence): Pay attention to TARGET_AVOID_XFORM...
Aaron Sawdey [Fri, 2 Nov 2018 17:02:38 +0000 (17:02 +0000)]
rs6000-string.c (expand_strncmp_gpr_sequence): Pay attention to TARGET_AVOID_XFORM and BYTES_BIG_ENDIAN.

2018-11-02  Aaron Sawdey  <acsawdey@linux.ibm.com>

* config/rs6000/rs6000-string.c (expand_strncmp_gpr_sequence): Pay
attention to TARGET_AVOID_XFORM and BYTES_BIG_ENDIAN.

From-SVN: r265751

5 years agoAlthough there's no fundamental reason why shrink wrapping and speculation tracking...
Richard Earnshaw [Fri, 2 Nov 2018 13:36:31 +0000 (13:36 +0000)]
Although there's no fundamental reason why shrink wrapping and speculation tracking are incompatible...

Although there's no fundamental reason why shrink wrapping and
speculation tracking are incompatible, a phase-ordering requirement
(we need to do speculation tracking before the final basic block
clean-up) means that the shrink wrapping pass can undo some of the
changes the speculation tracking pass makes.  The result is that the
tracking, while still safe is less comprehensive than we really want.

So to keep things simple, and because the tracking code is quite
expensive anyway, it seems best to just disable that pass when we are
tracking speculative execution.

 * config/aarch64/aarch64.c (aarch64_override_options): Disable
 shrink-wrapping when -mtrack-speculation.

From-SVN: r265747