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

From-SVN: r269817

5 years agoPR tree-optimization/89688 - -Wstringop-overflow confused by const 2D array of char
Martin Sebor [Tue, 19 Mar 2019 22:43:10 +0000 (22:43 +0000)]
PR tree-optimization/89688 - -Wstringop-overflow confused by const 2D array of char

gcc/c/ChangeLog:

PR tree-optimization/89688
* c-decl.c (finish_decl): Call braced_lists_to_string for more
kinds of initializers.

gcc/c-family/ChangeLog:

PR tree-optimization/89688
* c-common.c (braced_list_to_string): Make static.
(braced_lists_to_strings): Define new function.
* c-common.h (braced_list_to_string): Remove.
(braced_lists_to_strings): Declare.

gcc/cp/ChangeLog:

PR tree-optimization/89688
* typeck2.c (store_init_value): Call braced_lists_to_string for more
kinds of initializers.

gcc/testsuite/ChangeLog:

PR tree-optimization/89688
* gcc.dg/strlenopt-61.c: New test.
* g++.dg/warn/Wstringop-overflow-2.C: New test.

From-SVN: r269814

5 years agoRISC-V: Fix %lo overflow with BLKmode references.
Jim Wilson [Tue, 19 Mar 2019 22:33:34 +0000 (22:33 +0000)]
RISC-V: Fix %lo overflow with BLKmode references.

gcc/
PR target/89411
* config/riscv/riscv.c (riscv_valid_lo_sum_p): New arg x.  New locals
align, size, offset.  Use them to handle a BLKmode reference.  Update
comment.
(riscv_classify_address): Pass info->offset to riscv_valid_lo_sum_p.

gcc/testsuite/
PR target/89411
* gcc.target/riscv/losum-overflow.c: New test.

From-SVN: r269813

5 years agore PR rtl-optimization/89768 (ICE in compare_and_jump_seq at loop-unroll.c:838)
Jakub Jelinek [Tue, 19 Mar 2019 19:04:14 +0000 (20:04 +0100)]
re PR rtl-optimization/89768 (ICE in compare_and_jump_seq at loop-unroll.c:838)

PR rtl-optimization/89768
* loop-unroll.c (unroll_loop_constant_iterations): Use gen_int_mode
instead of GEN_INT.
(unroll_loop_runtime_iterations): Likewise.

From-SVN: r269812

5 years agocompiler,runtime: pass old slice's ptr/len/cap by value to growslice
Ian Lance Taylor [Tue, 19 Mar 2019 18:42:43 +0000 (18:42 +0000)]
compiler,runtime: pass old slice's ptr/len/cap by value to growslice

    In the C calling convention, on AMD64, and probably a number of
    other architectures, a 3-word struct argument is passed on stack.
    This is less efficient than passing in three registers. Further,
    this may affect the code generation in other part of the program,
    even if the function is not actually called.

    Slices are common in Go and append is a common slice operation,
    which calls growslice in the growing path. To improve the code
    generation, pass the slice header's three fields as separate
    values, instead of a struct, to growslice.

    The drawback is that this makes the runtime implementation
    slightly diverges from the gc runtime.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/168277

From-SVN: r269811

5 years agoPR tree-optimization/89644 - false-positive -Warray-bounds on strncpy with unterminat...
Martin Sebor [Tue, 19 Mar 2019 18:35:42 +0000 (18:35 +0000)]
PR tree-optimization/89644 - false-positive -Warray-bounds on strncpy with unterminated array

gcc/ChangeLog:
* tree-ssa-strlen.c (handle_builtin_stxncpy): Use full_string_p
rather than endptr as an indicator of nul-termination.

From-SVN: r269809

5 years agoPR tree-optimization/89644 - False-positive -Warray-bounds diagnostic on strncpy
Martin Sebor [Tue, 19 Mar 2019 17:45:34 +0000 (17:45 +0000)]
PR tree-optimization/89644 - False-positive -Warray-bounds diagnostic on strncpy

gcc/ChangeLog:

PR tree-optimization/89644
* tree-ssa-strlen.c (handle_builtin_stxncpy): Consider unterminated
arrays in determining sequence sizes in strncpy and stpncpy.

gcc/testsuite/ChangeLog:

PR tree-optimization/89644
* gcc.dg/Wstringop-truncation-8.c: New test.

From-SVN: r269807

5 years agoFix set of even probabilities (PR middle-end/89737).
Martin Liska [Tue, 19 Mar 2019 17:08:28 +0000 (18:08 +0100)]
Fix set of even probabilities (PR middle-end/89737).

2019-03-19  Martin Liska  <mliska@suse.cz>

PR middle-end/89737
* predict.c (combine_predictions_for_bb): Empty likely_edges and
unlikely_edges if there's an edge that belongs to both these sets.
2019-03-19  Martin Liska  <mliska@suse.cz>

PR middle-end/89737
* gcc.dg/pr89737.c: New test.

From-SVN: r269804

5 years agors6000: Unaligned stfiwx on older CPUs (PR89746)
Segher Boessenkool [Tue, 19 Mar 2019 16:58:42 +0000 (17:58 +0100)]
rs6000: Unaligned stfiwx on older CPUs (PR89746)

The "classic" PowerPCs (6xx/7xx) are not STRICT_ALIGNMENT, but their
floating point units are.  This is not normally a problem, the ABIs
make everything FP aligned.  The RTL patterns converting FP to integer
however get a potentially unaligned destination, and we do not want to
do an stfiwx on that on such older CPUs.

This fixes it.  It does not change anything for TARGET_MFCRF targets
(POWER4 and later).  It also won't change anything for strict-alignment
targets, or CPUs without hardware FP of course, or CPUs that do not
implement stfiwx (older 4xx/5xx/8xx).

It does not change the corresponding fixuns* pattern, because that can
not be enabled on any CPU that cannot handle unaligned FP well.

PR target/89746
* config/rs6000/rs6000.md (fix_trunc<mode>si2_stfiwx): If we have a
non-TARGET_MFCRF target, and the dest is memory but not 32-bit aligned,
go via a stack temporary.

From-SVN: r269802

5 years agore PR target/89378 ([MIPS] FAIL: gcc.dg/vect/pr88598-3.c -mmsa (internal compiler...
Jakub Jelinek [Tue, 19 Mar 2019 16:10:59 +0000 (17:10 +0100)]
re PR target/89378 ([MIPS] FAIL: gcc.dg/vect/pr88598-3.c  -mmsa (internal compiler error))

PR target/89378
* config/mips/mips.c (mips_expand_vec_cond_expr): Use gen_lowpart
instead of gen_rtx_SUBREG.
* config/mips/mips-msa.md (vec_extract<mode><unitmode>): Likewise.

From-SVN: r269801

5 years agore PR debug/88389 (-flto -g -gsplit-dwarf is broken)
Richard Biener [Tue, 19 Mar 2019 14:57:18 +0000 (14:57 +0000)]
re PR debug/88389 (-flto -g -gsplit-dwarf is broken)

2019-03-19  Richard Biener  <rguenther@suse.de>

PR debug/88389
* opts.c (finish_options): Disable -gsplit-dwarf when doing LTO.

From-SVN: r269800

5 years agore PR lto/87089 (tree check: expected class 'type', have 'declaration' (namespace_dec...
Jan Hubicka [Tue, 19 Mar 2019 14:53:43 +0000 (15:53 +0100)]
re PR lto/87089 (tree check: expected class 'type', have 'declaration' (namespace_decl) in type_with_linkage_p, at ipa-utils.h)

PR lto/87809
PR lto/89335
* tree.c (free_lang_data_in_decl): Do not free context of C++
destrutors.

* g++.dg/lto/pr87089_0.C: New testcase.
* g++.dg/lto/pr87089_1.C: New testcase.
* g++.dg/lto/pr89335_0.C: New testcase.

From-SVN: r269799

5 years agolibgo: fix build on AIX
Ian Lance Taylor [Tue, 19 Mar 2019 14:00:59 +0000 (14:00 +0000)]
libgo: fix build on AIX

    Since aix/ppc64 has been added to GC toolchain, a mix between new and
    old files were created in gcc toolchain.
    This commit corrects this merge for aix/ppc64 and aix/ppc.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/167658

From-SVN: r269797

5 years agore PR target/89736 (New test pr87532-mc.c fails on compiler not defaulting to VSX)
Kelvin Nilsen [Tue, 19 Mar 2019 13:44:03 +0000 (13:44 +0000)]
re PR target/89736 (New test pr87532-mc.c fails on compiler not defaulting to VSX)

gcc/testsuite/ChangeLog:

2019-03-19  Kelvin Nilsen  <kelvin@gcc.gnu.org>

PR target/89736
* gcc.target/powerpc/pr87532-mc.c: Modify dejagnu directives to
restrict this test to vsx targets.

From-SVN: r269796

5 years agore PR target/89506 (ICE: in decompose, at rtl.h:2266 with -Og -g)
Jakub Jelinek [Tue, 19 Mar 2019 10:05:10 +0000 (11:05 +0100)]
re PR target/89506 (ICE: in decompose, at rtl.h:2266 with -Og -g)

PR target/89506
* config/arm/arm.md (cmpsi2_addneg): Swap the alternatives and use
subs for the first alternative except when operands[3] is 1.

From-SVN: r269795

5 years agoUpdate libstdc++ API Evolution documentation
Jonathan Wakely [Tue, 19 Mar 2019 09:38:41 +0000 (09:38 +0000)]
Update libstdc++ API Evolution documentation

* doc/xml/manual/allocator.xml: Link to table documenting evolution
of extension allocators.
* doc/xml/manual/evolution.xml: Use angle brackets for header names.
Document new headers in 7.2, 8.1 and 9.1 releases.
* doc/xml/manual/using.xml: Adjust link target for new_allocator.
* doc/html/*: Regenerate.

From-SVN: r269794

5 years agore PR target/89752 (ICE in emit_move_insn, at expr.c:3723)
Jakub Jelinek [Tue, 19 Mar 2019 08:11:25 +0000 (09:11 +0100)]
re PR target/89752 (ICE in emit_move_insn, at expr.c:3723)

PR target/89752
* gimplify.c (gimplify_asm_expr): For output argument with
TREE_ADDRESSABLE type, clear allows_reg if it allows memory, otherwise
diagnose error.

* g++.dg/ext/asm15.C: Check for particular diagnostic wording.
* g++.dg/ext/asm16.C: Likewise.
* g++.dg/ext/asm17.C: New test.

From-SVN: r269793

5 years agore PR rtl-optimization/89753 (ICE in unroll_loop_constant_iterations, at loop-unroll...
Eric Botcazou [Tue, 19 Mar 2019 08:06:48 +0000 (08:06 +0000)]
re PR rtl-optimization/89753 (ICE in unroll_loop_constant_iterations, at loop-unroll.c:498)

PR rtl-optimization/89753
* loop-unroll.c (decide_unroll_constant_iterations): Make guard for
explicit unrolling factor even more robust.

From-SVN: r269791

5 years agore PR target/89726 (Incorrect inlined version of 'ceil' for 32bit)
Jakub Jelinek [Tue, 19 Mar 2019 07:25:59 +0000 (08:25 +0100)]
re PR target/89726 (Incorrect inlined version of 'ceil' for 32bit)

PR target/89726
* config/i386/i386.c (ix86_expand_floorceildf_32): In ceil
compensation use x2 += 1 instead of x2 -= -1 and when honoring
signed zeros, do another copysign after the compensation.

* gcc.target/i386/fpprec-1.c (x): Add 6 new constants.
(expect_round, expect_rint, expect_floor, expect_ceil, expect_trunc):
Add expected results for them.

From-SVN: r269790

5 years agore PR c/89734 (const qualifier on return type not erased inside __typeof__)
Jakub Jelinek [Tue, 19 Mar 2019 06:55:31 +0000 (07:55 +0100)]
re PR c/89734 (const qualifier on return type not erased inside __typeof__)

PR c/89734
* c-decl.c (grokdeclarator): Call c_build_qualified_type on function
return type even if quals_used is 0.  Formatting fixes.

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

From-SVN: r269789

5 years agoDaily bump.
GCC Administrator [Tue, 19 Mar 2019 00:16:11 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r269788

5 years agoPR tree-optimization/89720 - Spurious -Warray-bounds warning on a range with max...
Martin Sebor [Mon, 18 Mar 2019 23:48:50 +0000 (23:48 +0000)]
PR tree-optimization/89720 - Spurious -Warray-bounds warning on a range with max < min

gcc/ChangeLog:

PR tree-optimization/89720
* tree-vrp.c (vrp_prop::check_mem_ref): Treat range with max < min
more conservatively, the same as anti-range.

gcc/testsuite/ChangeLog:

PR tree-optimization/89720
* gcc.dg/Warray-bounds-42.c: New test.

From-SVN: r269785

5 years agomh-mingw: Also set __USE_MINGW_ACCESS flag for C++ code.
Johannes Pfau [Mon, 18 Mar 2019 22:36:56 +0000 (22:36 +0000)]
mh-mingw: Also set __USE_MINGW_ACCESS flag for C++ code.

From-SVN: r269784

5 years ago* sv.po: Update.
Joseph Myers [Mon, 18 Mar 2019 21:36:44 +0000 (21:36 +0000)]
* sv.po: Update.

From-SVN: r269783

5 years agoAdd a test for PR c++/89630
H.J. Lu [Mon, 18 Mar 2019 21:22:30 +0000 (21:22 +0000)]
Add a test for PR c++/89630

PR c++/89630
* g++.target/i386/pr89630.C: New test.

From-SVN: r269781

5 years agolibgo: update to Go 1.12.1
Ian Lance Taylor [Mon, 18 Mar 2019 20:27:59 +0000 (20:27 +0000)]
libgo: update to Go 1.12.1

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/167749

From-SVN: r269780

5 years agoRISC-V: Fix testsuite regression caused by quotes around options.
Kito Cheng [Mon, 18 Mar 2019 19:45:20 +0000 (19:45 +0000)]
RISC-V: Fix testsuite regression caused by quotes around options.

2019-03-18  Kito Cheng  <kito.cheng@gmail.com>
* gcc.target/riscv/arch-1.c: Add quotes around march in dg-error.

From-SVN: r269779

5 years agoPR c++/89630 - ICE with dependent using-decl as template arg.
Jason Merrill [Mon, 18 Mar 2019 19:37:00 +0000 (15:37 -0400)]
PR c++/89630 - ICE with dependent using-decl as template arg.

Even though these two using-declarations have the same effect, they are not
the same declaration, and we don't need to work to treat them as the same
like we do for typedefs.  If we did need to, we would need to handle them
specially in iterative_hash_template_arg as well as here.

* tree.c (cp_tree_equal): Always return false for USING_DECL.

From-SVN: r269777

5 years agoPR c++/89761 - ICE with sizeof... in pack expansion.
Jason Merrill [Mon, 18 Mar 2019 19:35:12 +0000 (15:35 -0400)]
PR c++/89761 - ICE with sizeof... in pack expansion.

In this testcase we get confused when looking at the sizeof... because the
argument pack for 'args' has been wrapped in an ARGUMENT_PACK_SELECT as part
of expanding the fold-expression.  We handle this situation a bit lower down
in tsubst_pack_expansion, but that doesn't help the call to
argument_pack_element_is_expansion_p, which happens earlier.

* pt.c (argument_pack_element_is_expansion_p): Handle
ARGUMENT_PACK_SELECT.

From-SVN: r269776

5 years agoPR c++/89640 - GNU attributes on lambda.
Jason Merrill [Mon, 18 Mar 2019 19:34:47 +0000 (15:34 -0400)]
PR c++/89640 - GNU attributes on lambda.

My patch for PR 60503 to fix C++11 attribute parsing on lambdas accidentally
removed support for GNU attributes.

* parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.

From-SVN: r269775

5 years agors6000: Fix altivec-7.c testcase
Segher Boessenkool [Mon, 18 Mar 2019 17:46:18 +0000 (18:46 +0100)]
rs6000: Fix altivec-7.c testcase

It currently wants to see lvx insns on AIX, and no lvx insns on Linux.
What is really wanted is lvx insns when no VSX, and lxv* insns if VSX.
This fixes it.

* gcc.target/powerpc/altivec-7.c: Look for lxv* if generating VSX
instructions, and lvx if not.

From-SVN: r269772

5 years agors6000: Use pointers in bswap testcases
Segher Boessenkool [Mon, 18 Mar 2019 17:44:56 +0000 (18:44 +0100)]
rs6000: Use pointers in bswap testcases

Currently these bswap testcases use global variables, which causes
problems with -m32: the memory access is a D-form access, and when
combine tries to combine that with the bswap it tries a D-form store
with byte reverse.  That instruction does not exist, and since combine
started with only two insns here it will not try splitting this.

This should be improved, but it is not what this test is testing, and
the "load" case already uses a pointer, so let's do that for the store
case as well.

* gcc.target/powerpc/bswap16.c: Use a pointer instead of a global for
the "store" test as well.
* gcc.target/powerpc/bswap32.c: Ditto.

From-SVN: r269771

5 years agors6000: Fix pr18096-1.c test
Segher Boessenkool [Mon, 18 Mar 2019 17:43:34 +0000 (18:43 +0100)]
rs6000: Fix pr18096-1.c test

For the big stack frame in the test GCC used to say

pr18096-1.c:7:6: error: total size of local objects too large

but now it says

pr18096-1.c:7:6: error: total size of local objects 2147483647 exceeds maximum 2147483392

Let's just allow both in the test.

gcc/testsuite/
* gcc.target/powerpc/pr18096-1.c: Allow an error message that says
"exceeds" instead of just one that talks about "too large".

From-SVN: r269770

5 years agore PR fortran/68009 (prototype for gfortran_runtime_error with inline matmul)
Thomas Koenig [Mon, 18 Mar 2019 17:35:54 +0000 (17:35 +0000)]
re PR fortran/68009 (prototype for gfortran_runtime_error with inline matmul)

2019-03-18  Thomas Koenig  <tkoeng@gcc.gnu.org>

PR fortran/68009
* iresolve.c: Include trans.h.
(gfc_resolve_fe_runtine_error): Set backend_decl on
resolved_sym.

From-SVN: r269769

5 years agoPR c++/89682 - wrong access error in default argument.
Jason Merrill [Mon, 18 Mar 2019 15:58:24 +0000 (11:58 -0400)]
PR c++/89682 - wrong access error in default argument.

Here we were pushing into the right access context, but we were called from
a deferred checking context, so didn't end up doing the checks until after
we left the access context.

* pt.c (tsubst_default_argument): Don't defer access checks.

From-SVN: r269766

5 years agore PR tree-optimization/88945 (ICE in fold_convert_loc in FRE when using -fdump-tree...
Richard Biener [Mon, 18 Mar 2019 13:59:11 +0000 (13:59 +0000)]
re PR tree-optimization/88945 (ICE in fold_convert_loc in FRE when using -fdump-tree-fre-details)

2019-03-18  Richard Biener  <rguenther@suse.de>

PR middle-end/88945
* tree-ssanames.c (release_ssa_name_fn): For released SSA names
use a TREE_TYPE of error_mark_node to avoid ICEs when dumping
basic-blocks that are removed.  Remove restoring SSA_NAME_VAR.
* tree-outof-ssa.c (eliminate_useless_phis): Remove redundant checking.

From-SVN: r269765

5 years agoImplement circular print buffer.
Andrew Stubbs [Mon, 18 Mar 2019 13:13:27 +0000 (13:13 +0000)]
Implement circular print buffer.

2019-03-18  Andrew Stubbs  <ams@codesourcery.com>

gcc/
* config/gcn/gcn-run.c (struct output): Make next_output unsigned.
Extend queue to 1024 entries.
Add "consumed" field.
(gomp_print_output): Remove print_index parameter.
Add final parameter.
Change limit to unsigned.
Use consumed field to implement circular buffer.
Detect interrupted print in final pass.
Flush output at the end.
(run): Update gomp_print_output usage.
(main): Initialize kernargs->output_data.consumed.

From-SVN: r269764

5 years agoFix a case in which the vector cost model was ignored
Richard Sandiford [Mon, 18 Mar 2019 12:25:32 +0000 (12:25 +0000)]
Fix a case in which the vector cost model was ignored

This patch fixes a case in which we vectorised something with a
fully-predicated loop even after the cost model had rejected it.
E.g. the loop in the testcase has the costs:

  Vector inside of loop cost: 27
  Vector prologue cost: 0
  Vector epilogue cost: 0
  Scalar iteration cost: 7
  Scalar outside cost: 6
  Vector outside cost: 0
  prologue iterations: 0
  epilogue iterations: 0

and we can see that the loop executes at most three times, but we
decided to vectorise it anyway.

(The costs here are equal for three iterations, but the same thing
happens even when the vector code is strictly more expensive.)

The problem is the handling of "/VF" in:

  /* Calculate number of iterations required to make the vector version
     profitable, relative to the loop bodies only.  The following condition
     must hold true:
     SIC * niters + SOC > VIC * ((niters-PL_ITERS-EP_ITERS)/VF) + VOC
     where
     SIC = scalar iteration cost, VIC = vector iteration cost,
     VOC = vector outside cost, VF = vectorization factor,
     PL_ITERS = prologue iterations, EP_ITERS= epilogue iterations
     SOC = scalar outside cost for run time cost model check.  */

We treat the "/VF" as truncating, but for fully-predicated loops, it's
closer to a ceil division, since fractional iterations are handled by a
full iteration with some predicate bits set to false.

The easiest fix seemed to be to calculate the minimum number of vector
iterations first, then use that to calculate the minimum number of scalar
iterations.

Calculating the minimum number of vector iterations might make sense for
unpredicated loops too, since calculating the scalar niters directly
doesn't take into account the fact that the VIC multiple has to be an
integer.  But the handling of PL_ITERS and EP_ITERS for unpredicated
loops is a bit hand-wavy anyway, so maybe vagueness here cancels out
vagueness there?

Either way, changing this for unpredicated loops would be much too
invasive for stage 4, so the patch keeps it specific to fully-predicated
loops (i.e. SVE) for now.  There's no functional change for other targets.

2019-03-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-loop.c (vect_estimate_min_profitable_iters): Fix the
calculation of the minimum number of scalar iterations for
fully-predicated loops.

gcc/testsuite/
* gcc.target/aarch64/sve/cost_model_1.c: New test.

From-SVN: r269763

5 years agoAdd forgotten requeing in propagate_subaccesses_across_link
Martin Jambor [Mon, 18 Mar 2019 11:28:01 +0000 (12:28 +0100)]
Add forgotten requeing in propagate_subaccesses_across_link

2019-03-18  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/89546
* tree-sra.c (propagate_subaccesses_across_link): Requeue new_acc if
any propagation to its children took place.

testsuite/
* gcc.dg/tree-ssa/pr89546.c: New test.

From-SVN: r269761

5 years agogcc/riscv: Correctly ignore empty C++ structs when flattening for ABI
Andrew Burgess [Mon, 18 Mar 2019 10:42:53 +0000 (10:42 +0000)]
gcc/riscv: Correctly ignore empty C++ structs when flattening for ABI

This fixes PR target/89627.

The RISC-V ABI document[1] says:

   For the purposes of this section, "struct" refers to a C struct
   with its hierarchy flattened, including any array fields. That is,
   struct { struct { float f[1]; } g[2]; } and struct { float f; float
   g; } are treated the same. Fields containing empty structs or
   unions are ignored while flattening, even in C++, unless they have
   nontrivial copy constructors or destructors.

However, this flattening only applies when one of the fields of the
flattened structure can be placed into a floating point register,
otherwise no flattening occurs.

Currently GCC fails to correctly consider that empty C++ structures
have a non-zero size when constructing the arguments from a flattened
structure, and as a result, trying to pass a C++ structure like this:

  struct sf { struct {} e; float f; };

Doesn't work correctly, GCC fails to take the offset of 'f' within
'sf' into account and will actually pass the space backing 'e' as the
contents of 'f'.

This patch fixes this so that 'f' will be passed correctly.  A couple
of new tests are added to cover this functionality.

[1] https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md

gcc/ChangeLog:

PR target/89627
* config/riscv/riscv.c (riscv_pass_fpr_single): Add offset
parameter, and make use of it.
(riscv_get_arg_info): Pass offset to riscv_pass_fpr_single.

gcc/testsuite/ChangeLog:

PR target/89627
* g++.target/riscv/call-with-empty-struct-float.C: New file.
* g++.target/riscv/call-with-empty-struct-int.C: New file.
* g++.target/riscv/call-with-empty-struct.H: New file.
* g++.target/riscv/riscv.exp: New file.

From-SVN: r269760

5 years agore PR c++/85014 (internal compiler error: in lookup_base, at cp/search.c:185)
Paolo Carlini [Mon, 18 Mar 2019 09:38:27 +0000 (09:38 +0000)]
re PR c++/85014 (internal compiler error: in lookup_base, at cp/search.c:185)

/cp
2019-03-18  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/85014
* semantics.c (finish_non_static_data_member): Check return value
of context_for_name_lookup and immediately return error_mark_node
if isn't a type.

/testsuite
2019-03-18  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/85014
* g++.dg/cpp0x/pr85014.C: New.

From-SVN: r269759

5 years ago[ARC] Enable code density frame option for elf targets.
Claudiu Zissulescu [Mon, 18 Mar 2019 09:28:45 +0000 (10:28 +0100)]
[ARC] Enable code density frame option for elf targets.

xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.opt (mcode-density-frame): Get the inital value
from TARGET_CODE_DENSITY_FRAME_DEFAULT.
* config/arc/elf.h (TARGET_CODE_DENSITY_FRAME_DEFAULT): Define.
* config/arc/linux.h (TARGET_CODE_DENSITY_FRAME_DEFAULT): Define.
* config/arc/arc.md (pop_multi_fp_blink): Adjust constraints to
match what the ops is doing.
(push_multi_fp_blink): Likewise.
* config/arc/arc.c (arc_override_options): Enable enter/leave when
compiling for size and elf target.
(arc_save_callee_enter): Adjust note to match what enter/leave
operation does.

From-SVN: r269758

5 years ago[ARC] Fix tst_movb pattern.
Claudiu Zissulescu [Mon, 18 Mar 2019 09:28:33 +0000 (10:28 +0100)]
[ARC] Fix tst_movb pattern.

xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.md (tst_movb): Fix constraint.

From-SVN: r269757

5 years ago[ARC] Define TARGET_HAVE_SPECULATION_SAFE_VALUE.
Claudiu Zissulescu [Mon, 18 Mar 2019 09:28:22 +0000 (10:28 +0100)]
[ARC] Define TARGET_HAVE_SPECULATION_SAFE_VALUE.

xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.c (TARGET_HAVE_SPECULATION_SAFE_VALUE): Define.

From-SVN: r269756

5 years ago[ARC] Introduce ADJUST_REG_ALLOC_ORDER.
Claudiu Zissulescu [Mon, 18 Mar 2019 09:28:11 +0000 (10:28 +0100)]
[ARC] Introduce ADJUST_REG_ALLOC_ORDER.

The ARC port is changing the allocation order in the
arc_conditional_register_usage function, but this is not the proper
way. Thus, we employ ADJUST_REG_ALLOC_ORDER hook for this task.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc-protos.h (arc_adjust_reg_alloc_order): Declare.
* config/arc/arc.c (arc_conditional_register_usage): Remove all
reg_alloc_order references.
(size_alloc_order): Define.
(arc_adjust_reg_alloc_order): New function.
* config/arc/arc.h (REG_ALLOC_ORDER): Proper define the register
order.
(ADJUST_REG_ALLOC_ORDER): Define.
(HONOR_REG_ALLOC_ORDER): Likewise.

From-SVN: r269755

5 years agore PR target/87561 (416.gamess is slower by ~10% starting from r264866 with -Ofast)
Richard Biener [Mon, 18 Mar 2019 09:17:43 +0000 (09:17 +0000)]
re PR target/87561 (416.gamess is slower by ~10% starting from r264866 with -Ofast)

2019-03-18  Richard Biener  <rguenther@suse.de>

PR target/87561
* config/i386/i386.c (ix86_add_stmt_cost): Pessimize strided
loads and stores a bit more.

From-SVN: r269754

5 years agore PR target/87561 (416.gamess is slower by ~10% starting from r264866 with -Ofast)
Richard Biener [Mon, 18 Mar 2019 09:16:56 +0000 (09:16 +0000)]
re PR target/87561 (416.gamess is slower by ~10% starting from r264866 with -Ofast)

2019-03-18  Richard Biener  <rguenther@suse.de>

PR target/87561
* config/i386/i386.c (ix86_add_stmt_cost): Apply strided
load pessimization to stores as well.

From-SVN: r269753

5 years agore PR middle-end/86979 (ICE: in maybe_record_trace_start, at dwarf2cfi.c:2348 with...
Jakub Jelinek [Mon, 18 Mar 2019 08:31:41 +0000 (09:31 +0100)]
re PR middle-end/86979 (ICE: in maybe_record_trace_start, at dwarf2cfi.c:2348 with -m32 on darwin)

PR middle-end/86979
* gcc.dg/pr86979.c: New test.

From-SVN: r269752

5 years agore PR rtl-optimization/89676 (Redundant moves for long long shift on 32bit x86)
Andrey Belevantsev [Mon, 18 Mar 2019 07:51:06 +0000 (10:51 +0300)]
re PR rtl-optimization/89676 (Redundant moves for long long shift on 32bit x86)

        PR middle-end/89676
        * sel-sched.c (compute_av_set_at_bb_end): When we have an ineligible
        successor, use NULL as its av set.

From-SVN: r269751

5 years agore PR fortran/88008 (ICE in check_typebound_baseobject, at fortran/resolve.c:6058)
Thomas Koenig [Mon, 18 Mar 2019 07:28:42 +0000 (07:28 +0000)]
re PR fortran/88008 (ICE in check_typebound_baseobject, at fortran/resolve.c:6058)

2019-03-17  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/88008
* gfortran.h (expr_t): Add EXPR_UNKNOWN.
* expr.c (gfc_copy_expr): Add EXPR_UNKNOWN to switch statement.
(gfc_simplify_expr): Likewise.
* module.c (mio_expr): Likewise.
* resovle.c (extract_compcall_passed_object): Issue error on
unknown type.
(check_typebound_baseobject): Issue error on wrong type.
* trans-expr.c (gfc_apply_interface_mapping_to_expr): Add
EXPR_UNKNOWN to switch statement.

2019-03-17  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/88008
 * gfortran.dg/typebound_call_31.f90: New test.

From-SVN: r269750

5 years agoDaily bump.
GCC Administrator [Mon, 18 Mar 2019 00:16:19 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r269749

5 years agoPR c++/89571 - ICE with ill-formed noexcept on constructor.
Jason Merrill [Sun, 17 Mar 2019 20:07:26 +0000 (16:07 -0400)]
PR c++/89571 - ICE with ill-formed noexcept on constructor.

Earlier changes to defer instantiating a defaulted noexcept-specifier that
depends on yet-unparsed default member initializers broke this testcase,
where instantiation fails for another reason.  In this case there's no
reason to defer and try again later, so let's not.

* pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
(regenerate_decl_from_template): Use it for noexcept-specs.

From-SVN: r269746

5 years agopr83487-1_x.c: Use -fno-common option on hppa*-*-hpux*.
John David Anglin [Sun, 17 Mar 2019 19:37:00 +0000 (19:37 +0000)]
pr83487-1_x.c: Use -fno-common option on hppa*-*-hpux*.

* gcc.dg/compat/pr83487-1_x.c: Use -fno-common option on hppa*-*-hpux*.
* gcc.dg/compat/pr83487-1_y.c: Likewise.

From-SVN: r269745

5 years agopointer_init_10.f90: Require visibility support.
John David Anglin [Sun, 17 Mar 2019 19:16:53 +0000 (19:16 +0000)]
pointer_init_10.f90: Require visibility support.

* gfortran.dg/pointer_init_10.f90: Require visibility support.
* gfortran.dg/temporary_3.f90: Likewise.

From-SVN: r269744

5 years agopr88074.c: Require c99_runtime.
John David Anglin [Sun, 17 Mar 2019 18:24:14 +0000 (18:24 +0000)]
pr88074.c: Require c99_runtime.

* gcc.dg/pr88074.c: Require c99_runtime.
* gcc.dg/warn-abs-1.c: Likewise.
* gfortran.dg/ISO_Fortran_binding_1.f90: Likewise.

From-SVN: r269743

5 years agore PR testsuite/89666 (FAIL: gcc.dg/ipa/ipa-icf-39.c scan-ipa-dump-times icf "Unified...
John David Anglin [Sun, 17 Mar 2019 17:59:03 +0000 (17:59 +0000)]
re PR testsuite/89666 (FAIL: gcc.dg/ipa/ipa-icf-39.c scan-ipa-dump-times icf "Unified;" 2)

PR testsuite/89666
* c-c++-common/builtin-has-attribute-3.c: Define SKIP_ALIAS on
hppa*-*-hpux*.
* gcc.dg/attr-copy.c: Require alias support.
* gcc.dg/ipa/ipa-icf-39.c: Likewise.

From-SVN: r269742

5 years agoDaily bump.
GCC Administrator [Sun, 17 Mar 2019 00:16:13 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r269737

5 years agore PR fortran/89724 (Fortran diagnostics give wrong line number because of math-vecto...
Jakub Jelinek [Sat, 16 Mar 2019 21:18:49 +0000 (22:18 +0100)]
re PR fortran/89724 (Fortran diagnostics give wrong line number because of math-vector-fortran.h header file)

PR fortran/89724
* scanner.c (load_line): Remove linenum and current_line static
variables, add warned_tabs automatic variable.  Use current_file->line
instead of current_line and warned_tabs boolean to avoid diagnosing
tabs multiple times on the same line.

* gfortran.dg/continuation_15.f90: New test.
* gfortran.dg/continuation_16.f90: New test.

From-SVN: r269734

5 years agoFix type in last change.
John David Anglin [Sat, 16 Mar 2019 18:23:48 +0000 (18:23 +0000)]
Fix type in last change.

From-SVN: r269733

5 years agore PR testsuite/89393 (FAIL: g++.dg/abi/ref-temp1.C -std=c++14 scan-assembler ...
John David Anglin [Sat, 16 Mar 2019 18:10:31 +0000 (18:10 +0000)]
re PR testsuite/89393 (FAIL: g++.dg/abi/ref-temp1.C  -std=c++14  scan-assembler .weak(_definition)?[ \t]_?_ZGR1bIvE)

PR testsuite/89393
* g++.dg/abi/ref-temp1.C: Skip on 32-bit hppa*-*-hpux*.
* g++.dg/cpp0x/pr84497.C: Likewise.

From-SVN: r269732

5 years agobuiltin-has-attribute-4.c: Skip on 32-bit hppa*-*-hpux*.
John David Anglin [Sat, 16 Mar 2019 17:48:14 +0000 (17:48 +0000)]
builtin-has-attribute-4.c: Skip on 32-bit hppa*-*-hpux*.

* c-c++-common/builtin-has-attribute-4.c: Skip on 32-bit hppa*-*-hpux*.
* gcc.dg/attr-copy-6.c: Likewise.
* gcc.dg/pr87793.c: Likewise.

From-SVN: r269731

5 years agore PR inline-asm/84941 (internal compiler error: in reg_overlap_mentioned_p, at rtlan...
John David Anglin [Sat, 16 Mar 2019 17:31:30 +0000 (17:31 +0000)]
re PR inline-asm/84941 (internal compiler error: in reg_overlap_mentioned_p, at rtlanal.c:1870 (reg_overlap_mentioned_p()/match_asm_constraints_1()))

PR testsuite/84941
* gcc.dg/pr84941.c: Skip on hppa*-*-*.

From-SVN: r269730

5 years agoWattributes-10.c: Add -fno-common option on hppa*-*-hpux*.
John David Anglin [Sat, 16 Mar 2019 17:08:43 +0000 (17:08 +0000)]
Wattributes-10.c: Add -fno-common option on hppa*-*-hpux*.

* gcc.dg/Wattributes-10.c: Add -fno-common option on hppa*-*-hpux*.
* gcc.dg/gimplefe-34.c: Likewise.
* gcc.dg/compat/pr83487-2_x.c: Use -fno-common option on hppa*-*-hpux*.
* gcc.dg/compat/pr83487-2_y.c: Likewise.

From-SVN: r269729

5 years agore PR testsuite/84174 (FAIL: gcc.dg/Wattributes-6.c (test for warnings, line 404))
John David Anglin [Sat, 16 Mar 2019 16:39:49 +0000 (16:39 +0000)]
re PR testsuite/84174 (FAIL: gcc.dg/Wattributes-6.c  (test for warnings, line 404))

PR testsuite/84174
* gcc.dg/Wattributes-6.c: Skip warning check at line 404 on
hppa*64*-*-*.

From-SVN: r269728

5 years agore PR testsuite/83453 (FAIL: c-c++-common/Wattributes.c -std=gnu++98 (test for...
John David Anglin [Sat, 16 Mar 2019 15:44:25 +0000 (15:44 +0000)]
re PR testsuite/83453 (FAIL: c-c++-common/Wattributes.c  -std=gnu++98  (test for warnings, line 404))

PR testsuite/83453
* c-c++-common/Wattributes.c: Skip a warning check on hppa*64*-*-*.

From-SVN: r269727

5 years agotarget-supports.exp (check_ascii_locale_available): Remove hppa*-*-hpux*.
John David Anglin [Sat, 16 Mar 2019 15:18:36 +0000 (15:18 +0000)]
target-supports.exp (check_ascii_locale_available): Remove hppa*-*-hpux*.

* lib/target-supports.exp (check_ascii_locale_available): Remove
hppa*-*-hpux*.

From-SVN: r269726

5 years agore PR fortran/84394 (compiler error when using modules with derived types in block...
Thomas Koenig [Sat, 16 Mar 2019 11:50:03 +0000 (11:50 +0000)]
re PR fortran/84394 (compiler error when using modules with derived types in block data subprograms)

2019-03-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84394
* symbol.c (gfc_add_subroutine): If we are encountering a
subrtoutine within a BLOCK DATA and the name starts with an
underscore, do not check.

2019-03-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84394
* gfortran.dg/blockdata_11.f90: New test.

From-SVN: r269721

5 years agoDaily bump.
GCC Administrator [Sat, 16 Mar 2019 00:16:23 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r269720

5 years agore PR fortran/60091 (Misleading error messages in rank-2 pointer assignment to rank...
Harald Anlauf [Fri, 15 Mar 2019 22:20:20 +0000 (22:20 +0000)]
re PR fortran/60091 (Misleading error messages in rank-2 pointer assignment to rank-1 target)

2019-03-15  Harald Anlauf  <anlauf@gmx.de>

PR fortran/60091
* expr.c (gfc_check_pointer_assign): Correct and improve error
messages for invalid pointer assignments.

PR fortran/60091
* gfortran.dg/pointer_remapping_3.f08: Adjust error messages.
* gfortran.dg/pointer_remapping_7.f90: Adjust error message.

From-SVN: r269717

5 years agoLRA: side_effects_p stmts' output is not invariant (PR89721)
Segher Boessenkool [Fri, 15 Mar 2019 22:09:15 +0000 (23:09 +0100)]
LRA: side_effects_p stmts' output is not invariant (PR89721)

PR89721 shows LRA treating an unspec_volatile's result as invariant,
which of course isn't correct.  This patch fixes it.

PR rtl-optimization/89721
* lra-constraints (invariant_p): Return false if side_effects_p holds.

From-SVN: r269716

5 years agore PR target/87532 (bad results from vec_extract(unsigned char, foo) dependent upon...
Kelvin Nilsen [Fri, 15 Mar 2019 19:52:43 +0000 (19:52 +0000)]
re PR target/87532 (bad results from vec_extract(unsigned char, foo) dependent upon function inline)

gcc/ChangeLog:

2019-03-15  Kelvin Nilsen  <kelvin@gcc.gnu.org>

PR target/87532
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
When handling vec_extract, use modular arithmetic to allow
constant selectors greater than vector length.
* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Allow
V1TImode vectors to have constant selector values greater than 0.
Use modular arithmetic to compute vector index.
(rs6000_split_vec_extract_var): Use modular arithmetic to compute
index for in-memory vectors.  Correct code generation for
in-register vectors.
(altivec_expand_vec_ext_builtin): Use modular arithmetic to
compute index.

gcc/testsuite/ChangeLog:

2019-03-15  Kelvin Nilsen  <kelvin@gcc.gnu.org>

PR target/87532
* gcc.target/powerpc/fold-vec-extract-char.p8.c: Modify expected
instruction selection.
* gcc.target/powerpc/fold-vec-extract-int.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-short.p8.c: Likewise.
* gcc.target/powerpc/pr87532-mc.c: New test.
* gcc.target/powerpc/pr87532.c: New test.
* gcc.target/powerpc/vec-extract-v16qiu-v2.h: New test.
* gcc.target/powerpc/vec-extract-v16qiu-v2a.c: New test.
* gcc.target/powerpc/vec-extract-v16qiu-v2b.c: New test.
* gcc.target/powerpc/vsx-builtin-10a.c: New test.
* gcc.target/powerpc/vsx-builtin-10b.c: New test.
* gcc.target/powerpc/vsx-builtin-11a.c: New test.
* gcc.target/powerpc/vsx-builtin-11b.c: New test.
* gcc.target/powerpc/vsx-builtin-12a.c: New test.
* gcc.target/powerpc/vsx-builtin-12b.c: New test.
* gcc.target/powerpc/vsx-builtin-13a.c: New test.
* gcc.target/powerpc/vsx-builtin-13b.c: New test.
* gcc.target/powerpc/vsx-builtin-14a.c: New test.
* gcc.target/powerpc/vsx-builtin-14b.c: New test.
* gcc.target/powerpc/vsx-builtin-15a.c: New test.
* gcc.target/powerpc/vsx-builtin-15b.c: New test.
* gcc.target/powerpc/vsx-builtin-16a.c: New test.
* gcc.target/powerpc/vsx-builtin-16b.c: New test.
* gcc.target/powerpc/vsx-builtin-17a.c: New test.
* gcc.target/powerpc/vsx-builtin-17b.c: New test.
* gcc.target/powerpc/vsx-builtin-18a.c: New test.
* gcc.target/powerpc/vsx-builtin-18b.c: New test.
* gcc.target/powerpc/vsx-builtin-19a.c: New test.
* gcc.target/powerpc/vsx-builtin-19b.c: New test.
* gcc.target/powerpc/vsx-builtin-20a.c: New test.
* gcc.target/powerpc/vsx-builtin-20b.c: New test.
* gcc.target/powerpc/vsx-builtin-9a.c: New test.
* gcc.target/powerpc/vsx-builtin-9b.c: New test.

From-SVN: r269715

5 years agocompiler: preserve nointerface property when inlining methods
Ian Lance Taylor [Fri, 15 Mar 2019 16:58:14 +0000 (16:58 +0000)]
compiler: preserve nointerface property when inlining methods

    When an inline function (with body) is imported from another package,
    make that the "nointerface" property (if set) is preserved.

    Fixes golang/go#30862.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/167742

From-SVN: r269713

5 years agoadd myself as selective scheduling reviewer
Alexander Monakov [Fri, 15 Mar 2019 16:49:24 +0000 (19:49 +0300)]
add myself as selective scheduling reviewer

* MAINTAINERS (Reviewers): Add myself as selective scheduling reviewer.
(Write After Approval): Remove myself.

From-SVN: r269712

5 years agocompiler: use const rather than constexpr
Ian Lance Taylor [Fri, 15 Mar 2019 15:50:34 +0000 (15:50 +0000)]
compiler: use const rather than constexpr

    Fixes bootstrap with a C++98 compiler.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/167762

From-SVN: r269710

5 years ago[PR88534] accept VAR_DECL in class literal template parms
Alexandre Oliva [Fri, 15 Mar 2019 13:56:55 +0000 (13:56 +0000)]
[PR88534] accept VAR_DECL in class literal template parms

P0732R2 / C++ 2a introduce class literals as template parameters.  The
front-end uses VAR_DECLs constructed from such literals to bind the
template PARM_DECLs, but dwarf2out.c used to reject such VAR_DECLs.

Taking DECL_INITIAL from such VAR_DECLs enables the generation of
DW_AT_const_value for them, at least when the class literal can
actually be represented as such.

for  gcc/ChangeLog

PR c++/88534
PR c++/88537
* dwarf2out.c (generic_parameter_die): Follow DECL_INITIAL of
VAR_DECL args.

for  gcc/testsuite/ChangeLog

PR c++/88534
PR c++/88537
* g++.dg/cpp2a/pr88534.C: New.
* g++.dg/cpp2a/pr88537.C: New.

From-SVN: r269709

5 years agore PR d/88990 (ICE in get_symbol_decl, at d/decl.cc:1097)
Iain Buclaw [Fri, 15 Mar 2019 13:37:07 +0000 (13:37 +0000)]
re PR d/88990 (ICE in get_symbol_decl, at d/decl.cc:1097)

    PR d/88990
d/dmd: Merge upstream dmd 8d4c876c6

The extern storage class flag was wrongly propagated to function scope
when starting the semantic pass on the body.

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

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

From-SVN: r269708

5 years agoS/390: Fix tests that expect unquoted option names
Robin Dapp [Fri, 15 Mar 2019 13:19:10 +0000 (13:19 +0000)]
S/390: Fix tests that expect unquoted option names

r269586 puts single quotes around option names. This patch fixes tests
that expect the old format.

From-SVN: r269706

5 years ago[AArch64] PR target/89719 Adjust gcc.target/aarch64/spellcheck*.c tests
Kyrylo Tkachov [Fri, 15 Mar 2019 09:50:11 +0000 (09:50 +0000)]
[AArch64] PR target/89719 Adjust gcc.target/aarch64/spellcheck*.c tests

As of recently the -march,-mcpu,-mtune strings in the error messages are
now quoted.
This patch adjusts the testcases in gcc.target/aarch64/ that had started
failing due to that change.

PR target/89719
* gcc.target/aarch64/spellcheck_4.c: Adjust dg-error string.
* gcc.target/aarch64/spellcheck_5.c: Likewise.
* gcc.target/aarch64/spellcheck_6.c: Likewise.

From-SVN: r269703

5 years agore PR c++/89709 (ICE with constexpr and "-O")
Jakub Jelinek [Fri, 15 Mar 2019 09:23:11 +0000 (10:23 +0100)]
re PR c++/89709 (ICE with constexpr and "-O")

PR c++/89709
* tree.c (inchash::add_expr): Strip any location wrappers.
* fold-const.c (operand_equal_p): Move stripping of location wrapper
after hash verification.

* g++.dg/cpp0x/constexpr-89709.C: New test.

From-SVN: r269702

5 years agore PR debug/89704 (ICE in add_const_value_attribute, at dwarf2out.c:19685)
Jakub Jelinek [Fri, 15 Mar 2019 08:00:46 +0000 (09:00 +0100)]
re PR debug/89704 (ICE in add_const_value_attribute, at dwarf2out.c:19685)

PR debug/89704
* dwarf2out.c (add_const_value_attribute): Return false for MINUS,
SIGN_EXTEND and ZERO_EXTEND.

* gcc.dg/debug/pr89704.c: New test.

From-SVN: r269700

5 years agocompiler: eliminate bound checks in append expression
Ian Lance Taylor [Fri, 15 Mar 2019 04:34:43 +0000 (04:34 +0000)]
compiler: eliminate bound checks in append expression

    The compiler generates two array index expressions when lowering
    an append expression. Currently they generate bound checks.
    Bound checks are not necessary in this case, as we know the slice
    has, or will grow to, enough length and capacity. Eliminate them.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/166817

From-SVN: r269699

5 years agoDaily bump.
GCC Administrator [Fri, 15 Mar 2019 00:16:11 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r269698

5 years agohash-table.h (remove_elt_with_hash): Return if slot is NULL rather than if is_empty...
Jason Merrill [Thu, 14 Mar 2019 22:47:01 +0000 (18:47 -0400)]
hash-table.h (remove_elt_with_hash): Return if slot is NULL rather than if is_empty (*slot).

* hash-table.h (remove_elt_with_hash): Return if slot is NULL rather
than if is_empty (*slot).
* hash-set-tests.c (test_set_of_strings): Add tests for addition of
existing elt and for elt removal.
* hash-map-tests.c (test_map_of_strings_to_int): Add test for removal
of already removed elt.

* hashtab.c (htab_remove_elt_with_hash): Return if slot is NULL rather
than if *slot is HTAB_EMPTY_ENTRY.

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

5 years agoi386: Handle REG_EH_REGION note
H.J. Lu [Thu, 14 Mar 2019 20:38:52 +0000 (20:38 +0000)]
i386: Handle REG_EH_REGION note

When we split:

(insn 18 17 76 2 (set (reg:SF 88 [ _19 ])
        (float:SF (mem/c:SI (symbol_ref:DI ("d") [flags 0x2]  <var_decl 0x7fd6d8290c60 d>) [1 d+0 S4 A32]))) "x.ii":4:20 170 {*floatsisf2}
     (expr_list:REG_EH_REGION (const_int 2 [0x2])
        (nil)))

to

(insn 94 17 18 2 (set (reg:V4SF 115)
        (vec_merge:V4SF (vec_duplicate:V4SF (float:SF (mem/c:SI (symbol_ref:DI ("d") [flags 0x2]  <var_decl 0x7f346837ac60 d>) [1 d+0 S4 A32])))
            (reg:V4SF 114)
            (const_int 1 [0x1]))) "x.ii":4:20 -1
     (nil))
(insn 18 94 76 2 (set (reg:SF 88 [ _19 ])
        (subreg:SF (reg:V4SF 115) 0)) "x.ii":4:20 112 {*movsf_internal}
     (expr_list:REG_EH_REGION (const_int 2 [0x2])
        (nil)))

we must copy the REG_EH_REGION note to the first insn and split the block
after the newly added insn.  The REG_EH_REGION on the second insn will be
removed later since it no longer traps.

gcc/

PR target/89650
* config/i386/i386.c (remove_partial_avx_dependency): Handle
REG_EH_REGION note.

gcc/testsuite/

PR target/89650
* g++.target/i386/pr89650.C: New test.

From-SVN: r269694

5 years agoDon't require 'bool' in a concept definition.
Jason Merrill [Thu, 14 Mar 2019 19:53:04 +0000 (15:53 -0400)]
Don't require 'bool' in a concept definition.

* parser.c (cp_parser_decl_specifier_seq): Support C++20
concept-definition syntax without 'bool'.

From-SVN: r269692

5 years ago* gcc.target/i386/pr85860.c: Use target int128 instead of lp64.
Uros Bizjak [Thu, 14 Mar 2019 18:39:44 +0000 (19:39 +0100)]
* gcc.target/i386/pr85860.c: Use target int128 instead of lp64.

From-SVN: r269691

5 years agogfortran.texi: Document Q edit descriptor under " Extensions not implemented in GNU...
Thomas Koenig [Thu, 14 Mar 2019 17:31:18 +0000 (17:31 +0000)]
gfortran.texi: Document Q edit descriptor under " Extensions not implemented in GNU Fortran".

2019-03-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

* gfortran.texi: Document Q edit descriptor under
" Extensions not implemented in GNU Fortran".

From-SVN: r269690

5 years agoRemove dead option from manual (PR other/89712).
Martin Liska [Thu, 14 Mar 2019 14:19:33 +0000 (15:19 +0100)]
Remove dead option from manual (PR other/89712).

2019-03-14  Martin Liska  <mliska@suse.cz>

PR other/89712
* doc/invoke.texi: Remove -fdump-class-hierarchy option.

From-SVN: r269684

5 years agore PR target/89711 (ICE in insert_vi_for_tree, at tree-ssa-structalias.c:2832)
Richard Biener [Thu, 14 Mar 2019 14:05:26 +0000 (14:05 +0000)]
re PR target/89711 (ICE in insert_vi_for_tree, at tree-ssa-structalias.c:2832)

2019-03-14  Richard Biener  <rguenther@suse.de>

PR target/89711
* config/i386/i386.c (make_resolver_func): Properly set
DECL_CONTEXT on the RESULT_DECL.
* config/rs6000/rs6000.c (make_resolver_func): Likewise.

From-SVN: r269683

5 years agoc-tree.h (enum c_declspec_il): New.
Richard Biener [Thu, 14 Mar 2019 13:25:27 +0000 (13:25 +0000)]
c-tree.h (enum c_declspec_il): New.

2019-03-14  Richard Biener  <rguenther@suse.de>

c/
* c-tree.h (enum c_declspec_il): New.
(struct c_declspecs): Merge gimple_p and rtl_p into declspec_il
enum bitfield.
* c-parser.c (c_parser_declaration_or_fndef): Adjust accordingly.
Pass start pass and declspec_il to c_parser_parse_gimple_body.
(c_parser_declspecs): Adjust.
* gimple-parser.c: Include cfg.h, cfghooks.h, cfganal.h, tree-cfg.h,
gimple-iterator.h, cfgloop.h, tree-phinodes.h, tree-into-ssa.h
and bitmap.h.
(struct gimple_parser): New.
(gimple_parser::push_edge): New method.
(c_parser_gimple_parse_bb_spec): New helper.
(c_parser_parse_gimple_body): Get start pass and IL specification.
Initialize SSA and CFG.
(c_parser_gimple_compound_statement): Handle CFG and SSA build.
Build a gimple_parser parsing state and pass it along.
(c_parser_gimple_statement): Change intermittend __PHI internal
function argument for the edge.
(c_parser_gimple_or_rtl_pass_list): Handle ssa, cfg flags.
(c_parser_gimple_goto_stmt): Record edges to build.
(c_parser_gimple_if_stmt): Likewise.
* gimple-parser.h (c_parser_parse_gimple_body): Adjust.
(c_parser_gimple_or_rtl_pass_list): Likewise.

* gimple-pretty-print.c: Include cfgloop.h.
(dump_gimple_phi): Adjust.
(dump_gimple_bb_header): Dump loop header for GIMPLE.
(pp_cfg_jump): Adjust.
(dump_implicit_edges): Dump fallthru to next block for GIMPLE as well.
* tree-cfg.c (build_gimple_cfg): Remove lower_phi_internal_fn call.
(lower_phi_internal_fn): Remove.
(verify_gimple_call): Remove IFN_PHI special-casing.
(dump_function_to_file): Dump IL state.
* tree-into-ssa.c (rewrite_add_phi_arguments): Revert changes
done to deal with PHI nodes being present in non-SSA state.

* gcc.dg/gimplefe-13.c: Adjust.
* gcc.dg/gimplefe-14.c: Likewise.
* gcc.dg/gimplefe-17.c: Likewise.
* gcc.dg/gimplefe-18.c: Likewise.
* gcc.dg/gimplefe-7.c: Likewise.
* gcc.dg/torture/pr89595.c: Likewise.
* gcc.dg/tree-ssa/cunroll-13.c: Likewise.
* gcc.dg/tree-ssa/ivopt_mult_1g.c: Likewise.
* gcc.dg/tree-ssa/ivopt_mult_2g.c: Likewise.
* gcc.dg/tree-ssa/scev-3.c: Likewise.
* gcc.dg/tree-ssa/scev-4.c: Likewise.
* gcc.dg/tree-ssa/scev-5.c: Likewise.
* gcc.dg/vect/vect-cond-arith-2.c: Likewise.
* gcc.target/aarch64/sve/loop_add_6.c: Likewise.

From-SVN: r269682

5 years agore PR ipa/89684 (ICE in gsi_for_stmt, at gimple-iterator.c:613)
Jakub Jelinek [Thu, 14 Mar 2019 13:05:34 +0000 (14:05 +0100)]
re PR ipa/89684 (ICE in gsi_for_stmt, at gimple-iterator.c:613)

PR ipa/89684
* multiple_target.c (create_dispatcher_calls): Change
references_to_redirect from vector of ipa_ref * to vector of ipa_ref.
In the node->iterate_referring loop, push *ref rather than ref, call
ref->remove_reference () and always pass 0 to iterate_referring.

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

From-SVN: r269681

5 years agore PR rtl-optimization/89679 (wrong code with -Og -frerun-cse-after-loop -fno-tree...
Jakub Jelinek [Thu, 14 Mar 2019 12:21:36 +0000 (13:21 +0100)]
re PR rtl-optimization/89679 (wrong code with -Og -frerun-cse-after-loop -fno-tree-fre)

PR rtl-optimization/89679
* expmed.c (expand_mult_const): Don't add a REG_EQUAL note if it
would contain a paradoxical SUBREG.

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

From-SVN: r269680

5 years agore PR tree-optimization/89710 (ICE in dyn_cast<gcond*, gimple>(gimple*) / should_dupl...
Richard Biener [Thu, 14 Mar 2019 11:07:41 +0000 (11:07 +0000)]
re PR tree-optimization/89710 (ICE in dyn_cast<gcond*, gimple>(gimple*) / should_duplicate_loop_header_p)

2019-03-14  Richard Biener  <rguenther@suse.de>

PR tree-optimization/89710
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Use
safe_dyn_cast.

* gcc.dg/torture/pr89710.c: New testcase.

From-SVN: r269679

5 years agoGCOV: print {start,end}_column in JSON file and gcov-dump tool.
Martin Liska [Thu, 14 Mar 2019 09:33:54 +0000 (10:33 +0100)]
GCOV: print {start,end}_column in JSON file and gcov-dump tool.

2019-03-14  Martin Liska  <mliska@suse.cz>

* coverage.c (coverage_begin_function): Stream also
end_column.
* doc/gcov.texi: Document 2 new fields in JSON file.  Improve
documentation about function declaration location.
* gcov-dump.c (tag_function): Print whole range
of function declaration.
* gcov.c (struct function_info): Add end_column field.
(function_info::function_info): Initialize it.
(output_json_intermediate_file): Output {start,end}_column
fields.
(read_graph_file): Read end_column.

From-SVN: r269678

5 years agore PR c++/89698 (Run-time error due to optimization of field access after cast at...
Richard Biener [Thu, 14 Mar 2019 09:24:21 +0000 (09:24 +0000)]
re PR c++/89698 (Run-time error due to optimization of field access after cast at -Os/-O2 and higher)

2019-03-14  Richard Biener  <rguenther@suse.de>

PR middle-end/89698
* fold-const.c (operand_equal_p): For INDIRECT_REF check
that the access types are similar.

* g++.dg/torture/pr89698.C: New testcase.

From-SVN: r269677

5 years agore PR tree-optimization/89703 (ICE in compare_values_warnv, at tree-vrp.c:997)
Jakub Jelinek [Thu, 14 Mar 2019 08:56:47 +0000 (09:56 +0100)]
re PR tree-optimization/89703 (ICE in compare_values_warnv, at tree-vrp.c:997)

PR tree-optimization/89703
* tree-ssa-strlen.c (valid_builtin_call): Punt if stmt call types
aren't compatible also with builtin_decl_explicit.  Check pure
or non-pure status of BUILT_IN_STR{{,N}CMP,N{LEN,{CAT,CPY}{,_CHK}}}
and BUILT_IN_STPNCPY{,_CHK}.

* gcc.c-torture/compile/pr89703-1.c: New test.
* gcc.c-torture/compile/pr89703-2.c: New test.

From-SVN: r269674

5 years agox32: Add addr32 prefix to VSIB address
H.J. Lu [Thu, 14 Mar 2019 08:49:54 +0000 (08:49 +0000)]
x32: Add addr32 prefix to VSIB address

32-bit indices in VSIB address are sign-extended to 64 bits.  In x32,
when 32-bit indices are used as addresses, like in

vgatherdps %ymm7, 0(,%ymm9,1), %ymm6

32-bit indices, 0xf7fa3010, is sign-extended to 0xfffffffff7fa3010 which
is invalid address.  Add addr32 prefix to UNSPEC_VSIBADDR instructions
for x32 if there is no base register nor symbol.

This fixes 175.vpr and 254.gap in SPEC CPU 2000 on x32 with

-Ofast -funroll-loops -march=haswell

gcc/

PR target/89523
* config/i386/i386.c (ix86_print_operand): Handle 'M' to add
addr32 prefix to VSIB address for X32.
* config/i386/sse.md (*avx512pf_gatherpf<mode>sf_mask): Prepend
"%M2" to opcode.
(*avx512pf_gatherpf<mode>df_mask): Likewise.
(*avx512pf_scatterpf<mode>sf_mask): Likewise.
(*avx512pf_scatterpf<mode>df_mask): Likewise.
(*avx2_gathersi<mode>): Prepend "%M3" to opcode.
(*avx2_gathersi<mode>_2): Prepend "%M2" to opcode.
(*avx2_gatherdi<mode>): Prepend "%M3" to opcode.
(*avx2_gatherdi<mode>_2): Prepend "%M2" to opcode.
(*avx2_gatherdi<mode>_3): Prepend "%M3" to opcode.
(*avx2_gatherdi<mode>_4): Prepend "%M2" to opcode.`
(*avx512f_gathersi<mode>): Prepend "%M4" to opcode.
(*avx512f_gathersi<mode>_2): Prepend "%M3" to opcode.
(*avx512f_gatherdi<mode>): Prepend "%M4" to opcode.
(*avx512f_gatherdi<mode>_2): Prepend "%M3" to opcode.
(*avx512f_scattersi<mode>): Prepend "%M0" to opcode.
(*avx512f_scatterdi<mode>): Likewise.

gcc/testsuite/

PR target/89523
* gcc.target/i386/pr89523-1a.c: New test.
* gcc.target/i386/pr89523-1b.c: Likewise.
* gcc.target/i386/pr89523-2.c: Likewise.
* gcc.target/i386/pr89523-3.c: Likewise.
* gcc.target/i386/pr89523-4.c: Likewise.
* gcc.target/i386/pr89523-5.c: Likewise.
* gcc.target/i386/pr89523-6.c: Likewise.
* gcc.target/i386/pr89523-7.c: Likewise.
* gcc.target/i386/pr89523-8.c: Likewise.
* gcc.target/i386/pr89523-9.c: Likewise.

From-SVN: r269673

5 years agore PR c++/89512 (ICE in get_expr_operands, at tree-ssa-operands.c:882)
Jakub Jelinek [Thu, 14 Mar 2019 08:14:48 +0000 (09:14 +0100)]
re PR c++/89512 (ICE in get_expr_operands, at tree-ssa-operands.c:882)

PR c++/89512
* semantics.c (finish_qualified_id_expr): Reject variable templates.

* g++.dg/cpp1y/var-templ61.C: New test.

From-SVN: r269672

5 years agore PR c++/89652 (ICE during constexpr evaluation)
Jakub Jelinek [Thu, 14 Mar 2019 08:13:09 +0000 (09:13 +0100)]
re PR c++/89652 (ICE during constexpr evaluation)

PR c++/89652
* constexpr.c (struct constexpr_ctx): Change save_exprs type from
hash_set<tree> to vec<tree>.
(cxx_eval_call_expression): Adjust for save_exprs being a vec instead
of hash_set.
(cxx_eval_loop_expr): Likewise.  Truncate the vector after each
removal of SAVE_EXPRs from values.
(cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
method on save_exprs instead of add.

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

From-SVN: r269671

5 years agoDaily bump.
GCC Administrator [Thu, 14 Mar 2019 00:16:19 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r269670