gcc.git
6 years agogcc_release (build_sources): Use getconf to get at the number of cores in the system...
Richard Biener [Thu, 25 Jan 2018 10:22:38 +0000 (10:22 +0000)]
gcc_release (build_sources): Use getconf to get at the number of cores in the system and pass -jN to gcc_build.

2018-01-25  Richard Biener  <rguenther@suse.de>

* gcc_release (build_sources): Use getconf to get at the number
of cores in the system and pass -jN to gcc_build.

From-SVN: r257045

6 years agoFix vect-reduc-or_[12].c changes in r257022
Richard Sandiford [Thu, 25 Jan 2018 10:21:08 +0000 (10:21 +0000)]
Fix vect-reduc-or_[12].c changes in r257022

I'd somehow thought that the dump lines in these two tests were already
correctly guarded, but they weren't.

2018-01-25  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/testsuite/
* gcc.dg/vect/vect-reduc-or_1.c: Require whole_vector_shift for
the shift dump line.
* gcc.dg/vect/vect-reduc-or_2.c: Likewise.

From-SVN: r257044

6 years ago* pecoff.c (coff_add): Use coff_read4, not memcpy.
Ian Lance Taylor [Thu, 25 Jan 2018 02:42:26 +0000 (02:42 +0000)]
* pecoff.c (coff_add): Use coff_read4, not memcpy.

From-SVN: r257040

6 years agore PR other/68239 (libbacktrace allocation is sometimes very slow)
Ian Lance Taylor [Thu, 25 Jan 2018 02:24:45 +0000 (02:24 +0000)]
re PR other/68239 (libbacktrace allocation is sometimes very slow)

PR other/68239
* mmap.c (backtrace_free_locked): Don't put more than 16 entries
on the free list.

From-SVN: r257039

6 years agore PR target/81550 (gcc.target/powerpc/loop_align.c fails starting with r250482)
Michael Meissner [Thu, 25 Jan 2018 01:09:19 +0000 (01:09 +0000)]
re PR target/81550 (gcc.target/powerpc/loop_align.c fails starting with r250482)

[gcc/testsuite]
2018-01-24  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/81550
* gcc.target/powerpc/loop_align.c: Use unsigned long for the loop
index instead of int, which allows IVOPTs to properly optimize the
loop.

From-SVN: r257038

6 years agoFix jit.dg/test-alignment* (PR jit/82846)
David Malcolm [Thu, 25 Jan 2018 00:45:51 +0000 (00:45 +0000)]
Fix jit.dg/test-alignment* (PR jit/82846)

These testcases jit-compile functions that return char, but
were erroneously calling them as if they returned int.

This led to errors for certain target configurations (e.g.
reading from %eax (32-bit) in the harness when only %al (8-bit)
had been written to in the jit-compiled function).

gcc/testsuite/ChangeLog:
PR jit/82846
* jit.dg/test-alignment.c (create_aligned_code): Fix return type
of "fn_type" typedef.
* jit.dg/test-alignment.cc (verify_aligned_code): Likewise.

From-SVN: r257037

6 years agoDaily bump.
GCC Administrator [Thu, 25 Jan 2018 00:16:14 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r257036

6 years agocompiler: rationalize external symbol names
Ian Lance Taylor [Wed, 24 Jan 2018 23:50:09 +0000 (23:50 +0000)]
compiler: rationalize external symbol names

    Encode all external symbol names using only ASCII alphanumeric
    characters, underscore, and dot.  Use a scheme that can be reliably
    demangled to a somewhat readable version as described in the long
    comment in names.cc.

    A minor cleanup discovered during this was that we were treating
    function types as different if one had a NULL parameters_ field and
    another has a non-NULL parameters_ field that has no parameters.  This
    worked because we mangled them slightly differently.  We now mangle
    them the same, so we treat them as equal, as we should anyhow.

    Reviewed-on: https://go-review.googlesource.com/89555

* go.go-torture/execute/names-1.go: New test.

From-SVN: r257033

6 years agoFix m68k-linux-gnu libgcc build for ColdFire (PR target/68467).
Joseph Myers [Wed, 24 Jan 2018 23:36:29 +0000 (23:36 +0000)]
Fix m68k-linux-gnu libgcc build for ColdFire (PR target/68467).

PR target/68467 is libgcc failing to build for m68k-linux-gnu
configured for ColdFire.

Jeff has an analysis in the PR identifying the problem as resulting
from the callers of libcalls with 1-byte or 2-byte arguments wanting
to push just 1 or 2 bytes on the stack, while the libcall
implementations have the normal C ABI and expect 4-byte arguments.
For normal C functions, I believe the TARGET_PROMOTE_PROTOTYPES
definition would ensure such arguments get passed as 4-byte, but that
does not apply for libcalls.

This patch fixes the issue by defining TARGET_PROMOTE_FUNCTION_MODE
for m68k.  The definition is conservative, only applying promotions in
the case of arguments to libcalls; otherwise it returns the unpromoted
type, which I believe matches what the default implementation of the
hook would have done on m68k.

I have tested that this fixes the libgcc build for ColdFire, and, in
conjunction with one glibc patch, this enables glibc to build cleanly
for ColdFire and to pass the compilation parts of the glibc testsuite
except for one test unrelated to this patch (while glibc and the
compilation parts of the testsuite continue to build OK for
non-ColdFire m68k, as expected).  I have *not* run any GCC tests for
this patch, or any execution tests for m68k.

PR target/68467
* config/m68k/m68k.c (m68k_promote_function_mode): New function.
(TARGET_PROMOTE_FUNCTION_MODE): New macro.

From-SVN: r257032

6 years agore PR target/83994 (%ebx is clobbered by stack-clash probing for regparm-3 function...
Jeff Law [Wed, 24 Jan 2018 21:57:16 +0000 (14:57 -0700)]
re PR target/83994 (%ebx is clobbered by stack-clash probing for regparm-3 function in PIC mode)

PR target/83994
* i386.c (get_probe_interval): Move to earlier point.
(ix86_compute_frame_layout): If -fstack-clash-protection and
the frame is larger than the probe interval, then use pushes
to save registers rather than reg->mem moves.
(ix86_expand_prologue): Remove conditional for int_registers_saved
assertion.

PR target/83994
* gcc.target/i386/pr83994.c: New test.

From-SVN: r257031

6 years agore PR target/84014 (ICE in setup_min_max_allocno_live_range_point, at ira-build.c...
Vladimir Makarov [Wed, 24 Jan 2018 19:45:55 +0000 (19:45 +0000)]
re PR target/84014 (ICE in setup_min_max_allocno_live_range_point, at ira-build.c:2762)

2018-01-24  Vladimir Makarov  <vmakarov@redhat.com>

PR target/84014
* ira-build.c (setup_min_max_allocno_live_range_point): Set up
min/max for never referenced object.

2018-01-24  Vladimir Makarov  <vmakarov@redhat.com>

PR target/84014
* gcc.target/powerpc/pr84014.c: New.

From-SVN: r257029

6 years agore PR middle-end/83977 (ICE in simd_clone_clauses_extract, at omp-simd-clone.c:184)
Jakub Jelinek [Wed, 24 Jan 2018 16:28:47 +0000 (17:28 +0100)]
re PR middle-end/83977 (ICE in simd_clone_clauses_extract, at omp-simd-clone.c:184)

PR middle-end/83977
* tree.c (free_lang_data_in_decl): Don't clear DECL_ABSTRACT_ORIGIN
here.
* omp-low.c (create_omp_child_function): Remove "omp declare simd"
attributes from DECL_ATTRIBUTES (decl) without affecting
DECL_ATTRIBUTES (current_function_decl).
* omp-simd-clone.c (expand_simd_clones): Ignore DECL_ARTIFICIAL
functions with non-NULL DECL_ABSTRACT_ORIGIN.

* c-c++-common/gomp/pr83977-1.c: New test.
* c-c++-common/gomp/pr83977-2.c: New test.
* c-c++-common/gomp/pr83977-3.c: New test.
* gfortran.dg/gomp/pr83977.f90: New test.

From-SVN: r257023

6 years agoRemove explicit dg-do runs from gcc.dg/vect (PR 83889)
Richard Sandiford [Wed, 24 Jan 2018 16:22:40 +0000 (16:22 +0000)]
Remove explicit dg-do runs from gcc.dg/vect (PR 83889)

The failures in this PR were from forcing { dg-do run } even when
vect.exp chooses options that are incompatible with the runtime.
The default vect.exp behaviour is to execute when possible, so there's
no need for a dg-do at all.

The patch removes other unconditional { dg-do run }s too.  Many of them
were already failing in the same way.

Also, the dg-do run condition in vect-reduc-or* seems unnecessary:
the test should run correctly whatever happens, and the scan tests
are already guarded properly.

2018-01-24  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/testsuite/
PR testsuite/83889
* gcc.dg/vect/pr79920.c: Remove explicit dg-do run.
* gcc.dg/vect/pr80631-1.c: Likewise.
* gcc.dg/vect/pr80631-2.c: Likewise.
* gcc.dg/vect/pr81410.c: Likewise.
* gcc.dg/vect/pr81633.c: Likewise.
* gcc.dg/vect/pr81815.c: Likewise.
* gcc.dg/vect/pr82108.c: Likewise.
* gcc.dg/vect/pr83857.c: Likewise.
* gcc.dg/vect/vect-alias-check-8.c: Likewise.
* gcc.dg/vect/vect-alias-check-9.c: Likewise.
* gcc.dg/vect/vect-alias-check-10.c: Likewise.
* gcc.dg/vect/vect-alias-check-11.c: Likewise.
* gcc.dg/vect/vect-alias-check-12.c: Likewise.
* gcc.dg/vect/vect-reduc-11.c: Likewise.
* gcc.dg/vect/vect-tail-nomask-1.c: Likewise.
* gcc.dg/vect/vect-reduc-in-order-1.c: Remove dg-do run and use
dg-xfail-run-if instead.
* gcc.dg/vect/vect-reduc-in-order-2.c: Likewise.
* gcc.dg/vect/vect-reduc-in-order-3.c: Likewise.
* gcc.dg/vect/vect-reduc-in-order-4.c: Likewise.
* gcc.dg/vect/vect-reduc-or_1.c: Remove conditional dg-do run.
* gcc.dg/vect/vect-reduc-or_2.c: Likewise.

From-SVN: r257022

6 years agoFix use of boolean_true/false_node (PR 83979)
Richard Sandiford [Wed, 24 Jan 2018 16:22:30 +0000 (16:22 +0000)]
Fix use of boolean_true/false_node (PR 83979)

r255913 changed some constant_boolean_node calls to boolean_true_node
and boolean_false_node, which meant that the returned tree didn't
always have the right type.

2018-01-24  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/83979
* fold-const.c (fold_comparison): Use constant_boolean_node
instead of boolean_{true,false}_node.

gcc/testsuite/
PR tree-optimization/83979
* g++.dg/pr83979.c: New test.

From-SVN: r257021

6 years agoipa-profile.c (ipa_propagate_frequency_1): Fix logic skipping calls with zero counts.
Jan Hubicka [Wed, 24 Jan 2018 16:18:18 +0000 (17:18 +0100)]
ipa-profile.c (ipa_propagate_frequency_1): Fix logic skipping calls with zero counts.

* ipa-profile.c (ipa_propagate_frequency_1): Fix logic skipping calls
with zero counts.

From-SVN: r257020

6 years agors6000.md (*call_indirect_nonlocal_sysv<mode>): Simplify the clause that sets the...
Bill Schmidt [Wed, 24 Jan 2018 15:42:30 +0000 (15:42 +0000)]
rs6000.md (*call_indirect_nonlocal_sysv<mode>): Simplify the clause that sets the length attribute.

2018-01-24  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

* config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv<mode>):
Simplify the clause that sets the length attribute.
(*call_value_indirect_nonlocal_sysv<mode>): Likewise.
(*sibcall_nonlocal_sysv<mode>): Clean up code block; simplify the
clause that sets the length attribute.
(*sibcall_value_nonlocal_sysv<mode>): Likewise.

From-SVN: r257019

6 years agoPR c++/82249 - wrong mismatched pack length error.
Jason Merrill [Wed, 24 Jan 2018 15:20:53 +0000 (10:20 -0500)]
PR c++/82249 - wrong mismatched pack length error.

* pt.c (extract_fnparm_pack, tsubst_pack_expansion): Handle
unsubstituted function parameter pack.

From-SVN: r257018

6 years ago[testsuite] Fix arm options in gcc.dg/lto/20110201-1_0.c
Kyrylo Tkachov [Wed, 24 Jan 2018 14:43:52 +0000 (14:43 +0000)]
[testsuite] Fix arm options in gcc.dg/lto/20110201-1_0.c

This test fails on arm hardfloat targets because it sets an explicit -mfloat-abi=softfp.
The usual approach to setting the NEON options is to use dg-add-options arm_neon.
But in the lto tests we don't have that framework, we can only set them explicitly with dg-lto-options.

The solution is to remove the explicit -mfloat-abi=softfp and instead add an effective target check
for arm_neon_ok_no_float_abi that makes sure we only run this test if -mfpu=neon is enough to get NEON
without any -mfloat-abi options. In fact, this is what the comment above check_effective_target_arm_neon_ok_no_float_abi_nocache
recommends for lto tests.

That way on my hardfloat toolchain the test doesn't try to link the softfp binary against a hard-float runtime/test glue
and all is good. I've tested that the test is appropriately skipped when testing a --with-float=soft toolchain.

     * gcc.dg/lto/20110201-1_0.c: Remove explicit -mfloat-abi=softfp
     option.  Add arm_neon_ok_no_float_abi check.

From-SVN: r257017

6 years ago[nvptx, PR83589] Workaround for branch-around-nothing JIT bug
Tom de Vries [Wed, 24 Jan 2018 13:52:12 +0000 (13:52 +0000)]
[nvptx, PR83589] Workaround for branch-around-nothing JIT bug

2018-01-24  Tom de Vries  <tom@codesourcery.com>

PR target/83589
* config/nvptx/nvptx.c (WORKAROUND_PTXJIT_BUG_2): Define to 1.
(nvptx_pc_set, nvptx_condjump_label): New function. Copy from jump.c.
Add strict parameter.
(prevent_branch_around_nothing): Insert dummy insn between branch to
label and label with no ptx insn inbetween.
* config/nvptx/nvptx.md (define_insn "fake_nop"): New insn.

* testsuite/libgomp.oacc-c-c++-common/pr83589.c: New test.

From-SVN: r257016

6 years ago[nvptx, PR81352] Add exit insn after noreturn call for neutered threads in warp
Tom de Vries [Wed, 24 Jan 2018 11:27:10 +0000 (11:27 +0000)]
[nvptx, PR81352] Add exit insn after noreturn call for neutered threads in warp

2018-01-24  Tom de Vries  <tom@codesourcery.com>

PR target/81352
* config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call
for neutered threads in warp.
* config/nvptx/nvptx.md (define_insn "exit"): New insn.

* testsuite/libgomp.oacc-fortran/pr81352.f90: New test.

From-SVN: r257014

6 years agore PR tree-optimization/83176 ([graphite] ICE in set_codegen_error, at graphite-isl...
Richard Biener [Wed, 24 Jan 2018 09:37:41 +0000 (09:37 +0000)]
re PR tree-optimization/83176 ([graphite] ICE in set_codegen_error, at graphite-isl-ast-to-gimple.c:206)

2018-01-24  Richard Biener  <rguenther@suse.de>

PR tree-optimization/83176
* tree-chrec.c (chrec_fold_plus_1): Handle (signed T){(T) .. }
operands.

* gcc.dg/graphite/pr83176.c: New testcase.

From-SVN: r257013

6 years agore PR tree-optimization/82819 ([graphite] ICE in set_codegen_error, at graphite-isl...
Richard Biener [Wed, 24 Jan 2018 09:31:56 +0000 (09:31 +0000)]
re PR tree-optimization/82819 ([graphite] ICE in set_codegen_error, at graphite-isl-ast-to-gimple.c:206)

2018-01-24  Richard Biener  <rguenther@suse.de>

PR tree-optimization/82819
* graphite-isl-ast-to-gimple.c (binary_op_to_tree): Avoid
code generating pluses that are no-ops in the target precision.

* gcc.dg/graphite/pr82819.c: New testcase.

From-SVN: r257012

6 years agore PR fortran/84000 (ICE in replace_loop_annotate, at tree-cfg.c:352)
Richard Biener [Wed, 24 Jan 2018 08:43:40 +0000 (08:43 +0000)]
re PR fortran/84000 (ICE in replace_loop_annotate, at tree-cfg.c:352)

2018-01-24  Richard Biener  <rguenther@suse.de>

PR middle-end/84000
* tree-cfg.c (replace_loop_annotate): Handle annot_expr_parallel_kind.

From-SVN: r257011

6 years agocfgcleanup.c (try_crossjump_to_edge): Use combine_with_count to merge probabilities.
Jan Hubicka [Wed, 24 Jan 2018 08:12:40 +0000 (09:12 +0100)]
cfgcleanup.c (try_crossjump_to_edge): Use combine_with_count to merge probabilities.

* cfgcleanup.c (try_crossjump_to_edge): Use combine_with_count
to merge probabilities.
* predict.c (probably_never_executed): Also mark as cold functions
with global 0 profile and guessed local profile.
* profile-count.c (profile_probability::combine_with_count): New
member function.
* profile-count.h (profile_probability::operator*,
profile_probability::operator*=, profile_probability::operator/,
profile_probability::operator/=): Reduce precision to adjusted
and set value to guessed on contradictory divisions.
(profile_probability::combine_with_freq): Remove.
(profile_probability::combine_wiht_count): Declare.
(profile_count::force_nonzero):: Set to adjusted.
(profile_count::probability_in):: Set quality to adjusted.
* tree-ssa-tail-merge.c (replace_block_by): Use
combine_with_count.

From-SVN: r257010

6 years agore PR c++/83921 (GCC rejects constexpr initialization of empty aggregate.)
Paolo Carlini [Wed, 24 Jan 2018 00:57:18 +0000 (00:57 +0000)]
re PR c++/83921 (GCC rejects constexpr initialization of empty aggregate.)

/cp
2018-01-23  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/83921
* decl.c (check_for_uninitialized_const_var): Not static; add
bool and tsubst_flags_t parameters; adjust to be used both in
constexpr context and not.
* constexpr.c (potential_constant_expression_1): Use the above.
* cp-tree.h (check_for_uninitialized_const_var): Declare.

/testsuite
2018-01-23  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/83921
* g++.dg/cpp1y/constexpr-83921-1.C: New.
* g++.dg/cpp1y/constexpr-83921-2.C: Likewise.
* g++.dg/cpp1y/constexpr-83921-3.C: Likewise.
* g++.dg/ext/stmtexpr20.C: Likewise.
* g++.dg/ext/stmtexpr21.C: Likewise.

From-SVN: r257009

6 years agoDaily bump.
GCC Administrator [Wed, 24 Jan 2018 00:16:13 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r257008

6 years agoRISC-V: Add -mpreferred-stack-boundary option.
Andrew Waterman [Tue, 23 Jan 2018 23:06:48 +0000 (23:06 +0000)]
RISC-V: Add -mpreferred-stack-boundary option.

2018-01-23  Andrew Waterman  <andrew@sifive.com>
gcc/
* config/riscv/riscv.c (riscv_stack_boundary): New.
(riscv_option_override): Set riscv_stack_boundary.  Handle
riscv_preferred_stack_boundary_arg.
* config/riscv/riscv.h (MIN_STACK_BOUNDARY, ABI_STACK_BOUNDARY): New.
(BIGGEST_ALIGNMENT): Set to STACK_BOUNDARY.
(STACK_BOUNDARY): Set to riscv_stack_boundary.
(RISCV_STACK_ALIGN): Use STACK_BOUNDARY.
* config/riscv/riscv.opt (mpreferred-stack-boundary): New.
* doc/invoke.tex (RISC-V Options): Add -mpreferred-stack-boundary.

Co-Authored-By: Jim Wilson <jimw@sifive.com>
From-SVN: r257005

6 years agolibgcc: xtensa: fix NaN return from add/sub/mul/div helpers
Max Filippov [Tue, 23 Jan 2018 21:42:52 +0000 (21:42 +0000)]
libgcc: xtensa: fix NaN return from add/sub/mul/div helpers

libgcc/
2018-01-23  Max Filippov  <jcmvbkbc@gmail.com>

* config/xtensa/ieee754-df.S (__addsf3, __subsf3, __mulsf3)
(__divsf3): Make NaN return value quiet.
* config/xtensa/ieee754-sf.S (__adddf3, __subdf3, __muldf3)
(__divdf3): Make NaN return value quiet.

From-SVN: r257002

6 years ago* g++.dg/cpp1y/lambda-generic.C: Remove libstdc++ dependency.
Jason Merrill [Tue, 23 Jan 2018 21:24:01 +0000 (16:24 -0500)]
* g++.dg/cpp1y/lambda-generic.C: Remove libstdc++ dependency.

From-SVN: r257001

6 years agoPR c++/83947 - ICE with auto declarations.
Jason Merrill [Tue, 23 Jan 2018 21:23:53 +0000 (16:23 -0500)]
PR c++/83947 - ICE with auto declarations.

* pt.c (do_auto_deduction): Don't deduce from an auto decl.
* decl.c (undeduced_auto_decl): Limit to vars and fns.

From-SVN: r257000

6 years agoC++: Fix ICE in fold_for_warn on CAST_EXPR (PR c++/83974)
David Malcolm [Tue, 23 Jan 2018 21:19:09 +0000 (21:19 +0000)]
C++: Fix ICE in fold_for_warn on CAST_EXPR (PR c++/83974)

gcc/cp/ChangeLog:
PR c++/83974
* pt.c (tsubst_copy_and_build) <CONSTRUCTOR>: Remove early bailout
for pointer to member function types.

gcc/testsuite/ChangeLog:
PR c++/83974
* g++.dg/warn/pr83974.C: New test case.

From-SVN: r256999

6 years agore PR sanitizer/83987 (ICE with OpenMP, sanitizer and virtual bases)
Jakub Jelinek [Tue, 23 Jan 2018 20:36:34 +0000 (21:36 +0100)]
re PR sanitizer/83987 (ICE with OpenMP, sanitizer and virtual bases)

PR sanitizer/83987
* tree.c (cp_free_lang_data): Change DECL_VALUE_EXPR of
DECL_OMP_PRIVATIZED_MEMBER vars to error_mark_node.

* g++.dg/ubsan/pr83987.C: New test.

From-SVN: r256997

6 years agoi386: Use const reference of struct ix86_frame to avoid copy
H.J. Lu [Tue, 23 Jan 2018 19:30:32 +0000 (19:30 +0000)]
i386: Use const reference of struct ix86_frame to avoid copy

We can use const reference of struct ix86_frame to avoid making a local
copy of ix86_frame.  ix86_expand_epilogue makes a local copy of struct
ix86_frame and uses the reg_save_offset field as a local variable.  This
patch uses a separate local variable for reg_save_offset.

Tested on x86-64 with ada.

PR target/83905
* config/i386/i386.c (ix86_expand_prologue): Use cost reference
of struct ix86_frame.
(ix86_expand_epilogue): Likewise.  Add a local variable for
the reg_save_offset field in struct ix86_frame.

From-SVN: r256996

6 years agore PR fortran/83866 (ICE in gfc_release_symbol, at fortran/symbol.c:3087)
Paul Thomas [Tue, 23 Jan 2018 19:13:10 +0000 (19:13 +0000)]
re PR fortran/83866 (ICE in gfc_release_symbol, at fortran/symbol.c:3087)

2018-23-01  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83866
* decl.c (gfc_match_derived_decl): If eos not matched, recover
and emit error about garbage after declaration.

2018-23-01  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83866
* gfortran.dg/pdt_29.f03 : New test.

From-SVN: r256995

6 years agore PR fortran/83898 (ICE in gfc_conv_expr_descriptor, at fortran/trans-array.c:7181)
Paul Thomas [Tue, 23 Jan 2018 19:10:48 +0000 (19:10 +0000)]
re PR fortran/83898 (ICE in gfc_conv_expr_descriptor, at fortran/trans-array.c:7181)

2018-23-01  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83898
* trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
for characters.

2018-23-01  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83898
* gfortran.dg/associate_33.f03 : New test.

From-SVN: r256994

6 years agore PR tree-optimization/82604 (SPEC CPU2006 410.bwaves ~50% performance regression...
Bin Cheng [Tue, 23 Jan 2018 16:47:03 +0000 (16:47 +0000)]
re PR tree-optimization/82604 (SPEC CPU2006 410.bwaves ~50% performance regression with trunk@253679 when ftree-parallelize-loops is used)

PR tree-optimization/82604
* tree-loop-distribution.c (enum partition_kind): New enum item
PKIND_PARTIAL_MEMSET.
(partition_builtin_p): Support above new enum item.
(generate_code_for_partition): Ditto.
(compute_access_range): Differentiate cases that equality can be
proven at all loops, the innermost loops or no loops.
(classify_builtin_st, classify_builtin_ldst): Adjust call to above
function.  Set PKIND_PARTIAL_MEMSET for partition appropriately.
(finalize_partitions, distribute_loop): Don't fuse partition of
PKIND_PARTIAL_MEMSET kind when distributing 3-level loop nest.
(prepare_perfect_loop_nest): Distribute 3-level loop nest only if
parloop is enabled.

From-SVN: r256990

6 years agoHandle trailing arrays in ODR warning (PR lto/81440).
Martin Liska [Tue, 23 Jan 2018 15:46:02 +0000 (16:46 +0100)]
Handle trailing arrays in ODR warning (PR lto/81440).

2018-01-23  Martin Liska  <mliska@suse.cz>

PR lto/81440
* lto-symtab.c (lto_symtab_merge): Handle and do not warn about
trailing arrays at the end of a struct.
2018-01-23  Martin Liska  <mliska@suse.cz>

PR lto/81440
* gcc.dg/lto/pr81440.h: New test.
* gcc.dg/lto/pr81440_0.c: New test.
* gcc.dg/lto/pr81440_1.c: New test.

From-SVN: r256989

6 years agoRemove predictors that are unrealiable.
Martin Liska [Tue, 23 Jan 2018 15:43:59 +0000 (16:43 +0100)]
Remove predictors that are unrealiable.

2018-01-23  Martin Liska  <mliska@suse.cz>

* predict.def (PRED_INDIR_CALL): Set probability to PROB_EVEN in
order to ignore the predictor.
(PRED_POLYMORPHIC_CALL): Likewise.
(PRED_RECURSIVE_CALL): Likewise.

From-SVN: r256988

6 years ago[PR c++/839888] Baselink tsubst ICE
Nathan Sidwell [Tue, 23 Jan 2018 14:08:11 +0000 (14:08 +0000)]
[PR c++/839888] Baselink tsubst ICE

https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01954.html
PR c++/83988
* pt.c (tsubst_baselink): Remove optype assert.
* ptree.c (cxx_print_xnode): <case BASELINK> Print BASELINK_OPTYPE.

PR c++/83988
* g++.dg/template/pr83988.C: New.

From-SVN: r256986

6 years agore PR c++/82882 (ICE Segmentation fault)
Jakub Jelinek [Tue, 23 Jan 2018 14:04:18 +0000 (15:04 +0100)]
re PR c++/82882 (ICE Segmentation fault)

PR c++/82882
PR c++/83978
* g++.dg/cpp0x/pr82882.C: New test.
* g++.dg/cpp0x/pr83978.C: New test.

From-SVN: r256985

6 years agore PR c++/83958 (ICE: Segmentation fault (in find_decomp_class_base))
Jakub Jelinek [Tue, 23 Jan 2018 13:52:23 +0000 (14:52 +0100)]
re PR c++/83958 (ICE: Segmentation fault (in find_decomp_class_base))

PR c++/83958
* decl.c (cp_finish_decomp): Diagnose if reference structure binding
refers to incomplete type.

* g++.dg/cpp1z/decomp35.C: New test.

From-SVN: r256984

6 years agoClean-up IPA profile dump output.
Martin Liska [Tue, 23 Jan 2018 12:26:37 +0000 (13:26 +0100)]
Clean-up IPA profile dump output.

2018-01-23  Martin Liska  <mliska@suse.cz>

* tree-profile.c (tree_profiling): Print function header to
aware reader which function we are working on.
* value-prof.c (gimple_find_values_to_profile): Do not print
not interesting value histograms.

From-SVN: r256983

6 years agoFix profile_quality sanity check.
Martin Liska [Tue, 23 Jan 2018 12:24:55 +0000 (13:24 +0100)]
Fix profile_quality sanity check.

2018-01-22  Martin Liska  <mliska@suse.cz>

* profile-count.h (enum profile_quality): Add
profile_uninitialized as the first value. Do not number values
as they are zero based.
(profile_count::verify): Update sanity check.
(profile_probability::verify): Likewise.

From-SVN: r256982

6 years ago[C++ PATCH] Deprecate ARM-era for scopes
Nathan Sidwell [Tue, 23 Jan 2018 12:18:50 +0000 (12:18 +0000)]
[C++ PATCH] Deprecate ARM-era for scopes

https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01940.html
gcc/cp/
Deprecate ARM-era for scope handling
* decl.c (poplevel): Flag_new_for_scope is a boolean-like.
(cxx_init_decl_processing): Deprecate flag_new_for_scope being
cleared.
* name-lookup.c (check_for_out_of_scope_variable): Deprecate and
cleanup handling.
* semantics.c (begin_for_scope): Flag_new_for_scope is
boolean-like.
(finish_for_stmt, begin_range_for_stmt): Likewise.

gcc/
* doc/invoke.texi (ffor-scope): Deprecate.

gcc/cp/
* g++.dg/cpp0x/range-for10.C: Adjust.
* g++.dg/ext/forscope1.C: Adjust.
* g++.dg/ext/forscope2.C: Adjust.
* g++.dg/template/for1.C: Adjust.

From-SVN: r256981

6 years ago-Warray-bounds: Fix false positive in some "switch" stmts (PR tree-optimization/83510)
David Malcolm [Tue, 23 Jan 2018 11:10:47 +0000 (11:10 +0000)]
-Warray-bounds: Fix false positive in some "switch" stmts (PR tree-optimization/83510)

PR tree-optimization/83510 reports that r255649 (for
PR tree-optimization/83312) introduced a false positive for
-Warray-bounds for array accesses within certain switch statements:
those for which value-ranges allow more than one case to be reachable,
but for which one or more of the VR-unreachable cases contain
out-of-range array accesses.

In the reproducer, after the switch in f is inlined into g, we have 3 cases
for the switch (case 9, case 10-19, and default), within a loop that
ranges from 0..9.

With both the old and new code, vr_values::simplify_switch_using_ranges clears
the EDGE_EXECUTABLE flag on the edge to the "case 10-19" block.  This
happens during the dom walk within the substitute_and_fold_engine.

With the old code, the clearing of that EDGE_EXECUTABLE flag led to the
      /* Skip blocks that were found to be unreachable.  */
code in the old implementation of vrp_prop::check_all_array_refs skipping
the "case 10-19" block.

With the new code, we have a second dom walk, and that dom_walker's ctor
sets all edges to be EDGE_EXECUTABLE, losing that information.

Then, dom_walker::before_dom_children (here, the subclass'
check_array_bounds_dom_walker::before_dom_children) can return one edge, if
there's a unique successor edge, and dom_walker::walk filters the dom walk
to just that edge.

Here we have two VR-valid edges (case 9 and default), and an VR-invalid
successor edge (case 10-19).  There's no *unique* valid successor edge,
and hence taken_edge is NULL, and the filtering in dom_walker::walk
doesn't fire.

Hence we've lost the filtering of the "case 10-19" BB, hence the false
positive.

The issue is that we have two dom walks: first within vr_values'
substitute_and_fold_dom_walker (which has skip_unreachable_blocks == false),
then another within vrp_prop::check_all_array_refs (with
skip_unreachable_blocks == true).

Each has different "knowledge" about ruling out edges due to value-ranges,
but we aren't combining that information.  The former "knows" about
out-edges at a particular control construct (e.g. at a switch), the latter
"knows" about dominance, but only about unique successors (hence the
problem when two out of three switch cases are valid).

This patch combines the information by preserving the EDGE_EXECUTABLE
flags from the first dom walk, and using it in the second dom walk,
potentially rejecting additional edges.

Doing so fixes the false positive.

I attempted an alternative fix, merging the two dom walks into one, but
that led to crashes in identify_jump_threads, so I went with this, as
a less invasive fix.

gcc/ChangeLog:
PR tree-optimization/83510
* domwalk.c (set_all_edges_as_executable): New function.
(dom_walker::dom_walker): Convert bool param
"skip_unreachable_blocks" to enum reachability.  Move setup of
edge flags to set_all_edges_as_executable and only do it when
reachability is REACHABLE_BLOCKS.
* domwalk.h (enum dom_walker::reachability): New enum.
(dom_walker::dom_walker): Convert bool param
"skip_unreachable_blocks" to enum reachability.
(set_all_edges_as_executable): New decl.
* graphite-scop-detection.c  (gather_bbs::gather_bbs): Convert
from false for "skip_unreachable_blocks" to ALL_BLOCKS for
"reachability".
* tree-ssa-dom.c (dom_opt_dom_walker::dom_opt_dom_walker): Likewise,
but converting true to REACHABLE_BLOCKS.
* tree-ssa-sccvn.c (sccvn_dom_walker::sccvn_dom_walker): Likewise.
* tree-vrp.c
(check_array_bounds_dom_walker::check_array_bounds_dom_walker):
Likewise, but converting it to REACHABLE_BLOCKS_PRESERVING_FLAGS.
(vrp_dom_walker::vrp_dom_walker): Likewise, but converting it to
REACHABLE_BLOCKS.
(vrp_prop::vrp_finalize): Call set_all_edges_as_executable
if check_all_array_refs will be called.

gcc/testsuite/ChangeLog:
PR tree-optimization/83510
* gcc.c-torture/compile/pr83510.c: New test case.

From-SVN: r256980

6 years agoAdd more test coverage to selftest::test_location_wrappers
David Malcolm [Tue, 23 Jan 2018 11:05:21 +0000 (11:05 +0000)]
Add more test coverage to selftest::test_location_wrappers

gcc/ChangeLog:
* tree.c (selftest::test_location_wrappers): Add more test
coverage.

From-SVN: r256979

6 years agoFix memory leaks in sbitmap.c selftests
David Malcolm [Tue, 23 Jan 2018 11:01:55 +0000 (11:01 +0000)]
Fix memory leaks in sbitmap.c selftests

"make selftest-valgrind" shows a few leaks in sbitmap.c's selftests;
this patch fixes them.

gcc/ChangeLog:
* sbitmap.c (selftest::test_set_range): Fix memory leaks.
(selftest::test_bit_in_range): Likewise.

From-SVN: r256978

6 years agoFix vect_float markup for a couple of tests (PR 83888)
Richard Sandiford [Tue, 23 Jan 2018 10:42:32 +0000 (10:42 +0000)]
Fix vect_float markup for a couple of tests (PR 83888)

vect_float is true for arm*-*-* targets, but the support is only
available when -funsafe-math-optimizations is on.  This caused
failures in two tests that disable fast-math.

The easiest fix seemed to be to add a new target selector for
"vect_float without special options".

2018-01-23  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR testsuite/83888
* doc/sourcebuild.texi (vect_float): Say that the selector
only describes the situation when -funsafe-math-optimizations is on.
(vect_float_strict): Document.

gcc/testsuite/
PR testsuite/83888
* lib/target-supports.exp (check_effective_target_vect_float): Say
that the result only holds when -funsafe-math-optimizations is on.
(check_effective_target_vect_float_strict): New procedure.
* gcc.dg/vect/no-fast-math-vect16.c: Use vect_float_strict instead
of vect_float.
* gcc.dg/vect/vect-reduc-6.c: Likewise.

From-SVN: r256977

6 years agoDisable some patterns for fold-left reductions (PR 83965)
Richard Sandiford [Tue, 23 Jan 2018 10:42:10 +0000 (10:42 +0000)]
Disable some patterns for fold-left reductions (PR 83965)

In this PR we recognised a PLUS_EXPR as a fold-left reduction,
then applied pattern matching to convert it to a WIDEN_SUM_EXPR.
We need to keep the original code in this case since we implement
the reduction using scalar rather than vector operations.

2018-01-23  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/83965
* tree-vect-patterns.c (vect_reassociating_reduction_p): New function.
(vect_recog_dot_prod_pattern, vect_recog_sad_pattern): Use it
instead of checking only for a reduction.
(vect_recog_widen_sum_pattern): Likewise.

gcc/testsuite/
PR tree-optimization/83965
* gcc.dg/vect/pr83965.c: New test.

From-SVN: r256976

6 years agopredict.c (probably_never_executed): Only use precise profile info.
Jan Hubicka [Tue, 23 Jan 2018 09:55:37 +0000 (10:55 +0100)]
predict.c (probably_never_executed): Only use precise profile info.

* predict.c (probably_never_executed): Only use precise profile info.
(compute_function_frequency): Skip after inlining hack since we now
have quality checking.

From-SVN: r256975

6 years agoprofile-count.h (profile_probability::very_unlikely, [...]): Set precision to guessed.
Jan Hubicka [Tue, 23 Jan 2018 09:50:01 +0000 (10:50 +0100)]
profile-count.h (profile_probability::very_unlikely, [...]): Set precision to guessed.

* profile-count.h (profile_probability::very_unlikely,
profile_probability::unlikely, profile_probability::even): Set
precision to guessed.

From-SVN: r256974

6 years agore PR tree-optimization/83963 ([graphite] ICE in merge_sese, at graphite-scop-detecti...
Richard Biener [Tue, 23 Jan 2018 08:00:20 +0000 (08:00 +0000)]
re PR tree-optimization/83963 ([graphite] ICE in merge_sese, at graphite-scop-detection.c:517)

2018-01-23  Richard Biener  <rguenther@suse.de>

PR tree-optimization/83963
* graphite-scop-detection.c (scop_detection::harmful_loop_in_region):
Properly terminate dominator walk when crossing the exit edge not
when visiting its source block.

* gfortran.dg/graphite/pr83963.f: New testcase.
* gcc.dg/graphite/pr83963-2.c: Likewise.

From-SVN: r256973

6 years agore PR c++/83918 ([c++17] ICE on constexpr eval of datatype involving function and...
Jakub Jelinek [Tue, 23 Jan 2018 07:46:05 +0000 (08:46 +0100)]
re PR c++/83918 ([c++17] ICE on constexpr eval of datatype involving function and variadic template)

PR c++/83918
* tree.c (maybe_wrap_with_location): Use NON_LVALUE_EXPR rather than
VIEW_CONVERT_EXPR to wrap CONST_DECLs.

* g++.dg/cpp1z/pr83918.C: New test.

From-SVN: r256972

6 years agocmd/go: buildid support for AIX archives.
Ian Lance Taylor [Tue, 23 Jan 2018 04:44:12 +0000 (04:44 +0000)]
cmd/go: buildid support for AIX archives.

    Reviewed-on: https://go-review.googlesource.com/88935

From-SVN: r256971

6 years agoDaily bump.
GCC Administrator [Tue, 23 Jan 2018 00:16:21 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r256970

6 years agore PR tree-optimization/83957 (ICE: Segmentation fault (in gimple_phi_arg))
Jakub Jelinek [Mon, 22 Jan 2018 23:00:50 +0000 (00:00 +0100)]
re PR tree-optimization/83957 (ICE: Segmentation fault (in gimple_phi_arg))

PR tree-optimization/83957
* omp-expand.c (expand_omp_for_generic): Ignore virtual PHIs.  Remove
semicolon after for body surrounded by braces.

* gcc.dg/autopar/pr83957.c: New test.

From-SVN: r256967

6 years agore PR tree-optimization/83081 ([arm] gcc.dg/pr80218.c fails since r254888)
Jakub Jelinek [Mon, 22 Jan 2018 22:59:33 +0000 (23:59 +0100)]
re PR tree-optimization/83081 ([arm] gcc.dg/pr80218.c fails since r254888)

PR tree-optimization/83081
* profile-count.h (profile_probability::split): New method.
* dojump.c (do_jump_1) <case TRUTH_ANDIF_EXPR, case TRUTH_ORIF_EXPR>:
Use profile_probability::split.
(do_compare_rtx_and_jump): Fix adjustment of probabilities
when splitting a single conditional jump into 2.

* gcc.dg/predict-8.c: Adjust expected probability.

From-SVN: r256966

6 years agoPR c++/83720 - different fix
Jason Merrill [Mon, 22 Jan 2018 22:41:48 +0000 (17:41 -0500)]
PR c++/83720 - different fix

* decl2.c (determine_visibility): Fix template_decl handling
instead of blocking it.

From-SVN: r256965

6 years agoPR c++/83720 - ICE with lambda and LTO.
Jason Merrill [Mon, 22 Jan 2018 21:51:53 +0000 (16:51 -0500)]
PR c++/83720 - ICE with lambda and LTO.

* decl2.c (determine_visibility): Clear template_decl for
function-scope decls.  Propagate anonymous linkage from containing
function.

From-SVN: r256964

6 years agoFinish removing class move_computations_dom_walker
David Malcolm [Mon, 22 Jan 2018 20:53:57 +0000 (20:53 +0000)]
Finish removing class move_computations_dom_walker

r232820 (aka 2c7b2f8860794cc9b9cf5eeea9d7dc109c0de3be) removed the
implementation of class move_computations_dom_walker, but kept the decl.

This patch removes the stray decl.

gcc/ChangeLog:
PR tree-optimization/69452
* tree-ssa-loop-im.c (class move_computations_dom_walker): Remove
decl.

From-SVN: r256963

6 years agorl78-expand.md: New define_expand "bswaphi2"
Sebastian Perta [Mon, 22 Jan 2018 20:20:28 +0000 (20:20 +0000)]
rl78-expand.md: New define_expand "bswaphi2"

2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/rl78-expand.md: New define_expand "bswaphi2"
* config/rl78/rl78-virt.md: New define_insn "*bswaphi2_virt"
* config/rl78/rl78-real.md: New define_insn "*bswaphi2_real"

From-SVN: r256961

6 years agorl78-protos.h: New function declaration rl78_split_movdi
Sebastian Perta [Mon, 22 Jan 2018 19:53:55 +0000 (19:53 +0000)]
rl78-protos.h: New function declaration rl78_split_movdi

2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/rl78-protos.h: New function declaration rl78_split_movdi
* config/rl78/rl78.md: New define_expand "movdi"
* config/rl78/rl78.c: New function definition rl78_split_movdi

From-SVN: r256960

6 years agore PR target/83862 (powerpc: ICE in signbit testcase)
Michael Meissner [Mon, 22 Jan 2018 19:36:18 +0000 (19:36 +0000)]
re PR target/83862 (powerpc: ICE in signbit testcase)

[gcc]
2018-01-22  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/83862
* config/rs6000/rs6000-protos.h (rs6000_split_signbit): Delete,
no longer used.
* config/rs6000/rs6000.c (rs6000_split_signbit): Likewise.
* config/rs6000/rs6000.md (signbit<mode>2): Change code for IEEE
128-bit to produce an UNSPEC move to get the double word with the
signbit and then a shift directly to do signbit.
(signbit<mode>2_dm): Replace old IEEE 128-bit signbit
implementation with a new version that just does either a direct
move or a regular move.  Move memory interface to separate insns.
Move insns so they are next to the expander.
(signbit<mode>2_dm_mem_be): New combiner insns to combine load
with signbit move.  Split big and little endian case.
(signbit<mode>2_dm_mem_le): Likewise.
(signbit<mode>2_dm_<su>ext): Delete, no longer used.
(signbit<mode>2_dm2): Likewise.

[gcc/testsuite]
2018-01-22  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/83862
* gcc.target/powerpc/pr83862.c: New test.

From-SVN: r256959

6 years agorl78.md: New define_expand "anddi3".
Sebastian Perta [Mon, 22 Jan 2018 19:23:15 +0000 (19:23 +0000)]
rl78.md: New define_expand "anddi3".

2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/rl78.md: New define_expand "anddi3".

2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/anddi3.S: New assembly file.
* config/rl78/t-rl78: Added anddi3.S to LIB2ADD.

From-SVN: r256958

6 years agorl78.md: New define_expand "umindi3".
Sebastian Perta [Mon, 22 Jan 2018 18:51:28 +0000 (18:51 +0000)]
rl78.md: New define_expand "umindi3".

2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/rl78.md: New define_expand "umindi3".

2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/umindi3.S: New assembly file.
* config/rl78/t-rl78: Added umindi3.S to LIB2ADD.

From-SVN: r256957

6 years ago* es.po: Update.
Joseph Myers [Mon, 22 Jan 2018 18:22:58 +0000 (18:22 +0000)]
* es.po: Update.

From-SVN: r256955

6 years agorl78.md: New define_expand "smindi3".
Sebastian Perta [Mon, 22 Jan 2018 18:17:09 +0000 (18:17 +0000)]
rl78.md: New define_expand "smindi3".

2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/rl78.md: New define_expand "smindi3".

2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/smindi3.S: New assembly file.
* config/rl78/t-rl78: Added smindi3.S to LIB2ADD.

From-SVN: r256954

6 years agorl78.md: New define_expand "smaxdi3".
Sebastian Perta [Mon, 22 Jan 2018 17:38:26 +0000 (17:38 +0000)]
rl78.md: New define_expand "smaxdi3".

2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/rl78.md: New define_expand "smaxdi3".

2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/smaxdi3.S: New assembly file.
* config/rl78/t-rl78: Added smaxdi3.S to LIB2ADD.

From-SVN: r256953

6 years agors6000-builtin.def (ST_ELEMREV_V1TI, [...]): Add macro expansion.
Carl Love [Mon, 22 Jan 2018 17:27:12 +0000 (17:27 +0000)]
rs6000-builtin.def (ST_ELEMREV_V1TI, [...]): Add macro expansion.

gcc/ChangeLog:

2018-01-22 Carl Love <cel@us.ibm.com>

* config/rs6000/rs6000-builtin.def (ST_ELEMREV_V1TI, LD_ELEMREV_V1TI,
LVX_V1TI): Add macro expansion.
* config/rs6000/rs6000-c.c (altivec_builtin_types): Add argument
definitions for VSX_BUILTIN_VEC_XST_BE, VSX_BUILTIN_VEC_ST,
VSX_BUILTIN_VEC_XL, LD_ELEMREV_V1TI builtins.
* config/rs6000/rs6000-p8swap.c (insn_is_swappable_p);
Change check to determine if the instruction is a byte reversing
entry.  Fix typo in comment.
* config/rs6000/rs6000.c (altivec_expand_builtin): Add case entry
for VSX_BUILTIN_ST_ELEMREV_V1TI and VSX_BUILTIN_LD_ELEMREV_V1TI.
Add def_builtin calls for new builtins.
* config/rs6000/vsx.md (vsx_st_elemrev_v1ti, vsx_ld_elemrev_v1ti):
Add define_insn expansion.

gcc/testsuite/ChangeLog:

2018-01-22  Carl Love  <cel@us.ibm.com>
* gcc.target/powerpc/powerpc.exp: Add torture tests for
builtins-4-runnable.c, builtins-6-runnable.c,
builtins-5-p9-runnable.c, builtins-6-p9-runnable.c.
* gcc.target/powerpc/builtins-6-runnable.c: New test file.
* gcc.target/powerpc/builtins-4-runnable.c: Add additional tests
for signed/unsigned 128-bit and long long int loads.

From-SVN: r256952

6 years agore PR c++/81933 (Invalid "constexpr call flows off the end of the function" error)
Marek Polacek [Mon, 22 Jan 2018 16:05:20 +0000 (16:05 +0000)]
re PR c++/81933 (Invalid "constexpr call flows off the end of the function" error)

PR c++/81933
* typeck2.c (split_nonconstant_init_1): Return false if we didn't
split out anything.

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

From-SVN: r256951

6 years agofixed year in gcc/ChangeLog and libgcc/ChangeLog
Sebastian Perta [Mon, 22 Jan 2018 15:05:59 +0000 (15:05 +0000)]
fixed year in gcc/ChangeLog and libgcc/ChangeLog

From-SVN: r256949

6 years agorl78.md: New define_expand "umaxdi3".
Sebastian Perta [Mon, 22 Jan 2018 15:00:59 +0000 (15:00 +0000)]
rl78.md: New define_expand "umaxdi3".

2017-01-22  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/rl78.md: New define_expand "umaxdi3".

2017-01-22  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/umaxdi3.S: New assembly file.
* config/rl78/t-rl78: Added umaxdi3.S to LIB2ADD.

From-SVN: r256948

6 years agofold-vec-abs-short-fwrap.c: Add xxspltib to scan-asembler valid instructions list.
Will Schmidt [Mon, 22 Jan 2018 14:49:57 +0000 (14:49 +0000)]
fold-vec-abs-short-fwrap.c: Add xxspltib to scan-asembler valid instructions list.

[testsuite]

2018-01-19  Will Schmidt <will_schmidt@vnet.ibm.com>

* gcc.target/powerpc/fold-vec-abs-short-fwrap.c: Add xxspltib to
scan-asembler valid instructions list.
* gcc.target/powerpc/fold-vec-abs-short.c: Same.
* gcc.target/powerpc/fold-vec-shift-left-longlong.c: Clean up
power8-vector requirement and option.
* gcc.target/powerpc/fold-vec-shift-left-fwrapv.c: Same.

From-SVN: r256947

6 years agorl78.c (rl78_note_reg_set): fixed dead reg check for non-QImode registers
Sebastian Perta [Mon, 22 Jan 2018 13:53:48 +0000 (13:53 +0000)]
rl78.c (rl78_note_reg_set): fixed dead reg check for non-QImode registers

2018-01-12  Sebastian Perta  <sebastian.perta@renesas.com>

* config/rl78/rl78.c (rl78_note_reg_set): fixed dead reg check
for non-QImode registers

From-SVN: r256945

6 years agoPR 78534, 83704 Large character lengths
Janne Blomqvist [Mon, 22 Jan 2018 13:31:08 +0000 (15:31 +0200)]
PR 78534, 83704 Large character lengths

This patch fixes various parts of the code to use a larger type than
int for the character length. Depending on the situation,
HOST_WIDE_INT, size_t, or gfc_charlen_t is appropriate.

Regtested on x86_64-pc-linux-gnu and i686-pc-linux-gnu.

gcc/fortran/ChangeLog:

2018-01-22  Janne Blomqvist  <jb@gcc.gnu.org>

PR 78534
PR 83704
* arith.c (gfc_arith_concat): Use size_t for string length.
(gfc_compare_string): Likewise.
(gfc_compare_with_Cstring): Likewise.
* array.c (gfc_resolve_character_array_constructor): Use
HOST_WIDE_INT, gfc_mpz_get_hwi.
* check.c (gfc_check_fe_runtime_error): Use size_t.
* data.c (create_character_initializer): Use HOST_WIDE_INT,
gfc_extract_hwi.
* decl.c (gfc_set_constant_character_len): Use gfc_charlen_t.
(add_init_expr_to_sym): Use HOST_WIDE_INT.
* expr.c (gfc_build_init_expr): Use HOST_WIDE_INT,
gfc_extract_hwi.
(gfc_apply_init): Likewise.
* match.h (gfc_set_constant_character_len): Update prototype.
* primary.c (match_string_constant): Use size_t.
* resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT,
gfc_mpz_get_hwi.
* simplify.c (init_result_expr): Likewise.
(gfc_simplify_len_trim): Use size_t.
* target-memory.c (gfc_encode_character): Use size_t.
(gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi.
(interpret_array): Use size_t.
(gfc_interpret_character): Likewise.
* target-memory.h (gfc_encode_character): Update prototype.
(gfc_interpret_character): Likewise.
(gfc_target_interpret_expr): Likewise.
* trans-const.c (gfc_build_string_const): Use size_t for length
argument.
(gfc_build_wide_string_const): Likewise.
* trans-const.h (gfc_build_string_const): Likewise.
(gfc_build_wide_string_const): Likewise.

2018-01-22  Janne Blomqvist  <jb@gcc.gnu.org>

PR 78534
PR 83704
* gfortran.dg/string_1.f90: Remove printing the length.

From-SVN: r256944

6 years agore PR tree-optimization/83963 ([graphite] ICE in merge_sese, at graphite-scop-detecti...
Richard Biener [Mon, 22 Jan 2018 13:10:57 +0000 (13:10 +0000)]
re PR tree-optimization/83963 ([graphite] ICE in merge_sese, at graphite-scop-detection.c:517)

2018-01-22  Richard Biener  <rguenther@suse.de>

PR tree-optimization/83963
* graphite-scop-detection.c (scop_detection::get_sese): Delay
including the loop exit block.
(scop_detection::merge_sese): Likewise.
(scop_detection::add_scop): Do it here instead.

* gcc.dg/graphite/pr83963.c: New testcase.

From-SVN: r256943

6 years agore PR c++/83895 (-Wparentheses warns about pointer-to-member typedefs)
Ville Voutilainen [Mon, 22 Jan 2018 12:44:33 +0000 (14:44 +0200)]
re PR c++/83895 (-Wparentheses warns about pointer-to-member typedefs)

PR c++/83895

cp/

* decl.c (grokdeclarator): Don't diagnose extra parens
on typedefs.

testsuite/

* g++.dg/warn/83895.C: New.

From-SVN: r256942

6 years ago[ARM] Fix test fail with conflicting -mfloat-abi
Sudakshina Das [Mon, 22 Jan 2018 10:56:26 +0000 (10:56 +0000)]
[ARM] Fix test fail with conflicting -mfloat-abi

This patch fixes my earlier test case that fails for arm-none-eabi
with explicit user option for -mfloat-abi which conflict with
the test case options. I have added a guard to skip the test
on those cases.

ChangeLog entries:

*** gcc/testsuite/ChangeLog ***

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

* gcc.c-torture/compile/pr82096.c: Add dg-skip-if and
dg-require-effective-target directives.

From-SVN: r256941

6 years ago[arm] Make gcc.target/arm/copysign_softfloat_1.c more robust
Kyrylo Tkachov [Mon, 22 Jan 2018 10:50:20 +0000 (10:50 +0000)]
[arm] Make gcc.target/arm/copysign_softfloat_1.c more robust

This test has needlessly restrictive requirements. It tries to force a soft-float target and tries to run.
This makes it unsupportable for any non-soft-float variant.
In fact, the test can be a run-time test for any target, and only the scan-assembler tests are specific to
-mfloat-abi=soft. So this patch makes the test always runnable and makes the scan-assembler checks predicable
on the the new arm_sotftfloat effective target check.

* doc/sourcebuild.texi (arm_softfloat): Document.

* lib/target-supports.exp (check_effective_target_arm_softfloat):
New procedure.
* gcc.target/arm/copysign_softfloat_1.c: Allow running everywhere.
Adjust scan-assembler checks for soft-float.

From-SVN: r256940

6 years agore PR target/83946 (Safe Indirect Jumps broken on AIX)
Bill Schmidt [Mon, 22 Jan 2018 02:46:11 +0000 (02:46 +0000)]
re PR target/83946 (Safe Indirect Jumps broken on AIX)

2018-01-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

PR target/83946
* gcc.target/powerpc/safe-indirect-jump-8.c: Skip for AIX.

From-SVN: r256939

6 years agoDaily bump.
GCC Administrator [Mon, 22 Jan 2018 00:16:13 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r256938

6 years agopr83621.c: Add -fno-common additional option on hppa*-&-hpux*.
John David Anglin [Sun, 21 Jan 2018 18:35:49 +0000 (18:35 +0000)]
pr83621.c: Add -fno-common additional option on hppa*-&-hpux*.

* gcc.dg/pr83621.c: Add -fno-common additional option on hppa*-&-hpux*.
* gcc.dg/pr83623.c: Likewise.
* gcc.dg/pr83666.c: Likewise.

From-SVN: r256935

6 years agore PR testsuite/77734 (FAIL: gcc.dg/plugin/must-tail-call-1.c -fplugin=./must_tail_ca...
John David Anglin [Sun, 21 Jan 2018 18:15:31 +0000 (18:15 +0000)]
re PR testsuite/77734 (FAIL: gcc.dg/plugin/must-tail-call-1.c -fplugin=./must_tail_call_plugin.so (test  for excess errors))

PR gcc/77734
* config/pa/pa.c (pa_function_ok_for_sibcall): Use
targetm.binds_local_p instead of TREE_PUBLIC to check local binding.
Move TARGET_PORTABLE_RUNTIME check after TARGET_64BIT check.

From-SVN: r256934

6 years agore PR lto/83452 (FAIL: gfortran.dg/save_6.f90 -O0 (test for excess errors))
John David Anglin [Sun, 21 Jan 2018 17:52:44 +0000 (17:52 +0000)]
re PR lto/83452 (FAIL: gfortran.dg/save_6.f90   -O0  (test for excess errors))

PR lto/83452
* config/pa/stublib.c (L_gnu_lto_v1): New stub definition.
* config/pa/t-stublib (gnu_lto_v1-stub.o): Add make fragment.

From-SVN: r256933

6 years agore PR target/83946 (Safe Indirect Jumps broken on AIX)
Bill Schmidt [Sun, 21 Jan 2018 13:26:07 +0000 (13:26 +0000)]
re PR target/83946 (Safe Indirect Jumps broken on AIX)

[gcc]

2018-01-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
    David Edelsohn <dje.gcc@gmail.com>

PR target/83946
* config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv<mode>):
Change "crset eq" to "crset 2".
(*call_value_indirect_nonlocal_sysv<mode>): Likewise.
(*call_indirect_aix<mode>_nospec): Likewise.
(*call_value_indirect_aix<mode>_nospec): Likewise.
(*call_indirect_elfv2<mode>_nospec): Likewise.
(*call_value_indirect_elfv2<mode>_nospec): Likewise.
(*sibcall_nonlocal_sysv<mode>): Change "crset eq" to "crset 2";
change assembly output from . to $.
(*sibcall_value_nonlocal_sysv<mode>): Likewise.
(indirect_jump<mode>_nospec): Change assembly output from . to $.
(*tablejump<mode>_internal1_nospec): Likewise.

[gcc/testsuite]

2018-01-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
    David Edelsohn <dje.gcc@gmail.com>

PR target/83946
* gcc.target/powerpc/safe-indirect-jump-1.c: Change expected
assembly output from "crset eq" to "crset 2".
* gcc.target/powerpc/safe-indirect-jump-2.c: Change expected
assembly output from . to $.
* gcc.target/powerpc/safe-indirect-jump-3.c: Likewise.
* gcc.target/powerpc/safe-indirect-jump-1.c: Change expected
assembly output from "crset eq" to "crset 2".
* gcc.target/powerpc/safe-indirect-jump-8.c: Change expected
assembly output from "crset eq" to "crset 2", and from . to $.

Co-Authored-By: David Edelsohn <dje.gcc@gmail.com>
From-SVN: r256931

6 years agoFix ChangeLog entry.
Oleg Endo [Sun, 21 Jan 2018 05:12:01 +0000 (05:12 +0000)]
Fix ChangeLog entry.

From-SVN: r256927

6 years agore PR target/80870 (ICE building 7.1.0 sh-elf crosscompiler on macOS)
Oleg Endo [Sun, 21 Jan 2018 05:03:26 +0000 (05:03 +0000)]
re PR target/80870 (ICE building 7.1.0 sh-elf crosscompiler on macOS)

PR target/80870
* config/sh/rx/rx.c (config/sh/sh_optimize_sett_clrt.cc):
Use INCLUDE_ALGORITHM and INCLUDE_VECTOR instead of direct includes.

From-SVN: r256926

6 years agosimple-object-xcoff.c (simple_object_xcoff_find_sections): Use ulong_type to avoid...
Eli Zaretskii [Sun, 21 Jan 2018 05:01:31 +0000 (05:01 +0000)]
simple-object-xcoff.c (simple_object_xcoff_find_sections): Use ulong_type to avoid warning about 32-bit shift.

* simple-object-xcoff.c (simple_object_xcoff_find_sections): Use
ulong_type to avoid warning about 32-bit shift.

From-SVN: r256925

6 years agoDaily bump.
GCC Administrator [Sun, 21 Jan 2018 00:16:29 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r256924

6 years agore PR fortran/83900 (ICE in gfc_simplify_matmul, at fortran/simplify.c:4593)
Steven G. Kargl [Sat, 20 Jan 2018 20:33:34 +0000 (20:33 +0000)]
re PR fortran/83900 (ICE in gfc_simplify_matmul, at fortran/simplify.c:4593)

2018-01-20  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/83900
    * simplify.c (gfc_simplify_matmul): Set return type correctly.

2018-01-20  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/83900
* gfortran.dg/matmul_18.f90: New test.

From-SVN: r256919

6 years agoFix vect_def_type handling in x86 scatter support (PR 83940)
Richard Sandiford [Sat, 20 Jan 2018 13:43:22 +0000 (13:43 +0000)]
Fix vect_def_type handling in x86 scatter support (PR 83940)

As Jakub says in the PR, the problem here was that the x86/built-in
version of the scatter support was using a bogus scatter_src_dt
when calling vect_get_vec_def_for_stmt_copy (and had since it
was added).  The patch uses the vect_def_type from the original
call to vect_is_simple_use instead.

However, Jakub also pointed out that other parts of the load and store
code passed the vector operand rather than the scalar operand to
vect_is_simple_use.  That probably works most of the time since
a constant scalar operand should give a constant vector operand,
and likewise for external and internal definitions.  But it
definitely seems more robust to pass the scalar operand.

The patch avoids the issue for gather and scatter offsets by
using the cached gs_info.offset_dt.  This is safe because gathers
and scatters are never grouped, so there's only one statement operand
to consider.  The patch also caches the vect_def_type for mask operands,
which is safe because grouped masked operations share the same mask.

That just leaves the store rhs.  We still need to recalculate the
vect_def_type there since different store values in the group can
have different definition types.  But since we still have access
to the original scalar operand, it seems better to use that instead.

2018-01-20  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/83940
* tree-vect-stmts.c (vect_truncate_gather_scatter_offset): Set
offset_dt to vect_constant_def rather than vect_unknown_def_type.
(vect_check_load_store_mask): Add a mask_dt_out parameter and
use it to pass back the definition type.
(vect_check_store_rhs): Likewise rhs_dt_out.
(vect_build_gather_load_calls): Add a mask_dt argument and use
it instead of a call to vect_is_simple_use.
(vectorizable_store): Update calls to vect_check_load_store_mask
and vect_check_store_rhs.  Use the dt returned by the latter instead
of scatter_src_dt.  Use the cached mask_dt and gs_info.offset_dt
instead of calls to vect_is_simple_use.  Pass the scalar rather
than the vector operand to vect_is_simple_use when handling
second and subsequent copies of an rhs value.
(vectorizable_load): Update calls to vect_check_load_store_mask
and vect_build_gather_load_calls.  Use the cached mask_dt and
gs_info.offset_dt instead of calls to vect_is_simple_use.

gcc/testsuite/
PR tree-optimization/83940
* gcc.dg/torture/pr83940.c: New test.

From-SVN: r256918

6 years agore PR middle-end/83945 (internal compiler error: Segmentation fault with -O -fcode...
Jakub Jelinek [Sat, 20 Jan 2018 09:58:31 +0000 (10:58 +0100)]
re PR middle-end/83945 (internal compiler error: Segmentation fault with -O -fcode-hoisting)

PR middle-end/83945
* tree-emutls.c: Include gimplify.h.
(lower_emutls_2): New function.
(lower_emutls_1): If ADDR_EXPR is a gimple invariant and walk_tree
with lower_emutls_2 callback finds some TLS decl in it, unshare_expr
it before further processing.

* gcc.dg/tls/pr83945.c: New test.

From-SVN: r256916

6 years agore PR target/83930 (ICE: RTL check: expected code 'const_int', have 'mem' in simplify...
Jakub Jelinek [Sat, 20 Jan 2018 09:54:06 +0000 (10:54 +0100)]
re PR target/83930 (ICE: RTL check: expected code 'const_int', have 'mem' in simplify_binary_operation_1, at simplify-rtx.c:3302)

PR target/83930
* simplify-rtx.c (simplify_binary_operation_1) <case UMOD>: Use
UINTVAL (trueop1) instead of INTVAL (op1).

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

From-SVN: r256915

6 years agore PR fortran/83900 (ICE in gfc_simplify_matmul, at fortran/simplify.c:4593)
Steven G. Kargl [Sat, 20 Jan 2018 06:15:55 +0000 (06:15 +0000)]
re PR fortran/83900 (ICE in gfc_simplify_matmul, at fortran/simplify.c:4593)

2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/83900
* simplify.c (gfc_simplify_matmul): Delete bogus assertion.

2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/83900
* gfortran.dg/matmul_17.f90: New test.

From-SVN: r256912

6 years agoDaily bump.
GCC Administrator [Sat, 20 Jan 2018 00:16:35 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r256911

6 years agore PR fortran/80768 (NULL pointer dereferenced in gfc_check_num_images at fortran...
Steven G. Kargl [Fri, 19 Jan 2018 23:28:18 +0000 (23:28 +0000)]
re PR fortran/80768 (NULL pointer dereferenced in gfc_check_num_images at fortran/check.c)

2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/80768
* gfortran.dg/num_images_1.f90:  New test that tests fix in r250734.

From-SVN: r256906

6 years agore PR c++/81167 (ICE on valid C++ code in deferred_printed_type, at cp/error.c:118)
Jakub Jelinek [Fri, 19 Jan 2018 22:37:37 +0000 (23:37 +0100)]
re PR c++/81167 (ICE on valid C++ code in deferred_printed_type, at cp/error.c:118)

PR c++/81167
* call.c (joust): Use TREE_TYPE (source) if source is
a POINTER_TYPE_P rather than if ! DECL_CONSTRUCTOR_P (w->fn).

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

From-SVN: r256905

6 years agore PR debug/81570 (create_pseudo_cfg assumes that INCOMING_FRAME_SP_OFFSET is a constant)
Jakub Jelinek [Fri, 19 Jan 2018 22:36:04 +0000 (23:36 +0100)]
re PR debug/81570 (create_pseudo_cfg assumes that INCOMING_FRAME_SP_OFFSET is a constant)

PR debug/81570
PR debug/83728
* dwarf2cfi.c (DEFAULT_INCOMING_FRAME_SP_OFFSET): Define to
INCOMING_FRAME_SP_OFFSET if not defined.
(scan_trace): Add ENTRY argument.  If true and
DEFAULT_INCOMING_FRAME_SP_OFFSET != INCOMING_FRAME_SP_OFFSET,
emit a note to adjust the CFA offset.
(create_cfi_notes): Adjust scan_trace callers.
(create_cie_data): Use DEFAULT_INCOMING_FRAME_SP_OFFSET rather than
INCOMING_FRAME_SP_OFFSET in the CIE.
* config/i386/i386.h (DEFAULT_INCOMING_FRAME_SP_OFFSET): Define.
* config/stormy16/stormy16.h (DEFAULT_INCOMING_FRAME_SP_OFFSET):
Likewise.
* doc/tm.texi.in (DEFAULT_INCOMING_FRAME_SP_OFFSET): Document.
* doc/tm.texi: Regenerated.

From-SVN: r256904

6 years agore PR c++/83919 (spurious -Wignored-qualifiers warning)
Jakub Jelinek [Fri, 19 Jan 2018 22:35:09 +0000 (23:35 +0100)]
re PR c++/83919 (spurious -Wignored-qualifiers warning)

PR c++/83919
* typeck.c (convert_for_assignment): Suppress warn_ignored_qualifiers
for direct enum init.
* decl.c (reshape_init): Likewise.

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

From-SVN: r256903

6 years agore PR rtl-optimization/83147 (LRA inheritance undo on multiple sets problem)
Andreas Krebbel [Fri, 19 Jan 2018 22:16:30 +0000 (22:16 +0000)]
re PR rtl-optimization/83147 (LRA inheritance undo on multiple sets problem)

2018-01-19  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

PR rtl-optimization/83147
* lra-constraints.c (remove_inheritance_pseudos): Use
lra_substitute_pseudo_within_insn.

From-SVN: r256902