gcc.git
5 years agobuiltin-sprintf-10.c: Cast wchar_t to wint_t to avoid a bogus -Wformat warning in...
Martin Sebor [Fri, 22 Feb 2019 23:08:23 +0000 (23:08 +0000)]
builtin-sprintf-10.c: Cast wchar_t to wint_t to avoid a bogus -Wformat warning in ILP32 (bug 77970).

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/builtin-sprintf-10.c: Cast wchar_t to wint_t
to avoid a bogus -Wformat warning in ILP32 (bug 77970).

From-SVN: r269137

5 years agobaseline_symbols.txt: Adjust.
Eric Botcazou [Fri, 22 Feb 2019 21:25:59 +0000 (21:25 +0000)]
baseline_symbols.txt: Adjust.

* config/abi/post/sparc64-linux-gnu/baseline_symbols.txt: Adjust.
* config/abi/post/sparc64-linux-gnu/32/baseline_symbols.txt: Likewise.

From-SVN: r269136

5 years agore PR fortran/83057 (OPEN without a filename and without STATUS='SCRATCH' could produ...
Harald Anlauf [Fri, 22 Feb 2019 20:35:38 +0000 (20:35 +0000)]
re PR fortran/83057 (OPEN without a filename and without STATUS='SCRATCH' could produce a warning)

2019-02-22  Harald Anlauf  <anlauf@gmx.de>

PR fortran/83057
* io.c (gfc_match_open): Fix logic in checks of OPEN statement
when NEWUNIT= is specified.

PR fortran/83057
* gfortran.dg/newunit_6.f90: New test.

From-SVN: r269134

5 years agore PR fortran/89431 (CPP integer macros not defined)
Steven G. Kargl [Fri, 22 Feb 2019 20:27:57 +0000 (20:27 +0000)]
re PR fortran/89431 (CPP integer macros not defined)

2019-02-22  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/89431
* gfortran.texi: Fix documentation to match the implementation.

From-SVN: r269132

5 years agoPR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
Marek Polacek [Fri, 22 Feb 2019 19:24:37 +0000 (19:24 +0000)]
PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.

* decl.c (build_explicit_specifier): Don't check
processing_template_decl.  Call instantiation_dependent_expression_p
instead of value_dependent_expression_p.  Call
instantiate_non_dependent_expr_sfinae before
build_converted_constant_expr instead of calling
instantiate_non_dependent_expr after it.  Add
processing_template_decl_sentinel.

* g++.dg/cpp2a/explicit14.C: New test.

From-SVN: r269131

5 years agore PR libstdc++/89402 (warning: ‘void _ZNKSt4hashIeEclEe()’ specifies less restrictiv...
Jakub Jelinek [Fri, 22 Feb 2019 19:10:47 +0000 (20:10 +0100)]
re PR libstdc++/89402 (warning: ‘void _ZNKSt4hashIeEclEe()’ specifies less restrictive attribute than its target)

PR libstdc++/89402
* src/c++98/compatibility-ldbl.cc (_ZNKSt4hashIeEclEe): Change return
type to std::size_t and argument to type to long double.

From-SVN: r269130

5 years agoextend.texi (Other Builtins): Add __builtin_is_constant_evaluated.
Martin Sebor [Fri, 22 Feb 2019 18:38:36 +0000 (18:38 +0000)]
extend.texi (Other Builtins): Add __builtin_is_constant_evaluated.

gcc/ChangeLog:

* doc/extend.texi (Other Builtins): Add
__builtin_is_constant_evaluated.

From-SVN: r269129

5 years agore PR tree-optimization/87609 (miscompilation with restrict and loop)
Richard Biener [Fri, 22 Feb 2019 17:56:59 +0000 (17:56 +0000)]
re PR tree-optimization/87609 (miscompilation with restrict and loop)

2019-02-22  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87609
* tree-cfg.c (gimple_duplicate_bb): Only remap inlined cliques.

From-SVN: r269127

5 years agoPR tree-optimization/88993 - GCC 9 -Wformat-overflow=2 should reflect real libc limits
Martin Sebor [Fri, 22 Feb 2019 17:38:11 +0000 (10:38 -0700)]
PR tree-optimization/88993 - GCC 9 -Wformat-overflow=2 should reflect real libc limits

PR tree-optimization/88993 - GCC 9 -Wformat-overflow=2 should reflect real libc limits
PR tree-optimization/88835 - overly aggressive -Werror=format-overflow for printf

gcc/ChangeLog:

PR tree-optimization/88993
PR tree-optimization/88853
* gimple-ssa-sprintf.c (sprintf_dom_walker::call_info::is_file_func):
New helper.
(sprintf_dom_walker::call_info::is_string_func): New helper.
(format_directive): Only issue "may exceed" 4095/INT_MAX warnings
for formatted string functions.
(sprintf_dom_walker::handle_gimple_call): Fix a typo in a comment.

gcc/testsuite/ChangeLog:

PR tree-optimization/88993
PR tree-optimization/88853
* gcc.dg/tree-ssa/builtin-fprintf-warn-2.c: New test.
* gcc.dg/tree-ssa/builtin-printf-warn-2.c: New test.
* gcc.dg/tree-ssa/builtin-snprintf-warn-3.c: Adjust.
* gcc.dg/tree-ssa/builtin-sprintf-warn-18.c: Same.

From-SVN: r269125

5 years agore PR rtl-optimization/87761 ([MIPS] New FAIL: gcc.target/mips/fix-r4000-10.c ...
Jeff Law [Fri, 22 Feb 2019 16:38:43 +0000 (09:38 -0700)]
re PR rtl-optimization/87761 ([MIPS] New FAIL: gcc.target/mips/fix-r4000-10.c   -O1 start with r265398)

PR rtl-optimization/87761
* config/mips/mips.md: Add new combiner pattern to recognize
a bitfield extraction using (ashiftrt (truncate (ashift (...)))).

From-SVN: r269123

5 years agoHandle stack pointer with SUBS/ADDS instructions.
Matthew Malcomson [Fri, 22 Feb 2019 16:35:22 +0000 (16:35 +0000)]
Handle stack pointer with SUBS/ADDS instructions.

In general the stack pointer was not handled for many SUBS/ADDS patterns in
aarch64.md.
Both the "extended register" and "immediate" forms allow the stack pointer to be
used as the source register, while no form allows the stack pointer for the
destination register.

The define_insn patterns generating ADDS/SUBS did not allow the stack pointer
for any operand, while the define_peephole2 patterns that generated RTX to be
matched by these patterns allowed the stack pointer for any operand.

The patterns are fixed by adding the 'k' constraint for the first source operand
to all define_insns that generate the ADDS/SUBS "extended register" and
"immediate" forms (but not the "shifted register" form).

In peephole optimizations, constraint strings are ignored (see "(gccint) C
Constraint Interface" info node in the documentation), so the decision to act or
not is based solely on the predicate and condition.
This patch introduces a new predicate "aarch64_general_reg" to be used in
define_peephole2 patterns where only GENERAL_REGS registers are acceptable and
uses that predicate in the peepholes that generate patterns for ADDS/SUBS.

Full bootstrap and regtest done on aarch64-none-linux-gnu.
Regression tests done on aarch64-none-linux-gnu and aarch64-none-elf cross
compiler.

OK for trunk?

gcc/ChangeLog:

2019-02-22  Matthew Malcomson  <matthew.malcomson@arm.com>

PR target/89324
* config/aarch64/aarch64.md: Use aarch64_general_reg predicate on
destination register in peepholes generating patterns for ADDS/SUBS.
(add<mode>3_compare0,
*addsi3_compare0_uxtw, add<mode>3_compareC,
add<mode>3_compareV_imm, add<mode>3_compareV,
*adds_<optab><ALLX:mode>_<GPI:mode>,
*subs_<optab><ALLX:mode>_<GPI:mode>,
*adds_<optab><ALLX:mode>_shift_<GPI:mode>,
*subs_<optab><ALLX:mode>_shift_<GPI:mode>,
*adds_<optab><mode>_multp2, *subs_<optab><mode>_multp2,
*sub<mode>3_compare0, *subsi3_compare0_uxtw,
sub<mode>3_compare1): Allow stack pointer for source register.
* config/aarch64/predicates.md (aarch64_general_reg): New predicate.

gcc/testsuite/ChangeLog:

2019-02-22  Matthew Malcomson  <matthew.malcomson@arm.com>

PR target/89324
* gcc.dg/rtl/aarch64/subs_adds_sp.c: New test.
* gfortran.fortran-torture/compile/pr89324.f90: New test.

From-SVN: r269122

5 years agoPR c/89425 - -Wabsolute-value warns in dead subexpressions
Martin Sebor [Fri, 22 Feb 2019 16:24:36 +0000 (16:24 +0000)]
PR c/89425 - -Wabsolute-value warns in dead subexpressions

gcc/c/ChangeLog:

PR c/89425
* c-parser.c (sizeof_ptr_memacc_comptypes): Avoid warning in
unreachable subexpressions.

gcc/testsuite/ChangeLog:

PR c/89425
* gcc.dg/Wabsolute-value.c: New test.

From-SVN: r269121

5 years agoWbuiltin-declaration-mismatch-12.c: New test.
Martin Sebor [Fri, 22 Feb 2019 16:21:07 +0000 (16:21 +0000)]
Wbuiltin-declaration-mismatch-12.c: New test.

gcc/testsuite/ChangeLog:
* gcc.dg/Wbuiltin-declaration-mismatch-12.c: New test.

From-SVN: r269120

5 years agoi386: Add pass_remove_partial_avx_dependency
H.J. Lu [Fri, 22 Feb 2019 15:54:08 +0000 (15:54 +0000)]
i386: Add pass_remove_partial_avx_dependency

With -mavx, for

$ cat foo.i
extern float f;
extern double d;
extern int i;

void
foo (void)
{
  d = f;
  f = i;
}

we need to generate

vxorp[ds] %xmmN, %xmmN, %xmmN
...
vcvtss2sd f(%rip), %xmmN, %xmmX
...
vcvtsi2ss i(%rip), %xmmN, %xmmY

to avoid partial XMM register stall.  This patch adds a pass to generate
a single

vxorps %xmmN, %xmmN, %xmmN

at entry of the nearest dominator for basic blocks with SF/DF conversions,
which is in the fake loop that contains the whole function, instead of
generating one

vxorp[ds] %xmmN, %xmmN, %xmmN

for each SF/DF conversion.

NB: The LCM algorithm isn't appropriate here since it may place a vxorps
inside the loop.  Simple testcase show this:

$ cat badcase.c

extern float f;
extern double d;

void
foo (int n, int k)
{
  for (int j = 0; j != n; j++)
    if (j < k)
      d = f;
}

It generates

    ...
    loop:
      if(j < k)
        vxorps    %xmm0, %xmm0, %xmm0
        vcvtss2sd f(%rip), %xmm0, %xmm0
      ...
    loopend
    ...

This is because LCM only works when there is a certain benifit.  But for
conditional branch, LCM wouldn't move

   vxorps  %xmm0, %xmm0, %xmm0

out of loop.  SPEC CPU 2017 on Intel Xeon with AVX512 shows:

1. The nearest dominator

|RATE |Improvement|
|500.perlbench_r | 0.55% |
|538.imagick_r | 8.43% |
|544.nab_r | 0.71% |

2. LCM

|RATE |Improvement|
|500.perlbench_r | -0.76% |
|538.imagick_r | 7.96%  |
|544.nab_r | -0.13% |

Performance impacts of SPEC CPU 2017 rate on Intel Xeon with AVX512
using

-Ofast -flto -march=skylake-avx512 -funroll-loops

before

commit e739972ad6ad05e32a1dd5c29c0b950a4c4bd576
Author: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Jan 31 20:06:42 2019 +0000

            PR target/89071
            * config/i386/i386.md (*extendsfdf2): Split out reg->reg
            alternative to avoid partial SSE register stall for TARGET_AVX.
            (truncdfsf2): Ditto.
            (sse4_1_round<mode>2): Ditto.

    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268427 138bc75d-0d04-0410-961f-82ee72b054a4

are:

|INT RATE |Improvement|
|500.perlbench_r | 0.55% |
|502.gcc_r | 0.14% |
|505.mcf_r | 0.08% |
|523.xalancbmk_r | 0.18% |
|525.x264_r |-0.49% |
|531.deepsjeng_r |-0.04% |
|541.leela_r |-0.26% |
|548.exchange2_r |-0.3% |
|557.xz_r |BuildSame|

|FP RATE |Improvement|
|503.bwaves_r         |-0.29% |
|507.cactuBSSN_r | 0.04% |
|508.namd_r |-0.74% |
|510.parest_r |-0.01% |
|511.povray_r | 2.23% |
|519.lbm_r | 0.1% |
|521.wrf_r | 0.49% |
|526.blender_r | 0.13% |
|527.cam4_r | 0.65% |
|538.imagick_r | 8.43% |
|544.nab_r | 0.71% |
|549.fotonik3d_r | 0.15% |
|554.roms_r | 0.08% |

After commit e739972ad6ad05e32a1dd5c29c0b950a4c4bd576, on Skylake client,
impacts on 538.imagick_r with

-fno-unsafe-math-optimizations -march=native -Ofast -funroll-loops -flto

1. Size comparision:

before:

   text    data     bss     dec     hex filename
2436377    8352    4528 2449257  255f69 imagick_r

after:

   text    data     bss     dec     hex filename
2425249    8352    4528 2438129  2533f1 imagick_r

2. Number of vxorps:

before after difference
4948            4135            -19.66%

3. Performance improvement:

|RATE |Improvement|
|538.imagick_r | 5.5%  |

gcc/

2019-02-22  H.J. Lu  <hongjiu.lu@intel.com>
    Hongtao Liu  <hongtao.liu@intel.com>
    Sunil K Pandey  <sunil.k.pandey@intel.com>

PR target/87007
* config/i386/i386-passes.def: Add
pass_remove_partial_avx_dependency.
* config/i386/i386-protos.h
(make_pass_remove_partial_avx_dependency): New.
* config/i386/i386.c (make_pass_remove_partial_avx_dependency):
New function.
(pass_data_remove_partial_avx_dependency): New.
(pass_remove_partial_avx_dependency): Likewise.
(make_pass_remove_partial_avx_dependency): Likewise.
* config/i386/i386.md (avx_partial_xmm_update): New attribute.
(*extendsfdf2): Add avx_partial_xmm_update.
(truncdfsf2): Likewise.
(*float<SWI48:mode><MODEF:mode>2): Likewise.
(SF/DF conversion splitters): Disabled for TARGET_AVX.

gcc/testsuite/

2019-02-22  H.J. Lu  <hongjiu.lu@intel.com>
    Hongtao Liu  <hongtao.liu@intel.com>
    Sunil K Pandey  <sunil.k.pandey@intel.com>

PR target/87007
* gcc.target/i386/pr87007-1.c: New test.
* gcc.target/i386/pr87007-2.c: Likewise.

Co-Authored-By: Hongtao Liu <hongtao.liu@intel.com>
Co-Authored-By: Sunil K Pandey <sunil.k.pandey@intel.com>
From-SVN: r269119

5 years agore PR middle-end/85598 (Incorrect -Wformat-truncation in a loop only at -O2 and -O3)
Aldy Hernandez [Fri, 22 Feb 2019 13:46:01 +0000 (13:46 +0000)]
re PR middle-end/85598 (Incorrect -Wformat-truncation in a loop only at -O2 and -O3)

PR middle-end/85598
* gimple-ssa-sprintf.c (pass_sprintf_length::execute): Enable loop
analysis for pass.

From-SVN: r269115

5 years agox86: (Reapply) Move AESNI generation to Skylake and Goldmont
Thiago Macieira [Fri, 22 Feb 2019 12:49:21 +0000 (12:49 +0000)]
x86: (Reapply) Move AESNI generation to Skylake and Goldmont

This is a repeat of commit r263989, which commit r264052 accidentally
reverted.

2019-02-22  Thiago Macieira  <thiago.macieira@intel.com>

PR target/89444
* config/i386/i386.h (PTA_WESTMERE): Remove PTA_AES.
(PTA_SKYLAKE): Add PTA_AES.
(PTA_GOLDMONT): Likewise.

From-SVN: r269114

5 years agoc-pch.c (no_checksum): Remove.
Richard Biener [Fri, 22 Feb 2019 10:59:33 +0000 (10:59 +0000)]
c-pch.c (no_checksum): Remove.

2019-02-22  Richard Biener  <rguenther@suse.de>

c-family/
* c-pch.c (no_checksum): Remove.
(pch_init): Remove assertion that executable_checksum is not
all zero.
(c_common_valid_pch): Likewise.

From-SVN: r269113

5 years ago[GCC, AArch64] Fix a couple of bugs in BTI
Sudakshina Das [Fri, 22 Feb 2019 10:55:22 +0000 (10:55 +0000)]
[GCC, AArch64] Fix a couple of bugs in BTI

While doing more testing I found a couple of issues with my BTI patches.
This patch fixes them:
1) Remove a reference to return address key. The original patch was written
based on a different not yet committed patch ([PATCH 3/3][GCC][AARCH64] Add
support for pointer authentication B key) and I missed out on cleaning this
up. This is hidden behind the configuration option and thus went unnoticed.
2) Add a missed case for adding the BTI instruction in thunk functions.

*** gcc/ChangeLog ***

2019-02-22  Sudakshina Das  <sudi.das@arm.com>

* config/aarch64/aarch64.c (aarch64_output_mi_thunk): Add bti
instruction if enabled.
(aarch64_override_options): Remove reference to return address key.

From-SVN: r269112

5 years agore PR tree-optimization/89440 (ICE in vect_create_epilog_for_reduction, at tree-vect...
Richard Biener [Fri, 22 Feb 2019 10:52:49 +0000 (10:52 +0000)]
re PR tree-optimization/89440 (ICE in vect_create_epilog_for_reduction, at tree-vect-loop.c:5502)

2019-02-22  Richard Biener  <rguenther@suse.de>

PR tree-optimization/89440
* tree-vect-loop.c (vect_create_epilog_for_reduction): Remove
not necessary assert.

* gcc.dg/vect/pr89440.c: New testcase.

From-SVN: r269111

5 years agoRemove unused check_effective_target_offload_nvptx
Thomas Schwinge [Fri, 22 Feb 2019 10:51:52 +0000 (11:51 +0100)]
Remove unused check_effective_target_offload_nvptx

gcc/testsuite/
* lib/target-supports.exp (check_effective_target_offload_nvptx):
Remove.

From-SVN: r269110

5 years ago[libgomp] In OpenACC testing, by default only build for the offload target that we...
Thomas Schwinge [Fri, 22 Feb 2019 10:51:35 +0000 (11:51 +0100)]
[libgomp] In OpenACC testing, by default only build for the offload target that we're actually going to test

... to avoid compilation overhead, and to keep simple '-foffload=[...]'
handling in test cases.

libgomp/
* testsuite/libgomp.oacc-c++/c++.exp: Specify
"-foffload=$offload_target".
* testsuite/libgomp.oacc-c/c.exp: Likewise.
* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
* testsuite/lib/libgomp.exp
(check_effective_target_openacc_nvidia_accel_configured): Remove,
as (conceptually) merged into
check_effective_target_openacc_nvidia_accel_selected.  Adjust all
users.

From-SVN: r269109

5 years ago[libgomp] In OpenACC testing, cycle though all offload targets
Thomas Schwinge [Fri, 22 Feb 2019 10:51:20 +0000 (11:51 +0100)]
[libgomp] In OpenACC testing, cycle though all offload targets

... instead of through offload plugins.

libgomp/
* plugin/configfrag.ac: Populate and AC_SUBST offload_targets.
* testsuite/libgomp-test-support.exp.in: Adjust.
* testsuite/lib/libgomp.exp: Likewise.  Don't populate
openacc_device_types_s.
(offload_target_to_openacc_device_type): New proc.
* testsuite/libgomp.oacc-c++/c++.exp: Adjust.
* testsuite/libgomp.oacc-c/c.exp: Likewise.
* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
* Makefile.in: Regenerate.
* configure: Likewise.
* testsuite/Makefile.in: Likewise.

From-SVN: r269108

5 years ago[libgomp] Clarify difference between offload target, offload plugin, and OpenACC...
Thomas Schwinge [Fri, 22 Feb 2019 10:51:05 +0000 (11:51 +0100)]
[libgomp] Clarify difference between offload target, offload plugin, and OpenACC device type

libgomp/
* plugin/configfrag.ac: Populate and AC_SUBST offload_plugins
instead of offload_targets, and AC_DEFINE_UNQUOTED OFFLOAD_PLUGINS
instead of OFFLOAD_TARGETS.
* target.c (gomp_target_init): Adjust.
* testsuite/libgomp-test-support.exp.in: Likewise.
* testsuite/lib/libgomp.exp: Likewise.  Populate
openacc_device_types_s instead of offload_targets_s_openacc.
(check_effective_target_openacc_nvidia_accel_selected)
(check_effective_target_openacc_host_selected): Adjust.
* testsuite/libgomp.oacc-c++/c++.exp: Likewise.
* testsuite/libgomp.oacc-c/c.exp: Likewise.
* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
* Makefile.in: Regenerate.
* config.h.in: Likewise.
* configure: Likewise.
* testsuite/Makefile.in: Likewise.

From-SVN: r269107

5 years ago[libgomp] In OpenACC offloading testing, be more explicit in what is supported, and...
Thomas Schwinge [Fri, 22 Feb 2019 10:50:49 +0000 (11:50 +0100)]
[libgomp] In OpenACC offloading testing, be more explicit in what is supported, and what is not, or why not

libgomp/
* testsuite/lib/libgomp.exp: Error out for unknown offload target.
* testsuite/libgomp.oacc-c++/c++.exp: Likewise.  Report if
"offloading: supported, but hardware not accessible".
* testsuite/libgomp.oacc-c/c.exp: Likewise.
* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.

From-SVN: r269106

5 years ago[PR72741] Use 'oacc_build_routine_dims' for Fortran OpenACC 'routine' directives...
Thomas Schwinge [Fri, 22 Feb 2019 10:50:35 +0000 (11:50 +0100)]
[PR72741] Use 'oacc_build_routine_dims' for Fortran OpenACC 'routine' directives, too

... instead of having an incomplete local implementation.

With these changes in place, we can then also revert the work-around r267213
"[nvptx] Unify C/Fortran routine handling in nvptx_goacc_validate_dims".

gcc/fortran/
PR fortran/72741
* gfortran.h (oacc_routine_lop): New enum.
(symbol_attribute): Use it.
* openmp.c (gfc_oacc_routine_dims): Replace with...
(gfc_oacc_routine_lop): ... this new function.
(gfc_match_oacc_routine): Adjust.
* trans-decl.c (add_attributes_to_decl): Likewise.
gcc/
PR fortran/72741
* omp-general.c (oacc_replace_fn_attrib): Mostly split out into...
(oacc_replace_fn_attrib_attr): ... this new function.
* omp-general.h (oacc_replace_fn_attrib_attr): New prototype.
* config/nvptx/nvptx.c (nvptx_goacc_validate_dims_1): Revert workaround.
gcc/testsuite/
PR fortran/72741
* gfortran.dg/goacc/classify-routine.f95: Adjust.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
From-SVN: r269105

5 years agoRevert earlier OpenACC 'routine' changes
Thomas Schwinge [Fri, 22 Feb 2019 10:50:18 +0000 (11:50 +0100)]
Revert earlier OpenACC 'routine' changes

..., which were committed as part of, but logically don't belong into r261813
"Update OpenACC data clause semantics to the 2.5 behavior", and which confuse
later changes.

gcc/fortran/
* openmp.c (gfc_match_oacc_declare): Revert earlier changes.
gcc/testsuite/
* c-c++-common/goacc/routine-5.c: Revert earlier changes.
* g++.dg/goacc/template.C: Likewise.

From-SVN: r269104

5 years agoSilence '-Whsa' diagnostic in 'gfortran.dg/goacc/pr78027.f90'
Thomas Schwinge [Fri, 22 Feb 2019 10:50:02 +0000 (11:50 +0100)]
Silence '-Whsa' diagnostic in 'gfortran.dg/goacc/pr78027.f90'

... which has been present (with HSA offloading configured) ever since this
test case got added.

gcc/testsuite/
PR fortran/78027
* gfortran.dg/goacc/pr78027.f90: Add 'dg-additional-options "-Wno-hsa"'.

From-SVN: r269103

5 years ago[C, C++] Use correct location information for OpenACC shape and simple clauses
Thomas Schwinge [Fri, 22 Feb 2019 10:49:43 +0000 (11:49 +0100)]
[C, C++] Use correct location information for OpenACC shape and simple clauses

gcc/c/
* c-parser.c (c_parser_oacc_shape_clause): Add loc formal
parameter.  Adjust all users.
(c_parser_oacc_simple_clause): Replace parser with loc formal
parameter.  Adjust all users.
gcc/cp/
* parser.c (cp_parser_oacc_simple_clause): Remove parser formal
parameter, move loc formal parameter to the front.  Adjust all
users.
(cp_parser_oacc_shape_clause): Add loc formal parameter.  Adjust
all users.

From-SVN: r269102

5 years ago[arm] Add support for Neoverse N1
Kyrylo Tkachov [Fri, 22 Feb 2019 08:59:20 +0000 (08:59 +0000)]
[arm] Add support for Neoverse N1

This patch adds support for the Neoverse N1 [1]. This CPU was previously supported through the Ares codename.
-mcpu=ares is retained as an alias of the new -mcpu=neoverse-n1.

Bootstrapped and tested on arm-none-linux-gnueabihf.

* config/arm/arm-cpus.in (ares): Rename to...
(neoverse-n1): ... This.  Add ares as alias.
* config/arm/arm-tables.opt: Regenerate.
* config/arm/arm-tune.md: Likewise.
* doc/invoke.txt (ARM Options): Document neoverse-n1.

From-SVN: r269101

5 years ago[AArch64] Add support for Neoverse E1
Kyrylo Tkachov [Fri, 22 Feb 2019 08:58:04 +0000 (08:58 +0000)]
[AArch64] Add support for Neoverse E1

This patch adds -mcpu and -mtune support for the Neoverse E1 CPU [1].
The new option is -mcpu=neoverse-e1.
Bootstrapped and tested on aarch64-none-linux-gnu.

* config/aarch64/aarch64-cores.def (neoverse-e1): Define.
* config/aarch64/aarch64-tune.md: Regenerate.
* doc/invoke.texi (AArch64 Options): Document neoverse-e1 -mcpu option.

From-SVN: r269100

5 years ago[AArch64] Add support for Neoverse N1
Kyrylo Tkachov [Fri, 22 Feb 2019 08:56:50 +0000 (08:56 +0000)]
[AArch64] Add support for Neoverse N1

This patch adds support for the Neoverse N1 CPU [1]. This was supported in GCC earlier through the codename Ares,
which it now replaces. -mcpu=ares is still accepted as there's been a binutils release supporting it,
but the internal structures are renamed to use Neoverse N1-related identifiers.

Bootstrapped and tested on aarch64-none-linux-gnu.

* config/aarch64/aarch64.c (ares_tunings): Rename to...
(neoversen1_tunings): ... This.
* config/aarch64/aarch64-cores.def (ares): Change tuning to the above.
(neoverse-n1): New CPU.
* config/aarch64/aarch64-tune.md: Regenerate.
* doc/invoke.txt (AArch64 Options): Document neoverse-n1.

From-SVN: r269099

5 years agore PR tree-optimization/87609 (miscompilation with restrict and loop)
Richard Biener [Fri, 22 Feb 2019 08:38:14 +0000 (08:38 +0000)]
re PR tree-optimization/87609 (miscompilation with restrict and loop)

2019-02-22  Richard Biener  <rguenther@suse.de>

PR middle-end/87609
* cfghooks.h (dependence_hash): New typedef.
(struct copy_bb_data): New type.
(cfg_hooks::duplicate_block): Adjust to take a copy_bb_data argument.
(duplicate_block): Likewise.
* cfghooks.c (duplicate_block): Pass down copy_bb_data.
(copy_bbs): Create and pass down copy_bb_data.
* cfgrtl.c (cfg_layout_duplicate_bb): Adjust.
(rtl_duplicate_bb): Likewise.
* tree-cfg.c (gimple_duplicate_bb): If the copy_bb_data arg is not NULL
remap dependence info.

* gcc.dg/torture/restrict-7.c: New testcase.

From-SVN: r269098

5 years agore PR tree-optimization/87609 (miscompilation with restrict and loop)
Richard Biener [Fri, 22 Feb 2019 08:36:30 +0000 (08:36 +0000)]
re PR tree-optimization/87609 (miscompilation with restrict and loop)

2019-02-22  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87609
* tree-core.h (tree_base): Document special clique values.
* tree-inline.c (remap_dependence_clique): Do not use the
special clique value of one.
(maybe_set_dependence_info): Use clique one.
(clear_dependence_clique): New callback.
(compute_dependence_clique): Clear clique one from all refs
before assigning it (again).

From-SVN: r269097

5 years agoconfigure.host (abi_baseline_pair): Adjust for SPARC64/Linux.
Eric Botcazou [Fri, 22 Feb 2019 07:25:52 +0000 (07:25 +0000)]
configure.host (abi_baseline_pair): Adjust for SPARC64/Linux.

* configure.host (abi_baseline_pair): Adjust for SPARC64/Linux.
* config/abi/post/sparc64-linux-gnu: New directory.
* config/abi/post/sparc64-linux-gnu/baseline_symbols.txt: New file.
* config/abi/post/sparc64-linux-gnu/32: New directory.
* config/abi/post/sparc64-linux-gnu/32/baseline_symbols.txt: New file.

From-SVN: r269096

5 years agoPR c++/87685 - generic lambda 'this' capture error.
Jason Merrill [Fri, 22 Feb 2019 06:47:37 +0000 (01:47 -0500)]
PR c++/87685 - generic lambda 'this' capture error.

The standard says that in a generic lambda we should speculatively capture
'this' if we see a call to an overload set that contains a non-static member
function, but it seems wrong to reject the program if we can't capture,
since it might not actually be needed.

* lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
(maybe_generic_this_capture): Pass -1.

From-SVN: r269095

5 years agoPR c++/88394 - ICE with VLA init-capture.
Jason Merrill [Fri, 22 Feb 2019 02:47:33 +0000 (21:47 -0500)]
PR c++/88394 - ICE with VLA init-capture.

We mostly use is_normal_capture_proxy to decide whether or not to use
DECL_CAPTURED_VARIABLE; we could just check whether it's set.  VLA capture
is still mostly broken, but this fixes this ICE.

* lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.

From-SVN: r269094

5 years agoPR c++/88869 - C++17 ICE with CTAD and explicit specialization.
Jason Merrill [Fri, 22 Feb 2019 02:08:05 +0000 (21:08 -0500)]
PR c++/88869 - C++17 ICE with CTAD and explicit specialization.

The members of an explicit specialization of a class template don't have the
template parameters of that class template, so we shouldn't try to provide
arguments for them.  Only set outer_args when the class is an instantiation.

* pt.c (do_class_deduction): Don't include explicit specialization
args in outer_args.

From-SVN: r269093

5 years agoAdd tests for C++2a content of <atomic> header
Jonathan Wakely [Fri, 22 Feb 2019 01:16:15 +0000 (01:16 +0000)]
Add tests for C++2a content of <atomic> header

* testsuite/29_atomics/headers/atomic/types_std_c++20.cc: New test.
* testsuite/29_atomics/headers/atomic/types_std_c++20_neg.cc: New
test.

From-SVN: r269091

5 years agoP0482R5 char8_t: Updates to gdb pretty printing support
Tom Honermann [Fri, 22 Feb 2019 01:16:11 +0000 (01:16 +0000)]
P0482R5 char8_t: Updates to gdb pretty printing support

This patch adds recognition of the u8string and u8string_view type
aliases to the gdb pretty printer extension.

2019-02-22  Tom Honermann  <tom@honermann.net>

* python/libstdcxx/v6/printers.py (register_type_printers): Add type
printers for u8string and u8string_view.

From-SVN: r269090

5 years agoP0482R5 char8_t: Updates to existing standard library tests
Tom Honermann [Fri, 22 Feb 2019 01:16:08 +0000 (01:16 +0000)]
P0482R5 char8_t: Updates to existing standard library tests

This patch augments existing tests to validate behavior for char8_t.  In
all cases, added test cases are cloned from existing tests for wchar_t
or char16_t.

A few tests required updates to line numbers for diagnostic messages.

2019-02-22  Tom Honermann  <tom@honermann.net>

* testsuite/18_support/byte/ops.cc: Validate
std::to_integer<char8_t>, std::to_integer<char16_t>, and
std::to_integer<char32_t>.
* testsuite/18_support/numeric_limits/dr559.cc: Validate
std::numeric_limits<char8_t>.
* testsuite/18_support/numeric_limits/lowest.cc: Validate
std::numeric_limits<char8_t>::lowest().
* testsuite/18_support/numeric_limits/max_digits10.cc: Validate
std::numeric_limits<char8_t>::max_digits10.
* testsuite/18_support/type_info/fundamental.cc: Validate
typeinfo for char8_t.
* testsuite/20_util/from_chars/1_c++20_neg.cc: New test, validating
std::from_chars with char8_t.
* testsuite/20_util/hash/requirements/explicit_instantiation.cc:
Validate explicit instantiation of std::hash<char8_t>.
* testsuite/20_util/is_integral/value.cc: Validate
std::is_integral<char8_t>.
* testsuite/20_util/make_signed/requirements/typedefs-4.cc:
Validate std::make_signed<char8_t>.
* testsuite/21_strings/basic_string/cons/char/deduction.cc:
Validate u8string construction from char8_t sources.
* testsuite/21_strings/basic_string/types/pmr_typedefs.cc: Validate
std::pmr::u8string.
* testsuite/21_strings/basic_string_view/operations/compare/
char/70483.cc: Validate substr operations on u8string_view.
* testsuite/21_strings/basic_string_view/typedefs.cc: Validate that
the u8string_view typedef is defined.
* testsuite/21_strings/char_traits/requirements/
constexpr_functions.cc: Validate char_traits<char8_t> constexpr
member functions.
* testsuite/21_strings/char_traits/requirements/
constexpr_functions_c++17.cc: Validate char_traits<char8_t> C++17
constexpr member functions.
* testsuite/21_strings/headers/string/types_std_c++0x.cc: Validate
that the u8string typedef is defined.
* testsuite/22_locale/locale/cons/unicode.cc: Validate the presence
of the std::codecvt<char16_t, char8_t, std::mbstate_t> and
std::codecvt<char32_t, char8_t, std::mbstate_t> facets.
* testsuite/29_atomics/atomic/cons/assign_neg.cc: Update line
numbers.
* testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise.
* testsuite/29_atomics/atomic_integral/cons/assign_neg.cc:
Likewise.
* testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise.
* testsuite/29_atomics/atomic_integral/is_always_lock_free.cc:
Validate std::atomic<char8_t>::is_always_lock_free
* testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc:
Update line numbers.
* testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc:
Likewise.
* testsuite/29_atomics/atomic_integral/operators/increment_neg.cc:
Likewise.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
Validate std::experimental::pmr::u8string.
* testsuite/experimental/string_view/typedefs.cc: Validate that the
u8string_view typedef is defined.
* testsuite/util/testsuite_common_types.h: Add char8_t, char16_t and
char32_t to the typelists.

From-SVN: r269089

5 years agoDisambiguate __gnu_cxx::append_ partial specialization
Tom Honermann [Fri, 22 Feb 2019 01:15:58 +0000 (01:15 +0000)]
Disambiguate __gnu_cxx::append_ partial specialization

This patch corrects ambiguous partial specializations of
typelist::detail::append_.  Previously, neither append_<chain<Hd, Tl>,
Typelist_Chain> nor append_<Typelist_Chain, null_type> was a better
match for append_<chain<Hd, Tl>, null_type>.

2019-02-22  Tom Honermann  <tom@honermann.net>

* include/ext/typelist.h: Constrain a partial specialization of
typelist::detail::append_ to only match chain<T1,T2>.

From-SVN: r269088

5 years agore PR go/89406 (Go testing leaves many temporary directories in /tmp around)
Ian Lance Taylor [Fri, 22 Feb 2019 00:47:30 +0000 (00:47 +0000)]
re PR go/89406 (Go testing leaves many temporary directories in /tmp around)

PR go/89406
    net: remove unixgram test sockets

    Backport https://golang.org/cl/163277 from the master library.

    Updates https://gcc.gnu.org/PR89406

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

From-SVN: r269087

5 years agocmd/go: remove work directory on usage error
Ian Lance Taylor [Fri, 22 Feb 2019 00:41:25 +0000 (00:41 +0000)]
cmd/go: remove work directory on usage error

    Backport https://golang.org/cl/163237 from the master library:

        Ensure that cmd/go consistently calls base.Exit rather than os.Exit,
        so that we don't incorrectly leave the work directory around on exit.

        Test this by modifying the testsuite to run all the tests with TMPDIR
        set to a temporary directory, and then check that no files are left
        behind in that temporary directory. Adjust a couple of tests to make
        this approach work.

    Updates https://gcc.gnu.org/PR89406

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

From-SVN: r269086

5 years agoDaily bump.
GCC Administrator [Fri, 22 Feb 2019 00:16:20 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r269085

5 years agoextend.texi (__clear_cache): Correct signature.
Martin Sebor [Thu, 21 Feb 2019 23:23:12 +0000 (23:23 +0000)]
extend.texi (__clear_cache): Correct signature.

gcc/ChangeLog:

* doc/extend.texi (__clear_cache): Correct signature.

libgcc/ChangeLog:

* libgcc2.h (__clear_cache): Correct signature.
* libgcc2.c (__clear_cache): Same.

gcc/testsuite/ChangeLog:

* gcc.dg/Wbuiltin-declaration-mismatch-12.c: New test.

From-SVN: r269082

5 years agoPR c++/89422 - ICE with -g and lambda in default arg in template.
Jason Merrill [Thu, 21 Feb 2019 23:07:47 +0000 (18:07 -0500)]
PR c++/89422 - ICE with -g and lambda in default arg in template.

Here, we were trying to instantiate the default argument before setting
DECL_FRIEND_CONTEXT, so that the instantiated lambda ended up being treated
as part of the S template, which confused dwarf2out.

* pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.

From-SVN: r269081

5 years agoPR c++/88419 - C++17 ICE with class template arg deduction.
Jason Merrill [Thu, 21 Feb 2019 23:07:12 +0000 (18:07 -0500)]
PR c++/88419 - C++17 ICE with class template arg deduction.

Just like in make_constrained_auto, we need to defer setting TYPE_CANONICAL
until we've set fields that will affect structural_comptypes.

* pt.c (make_template_placeholder): Set TYPE_CANONICAL after
CLASS_PLACEHOLDER_TEMPLATE.

From-SVN: r269080

5 years agore PR go/89170 (FAIL: net/http)
Ian Lance Taylor [Thu, 21 Feb 2019 22:50:24 +0000 (22:50 +0000)]
re PR go/89170 (FAIL: net/http)

PR go/89170
* varasm.c (decode_addr_const): Call lookup_constant_def rather
than output_constant_def.
(add_constant_to_table): New static function.
(output_constant_def): Call add_constant_to_table.
(tree_output_constant_def): Likewise.

From-SVN: r269079

5 years agore PR c++/89285 (ICE after casting the this pointer in the constructor in C++17 mode)
Jakub Jelinek [Thu, 21 Feb 2019 21:21:25 +0000 (22:21 +0100)]
re PR c++/89285 (ICE after casting the this pointer in the constructor in C++17 mode)

PR c++/89285
* builtins.c (fold_builtin_arith_overflow): If first two args are
INTEGER_CSTs, set intres and ovfres to constants rather than calls
to ifn.

* constexpr.c (struct constexpr_fundef): Add parms and result members.
(retrieve_constexpr_fundef): Adjust for the above change.
(register_constexpr_fundef): Save constexpr body with copy_fn,
temporarily set DECL_CONTEXT on DECL_RESULT before that.
(get_fundef_copy): Change FUN argument to FUNDEF with
constexpr_fundef * type, grab body and parms/result out of
constexpr_fundef struct and temporarily change it for copy_fn calls
too.
(cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
adjust current_function_decl from ctx->call context.  Test
!potential_constant_expression instead of !is_constant_expression.
(cxx_bind_parameters_in_call): Grab parameters from new_call.  Undo
convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
(cxx_eval_call_expression): Adjust get_fundef_copy caller.
(cxx_eval_conditional_expression): For IF_STMT, allow then or else
operands to be NULL.
(label_matches): Handle BREAK_STMT and CONTINUE_STMT.
(cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
(cxx_eval_switch_expr): Add support for SWITCH_STMT.
(cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr.  Ignore
DECL_EXPR with USING_DECL operand.
* lambda.c (maybe_add_lambda_conv_op): Build thisarg using
build_int_cst to make it a valid constant expression.

* g++.dg/ubsan/vptr-4.C: Expect reinterpret_cast errors.
* g++.dg/cpp1y/constexpr-84192.C (f2): Adjust expected diagnostics.
* g++.dg/cpp1y/constexpr-70265-2.C (foo): Adjust expected line of
diagnostics.
* g++.dg/cpp1y/constexpr-89285.C: New test.
* g++.dg/cpp0x/constexpr-arith-overflow.C (add, sub, mul): Ifdef out
for C++11.
(TEST_ADD, TEST_SUB, TEST_MUL): Define to Assert (true) for C++11.
* g++.dg/cpp0x/constexpr-arith-overflow2.C: New test.

From-SVN: r269078

5 years agoPR libstdc++/89416 fix __is_move_insertable trait
Jonathan Wakely [Thu, 21 Feb 2019 20:47:43 +0000 (20:47 +0000)]
PR libstdc++/89416 fix __is_move_insertable trait

The common base class for __is_move_insertable and __is_copy_insertable
instantiates both the copy and move tests, when only one is needed. The
unneeded one might cause errors outside the immediate context.

The solution used in this patch is to replace them with alias templates,
which will only be instantiated as needed.

PR libstdc++/89416
* include/bits/alloc_traits.h (__is_alloc_insertable_impl): Replace
class template with class. Replace move and copy member types with
member alias templates, so they are only instantiated when needed.
(__is_copy_insertable, __is_move_insertable): Adjust base class.
* testsuite/23_containers/vector/modifiers/push_back/89130.cc: Enable
test for C++11/14/17 as well.
* testsuite/23_containers/vector/modifiers/push_back/89416.cc: New
test.

From-SVN: r269075

5 years agoi386: Replace -fcf-protection with -fcf-protection=branch
H.J. Lu [Thu, 21 Feb 2019 18:59:00 +0000 (18:59 +0000)]
i386: Replace -fcf-protection with -fcf-protection=branch

Since -mindirect-branch is incompatible with -fcf-protection=return and
-fcf-protection, replace -fcf-protection with -fcf-protection=branch.

PR target/87412
* gcc.target/i386/indirect-thunk-attr-14.c: Replace
-fcf-protection with -fcf-protection=branch.
* gcc.target/i386/indirect-thunk-attr-15.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-16.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-8.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-9.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-10.c: Likewise.

From-SVN: r269074

5 years agoPR c++/88690 - C++17 ICE with empty base in aggregate.
Jason Merrill [Thu, 21 Feb 2019 18:16:15 +0000 (13:16 -0500)]
PR c++/88690 - C++17 ICE with empty base in aggregate.

Base fields for empty bases appear in initialization order, which may not be
the same as layout order.  If they also show up in a CONSTRUCTOR in that
order, output_constructor_regular_field aborts because it understandably
doesn't want to go backwards.  I also considered making o_c_r_f more
tolerant of the case where the out-of-order field has fieldsize 0, and so no
actual data needs to be emitted, but we might as well avoid adding an
element to the CONSTRUCTOR in the first place.

* typeck2.c (process_init_constructor_record): Skip trivial
initialization of an empty base.

From-SVN: r269073

5 years agoFix pr88850-2 test
Wilco Dijkstra [Thu, 21 Feb 2019 18:08:56 +0000 (18:08 +0000)]
Fix pr88850-2 test

Like the pr88850.c test, also fix the pr88850-2.c testcase which
was failing in hardfp environments.

Committed as obvious.

    gcc/testsuite/
* gcc.target/arm/pr88850-2.c: Block -mfloat-abi override.
* gcc.target/arm/pr88850.c: Use -mfloat-abi=softfp.

From-SVN: r269072

5 years agodump-parse-tree.c (debug): Implement for gfc_expr *, gfc_typespec *, gfc_typespec...
Thomas Koenig [Thu, 21 Feb 2019 18:03:30 +0000 (18:03 +0000)]
dump-parse-tree.c (debug): Implement for gfc_expr *, gfc_typespec *, gfc_typespec and gfc_symbol *.

2019-02-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

    * dump-parse-tree.c (debug): Implement for gfc_expr *,
    gfc_typespec *, gfc_typespec and gfc_symbol *.

From-SVN: r269071

5 years agore PR fortran/86119 (Intrinsic len has wrong type if used within select type for...
Thomas Koenig [Thu, 21 Feb 2019 18:01:41 +0000 (18:01 +0000)]
re PR fortran/86119 (Intrinsic len has wrong type if used within select type for a class(*) string)

2019-02-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/86119
    * class.c (gfc_get_len_component): Add argument k for kind.
    If the kind of the resulting expression is not equal to k,
    convert it.
    * gfortran.h (gfc_len_component): Adjust prototype.
    * simplify.c (gfc_simplify_len): Pass kind to
    gfc_get_len_component.

2019-02-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/86119
    * gfortran.dg/warn_conversion_11.f90: New test.

From-SVN: r269070

5 years agoi386: Check -mindirect-branch/-mfunction-return with -fcf-protection
H.J. Lu [Thu, 21 Feb 2019 13:41:53 +0000 (13:41 +0000)]
i386: Check -mindirect-branch/-mfunction-return with -fcf-protection

Issue an error when -mindirect-branch or -mfunction-return are used
with incompatible -fcf-protection.

gcc/

PR target/87412
* config/i386/i386.c (ix86_set_indirect_branch_type): Issue an
error for -mindirect-branch/-mfunction-return with incompatible
-fcf-protection.

gcc/testsuite/

PR target/87412
* gcc.target/i386/pr87412-1.c: New file.
* gcc.target/i386/pr87412-2.c: Likewise.
* gcc.target/i386/pr87412-3.c: Likewise.
* gcc.target/i386/pr87412-4.c: Likewise.

From-SVN: r269068

5 years agore PR bootstrap/88714 (bootstrap comparison failure on armv7l since r265398)
Jakub Jelinek [Thu, 21 Feb 2019 12:04:26 +0000 (13:04 +0100)]
re PR bootstrap/88714 (bootstrap comparison failure on armv7l since r265398)

PR bootstrap/88714
* constraints.md (q): Remove.
* config/arm/ldrdstrd.md (*arm_ldrd, *arm_strd): Use rk constraint
instead of q.

From-SVN: r269067

5 years ago[omp] Move NE_EXPR handling to omp_adjust_for_condition
Martin Jambor [Thu, 21 Feb 2019 11:00:47 +0000 (12:00 +0100)]
[omp] Move NE_EXPR handling to omp_adjust_for_condition

2019-02-21  Martin Jambor  <mjambor@suse.cz>

PR hsa/89302
* omp-general.c (omp_extract_for_data): Removed a duplicate call
to omp_adjust_for_condition, moved NE_EXPR code_cond processing...
(omp_adjust_for_condition): ...here.  Added necessary parameters.
* omp-general.h (omp_adjust_for_condition): Updated declaration.
* omp-grid.c (grid_attempt_target_gridification): Adjust to pass
proper values to new parameters of omp_adjust_for_condition.

From-SVN: r269066

5 years agore PR c++/89392 (ICE in bitmap_bit_p, at bitmap.c:978)
Richard Biener [Thu, 21 Feb 2019 08:03:40 +0000 (08:03 +0000)]
re PR c++/89392 (ICE in bitmap_bit_p, at bitmap.c:978)

2019-02-21  Richard Biener  <rguenther@suse.de>

PR middle-end/89392
cp/
* vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
make symtab process new functions here.

From-SVN: r269065

5 years agoPR c++/87921 - wrong error with inline static data member.
Jason Merrill [Thu, 21 Feb 2019 02:24:40 +0000 (21:24 -0500)]
PR c++/87921 - wrong error with inline static data member.

c_parse_final_cleanups checks DECL_IN_AGGR_P to avoid trying to emit a
static data member that has not been defined.  The inline variable patch
changed that to exempt inline variables.  But in this case we haven't
instantiated the variable yet, so we really don't have a definition.  This
patch changes inline variable handling such that DECL_IN_AGGR_P is not set
for a defined inline variable, so we can remove all the checks of
DECL_INLINE_VAR_P after DECL_IN_AGGR_P.

With that change we were failing on a static data member that had been
instantiated due to a use before we got around to processing it in
instantiate_class_template; we should detect that and avoid all the
finish_static_data_member_decl processing, which assumes that it is the
first time we're seeing the variable.

* decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
for a non-template inline variable.  Do nothing for an
already-instantiated variable.
(c_parse_final_cleanups): Check DECL_IN_AGGR_P without
DECL_INLINE_VAR_P.
* decl.c (check_initializer): Likewise.
(make_rtl_for_nonlocal_decl): Likewise.
* pt.c (instantiate_decl): Likewise.
* typeck2.c (store_init_value): Likewise.

From-SVN: r269064

5 years agore PR go/89407 (go bootstrap failure on s390x starting with r268941)
Ian Lance Taylor [Thu, 21 Feb 2019 01:06:01 +0000 (01:06 +0000)]
re PR go/89407 (go bootstrap failure on s390x starting with r268941)

PR go/89407
    internal/cpu: use #ifdef __s390x__ in C code

    Patch by Jakub Jelinek.

    Fixes https://gcc.gnu.org/PR89407

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

From-SVN: r269063

5 years agoDaily bump.
GCC Administrator [Thu, 21 Feb 2019 00:16:45 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r269062

5 years agore PR c++/89403 (ICE in maybe_clone_body, at cp/optimize.c:693)
Jakub Jelinek [Thu, 21 Feb 2019 00:09:47 +0000 (01:09 +0100)]
re PR c++/89403 (ICE in maybe_clone_body, at cp/optimize.c:693)

PR c++/89403
* decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
for flag_syntax_only from here...
* semantics.c (expand_or_defer_fn_1): ... here.

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

From-SVN: r269059

5 years agore PR c++/89405 (ICE in import_export_decl, at cp/decl2.c:2959)
Jakub Jelinek [Thu, 21 Feb 2019 00:08:59 +0000 (01:08 +0100)]
re PR c++/89405 (ICE in import_export_decl, at cp/decl2.c:2959)

PR c++/89405
* decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
DECL_COMMON, set DECL_INTERFACE_KNOWN.

* g++.dg/cpp1z/inline-var5.C: New test.

From-SVN: r269058

5 years agore PR middle-end/89412 (gcc ICE in simplify_subreg, at simplify-rtx.c:6273 on i686...
Jakub Jelinek [Wed, 20 Feb 2019 23:02:29 +0000 (00:02 +0100)]
re PR middle-end/89412 (gcc ICE in simplify_subreg, at simplify-rtx.c:6273 on i686-linux-gnu)

PR middle-end/89412
* expr.c (expand_assignment): If result is a MEM, use change_address
instead of simplify_gen_subreg.

* gcc.c-torture/compile/pr89412.c: New test.

From-SVN: r269057

5 years agore PR middle-end/89091 (ICE: Segmentation fault (in tree_class_check))
Jakub Jelinek [Wed, 20 Feb 2019 23:01:41 +0000 (00:01 +0100)]
re PR middle-end/89091 (ICE: Segmentation fault (in tree_class_check))

PR middle-end/89091
* fold-const.c (decode_field_reference): Return NULL_TREE if
lang_hooks.types.type_for_size returns NULL.  Check it before
overwriting *exp_.  Use return NULL_TREE instead of return 0.

* gcc.dg/torture/pr89091.c: New test.

Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
From-SVN: r269056

5 years agore PR tree-optimization/88074 (g++ hangs on math expression)
Jakub Jelinek [Wed, 20 Feb 2019 22:41:26 +0000 (23:41 +0100)]
re PR tree-optimization/88074 (g++ hangs on math expression)

PR middle-end/88074
PR middle-end/89415
* toplev.c (do_compile): Double the emin/emax exponents to workaround
buggy mpc_norm.

* gcc.dg/pr88074-2.c: New test.

From-SVN: r269055

5 years agore PR target/89397 (ICE in build_call_expr_loc_array at gcc/tree.c:11563 since r229082)
Uros Bizjak [Wed, 20 Feb 2019 21:58:45 +0000 (22:58 +0100)]
re PR target/89397 (ICE in build_call_expr_loc_array at gcc/tree.c:11563 since r229082)

PR target/89397
* config/i386/i386.c (ix86_atomic_assign_expand_fenv): Check
TARGET_SSE in addition to TARGET_SSE_MATH.

(ix86_excess_precision): Ditto.
(ix86_float_exceptions_rounding_supported_p): Ditto.
(use_rsqrt_p): Ditto.
* config/i386/sse.md (rsqrt<mode>2): Ditto.

From-SVN: r269054

5 years agolinux-unwind.h (alpha_fallback_frame_state): Cast 'mcontext_t *' &rt_->uc.uc_mcontext...
Uros Bizjak [Wed, 20 Feb 2019 21:37:21 +0000 (22:37 +0100)]
linux-unwind.h (alpha_fallback_frame_state): Cast 'mcontext_t *' &rt_->uc.uc_mcontext to 'struct sigcontext *'.

* config/alpha/linux-unwind.h (alpha_fallback_frame_state):
Cast 'mcontext_t *' &rt_->uc.uc_mcontext to 'struct sigcontext *'.

From-SVN: r269053

5 years agore PR c++/89336 (internal compiler error when compiling a constexpr function)
Jakub Jelinek [Wed, 20 Feb 2019 21:16:27 +0000 (22:16 +0100)]
re PR c++/89336 (internal compiler error when compiling a constexpr function)

PR c++/89336
* constexpr.c (cxx_eval_store_expression): Diagnose changing of active
union member for -std=c++17 and earlier.

* g++.dg/cpp1y/constexpr-89336-3.C: New test.

From-SVN: r269052

5 years agoFix ICE with #line directive (PR c/89410)
David Malcolm [Wed, 20 Feb 2019 20:07:20 +0000 (20:07 +0000)]
Fix ICE with #line directive (PR c/89410)

PR c/89410 reports various issues with #line directives with very
large numbers; one of them is an ICE inside diagnostic-show-locus.c
when emitting a diagnostic at line 0xffffffff.

The issue is that the arithmetic in layout::calculate_line_spans to
determine if two line spans are sufficiently close to consolidate
was using the unsigned 32-bit linenum_type, which was overflowing
when comparing the line for the expanded location with those of
the location range (all on line 0xffffffff), leading to it
erroneously adding two spans for the same line, leading to an
assertion failure.

This patch fixes the ICE by generalizing the use of long long in
line-map.h's comparison function for linenum_type into a new
linenum_arith_t typedef, and using it here.

Doing so uncovered a second problem: the loop to print the lines
within the line_span for this case is infinite: looping from
0xfffffff upwards, overflowing to 0, and then never becoming
greater than 0xfffffff.  The patch fixes this by using linenum_arith_t
there also.

gcc/ChangeLog:
PR c/89410
* diagnostic-show-locus.c (layout::calculate_line_spans): Use
linenum_arith_t when determining if two adjacent line spans are
close enough to merge.
(diagnostic_show_locus): Use linenum_arith_t when iterating over
lines within each line_span.

gcc/testsuite/ChangeLog:
PR c/89410
* gcc.dg/pr89410-1.c: New test.
* gcc.dg/pr89410-2.c: New test.

libcpp/ChangeLog:
PR c/89410
* include/line-map.h (linenum_arith_t): New typedef.
(compare): Use it.

From-SVN: r269050

5 years agocompiler: fix a typo in comments
Ian Lance Taylor [Wed, 20 Feb 2019 19:14:12 +0000 (19:14 +0000)]
compiler: fix a typo in comments

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

From-SVN: r269049

5 years agoPR c++/87513 - 'sorry' mangling PMF template-id.
Jason Merrill [Wed, 20 Feb 2019 18:59:18 +0000 (13:59 -0500)]
PR c++/87513 - 'sorry' mangling PMF template-id.

Here build_offset_ref calls build_qualified_name to make a SCOPE_REF because
the dependent template arguments make type_dependent_expression_p (member)
true.  We could probably work hard to prevent this, but it doesn't seem
necessary, and it's easy to fix write_expression to handle the result.

* mangle.c (write_expression): Handle SCOPE_REF to BASELINK.

From-SVN: r269048

5 years ago* g++.old-deja/g++.robertl/eb92.C: Handle warning as well.
Jason Merrill [Wed, 20 Feb 2019 18:58:46 +0000 (13:58 -0500)]
* g++.old-deja/g++.robertl/eb92.C: Handle warning as well.

From-SVN: r269047

5 years agoPR c++/88380 - wrong-code with flexible array and NSDMI.
Jason Merrill [Wed, 20 Feb 2019 18:54:45 +0000 (13:54 -0500)]
PR c++/88380 - wrong-code with flexible array and NSDMI.

Here 'skipped' was set to -1 to force an explicit initializer for 'uninit'
before the initializer for 'initialized', and so we also tried to emit an
explicit initializer for the flexible array, for which build_zero_init
returns error_mark_node.  We should ignore flexarrays even when
skipped < 0.

* typeck2.c (process_init_constructor_record): Skip flexarrays.

From-SVN: r269046

5 years agoPR c++/88572 - wrong handling of braces on scalar init.
Will Wray [Wed, 20 Feb 2019 18:50:32 +0000 (13:50 -0500)]
PR c++/88572 - wrong handling of braces on scalar init.

* decl.c (reshape_init_r): Allow braces around scalar initializer
within aggregate init.  Reject double braced-init of scalar
variable.

From-SVN: r269045

5 years agotarget-supports.exp (check_effective_target_vect_usad_char): Add PowerPC support.
Pat Haugen [Wed, 20 Feb 2019 17:50:28 +0000 (17:50 +0000)]
target-supports.exp (check_effective_target_vect_usad_char): Add PowerPC support.

* lib/target-supports.exp (check_effective_target_vect_usad_char):
Add PowerPC support.
* gcc.dg/vect/slp-reduc-sad.c: Update scan string.
* gcc.dg/vect/vect-reduc-sad.c: Likewise.

From-SVN: r269043

5 years agolibsanitizer: Restore internal_readlink for x32
H.J. Lu [Wed, 20 Feb 2019 16:20:50 +0000 (16:20 +0000)]
libsanitizer: Restore internal_readlink for x32

Cherry-pick compiler-rt revision 354451:

r316591 has

@@ -389,13 +383,11 @@ uptr internal_dup2(int oldfd, int newfd) {
 }

 uptr internal_readlink(const char *path, char *buf, uptr bufsize) {
-#if SANITIZER_NETBSD
-  return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize);
-#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
+#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return internal_syscall(SYSCALL(readlinkat), AT_FDCWD,
                           (uptr)path, (uptr)buf, bufsize);
 #else
-  return internal_syscall(SYSCALL(readlink), (uptr)path, (uptr)buf, bufsize);
+  return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize);
 #endif
 }

which dropped the (uptr) cast and broke x32.  This patch puts back the
(uptr) cast to restore x32 and fixes:

https://bugs.llvm.org/show_bug.cgi?id=40783

Differential Revision: https://reviews.llvm.org/D58413

PR sanitizer/89409
* sanitizer_common/sanitizer_linux.cc (internal_readlink):
Cherry-pick compiler-rt r354451.

From-SVN: r269042

5 years agoFix testsuite
Caroline Tice [Wed, 20 Feb 2019 16:07:19 +0000 (08:07 -0800)]
Fix testsuite

2019-02-19  Caroline Tice <cmtice@google.com>

Fix testsuite
* testsuite/libvtv.cc/const_vtable.cc (main): Fix function signature.

From-SVN: r269041

5 years agorevert: re PR target/89397 (ICE in build_call_expr_loc_array at gcc/tree.c:11563...
Uros Bizjak [Wed, 20 Feb 2019 15:23:47 +0000 (16:23 +0100)]
revert: re PR target/89397 (ICE in build_call_expr_loc_array at gcc/tree.c:11563 since r229082)

Revert:
        PR target/89397
        * config/i386/i386.c (ix86_option_override_internal): Set
        opts->x_ix86_fpmath to FPMATH_387 when SSE is disabled.

        gcc/testsuite/

        PR target/89397
        * gcc.target/i386/pr89397.c: New test.

From-SVN: r269040

5 years ago[GCC] PR target/86487: fix the way 'uses_hard_regs_p' handles paradoxical
Andre Vieira [Wed, 20 Feb 2019 14:11:43 +0000 (14:11 +0000)]
[GCC] PR target/86487: fix the way 'uses_hard_regs_p' handles paradoxical
subregs

gcc/ChangeLog:
2019-02-20 Andre Vieira  <andre.simoesdiasvieira@arm.com>

PR target/86487
* lra-constraints.c(uses_hard_regs_p): Fix handling of
paradoxical SUBREGS.

gcc/testsuite/ChangeLog:
2019-02-20 Andre Vieira  <andre.simoesdiasvieira@arm.com>

PR target/86487
* gcc.target/arm/pr86487.c: New.

From-SVN: r269039

5 years agoChange singular to plural in gfortran.texi.
Martin Liska [Wed, 20 Feb 2019 11:12:10 +0000 (12:12 +0100)]
Change singular to plural in gfortran.texi.

2019-02-20  Martin Liska  <mliska@suse.cz>

* gfortran.texi: Change singular to plural.

From-SVN: r269038

5 years agore PR c++/84536 (ICE with non-type template parameter)
Paolo Carlini [Wed, 20 Feb 2019 10:47:02 +0000 (10:47 +0000)]
re PR c++/84536 (ICE with non-type template parameter)

/cp
2019-02-20  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84536
* pt.c (tsubst_init): Diagnose an initializer expanding to an
empty list of expressions; tweak wrt dependent types.
(regenerate_decl_from_template): For VAR_DECLs call tsubst_init
instead of tsubst_expr.

/testsuite
2019-02-20  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84536
* g++.dg/cpp1y/var-templ60.C: New.

From-SVN: r269037

5 years agoCorrection of ChangeLog entry, Thomas provided the code for this change.
Thomas Schwinge [Wed, 20 Feb 2019 10:09:53 +0000 (10:09 +0000)]
Correction of ChangeLog entry, Thomas provided the code for this change.

2019-02-19  Thomas Schwinge  <thomas@codesourcery.com>

PR c/87924
* openmp.c (gfc_match_omp_clauses): Add representation of wait clause
without argument as 'wait (GOMP_ASYNC_NOVAL)'.

From-SVN: r269036

5 years agoDocument Fortran header directive.
Martin Liska [Wed, 20 Feb 2019 09:23:12 +0000 (10:23 +0100)]
Document Fortran header directive.

2019-02-20  Martin Liska  <mliska@suse.cz>

* gfortran.texi: Document Fortran header directive.

From-SVN: r269035

5 years agore PR libstdc++/89402 (warning: ‘void _ZNKSt4hashIeEclEe()’ specifies less restrictiv...
Jakub Jelinek [Wed, 20 Feb 2019 07:57:41 +0000 (08:57 +0100)]
re PR libstdc++/89402 (warning: ‘void _ZNKSt4hashIeEclEe()’ specifies less restrictive attribute than its target)

PR libstdc++/89402
* src/c++98/compatibility-ldbl.cc (_ZNKSt4hashIeEclEe): Add
_GLIBCXX_PURE to the alias declaration.

From-SVN: r269034

5 years ago[rs6000] fix PR 88100, range check for vec_splat_{su}{8,16,32}
Li Jia He [Wed, 20 Feb 2019 02:35:39 +0000 (02:35 +0000)]
[rs6000] fix PR 88100, range check for vec_splat_{su}{8,16,32}

GCC revision 259524 implemented range check for the vec_splat_{su}{8,16,32}
builtins.  However, as a consequence of the implementation, the range check
is not done correctly for the expected vspltis[bhw] instructions.  The result
is that we may not get a valid error message if the valid range of the data
is exceeded.

Although the input of the function prototype of vec_splat_{su}{8,16,32} is
const int, the actual data usage range is limited to the data range of 5 bits
signed.  We should limit the int_cst.val[0] data to the 5 bit signed data range
without any modification in the input arg0 parameter.  However, the sext_hwi
function intercepts the data of TREE_INT_CST_LOW (arg0) as size bits in the
sext_hwi (TREE_INT_CST_LOW (arg0), size) statement.  This will cause some of
the excess data to fall within the range of 5 bits signed, so that the correct
diagnostic information cannot be generated, we need to remove the sext_hwi to
ensure that the input data has not been modified.

This patch fix range check for the vec_splat_s[8,16,32] builtins.  The argument
must be a 5-bit const int as specified for the vspltis[bhw] instructions.

for gcc/ChangeLog

PR target/88100
* gcc/config/rs6000/rs6000.c (rs6000_gimple_fold_builtin)
<case ALTIVEC_BUILTIN_VSPLTISB, ALTIVEC_BUILTIN_VSPLTISH,
ALTIVEC_BUILTIN_VSPLTISW>: Don't convert the operand before
range checking it.

for gcc/testsuite/ChangeLog

PR target/88100
* gcc/testsuite/gcc.target/powerpc/pr88100.c: New testcase.

From-SVN: r269033

5 years agoPR c++/88368 - wrong 'use of deleted function'
Jason Merrill [Wed, 20 Feb 2019 02:00:29 +0000 (21:00 -0500)]
PR c++/88368 - wrong 'use of deleted function'

Since my patch for 81359 allowed us to signal failure on return from
maybe_instantiate_noexcept, we no longer need to turn an error into
noexcept(false).  We also need to handle NSDMI instantiation errors under
synthesized_method_walk.  This change caused some instantiation context
notes to be lost in the testsuite, so I added push_tinst_level to
get_defaulted_eh_spec to restore that context.

* method.c (walk_field_subobs): Remember errors from get_nsdmi.
(get_defaulted_eh_spec): Call push_tinst_level.
* pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
* typeck2.c (merge_exception_specifiers): Handle error_mark_node.

From-SVN: r269032

5 years agoDaily bump.
GCC Administrator [Wed, 20 Feb 2019 00:16:45 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r269031

5 years ago* config/gcn/gcn.c (print_operand): Fix typo.
Jonathan Wakely [Tue, 19 Feb 2019 19:30:59 +0000 (19:30 +0000)]
* config/gcn/gcn.c (print_operand): Fix typo.

From-SVN: r269028

5 years agocompiler: add debugger-callable AST dump functins
Ian Lance Taylor [Tue, 19 Feb 2019 18:44:24 +0000 (18:44 +0000)]
compiler: add debugger-callable AST dump functins

    Introduce a set debug_go_* global functions that can be used to emit
    AST dumps for Go statements and expressions from within GDB (for use
    by people developing gccgo).

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

From-SVN: r269027

5 years agoFix pr88850 test
Wilco Dijkstra [Tue, 19 Feb 2019 18:43:43 +0000 (18:43 +0000)]
Fix pr88850 test

Fix pr88850.c testcase which was failing in hardfp environments.

Committed as obvious.

    gcc/testsuite/
* gcc.target/arm/pr88850.c: Block -mfloat-abi override.

From-SVN: r269026

5 years agoMakefile.am: Avoid the -D option which is not available with the install-sh fallback.
Bernd Edlinger [Tue, 19 Feb 2019 18:21:26 +0000 (18:21 +0000)]
Makefile.am: Avoid the -D option which is not available with the install-sh fallback.

2019-02-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * src/Makefile.am: Avoid the -D option which is not available
        with the install-sh fallback.  Use $(MKDIR_P) instead.
        * libdruntime/Makefile.am: Likewise.
        * src/Makefile.in: Regenerated.
        * libdruntime/Makefile.in: Regenerated.

From-SVN: r269025

5 years agore PR fortran/89384 (CONTIGUOUS dummy argument in BIND(C) interface incorrect when...
Thomas Koenig [Tue, 19 Feb 2019 17:55:33 +0000 (17:55 +0000)]
re PR fortran/89384 (CONTIGUOUS dummy argument in BIND(C) interface incorrect when actual is non-contiguous)

2019-02-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/89384
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): If the dummy
argument is contiguous and the actual argument may not be,
use gfc_conv_subref_array_arg.

2019-02-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/89384
* gfortran.dg/ISO_Fortran_binding_4.f90

From-SVN: r269024

5 years agounwind-dw2.c (_Unwind_GetGR): Compare regno instead of index to DWARF_ZERO_REG.
Uros Bizjak [Tue, 19 Feb 2019 16:10:00 +0000 (17:10 +0100)]
unwind-dw2.c (_Unwind_GetGR): Compare regno instead of index to DWARF_ZERO_REG.

* unwind-dw2.c (_Unwind_GetGR) [DWARF_ZERO_REG]: Compare
regno instead of index to DWARF_ZERO_REG.

From-SVN: r269021

5 years ago[PR87924] OpenACC wait clauses without async-arguments: remove XFAILs
Thomas Schwinge [Tue, 19 Feb 2019 16:04:17 +0000 (17:04 +0100)]
[PR87924] OpenACC wait clauses without async-arguments: remove XFAILs

... which the recent r269016 didn't do.

gcc/testsuite/
PR c/87924
* c-c++-common/goacc/asyncwait-5.c: Remove XFAILs.
* gfortran.dg/goacc/asyncwait-5.f: Likewise.

From-SVN: r269020

5 years agore PR go/89169 (FAIL: internal/cpu)
Ian Lance Taylor [Tue, 19 Feb 2019 15:42:09 +0000 (15:42 +0000)]
re PR go/89169 (FAIL: internal/cpu)

PR go/89169
    internal/cpu: do not require POWER8

    Although the gc toolchain requires POWER8, the gccgo toolchain does not.

    Fixes https://gcc.gnu.org/PR89169

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

From-SVN: r269019

5 years agoruntime: abort stack scan in cases that we cannot unwind the stack
Ian Lance Taylor [Tue, 19 Feb 2019 15:32:34 +0000 (15:32 +0000)]
runtime: abort stack scan in cases that we cannot unwind the stack

    In signal-triggered stack scan, if the signal is delivered at
    certain bad time (e.g. in vdso, or in the middle of setcontext?),
    the unwinder may not be able to unwind the whole stack, while it
    still reports _URC_END_OF_STACK. So we cannot rely on _URC_END_OF_STACK
    to tell if it successfully scanned the stack. Instead, we check
    the last Go frame to see it actually reached the end of the stack.
    For Go-created stack, this is runtime.kickoff. For C-created
    stack, we need to record the outermost Go frame when it enters
    the Go side.

    Also we cannot unwind the stack if the signal is delivered in the
    middle of runtime.gogo, halfway through a goroutine switch, where
    the g and the stack don't match. Give up in this case as well.

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

From-SVN: r269018

5 years agoi386: Set ix86_fpmath to FPMATH_387 without SSE
H.J. Lu [Tue, 19 Feb 2019 14:19:33 +0000 (14:19 +0000)]
i386: Set ix86_fpmath to FPMATH_387 without SSE

ix86_fpmath should be set to combination of FPMATH_387 and FPMATH_SSE.
When SSE is disabled, it should be set to FPMATH_387 and 387 codegen is
also controlled by -msoft-float.

gcc/

PR target/89397
* config/i386/i386.c (ix86_option_override_internal): Set
opts->x_ix86_fpmath to FPMATH_387 when SSE is disabled.

gcc/testsuite/

PR target/89397
* gcc.target/i386/pr89397.c: New test.

From-SVN: r269017

5 years agore PR c/87924 (OpenACC wait clauses without async-arguments)
Chung-Lin Tang [Tue, 19 Feb 2019 14:10:15 +0000 (14:10 +0000)]
re PR c/87924 (OpenACC wait clauses without async-arguments)

2019-02-19  Chung-Lin Tang <cltang@codesourcery.com>

PR c/87924
gcc/c/
* c-parser.c (c_parser_oacc_clause_wait): Add representation of wait
clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.

gcc/cp/
* parser.c (cp_parser_oacc_clause_wait): Add representation of wait
clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.

gcc/fortran/
* openmp.c (gfc_match_omp_clauses): Add representation of wait clause
without argument as 'wait (GOMP_ASYNC_NOVAL)'.

libgomp/
* oacc-parallel.c (GOACC_parallel_keyed): Remove condition on call to
goacc_wait().
(goacc_wait): Handle ACC_ASYNC_NOVAL case, remove goacc_thread() call
and related adjustment.

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
From-SVN: r269016