Jason Merrill [Fri, 26 Jan 2018 20:47:32 +0000 (15:47 -0500)]
PR c++/83956 - wrong dtor error with anonymous union
* method.c (walk_field_subobs): Variant members only affect
deletedness.
(maybe_explain_implicit_delete): Pass &deleted_p for diagnostic.
From-SVN: r257107
Damian Rouson [Fri, 26 Jan 2018 20:14:09 +0000 (20:14 +0000)]
Partial Failed Images patch
Co-Authored-By: Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
Co-Authored-By: Soren Rasmussen <s.c.rasmussen@gmail.com>
From-SVN: r257105
Steven G. Kargl [Fri, 26 Jan 2018 19:33:16 +0000 (19:33 +0000)]
re PR fortran/83998 (ICE in gfc_conv_intrinsic_dot_product, at fortran/trans-intrinsic.c:4403)
2018-01-26 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/83998
* simplify.c (compute_dot_product): Initialize result to INTEGER(1) 0
or .false. The summation does the correct type conversion.
(gfc_simplify_dot_product): Special case zero-sized arrays.
2018-01-26 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/83998
* gfortran.dg/dot_product_4.f90
From-SVN: r257104
Kyrylo Tkachov [Fri, 26 Jan 2018 17:15:21 +0000 (17:15 +0000)]
[AArch64] Fix gcc.target/aarch64/subs_compare_[12].c
This patch fixes the testsuite failures gcc.target/aarch64/subs_compare_1.c and subs_compare_2.c
The tests check that we combine a sequence like:
sub w2, w0, w1
cmp w0, w1
into
subs w2, w0, w1
This is done by a couple of peepholes in aarch64.md.
Unfortunately due to scheduling and other optimisations the SUB and CMP
can come in a different order:
cmp w0, w1
sub w0, w0, w1
And the existing peepholes cannot catch that and we fail to combine the two.
This patch adds a peephole that matches the CMP as the first insn and the SUB as the second
and outputs a SUBS. This is almost equivalent to the existing peephole that matches SUB first and CMP second
except that it doesn't have the restriction that the output register of the SUB has to not be one of the input registers.
Remember "sub w0, w0, w1 ; cmp w0, w1" is *not* equivalent to: "subs w0, w0, w1"
but "cmp w0, w1 ; sub w0, w0, w1" is.
So this is what this patch does. It adds a peephole for the case above and one for the SUB-immediate variant
(because the SUB-immediate is represented as PLUS-of-negated-immediate and thus has different RTL structure).
Bootstrapped and tested on aarch64-none-linux-gnu.
* config/aarch64/aarch64.md: Add peepholes for CMP + SUB -> SUBS
and CMP + SUB-immediate -> SUBS.
From-SVN: r257102
Jason Merrill [Fri, 26 Jan 2018 17:10:24 +0000 (12:10 -0500)]
PR c++/84036 - ICE with variadic capture.
PR c++/82249
* pt.c (tsubst_pack_expansion): When optimizing a simple
substitution, pull a single pack expansion out of its pack.
From-SVN: r257101
Martin Sebor [Fri, 26 Jan 2018 16:47:22 +0000 (16:47 +0000)]
PR tree-optimization/83896 - ice in get_string_len on a call to strlen with
PR tree-optimization/83896 - ice in get_string_len on a call to strlen with
non-constant length
gcc/ChangeLog:
PR tree-optimization/83896
* tree-ssa-strlen.c (get_string_len): Rename...
(get_string_cst_length): ...to this. Return HOST_WIDE_INT.
Avoid assuming length is constant.
(handle_char_store): Use HOST_WIDE_INT for string length.
gcc/testsuite/ChangeLog:
PR tree-optimization/83896
* gcc.dg/strlenopt-43.c: New test.
From-SVN: r257100
Uros Bizjak [Fri, 26 Jan 2018 15:48:24 +0000 (16:48 +0100)]
* ChangeLog: Fix whitespace.
From-SVN: r257098
Will Schmidt [Fri, 26 Jan 2018 15:37:34 +0000 (15:37 +0000)]
fold-vec-abs-int.c: Remove scan-assembler stanzas.
[testsuite]
2018-01-26 Will Schmidt <will_schmidt@vnet.ibm.com>
* gcc.target/powerpc/fold-vec-abs-int.c: Remove scan-assembler stanzas.
* gcc.target/powerpc/fold-vec-abs-int-fwrap.c: Same.
* gcc.target/powerpc/fold-vec-abs-int.p7.c: New.
* gcc.target/powerpc/fold-vec-abs-int.p8.c: New.
* gcc.target/powerpc/fold-vec-abs-int.p9.c: New.
* gcc.target/powerpc/fold-vec-abs-int-fwrapv.p7.c: New.
* gcc.target/powerpc/fold-vec-abs-int-fwrapv.p8.c: New.
* gcc.target/powerpc/fold-vec-abs-int-fwrapv.p9.c: New.
* gcc.target/powerpc/fold-vec-abs-longlong.c: Remove scan-assembler stanzas.
* gcc.target/powerpc/fold-vec-abs-longlong-fwrap.c: Same.
* gcc.target/powerpc/fold-vec-abs-longlong.p7.c: New.
* gcc.target/powerpc/fold-vec-abs-longlong.p8.c: New.
* gcc.target/powerpc/fold-vec-abs-longlong.p9.c: New.
* gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.p7.c: New.
* gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.p8.c: New.
* gcc.target/powerpc/fold-vec-abs-longlong-fwrapv.p9.c: New.
* gcc.target/powerpc/fold-vec-abs-short.c: Add xxspltib to valid instruction list.
* gcc.target/powerpc/fold-vec-abs-short-fwrapv.c: Same.
From-SVN: r257097
Uros Bizjak [Fri, 26 Jan 2018 15:36:32 +0000 (16:36 +0100)]
re PR target/81763 (Issues with BMI on 32bit x86 apps on GCC 7.1+)
PR target/81763
* config/i386/i386.md (*andndi3_doubleword): Add earlyclobber
to (=&r,r,rm) alternative. Add (=r,0,rm) and (=r,r,0) alternatives.
From-SVN: r257096
Will Schmidt [Fri, 26 Jan 2018 15:30:41 +0000 (15:30 +0000)]
fold-vec-cmp-int.c: Delete.
[testsuite]
2018-01-24 Will Schmidt <will_schmidt@vnet.ibm.com>
* gcc.target/powerpc/fold-vec-cmp-int.c: Delete.
* gcc.target/powerpc/fold-vec-cmp-int.h: New.
* gcc.target/powerpc/fold-vec-cmp-int.p7.c: New.
* gcc.target/powerpc/fold-vec-cmp-int.p8.c: New.
* gcc.target/powerpc/fold-vec-cmp-int.p9.c: New.
* gcc.target/powerpc/fold-vec-cmp-short.c: Delete.
* gcc.target/powerpc/fold-vec-cmp-short.h: New.
* gcc.target/powerpc/fold-vec-cmp-short.p8.c: New.
* gcc.target/powerpc/fold-vec-cmp-short.p9.c: New.
* gcc.target/powerpc/fold-vec-cmp-char.c: Delete.
* gcc.target/powerpc/fold-vec-cmp-char.h: New.
* gcc.target/powerpc/fold-vec-cmp-char.p8.c: New.
* gcc.target/powerpc/fold-vec-cmp-char.p9.c: New.
From-SVN: r257095
Martin Liska [Fri, 26 Jan 2018 15:27:14 +0000 (16:27 +0100)]
Fix ifunc detection.
2018-01-26 Martin Liska <mliska@suse.cz>
* lib/target-supports.exp: Return a value, otherwise -Wreturn-type
warning is seen.
From-SVN: r257094
Jason Merrill [Fri, 26 Jan 2018 15:25:23 +0000 (10:25 -0500)]
PR c++/82514 - ICE with local class in generic lambda.
* pt.c (regenerated_lambda_fn_p): Remove.
(enclosing_instantiation_of): Don't use it.
(tsubst_function_decl): Call enclosing_instantiation_of.
* pt.c (lookup_template_class_1): Add sanity check.
* name-lookup.c (do_pushtag): Don't add closures to local_classes.
From-SVN: r257093
Will Schmidt [Fri, 26 Jan 2018 15:20:45 +0000 (15:20 +0000)]
powerpcfold-vec-neg-longlong.h: New.
[testsuite]
2018-01-23 Will Schmidt <will_schmidt@vnet.ibm.com>
* gcc.target/powerpcfold-vec-neg-longlong.h: New.
* gcc.target/powerpc/fold-vec-neg-longlong.p8.c: New.
* gcc.target/powerpc/fold-vec-neg-longlong.p9.c: New.
* gcc.target/powerpc/fold-vec-neg-longlong.c: Delete.
* gcc.target/powerpc/fold-vec-neg-int.c: Remove scan-assembler stanzas.
* gcc.target/powerpc/fold-vec-neg-int.p7.c: New.
* gcc.target/powerpc/fold-vec-neg-int.p8.c: New.
* gcc.target/powerpc/fold-vec-neg-int.p9.c: New.
From-SVN: r257092
Richard Biener [Fri, 26 Jan 2018 14:50:25 +0000 (14:50 +0000)]
re PR rtl-optimization/84003 (FAIL: g++.dg/torture/pr77745.C with noinline foo)
2018-01-26 Richard Biener <rguenther@suse.de>
PR rtl-optimization/84003
* dse.c (record_store): Only record redundant stores when
the earlier store aliases at least all accesses the later one does.
* g++.dg/torture/pr77745.C: Mark foo noinline to trigger
latent bug in DSE if NOINLINE is appropriately defined.
* g++.dg/torture/pr77745-2.C: New testcase including pr77745.C
and defining NOINLINE.
From-SVN: r257091
Kyrylo Tkachov [Fri, 26 Jan 2018 14:34:34 +0000 (14:34 +0000)]
[arm] XFAIL advsimd-intrinsics/vld1x2.c
This recently added test fails on arm. We haven't implemented these intrinsics for arm
(any volunteers?) so for now let's XFAIL these on that target.
Also, the float64 versions of these intrinsics are not supposed to be available on arm
so this patch slightly adjusts the test to not include them for aarch32.
In any case the entire test is XFAILed on arm, so this doesn't have any noticeable
effect.
The same number of tests (PASS) still occur on aarch64 but now they appear as XFAIL
rather than FAIL on arm.
* gcc.target/aarch64/advsimd-intrinsics/vld1x2.c: Make float64
tests specific to aarch64. XFAIL test on arm.
From-SVN: r257090
Jakub Jelinek [Fri, 26 Jan 2018 11:48:05 +0000 (12:48 +0100)]
re PR rtl-optimization/83985 (Compile time hog for 32-bit BE powerpc targets)
PR rtl-optimization/83985
* dce.c (deletable_insn_p): Return false for separate shrink wrapping
REG_CFA_RESTORE insns.
(delete_unmarked_insns): Don't ignore separate shrink wrapping
REG_CFA_RESTORE insns here.
* gcc.dg/pr83985.c: New test.
From-SVN: r257087
Jakub Jelinek [Fri, 26 Jan 2018 11:47:11 +0000 (12:47 +0100)]
re PR c/83989 (-Wrestrict false positive with malloc-style functions)
PR c/83989
* gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Don't
use SSA_NAME_VAR as base for SSA_NAMEs with non-NULL SSA_NAME_VAR.
* c-c++-common/Wrestrict-3.c: New test.
From-SVN: r257086
Claudiu Zissulescu [Fri, 26 Jan 2018 11:34:31 +0000 (12:34 +0100)]
[ARC] Add ARCv2 core3 tune option.
ARCv2 Core3 cpus are comming with dbnz support. Add this feature on
the tune option.
gcc/
2018-01-26 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc-arch.h (arc_tune_attr): Add ARC_TUNE_CORE_3.
* config/arc/arc.c (arc_sched_issue_rate): Use ARC_TUNE_... .
(arc_init): Likewise.
(arc_override_options): Likewise.
(arc_file_start): Choose Tag_ARC_CPU_variation based on arc_tune
value.
(hwloop_fail): Use TARGET_DBNZ when we want to check for dbnz insn
support.
* config/arc/arc.h (TARGET_DBNZ): Define.
* config/arc/arc.md (attr tune): Add core_3, use ARC_TUNE_... to
properly set the tune attribute.
(dbnz): Use TARGET_DBNZ guard.
* config/arc/arc.opt (mtune): Add core3 option.
From-SVN: r257085
Claudiu Zissulescu [Fri, 26 Jan 2018 11:34:16 +0000 (12:34 +0100)]
[ARC] Rework delegitimate_address hook
Delegitimize address is used to undo the obfuscating effect of PIC
addresses, returning the address in a way which is understood by the
compiler. The old version of the hook was outdated, not beeing able
to recognize the current addresses generated by the ARC backend.
gcc/
2018-01-26 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.c (arc_delegitimize_address_0): Refactored to
recognize new pic like addresses.
(arc_delegitimize_address): Clean up.
testsuite/
2018-01-26 Claudiu Zissulescu <claziss@synopsys.com>
* testsuite/gcc.target/arc/tdelegitimize_addr.c: New test.
From-SVN: r257084
Claudiu Zissulescu [Fri, 26 Jan 2018 11:34:00 +0000 (12:34 +0100)]
[ARC] Add support for reduced register file set
gcc/
2018-01-26 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc-arches.def: Option mrf16 valid for all
architectures.
* config/arc/arc-c.def (__ARC_RF16__): New predefined macro.
* config/arc/arc-cpus.def (em_mini): New cpu with rf16 on.
* config/arc/arc-options.def (FL_RF16): Add mrf16 option.
* config/arc/arc-tables.opt: Regenerate.
* config/arc/arc.c (arc_conditional_register_usage): Handle
reduced register file case.
(arc_file_start): Set must have build attributes.
* config/arc/arc.h (MAX_ARC_PARM_REGS): Conditional define using
mrf16 option value.
* config/arc/arc.opt (mrf16): Add new option.
* config/arc/elf.h (ATTRIBUTE_PCS): Define.
* config/arc/genmultilib.awk: Handle new mrf16 option.
* config/arc/linux.h (ATTRIBUTE_PCS): Define.
* config/arc/t-multilib: Regenerate.
* doc/invoke.texi (ARC Options): Document mrf16 option.
libgcc/
2018-01-26 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/lib1funcs.S (__udivmodsi4): Use safe version for RF16
option.
(__divsi3): Use RF16 safe registers.
(__modsi3): Likewise.
From-SVN: r257083
Claudiu Zissulescu [Fri, 26 Jan 2018 11:33:42 +0000 (12:33 +0100)]
[ARC] Add SJLI support.
gcc/
2018-01-26 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc-protos.h: Add arc_is_secure_call_p proto.
* config/arc/arc.c (arc_handle_secure_attribute): New function.
(arc_attribute_table): Add 'secure_call' attribute.
(arc_print_operand): Print secure call operand.
(arc_function_ok_for_sibcall): Don't optimize tail calls when
secure.
(arc_is_secure_call_p): New function.
* config/arc/arc.md (call_i): Add support for sjli instruction.
(call_value_i): Likewise.
* config/arc/constraints.md (Csc): New constraint.
From-SVN: r257082
Claudiu Zissulescu [Fri, 26 Jan 2018 11:33:22 +0000 (12:33 +0100)]
[ARC] Add JLI support.
The ARCv2 ISA provides the JLI instruction, which is two-byte instructions
that can be used to reduce code size in an application. To make use of it,
we provide two new function attributes 'jli_always' and 'jli_fixed' which
will force the compiler to call the indicated function using a jli_s
instruction. The compiler also generates the entries in the JLI table for
the case when we use 'jli_always' attribute. In the case of 'jli_fixed'
the compiler assumes a fixed position of the function into JLI
table. Thus, the user needs to provide an assembly file with the JLI table
for the final link. This is usefully when we want to have a table in ROM
and a second table in the RAM memory.
The jli instruction usage can be also forced without the need to annotate
the source code via '-mjli-always' command.
gcc/
2018-01-26 Claudiu Zissulescu <claziss@synopsys.com>
John Eric Martin <John.Martin@emmicro-us.com>
* config/arc/arc-protos.h: Add arc_is_jli_call_p proto.
* config/arc/arc.c (_arc_jli_section): New struct.
(arc_jli_section): New type.
(rc_jli_sections): New static variable.
(arc_handle_jli_attribute): New function.
(arc_attribute_table): Add jli_always and jli_fixed attribute.
(arc_file_end): New function.
(TARGET_ASM_FILE_END): Define.
(arc_print_operand): Reuse 'S' letter for JLI output instruction.
(arc_add_jli_section): New function.
(jli_call_scan): Likewise.
(arc_reorg): Call jli_call_scan.
(arc_output_addsi): Remove 'S' from printing asm operand.
(arc_is_jli_call_p): New function.
* config/arc/arc.md (movqi_insn): Remove 'S' from printing asm
operand.
(movhi_insn): Likewise.
(movsi_insn): Likewise.
(movsi_set_cc_insn): Likewise.
(loadqi_update): Likewise.
(load_zeroextendqisi_update): Likewise.
(load_signextendqisi_update): Likewise.
(loadhi_update): Likewise.
(load_zeroextendhisi_update): Likewise.
(load_signextendhisi_update): Likewise.
(loadsi_update): Likewise.
(loadsf_update): Likewise.
(movsicc_insn): Likewise.
(bset_insn): Likewise.
(bxor_insn): Likewise.
(bclr_insn): Likewise.
(bmsk_insn): Likewise.
(bicsi3_insn): Likewise.
(cmpsi_cc_c_insn): Likewise.
(movsi_ne): Likewise.
(movsi_cond_exec): Likewise.
(clrsbsi2): Likewise.
(norm_f): Likewise.
(normw): Likewise.
(swap): Likewise.
(divaw): Likewise.
(flag): Likewise.
(sr): Likewise.
(kflag): Likewise.
(ffs): Likewise.
(ffs_f): Likewise.
(fls): Likewise.
(call_i): Remove 'S' asm letter, add jli instruction.
(call_value_i): Likewise.
* config/arc/arc.op (mjli-always): New option.
* config/arc/constraints.md (Cji): New constraint.
* config/arc/fpx.md (addsf3_fpx): Remove 'S' from printing asm
operand.
(subsf3_fpx): Likewise.
(mulsf3_fpx): Likewise.
* config/arc/simdext.md (vendrec_insn): Remove 'S' from printing
asm operand.
* doc/extend.texi (ARC): Document 'jli-always' and 'jli-fixed'
function attrbutes.
* doc/invoke.texi (ARC): Document mjli-always option.
gcc/testsuite
2018-01-26 Claudiu Zissulescu <claziss@synopsys.com>
* gcc.target/arc/jli-1.c: New file.
* gcc.target/arc/jli-2.c: Likewise.
Co-Authored-By: John Eric Martin <John.Martin@emmicro-us.com>
From-SVN: r257081
Sebastian Perta [Fri, 26 Jan 2018 10:57:53 +0000 (10:57 +0000)]
Corrected date in changelog
From-SVN: r257080
Sebastian Perta [Fri, 26 Jan 2018 10:55:31 +0000 (10:55 +0000)]
rl78.c: if operand 2 is const avoid addition with 0 and use incw and decw where possible
2018-01-25 Sebastian Perta <sebastian.perta@renesas.com>
* config/rl78/rl78.c: if operand 2 is const avoid addition with 0
and use incw and decw where possible
* testsuite/gcc.target/rl78/test_addsi3_internal.c: new file
From-SVN: r257079
Szabolcs Nagy [Fri, 26 Jan 2018 10:46:56 +0000 (10:46 +0000)]
Fix gcc.target/aarch64/sve/peel_ind_1.c for -mcmodel=tiny
gcc/testsuite/ChangeLog:
2018-01-26 Szabolcs Nagy <szabolcs.nagy@arm.com>
* gcc.target/aarch64/sve/peel_ind_1.c: Match (adrp|adr) in scan-assembler.
* gcc.target/aarch64/sve/peel_ind_2.c: Likewise.
* gcc.target/aarch64/sve/peel_ind_3.c: Likewise.
From-SVN: r257078
Richard Biener [Fri, 26 Jan 2018 10:30:36 +0000 (10:30 +0000)]
re PR tree-optimization/81082 (Failure to vectorise after reassociating index computation)
2018-01-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/81082
* fold-const.c (fold_plusminus_mult_expr): Do not perform the
association if it requires casting to unsigned.
* match.pd ((A * C) +- (B * C) -> (A+-B)): New patterns derived
from fold_plusminus_mult_expr to catch important cases late when
range info is available.
* gcc.dg/vect/pr81082.c: New testcase.
* gcc.dg/tree-ssa/loop-15.c: XFAIL the (int)((unsigned)n + -1U) * n + n
simplification to n * n.
From-SVN: r257077
Rainer Orth [Fri, 26 Jan 2018 08:32:21 +0000 (08:32 +0000)]
Configure USE_HIDDEN_LINKONCE on Solaris/x86
gcc/testsuite:
* gcc.target/i386/mcount_pic.c: Only xfail get_pc_thunk scan on
Solaris 10.
* gcc.target/i386/pr63620.c: Likewise.
gcc:
* config/i386/sol2.h (USE_HIDDEN_LINKONCE): Remove.
* configure.ac (hidden_linkonce): New test.
* configure: Regenerate.
* config.in: Regenerate.
From-SVN: r257076
Julia Koval [Fri, 26 Jan 2018 04:14:15 +0000 (05:14 +0100)]
Fix various x86 avx512{bitalg, vpopcntdq, vbmi2} issues (PR target/83488)
gcc/
* config/i386/avx512bitalgintrin.h (_mm512_bitshuffle_epi64_mask,
_mm512_mask_bitshuffle_epi64_mask, _mm256_bitshuffle_epi64_mask,
_mm256_mask_bitshuffle_epi64_mask, _mm_bitshuffle_epi64_mask,
_mm_mask_bitshuffle_epi64_mask): Fix type.
* config/i386/i386-builtin-types.def (UHI_FTYPE_V2DI_V2DI_UHI,
USI_FTYPE_V4DI_V4DI_USI): Remove.
* config/i386/i386-builtin.def (__builtin_ia32_vpshufbitqmb512_mask,
__builtin_ia32_vpshufbitqmb256_mask,
__builtin_ia32_vpshufbitqmb128_mask): Fix types.
* config/i386/i386.c (ix86_expand_args_builtin): Remove old types.
* config/i386/sse.md (VI1_AVX512VLBW): Change types.
gcc/testsuite/
* gcc.target/i386/avx512bitalg-vpshufbitqmb-1.c: Add -mavx512f -mavx512bw.
* gcc.target/i386/avx512bitalgvl-vpshufbitqmb-1.c: Add -mavx512bw.
* gcc.target/i386/i386.exp: Fix types.
From-SVN: r257075
GCC Administrator [Fri, 26 Jan 2018 00:16:20 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r257073
Alan Modra [Thu, 25 Jan 2018 23:57:18 +0000 (10:27 +1030)]
PR84033, powerpc64le -moptimize-swaps bad code with vec_vbpermq
vbpermq produces its output in bits 48..63 of the target vector reg,
so the output cannot be lane swapped.
gcc/
PR target/84033
* config/rs6000/rs6000-p8swap.c (rtx_is_swappable_p): Exclude
UNSPEC_VBPERMQ. Sort other unspecs.
gcc/testsuite/
PR target/84033
* gcc.target/powerpc/swaps-p8-46.c: New.
From-SVN: r257070
Ian Lance Taylor [Thu, 25 Jan 2018 23:13:31 +0000 (23:13 +0000)]
compiler: look through aliases when looking for methods
Add a Type::is_alias method to remove some existing loops and avoid
adding a new one.
Test case is https://golang.org/cl/89935.
Fixes golang/go#23489
Reviewed-on: https://go-review.googlesource.com/89975
From-SVN: r257069
Ian Lance Taylor [Thu, 25 Jan 2018 23:10:35 +0000 (23:10 +0000)]
compiler: deref receiver types in mangled names
This was the original intent, as reflected in the long comment at the
start of names.cc, but I forgot to implement it.
Also, remove a leading ".0" from the final name. That could occur for
a method whose receiver type starts with 'u', as in that case we
prepend a space to the mangled name, to avoid confusion with the
Unicode mangling, and the space turns into ".0".
Also, if the Unicode encoding would cause the final to start with
"..u" or "..U", add a leading underscore.
Patch gotest to not get fooled by some names.
The result of these changes is that all symbols start with a letter or
an underscore.
Reviewed-on: https://go-review.googlesource.com/90015
From-SVN: r257068
David Malcolm [Thu, 25 Jan 2018 19:19:29 +0000 (19:19 +0000)]
jit: remove some unused fields from recording::union_ (PR jit/81672)
gcc::jit::recording::union_ has some stray fields, which
are duplicates of those in the compound_type base class.
It looks like these have been present since the initial merger of the jit
branch to trunk (r217374), where it had three duplicate fields:
location *m_loc;
string *m_name;
fields *m_fields;
I removed the duplicate field "m_fields" in r219564 but missed the other
two.
This patch removes them.
gcc/jit/ChangeLog:
PR jit/81672
* jit-recording.h (gcc::jit::recording::union_): Remove fields
"m_loc" and "m_name".
From-SVN: r257066
Paul Thomas [Thu, 25 Jan 2018 19:09:40 +0000 (19:09 +0000)]
re PR fortran/37577 ([meta-bug] change internal array descriptor format for better syntax, C interop TR, rank 15)
2018-25-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/37577
* array.c (gfc_match_array_ref): If standard earlier than F2008
it is an error if the reference dimension is greater than 7.
libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the
dtype masks and shifts accordingly.
* trans-array.c (gfc_conv_descriptor_dtype): Use the dtype
type node to check the field.
(gfc_conv_descriptor_dtype): Access the rank field of dtype.
(duplicate_allocatable_coarray): Access the rank field of the
dtype descriptor rather than the dtype itself.
* trans-expr.c (get_scalar_to_descriptor_type): Store the type
of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE
(ie. a character).
(gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to
get_scalar_to_descriptor_type if the actual expression is a
constant.
(gfc_trans_structure_assign): Assign the rank directly to the
dtype rank field.
* trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result
to default integer kind.
(gfc_conv_intrinsic_sizeof): Obtain the element size from the
'elem_len' field of the dtype.
* trans-io.c (gfc_build_io_library_fndecls): Replace
gfc_int4_type_node with dtype_type_node where necessary.
(transfer_namelist_element): Use gfc_get_dtype_rank_type for
scalars.
* trans-types.c : Provide 'get_dtype_type_node' to acces the
dtype_type_node and, if necessary, build it.
The maximum size of an array element is now determined by the
maximum value of size_t.
Update the description of the array descriptor, including the
type def for the dtype_type.
(gfc_get_dtype_rank_type): Build a constructor for the dtype.
Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS.
(gfc_get_array_descriptor_base): Change the type of the dtype
field to dtype_type_node.
(gfc_get_array_descr_info): Get the offset to the rank field of
the dtype.
* trans-types.h : Add a prototype for 'get_dtype_type_node ()'.
* trans.h : Define the indices of the dtype fields.
2018-25-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/37577
* gfortran.dg/coarray_18.f90: Allow dimension 15 for F2008.
* gfortran.dg/coarray_lib_this_image_2.f90: Change 'array1' to
'array01' in the tree dump comparison.
* gfortran.dg/coarray_lib_token_4.f90: Likewise.
* gfortran.dg/inline_sum_1.f90: Similar - allow two digits.
* gfortran.dg/rank_1.f90: Allow dimension 15 for F2008.
2018-25-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/37577
* caf/single.c (_gfortran_caf_failed_images): Access the 'type'
and 'elem_len' fields of the dtype instead of the shifts.
(_gfortran_caf_stopped_images): Likewise.
* intrinsics/associated.c (associated): Compare the 'type' and
'elem_len' fields instead of the dtype.
* caf/date_and_time.c : Access the dtype fields rather using
shifts and masks.
* io/transfer.c (transfer_array ): Comment on item count.
(set_nml_var,st_set_nml_var): Change dtype type and use fields.
(st_set_nml_dtio_var): Likewise.
* libgfortran.h : Change definition of GFC_ARRAY_DESCRIPTOR and
add a typedef for the dtype_type. Change the GFC_DTYPE_* macros
to access the dtype fields.
From-SVN: r257065
David Edelsohn [Thu, 25 Jan 2018 18:50:44 +0000 (13:50 -0500)]
Change -march to -mcpu.
From-SVN: r257064
David Edelsohn [Thu, 25 Jan 2018 18:25:19 +0000 (18:25 +0000)]
* doc/invoke.texi (PowerPC Options): Document 'native' cpu type.
From-SVN: r257063
Ian Lance Taylor [Thu, 25 Jan 2018 18:14:04 +0000 (18:14 +0000)]
elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the desired CRC is zero.
* elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
desired CRC is zero.
(elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
From-SVN: r257062
Ian Lance Taylor [Thu, 25 Jan 2018 17:44:19 +0000 (17:44 +0000)]
runtime: fix lfstackUnpack on ia64
The top three region number bits must be masked out before
right-shifting the address bits into place, otherwise they will be
copied down into the lower always-zero address bits.
Reviewed-on: https://go-review.googlesource.com/84535
From-SVN: r257061
Jan Hubicka [Thu, 25 Jan 2018 17:24:06 +0000 (18:24 +0100)]
re PR tree-optimization/83055 (ICE in operator>, at profile-count.h:834)
PR middle-end/83055
* predict.c (drop_profile): Do not push/pop cfun; update also
node->count.
(handle_missing_profiles): Fix logic looking for zero profiles.
* gcc.dg/torture/pr83055.c: New testcase.
From-SVN: r257059
Jakub Jelinek [Thu, 25 Jan 2018 16:38:40 +0000 (17:38 +0100)]
re PR c++/84031 (structured binding unpacks nameless padding bitfields)
PR c++/84031
* decl.c (find_decomp_class_base): Ignore unnamed bitfields. Ignore
recursive calls that return ret.
(cp_finish_decomp): Ignore unnamed bitfields.
* g++.dg/cpp1z/decomp36.C: New test.
From-SVN: r257057
Ian Lance Taylor [Thu, 25 Jan 2018 15:38:41 +0000 (15:38 +0000)]
* pecoff.c (coff_add): Only release syms_view if it is valid.
From-SVN: r257053
Ian Lance Taylor [Thu, 25 Jan 2018 15:33:36 +0000 (15:33 +0000)]
* pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
From-SVN: r257052
Jakub Jelinek [Thu, 25 Jan 2018 15:32:02 +0000 (16:32 +0100)]
re PR middle-end/83977 (ICE in simd_clone_clauses_extract, at omp-simd-clone.c:184)
PR middle-end/83977
* ipa-fnsummary.c (compute_fn_summary): Clear can_change_signature
on functions with #pragma omp declare simd or functions with simd
attribute.
* omp-simd-clone.c (expand_simd_clones): Revert 2018-01-24 change.
* config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
Remove trailing \n from warning_at calls.
* c-c++-common/gomp/pr83977-1.c: Add -w to dg-options.
From-SVN: r257051
Jonathan Wakely [Thu, 25 Jan 2018 15:24:39 +0000 (15:24 +0000)]
PR libstdc++/81076 make __byte_operand SFINAE-friendly
PR libstdc++/81076
* include/c_global/cstddef (__byte_operand): Define primary template.
* testsuite/18_support/byte/81076.cc: New test.
From-SVN: r257050
Ian Lance Taylor [Thu, 25 Jan 2018 15:10:03 +0000 (15:10 +0000)]
compiler: don't write sink constants to C header file
Reviewed-on: https://go-review.googlesource.com/89815
From-SVN: r257049
Tom de Vries [Thu, 25 Jan 2018 10:25:14 +0000 (10:25 +0000)]
[nvptx, PR84028] Add exit insn after noreturn call for neutered workers
2018-01-25 Tom de Vries <tom@codesourcery.com>
PR target/84028
* config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call
for neutered workers.
* testsuite/libgomp.oacc-fortran/pr84028.f90: New test.
From-SVN: r257046
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
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
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
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
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
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
GCC Administrator [Thu, 25 Jan 2018 00:16:14 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r257036
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
GCC Administrator [Wed, 24 Jan 2018 00:16:13 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r257008
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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