Commit Graph

167772 Commits

Author SHA1 Message Date
Eric Botcazou
4f683506df 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
2019-03-19 08:06:48 +00:00
Jakub Jelinek
ce2c025c24 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
2019-03-19 08:25:59 +01:00
Jakub Jelinek
855cd9b166 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
2019-03-19 07:55:31 +01:00
GCC Administrator
7babd3e4f1 Daily bump.
From-SVN: r269788
2019-03-19 00:16:11 +00:00
Martin Sebor
c46c9745aa 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
2019-03-18 17:48:50 -06:00
Johannes Pfau
eea4e2ff0a mh-mingw: Also set __USE_MINGW_ACCESS flag for C++ code.
From-SVN: r269784
2019-03-18 22:36:56 +00:00
Joseph Myers
3d8ce9bab1 * sv.po: Update.
From-SVN: r269783
2019-03-18 21:36:44 +00:00
H.J. Lu
0bf09c3721 Add a test for PR c++/89630
PR c++/89630
	* g++.target/i386/pr89630.C: New test.

From-SVN: r269781
2019-03-18 14:22:30 -07:00
Ian Lance Taylor
a8b58d84bf libgo: update to Go 1.12.1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/167749

From-SVN: r269780
2019-03-18 20:27:59 +00:00
Kito Cheng
891cd9e3b9 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
2019-03-18 12:45:20 -07:00
Jason Merrill
7834e5a0e1 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
2019-03-18 15:37:00 -04:00
Jason Merrill
d849cfaeea 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
2019-03-18 15:35:12 -04:00
Jason Merrill
6e3587dbbc 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
2019-03-18 15:34:47 -04:00
Segher Boessenkool
5a1d5d6a8e 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
2019-03-18 18:46:18 +01:00
Segher Boessenkool
0a6d5a9e3e 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
2019-03-18 18:44:56 +01:00
Segher Boessenkool
b2ebe97358 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
2019-03-18 18:43:34 +01:00
Thomas Koenig
3051b25e66 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
2019-03-18 17:35:54 +00:00
Jason Merrill
b6e45a40cd 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
2019-03-18 11:58:24 -04:00
Richard Biener
ca6d4a08c1 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
2019-03-18 13:59:11 +00:00
Andrew Stubbs
f9cacebbde 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
2019-03-18 13:13:27 +00:00
Richard Sandiford
c57546fe94 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
2019-03-18 12:25:32 +00:00
Martin Jambor
cfce6e055d 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
2019-03-18 12:28:01 +01:00
Andrew Burgess
4d7dfada89 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
2019-03-18 10:42:53 +00:00
Paolo Carlini
e6da0bf1f1 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
2019-03-18 09:38:27 +00:00
Claudiu Zissulescu
f5d56cf957 [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
2019-03-18 10:28:45 +01:00
Claudiu Zissulescu
a094796050 [ARC] Fix tst_movb pattern.
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

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

From-SVN: r269757
2019-03-18 10:28:33 +01:00
Claudiu Zissulescu
8e95721a29 [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
2019-03-18 10:28:22 +01:00
Claudiu Zissulescu
864e2eaa39 [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
2019-03-18 10:28:11 +01:00
Richard Biener
7d7d1ce838 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
2019-03-18 09:17:43 +00:00
Richard Biener
0538ed1d36 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
2019-03-18 09:16:56 +00:00
Jakub Jelinek
1d24f24c6a 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
2019-03-18 09:31:41 +01:00
Andrey Belevantsev
4e3f3c46d7 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
2019-03-18 10:51:06 +03:00
Thomas Koenig
7e703f019b 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
2019-03-18 07:28:42 +00:00
GCC Administrator
af52cce0af Daily bump.
From-SVN: r269749
2019-03-18 00:16:19 +00:00
Jason Merrill
bbee94aa67 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
2019-03-17 16:07:26 -04:00
John David Anglin
ad0a3085d7 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
2019-03-17 19:37:00 +00:00
John David Anglin
d09f61a9a6 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
2019-03-17 19:16:53 +00:00
John David Anglin
3147bc6ccc 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
2019-03-17 18:24:14 +00:00
John David Anglin
712fee7a92 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
2019-03-17 17:59:03 +00:00
GCC Administrator
f5a18efc36 Daily bump.
From-SVN: r269737
2019-03-17 00:16:13 +00:00
Jakub Jelinek
985a72168a 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
2019-03-16 22:18:49 +01:00
John David Anglin
0581f5b2ad Fix type in last change.
From-SVN: r269733
2019-03-16 18:23:48 +00:00
John David Anglin
3b7f728384 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
2019-03-16 18:10:31 +00:00
John David Anglin
733a21e171 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
2019-03-16 17:48:14 +00:00
John David Anglin
3c390eda35 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
2019-03-16 17:31:30 +00:00
John David Anglin
38ea73a8c1 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
2019-03-16 17:08:43 +00:00
John David Anglin
cdff635634 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
2019-03-16 16:39:49 +00:00
John David Anglin
3b1cba4679 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
2019-03-16 15:44:25 +00:00
John David Anglin
8c8d4d29c1 target-supports.exp (check_ascii_locale_available): Remove hppa*-*-hpux*.
* lib/target-supports.exp (check_ascii_locale_available): Remove
	hppa*-*-hpux*.

From-SVN: r269726
2019-03-16 15:18:36 +00:00
Thomas Koenig
fbf1cec7a4 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
2019-03-16 11:50:03 +00:00