Commit Graph

172605 Commits

Author SHA1 Message Date
Tobias Burnus
a2c26c5031 Fortran] Support absent optional args with use_device_{ptr,addr}
2019-11-11  Tobias Burnus  <tobias@codesourcery.com>
            Kwok Cheung Yeung  <kcy@codesourcery.com>

        gcc/
        * langhooks-def.h (LANG_HOOKS_OMP_CHECK_OPTIONAL_ARGUMENT):
        Renamed from LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT; update define.
        (LANG_HOOKS_DECLS): Rename also here.
        * langhooks.h (lang_hooks_for_decls): Rename
        omp_is_optional_argument to omp_check_optional_argument; take
        additional bool argument.
        * omp-general.h (omp_check_optional_argument): Likewise.
        * omp-general.h (omp_check_optional_argument): Likewise.
        * omp-low.c (lower_omp_target): Update calls; handle absent
        Fortran optional arguments with USE_DEVICE_ADDR/USE_DEVICE_PTR.

        gcc/fortran/
        * trans-expr.c (gfc_conv_expr_present): Check for DECL_ARTIFICIAL
        for the VALUE hidden argument avoiding -fallow-underscore issues.
        * trans-decl.c (create_function_arglist): Also set
        GFC_DECL_OPTIONAL_ARGUMENT for per-value arguments.
        * f95-lang.c (LANG_HOOKS_OMP_CHECK_OPTIONAL_ARGUMENT):
        Renamed from LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT; point
        to gfc_omp_check_optional_argument.
        * trans.h (gfc_omp_check_optional_argument): Subsitutes
        gfc_omp_is_optional_argument declaration.
        * trans-openmp.c (gfc_omp_is_optional_argument): Make static.
        (gfc_omp_check_optional_argument): New function.

        libgomp/
        * testsuite/libgomp.fortran/use_device_ptr-optional-1.f90: Extend.
        * testsuite/libgomp.fortran/use_device_ptr-optional-2.f90: New.


Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com>

From-SVN: r278046
2019-11-11 10:19:29 +01:00
Thomas Schwinge
bfa1837b01 Torture testing: 'libgomp.fortran/target9.f90'
libgomp/
	* testsuite/libgomp.fortran/target9.f90: Specify 'dg-do run'.

From-SVN: r278045
2019-11-11 09:50:40 +01:00
Thomas Schwinge
6d4868f3a1 Torture testing: 'libgomp.fortran/use_device_addr-3.f90', 'libgomp.fortran/use_device_addr-4.f90', 'libgomp.fortran/use_device_ptr-1.f90'
libgomp/
	* testsuite/libgomp.fortran/use_device_addr-3.f90: Specify 'dg-do
	run'.
	* testsuite/libgomp.fortran/use_device_addr-4.f90: Likewise.
	* testsuite/libgomp.fortran/use_device_ptr-1.f90: Likewise.

From-SVN: r278044
2019-11-11 09:50:29 +01:00
H.J. Lu
ad65b42729 [PR87833] x86: Put -fPIC and -shared the last to create offload image
On x86, since -fPIC and -shared should be used to create offload image,
we put them the last to properly create offload image.

2019-11-11  H.J. Lu  <hjl.tools@gmail.com>

	PR target/87833
	* config/i386/intelmic-mkoffload.c (prepare_target_image): Put
	-fPIC and -shared the last to create offload image.

From-SVN: r278041
2019-11-11 09:38:28 +01:00
Thomas Schwinge
d9945c8842 Assert 'offset2' instead of 'offset' in 'gcc/gimplify.c:gimplify_scan_omp_clauses'
... to fix a long-time typo/copy'n'past-o.

	gcc/
	* gimplify.c (gimplify_scan_omp_clauses): Assert 'offset2' instead
	of 'offset'.

From-SVN: r278038
2019-11-11 09:18:46 +01:00
Thomas Schwinge
223bf296b2 [build] Properly track GCC language configure fragments
The 'gcc/configure' script sources all 'gcc/*/config-lang.in' files, but fails
to emit such dependency information into the build machinery.  That means,
currently, when something gets changed in a 'gcc/*/config-lang.in' file, this
is not noticed, and doesn't propagate through the build machinery.

Handling of configure fragments is modelled in the same way as it already
exists for Makefile fragments.

	gcc/
	* Makefile.in (LANG_CONFIGUREFRAGS): Define.
	(config.status): Use/depend on it.
	* configure.ac (all_lang_configurefrags): Track, 'AC_SUBST'.
	* configure: Regenerate.

From-SVN: r278035
2019-11-11 09:05:27 +01:00
Jiufu Guo
48f657953f rs6000: Refine small loop unroll in loop_unroll_adjust hook
In this patch, loop unroll adjust hook is introduced for powerpc.  We
can do target related heuristic adjustment in this hook.  In this patch,
-funroll-loops is enabled for small loops at O2 and above with an option
-munroll-small-loops to guard the small loops unrolling, and it works
fine with -flto.


gcc/
2019-11-11  Jiufu Guo  <guojiufu@linux.ibm.com>

	PR tree-optimization/88760
	* gcc/config/rs6000/rs6000.opt (-munroll-only-small-loops): New option.
	* gcc/common/config/rs6000/rs6000-common.c
	(rs6000_option_optimization_table) [OPT_LEVELS_2_PLUS_SPEED_ONLY]:
	Turn on -funroll-loops and -munroll-only-small-loops.
	[OPT_LEVELS_ALL]: Turn off -fweb and -frename-registers.
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Remove
	set of PARAM_MAX_UNROLL_TIMES and PARAM_MAX_UNROLLED_INSNS.
	Turn off -munroll-only-small-loops for explicit -funroll-loops.
	(TARGET_LOOP_UNROLL_ADJUST): Add loop unroll adjust hook.
	(rs6000_loop_unroll_adjust): Define it.  Use -munroll-only-small-loops.

gcc.testsuite/
2019-11-11  Jiufu Guo  <guojiufu@linux.ibm.com>

	PR tree-optimization/88760
	* gcc.dg/pr59643.c: Update back to r277550.

From-SVN: r278034
2019-11-11 06:30:38 +00:00
Kewen Lin
103cba80bd [rs6000] Make load cost a bit more in vectorization cost
To align with rs6000_insn_cost costing more for load type insns,
this patch is to make load insns cost more in vectorization cost
function.  The latency of load insns is about twice that of
"simple" instructions; 2 vs. 1 on older cores, and 4 (or so) vs.
2 on newer cores.  Considering that the result of load usually
is used somehow later (true-dep) but store won't, we keep the
store as before.

The SPEC2017 performance evaluation on Power8 shows 525.x264_r
+9.56%, 511.povray_r +2.08%, 527.cam4_r 1.16% gains, no 
significant degradation, SPECINT geomean +0.88%, SPECFP geomean
+0.26%.

The SPEC2017 performance evaluation on Power9 shows no significant
improvement or degradation, SPECINT geomean +0.04%, SPECFP geomean
+0.04%.

The SPEC2006 performance evaluation on Power8 shows 454.calculix
+4.41% gain but 416.gamess -1.19% and 453.povray -3.83% degradation.
I looked into the two degradation bmks, the degradation were NOT
due to hotspot changes by vectorization, were all side effects.
SPECINT geomean +0.10%, SPECFP geomean no changed considering
the degradation.

gcc/ChangeLog

2019-11-11  Kewen Lin  <linkw@gcc.gnu.org>

    * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Make
    scalar_load, vector_load, unaligned_load and vector_gather_load cost
    more to conform hardware latency and insn cost settings.

From-SVN: r278033
2019-11-11 05:08:20 +00:00
GCC Administrator
4b41bff297 Daily bump.
From-SVN: r278032
2019-11-11 00:16:18 +00:00
Iain Sandoe
34548764c2 [Darwin, machopic 11/n] A flag to indicate synbols should be linker-visible.
Some of the solution to PR71767 is incomplete, and we need finer-grained
control over whether symbols need to be made linker-visible.  This is a
preparation patch, providing the flag.

gcc/ChangeLog:

2019-11-10  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.h (MACHO_SYMBOL_FLAG_LINKER_VIS): New.
	(MACHO_SYMBOL_LINKER_VIS_P): New.

From-SVN: r278028
2019-11-10 21:48:27 +00:00
Janne Blomqvist
15471d58fe Don't print warning when moving to static with -fno-automatic
As part of PR 91413, GFortran now prints a warning when a variable is
moved from the stack to static storage. However, when the user
explicitly specifies that all local variables should be put in static
storage with the -fno-automatic option, don't print this warning.

Regtested on x86_64-pc-linux-gnu, committed as obvious.

gcc/fortran/ChangeLog:

2019-11-10  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/91413
	* trans-decl.c (gfc_finish_var_decl): Don't print warning when
	-fno-automatic is enabled.

From-SVN: r278027
2019-11-10 23:25:25 +02:00
Jason Merrill
2806ecbdc8 Implement D1957R0, T* to bool should be considered narrowing.
This paper was delayed until the February meeting in Prague so that we could
get a better idea of what the impact on existing code would actually be.  To
that end, I'm implementing it now.

	* typeck2.c (check_narrowing): Treat pointer->bool as a narrowing
	conversion with -std=c++2a.

From-SVN: r278026
2019-11-10 15:30:03 -05:00
Paul Thomas
0313a84a2f re PR fortran/92123 ([F2018/array-descriptor] Scalar allocatable/pointer with array descriptor (via bind(C)): ICE with select rank or error scalar variable with POINTER or ALLOCATABLE in procedure with BIND(C) is not yet supported)
2019-11-10  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/92123
	*decl.c (gfc_verify_c_interop_param): Remove error asserting
	that pointer or allocatable variables in a bind C procedure are
	not supported. Delete some trailing spaces.
	* trans-stmt.c (trans_associate_var): Correct the attempt to
	treat scalar pointer or allocatable temporaries as if they are
	array descriptors.

2019-11-10  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/92123
	* gfortran.dg/bind_c_procs_3.f90 : New test.
	* gfortran.dg/ISO_Fortran_binding_15.c : New test.
	* gfortran.dg/ISO_Fortran_binding_15.f90 : Additional source.

From-SVN: r278025
2019-11-10 18:33:00 +00:00
Kwok Cheung Yeung
4b77a3806c [LRA] Do not use eliminable registers for spilling
The liveness of eliminable hard registers is not tracked by LRA between
basic blocks, so they should not be used as spill registers as LRA may
decide to allocate them to pseudos while the spilled value is still live.

2019-11-10  Kwok Cheung Yeung  <kcy@codesourcery.com>

	gcc/
	* lra-spills.c (assign_spill_hard_regs): Do not spill into
	registers in eliminable_regset.

From-SVN: r278024
2019-11-10 18:22:38 +00:00
Jan Hubicka
b535138846 Manually CSE sreal frequency calculations
* ipa-inline.c (compute_uninlined_call_time,
	compute_inlined_call_time): Take edge frequency as
	parameter rather than computing it by itself.
	(big_speedup_p, edge_badness): Manually CSE sreal
	frequency calculations.

From-SVN: r278023
2019-11-10 18:18:00 +00:00
Jan Hubicka
65eaab18b1 Short circuit case where profiles are same.
* profile-count.c (profile_count::to_sreal_scale): Short circuit
	case where profiles are same.

From-SVN: r278022
2019-11-10 18:15:34 +00:00
Jan Hubicka
d07f74faa6 * cgraph.c (cgraph_edge::maybe_hot_p): Do not use sreal_frequency.
From-SVN: r278021
2019-11-10 18:10:51 +00:00
Jan Hubicka
d40e2362bb ipa-prop.c (ipa_propagate_indirect_call_infos): Remove ipa edge args summaries of inlined edge unless...
* ipa-prop.c (ipa_propagate_indirect_call_infos): Remove ipa edge
	args summaries of inlined edge unless it holds info about
	described reference.

From-SVN: r278020
2019-11-10 15:44:13 +00:00
Gerald Pfeifer
7901a85f3c Switch www.hboehm.info to https
* doc/xml/manual/using.xml: Switch www.hboehm.info to https.

From-SVN: r278019
2019-11-10 13:37:26 +00:00
Segher Boessenkool
7964e40de3 rs6000: Allow any CC mode in movcc
Sometimes combine wants to do a move in CCFPmode, but we don't currently
handle moves in any CC mode other than CCmode.  Fix that oversight.


	* config/rs6000/rs6000.md (CC_any): New mode iterator.
	(*movcc_internal1): Rename to...
	(*movcc_<mode> for CC_any): ... this.  Support moves of all CC modes.

From-SVN: r278017
2019-11-10 12:53:31 +01:00
Jan Hubicka
6cf67b62c8 cgraph.h (struct cgraph_node): Add ipcp_clone flag.
* cgraph.h (struct cgraph_node): Add ipcp_clone flag.
	(cgraph_node::create_virtual_clone): Copy it.
	* ipa-cp.c (ipcp_versionable_function_p): Watch for missing
	summaries.
	(ignore_edge_p): If caller has ipa-cp disabled, skip the edge, too.
	(ipcp_verify_propagated_values): Do not verify nodes where ipcp
	is disabled.
	(propagate_constants_across_call): If callee is not analyzed, give up.
	(propagate_constants_topo): Lower to bottom latties of all callees of
	functions with ipa-cp disabled.
	(ipcp_propagate_stage): Skip functions with ipa-cp disabled.
	(cgraph_edge_brings_value_p): Check for availability first.
	(create_specialized_node): Set ipcp_clone.
	(ipcp_store_bits_results): Check that info is present.
	* ipa-fnsummary.c (evaluate_properties_for_edge): Do not analyze
	thunks.
	(ipa_call_context::duplicate_from, ipa_call_context::equal_to): Be
	conservative when callee summary is missing.
	(remap_edge_summaries): Lookup call summary only when needed.
	* ipa-icf.c (sem_function::param_used_p): Be ready for missing summary.
	* ipa-prpo.c (ipa_alloc_node_params, ipa_initialize_node_params):
	Use get_create.
	(ipa_analyze_node): Use get_create.
	(propagate_controlled_uses): Do not propagate when function is not
	analyzed.
	(ipa_propagate_indirect_call_infos): Remove summary of inline clone.
	(ipa_read_node_info): Use get_create.
	* ipa-prop.h (IPA_NODE_REF): Use get.
	(IPA_NODE_REF_GET_CREATE): New.

From-SVN: r278016
2019-11-10 11:25:38 +00:00
GCC Administrator
64166bf04b Daily bump.
From-SVN: r278013
2019-11-10 00:16:22 +00:00
Jan Hubicka
2ee6e04aae ipa-fnsummary.c (evaluate_properties_for_edge): Call IPA_NODE_REF on function symbol.
* ipa-fnsummary.c (evaluate_properties_for_edge): Call IPA_NODE_REF
	on function symbol.
	* gcc.dg/tree-ssa/pr46076.c: Make tested code hot.

From-SVN: r278009
2019-11-09 21:35:35 +00:00
Jan Hubicka
7b22b7cece tree.c (fld_incomplete_type_of): Clear TYPE_FINAL_P, TYPE_EMPTY_P, ENUM_IS_OPAQUE and ENUM_IS_SCOPED.
* tree.c (fld_incomplete_type_of): Clear TYPE_FINAL_P, TYPE_EMPTY_P,
	ENUM_IS_OPAQUE and ENUM_IS_SCOPED.
	(free_lang_data_in_binfo): Clear TREE_PUBLIC in BINFO
	(free_lang_data_in_type): Clear ENUM_IS_OPAQUE and ENUM_IS_SCOPED.

From-SVN: r278008
2019-11-09 21:33:55 +00:00
Jan Hubicka
49d9c9d283 ipa-inline-analysis.c (do_estimate_growth_1): Add support for capping the growth cumulated.
* ipa-inline-analysis.c (do_estimate_growth_1): Add support for
	capping the growth cumulated.
	(offline_size): Break out from ...
	(estimate_growth): ... here.
	(check_callers): Add N, OFFLINE and MIN_SIZE and KNOWN_EDGE
	parameters.
	(growth_likely_positive): Turn to ...
	(growth_positive_p): Re-implement.
	* ipa-inline.h (growth_likely_positive): Remove.
	(growth_positive_p): Declare.
	* ipa-inline.c (want_inline_small_function_p): Use
	growth_positive_p.
	(want_inline_function_to_all_callers_p): Likewise.

From-SVN: r278007
2019-11-09 17:52:56 +00:00
Jan Hubicka
e3bd08dde1 ipa-fnsummary.c (ipa_call_context::estimate_size_and_time): Fix calculation of min_size.
* ipa-fnsummary.c (ipa_call_context::estimate_size_and_time): Fix
	calculation of min_size.
	(ipa_update_overall_fn_summary): Likewise.

From-SVN: r278006
2019-11-09 17:45:29 +00:00
Jan Hubicka
83263ef536 ipa-fnsummary.c (estimate_edge_size_and_time): Do not call estimate_edge_devirt_benefit when not computing hints...
* ipa-fnsummary.c (estimate_edge_size_and_time): Do not call
	estimate_edge_devirt_benefit when not computing hints;
	do not compute time when not asked for.
	(estimate_calls_size_and_time): Pass NULL hints and time when
	these are not computed; do not evaluate hint predicates when these are
	not computed.
	(ipa_merge_fn_summary_after_inlining): Do not re-evaluate edge
	frequency.

From-SVN: r278005
2019-11-09 17:37:38 +00:00
Jakub Jelinek
c47bee97fa re PR tree-optimization/92401 (ICE in fold_ternary_loc, at fold-const.c:11698)
PR tree-optimization/92401
	* gimple-match-head.c (gimple_resimplify1): Call const_unop only
	if res_op->code is an expression with code length 1.
	* gimple-match-head.c (gimple_resimplify2): Call const_binop only
	if res_op->code is an expression with code length 2.
	* gimple-match-head.c (gimple_resimplify3): Call fold_ternary only
	if res_op->code is an expression with code length 3.

	* g++.dg/opt/pr92401.C: New test.

From-SVN: r278004
2019-11-09 18:09:44 +01:00
Thomas Koenig
b03932cb99 Commit symbol for external BLAS routine when translating MATMUL to *GEMM.
2019-11-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/92321
	* frontend-passes.c (call_external_blas): Commit symbol for
	external BLAS routine.

2019-11-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/92321
	* gfortran.dg/matmul_blas_2.f90: New test.

From-SVN: r278003
2019-11-09 14:54:19 +00:00
Iain Sandoe
95cc59f17b [Darwin, machopic 10/n] Rework X86 mcount stub code.
When a stub is used to call the mcount function, the code is already
marking it as used unconditionally;  This is the only use of the so-
called validation outside darwin.{h,c}.  This moves the 'validation'
into darwin.c which is a step towards making validation routine local.

gcc/

2019-11-09  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_mcount_stub_name): Validate the
	symbol stub name when it is created.
	* config/i386/darwin.h (FUNCTION_PROFILER): Remove the symbol
	stub validation.

From-SVN: r278000
2019-11-09 13:43:04 +00:00
GCC Administrator
038d7e1b19 Daily bump.
From-SVN: r277999
2019-11-09 00:16:19 +00:00
Jakub Jelinek
dfea3d6fde symtab.c: Fix comment typos.
* symtab.c: Fix comment typos.
	* cgraphunit.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphclones.c: Likewise.
	* cgraph.c: Likewise.
	* varpool.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* ipa-sra.c: Likewise.
	(scan_expr_access, check_all_callers_for_issues): Fix typo
	in a dump message.

From-SVN: r277995
2019-11-09 00:56:37 +01:00
Jakub Jelinek
a63d6356be dec_char_conversion_in_assignment_4.f90: Use dg-do compile instead of dg-do run.
* gfortran.dg/dec_char_conversion_in_assignment_4.f90: Use
	dg-do compile instead of dg-do run.
	* gfortran.dg/dec_char_conversion_in_data_3.f90: Likewise.

From-SVN: r277994
2019-11-09 00:55:45 +01:00
Iain Sandoe
9342ec4d7b [Darwin] Add include guard to darwin-protos.h
The Darwin protos header is missing an include guard, this adds one.

gcc/ChangeLog:

2019-11-08  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin-protos.h: Add include quard.

From-SVN: r277993
2019-11-08 22:09:30 +00:00
Marek Polacek
65471f09e9 PR c++/92215 - flawed diagnostic for bit-field with non-integral type.
I noticed that for code like

  struct S {
    int *foo : 3;
  };

we generate nonsensical

  r.C:2:8: error: function definition does not declare parameters
      2 |   int *foo : 3;

It talks about a function because after parsing the declspecs of 'foo' we don't
see either ':' or "name :", so we think it's not a bit-field decl.  So we parse
the declarator and since a ctor-initializer begins with a ':', we try to parse
it as a function body, generating the awful diagnostic.  With this patch, we
issue:

  r.C:2:8: error: bit-field ‘foo’ has non-integral type ‘int*’
      2 |   int *foo : 3;

	* parser.c (cp_parser_member_declaration): Add a diagnostic for
	bit-fields with non-integral types.

	* g++.dg/diagnostic/bitfld4.C: New test.

From-SVN: r277991
2019-11-08 21:48:47 +00:00
Marek Polacek
a2dbbda892 PR c++/92058 - constinit malfunction in static data member.
* g++.dg/cpp2a/constinit15.C: New test.

From-SVN: r277990
2019-11-08 21:40:45 +00:00
Andrew MacLeod
bb74ef9e8c Modify range_operator::fold_range() and wi_fold () to return via reference.
2019-11-08  Andrew MacLeod <amacleod@redhat.com>

	* range-op.h (range_operator::fold_range): Return result in a
	reference parameter instead of by value.
	(range_operator::wi_fold): Same.
	* range-op.cc (range_operator::wi_fold): Return result in a reference
	parameter instead of by value.
	(range_operator::fold_range): Same.
	(value_range_from_overflowed_bounds): Same.
	(value_range_with_overflow): Same
	(create_possibly_reversed_range): Same.
	(operator_equal::fold_range): Same.
	(operator_not_equal::fold_range): Same.
	(operator_lt::fold_range): Same.
	(operator_le::fold_range): Same.
	(operator_gt::fold_range): Same.
	(operator_ge::fold_range): Same.
	(operator_plus::wi_fold): Same.
	(operator_plus::op1_range): Change call to fold_range.
	(operator_plus::op2_range): Change call to fold_range.
	(operator_minus::wi_fold): Return result via reference parameter.
	(operator_minus::op1_range): Change call to fold_range.
	(operator_minus::op2_range): Change call to fold_range.
	(operator_min::wi_fold): Return result via reference parameter.
	(operator_max::wi_fold): Same.
	(cross_product_operator::wi_cross_product): Same.
	(operator_mult::wi_fold): Same.
	(operator_div::wi_fold): Same.
	(operator_div op_floor_div): Fix whitespace.
	(operator_exact_divide::op1_range): Change call to fold_range.
	(operator_lshift::fold_range): Return result via reference parameter.
	(operator_lshift::wi_fold): Same.
	(operator_rshift::fold_range): Same.
	(operator_rshift::wi_fold): Same.
	(operator_cast::fold_range): Same.
	(operator_cast::op1_range): Change calls to fold_range.
	(operator_logical_and::fold_range): Return result via reference.
	(wi_optimize_and_or): Adjust call to value_range_with_overflow.
	(operator_bitwise_and::wi_fold): Return result via reference.
	(operator_logical_or::fold_range): Same.
	(operator_bitwise_or::wi_fold): Same.
	(operator_bitwise_xor::wi_fold): Same.
	(operator_trunc_mod::wi_fold): Same.
	(operator_logical_not::fold_range): Same.
	(operator_bitwise_not::fold_range): Same.
	(operator_bitwise_not::op1_range): Change call to fold_range.
	(operator_cst::fold_range): Return result via reference.
	(operator_identity::fold_range): Same.
	(operator_abs::wi_fold): Same.
	(operator_absu::wi_fold): Same.
	(operator_negate::fold_range): Same.
	(operator_negate::op1_range): Change call to fold_range.
	(operator_addr_expr::fold_range): Return result via reference.
	(operator_addr_expr::op1_range): Change call to fold_range.
	(operator_pointer_plus::wi_fold): Return result via reference.
	(operator_pointer_min_max::wi_fold): Same.
	(operator_pointer_and::wi_fold): Same.
	(operator_pointer_or::wi_fold): Same.
	(range_op_handler): Change call to fold_range.
	(range_cast): Same.
	* tree-vrp.c (range_fold_binary_symbolics_p): Change call to
	fold_range.
	(range_fold_unary_symbolics_p): Same.
	(range_fold_binary_expr): Same.
	(range_fold_unary_expr): Same.

From-SVN: r277979
2019-11-08 17:51:40 +00:00
Jakub Jelinek
77b29023e1 * arith.c (character2representation): Change i type to size_t.
From-SVN: r277978
2019-11-08 17:48:41 +01:00
Richard Sandiford
d308ca27c7 Use correct vector type in neutral_op_for_slp_reduction
With the new reduction vectype handling, neutral_op_for_slp_reduction
needs to know whether the caller is using STMT_VINFO_REDUC_VECTYPE
(for an epilogue value) or STMT_VINFO_VECTYPE (for a PHI argument).

This fixes various gcc.target/aarch64/sve/slp_* tests.

2019-11-08  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vect-loop.c (neutral_op_for_slp_reduction): Take the
	vector type as an argument rather than reading it from the
	stmt_vec_info.
	(vect_create_epilog_for_reduction): Update accordingly.
	(vectorizable_reduction): Likewise.
	(vect_transform_cycle_phi): Likewise.

From-SVN: r277977
2019-11-08 16:08:03 +00:00
Segher Boessenkool
fd14d6cbc4 rs6000: Fix branch_comparison_operator
* config/rs6000/predicates.md (branch_comparison_operator): Allow only
	the comparison codes that make sense for the mode used, and only the
	codes that can be done with a single branch instruction.

From-SVN: r277976
2019-11-08 15:53:42 +01:00
Mark Eggleston
2afeb1ca38 Allow CHARACTER literals in assignments and data statements.
Allows character literals to used to assign values to non-character variables
in the same way that Hollerith constants are used. In addition character
literals can be used in data statements just like Hollerith constants.

Warnings of such use are output to discourage this usage as it is a non-standard
legacy feature and must be explicitly enabled.
 
Enabled by -fdec and -fdec-char-conversions.


Co-Authored-By: Jim MacArthur <jim.macarthur@codethink.co.uk>

From-SVN: r277975
2019-11-08 14:28:57 +00:00
Andre Vieira
4e9d58d167 [vect] PR 92351: When peeling for alignment make alignment of epilogues unknown
gcc/ChangeLog:
2019-11-08  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	PR tree-optimization/92351
	* tree-vect-data-refs.c (vect_compute_data_ref_alignment): When we are
	peeling the main loop for alignment, make sure to set the misalignment
	of the epilogue's data references to DR_MISALIGNMENT_UNKNOWN.

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

	PR tree-optimization/92351
	* gcc.dg/vect/vect-peel-2.c: Disable epilogue vectorization and
	split the source of this test to...
	* gcc.dg/vect/vect-peel-2-src.c: ... This.
	* gcc.dg/vect/vect-peel-2-epilogues.c: New test.

From-SVN: r277974
2019-11-08 13:52:56 +00:00
Richard Biener
14df3a17aa dbgcnt.def (ivopts_loop): Add.
2019-11-08  Richard Biener  <rguenther@suse.de>

	* dbgcnt.def (ivopts_loop): Add.
	* tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize): Check
	ivopts_loop before optimizing a loop.

From-SVN: r277973
2019-11-08 13:16:28 +00:00
Richard Biener
e7399b548c re PR ipa/92409 (r277920 causes ICE in gcc.dg/cast-function-1.c)
2019-11-08  Richard Biener  <rguenther@suse.de>

	PR ipa/92409
	* tree-inline.c (declare_return_variable): Properly handle
	type mismatches for the return slot.

From-SVN: r277972
2019-11-08 13:15:40 +00:00
Eric Botcazou
03a05fd35a overflow-1.c: Add -fno-pie to the options.
* gcc.target/sparc/overflow-1.c: Add -fno-pie to the options.
	* gcc.target/sparc/overflow-2.c: Likewise.

From-SVN: r277969
2019-11-08 12:45:24 +00:00
Eric Botcazou
0a83f1a441 re PR target/92095 (internal error with -O1 -mcpu=niagara2 -fPIE)
PR target/92095
	* config/sparc/sparc-protos.h (output_load_pcrel_sym): Declare.
	* config/sparc/sparc.c (sparc_cannot_force_const_mem): Revert latest
 	change.
	(got_helper_needed): New static variable.
	(output_load_pcrel_sym): New function.
	(get_pc_thunk_name): Remove after inlining...
	(load_got_register): ...here.  Rework the initialization of the GOT
	register and of the GOT helper.
	(save_local_or_in_reg_p): Test the REGNO of the GOT register.
	(sparc_file_end): Test got_helper_needed to decide whether the GOT
	helper must be emitted.  Use output_asm_insn instead of fprintf.
	(sparc_init_pic_reg): In PIC mode, always initialize the PIC register
	if optimization is enabled.
	* config/sparc/sparc.md (load_pcrel_sym<P:mode>): Emit the assembly
	by calling output_load_pcrel_sym.

From-SVN: r277966
2019-11-08 12:30:47 +00:00
Richard Sandiford
93ace3af2c Fix code order in tree-sra.c:create_access
If get_ref_base_and_extent returns poly_int offsets or sizes,
tree-sra.c:create_access prevents SRA from being applied to the base.
However, we haven't verified by that point that we have a valid base
to disqualify.

This originally led to an ICE on the attached testcase, but it
no longer triggers there after the introduction of IPA SRA.

2019-11-08  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-sra.c (create_access): Delay disqualifying the base
	for poly_int values until we know we have a base.

gcc/testsuite/
	* gcc.target/aarch64/sve/acle/general/inline_2.c: New test.

From-SVN: r277965
2019-11-08 11:58:45 +00:00
Andre Vieira
b602712b3e [vect] Disable vectorization of epilogues for loops with SIMDUID set
gcc/ChangeLog:
2019-11-08  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* tree-vect-loop.c (vect_analyze_loop): Disable epilogue vectorization
	for loops with SIMDUID set.  Enable epilogue vectorization for loops
	with SIMDLEN set after finding a main loop with a VF that matches it.

From-SVN: r277964
2019-11-08 11:30:50 +00:00
Jakub Jelinek
5384a80270 re PR target/92038 (Extremely inefficient x86_64 code for trivally copyable types passed in registers.)
PR target/92038
	* gimple-ssa-store-merging.c (find_constituent_stores): For return
	value only, return non-NULL if there is a single non-clobber
	constituent store even if there are constituent clobbers and return
	one of clobber constituent stores if all constituent stores are
	clobbers.
	(split_group): Handle clobbers.
	(imm_store_chain_info::output_merged_store): When computing
	bzero_first, look after all clobbers at the start.  Don't count
	clobber stmts in orig_num_stmts, except if the first orig store is
	a clobber covering the whole area and split_stores cover the whole
	area, consider equal number of stmts ok.  Punt if split_stores
	contains only ->orig stores and their number plus number of original
	clobbers is equal to original number of stmts.  For ->orig, look past
	clobbers in the constituent stores.
	(imm_store_chain_info::output_merged_stores): Don't remove clobber
	stmts.
	(rhs_valid_for_store_merging_p): Don't return false for clobber stmt
	rhs.
	(store_valid_for_store_merging_p): Allow clobber stmts.
	(verify_clear_bit_region_be): Fix up a thinko in function comment.

	* g++.dg/opt/store-merging-1.C: New test.
	* g++.dg/opt/store-merging-2.C: New test.
	* g++.dg/opt/store-merging-3.C: New test.

From-SVN: r277963
2019-11-08 11:53:50 +01:00
Jakub Jelinek
aea86742ce re PR middle-end/92384 (Empty class instances have different equal testing result among GCC versions)
PR c++/92384
	* function.c (assign_parm_setup_block, assign_parm_setup_stack): Don't
	copy TYPE_EMPTY_P arguments from data->entry_parm to data->stack_parm
	slot.
	(assign_parms): For TREE_ADDRESSABLE parms with TYPE_EMPTY_P type
	force creation of a unique data.stack_parm slot.

	* g++.dg/torture/pr92384.C: New test.

From-SVN: r277962
2019-11-08 11:52:50 +01:00