Commit Graph

172963 Commits

Author SHA1 Message Date
Jan Hubicka
d2bcf46cd0 Incremental updating of inline summaries.
* ipa-fnsummary.c (ipa_fn_summary::account_size_time): Allow
	negative time in calls summary; correct roundoff errors
	leading to negative times.
	(ipa_merge_fn_summary_after_inlining): Update calls size time table
	if present.
	(ipa_update_overall_fn_summary): Add RESET parameter.
	* ipa-fnsummary.h (ipa_update_overall_fn_summary): Update prototype.
	* ipa-inline-transform.c (inline_call): Enable incremental updates.

From-SVN: r278541
2019-11-21 08:03:01 +00:00
Ian Lance Taylor
b4b7464b57 re PR go/92605 (r278509 causes/reveals issue in building go library)
PR go/92605
    runtime: declare runtime_usestackmaps in stack.c, not runtime.h
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/208161

From-SVN: r278540
2019-11-21 01:06:47 +00:00
Ian Lance Taylor
025f56b7d3 mksysinfo: use type aliases for time struct field types
Also fix a case where grep wasn't redirecting to /dev/null.
    
    Fixes golang/go#35713
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/208160

From-SVN: r278539
2019-11-21 01:03:55 +00:00
Jakub Jelinek
b69d4d4542 re PR c++/90842 (ICE in poplevel, at cp/decl.c:585)
PR c++/90842
	* parser.c (cp_parser_decl_specifier_seq): For concept or typedef
	break early if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
	For type specifiers, set CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS
	if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR is set.

	* g++.dg/cpp1y/lambda-generic-90842.C: New test.

Co-Authored-By: Jason Merrill <jason@redhat.com>

From-SVN: r278538
2019-11-21 02:00:43 +01:00
GCC Administrator
f0a2c2c89c Daily bump.
From-SVN: r278537
2019-11-21 00:16:35 +00:00
Marek Polacek
3697264c3a Add test for PR c++/92443.
* g++.dg/cpp0x/constexpr-92443.C: New test.

From-SVN: r278534
2019-11-20 22:59:20 +00:00
Richard Sandiford
0f6e9b2946 Restore stmt def types after scheduling two-operation SLP
2019-11-20  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vect-slp.c (vect_schedule_slp_instance): Restore stmt
	def types for two-operation SLP.

From-SVN: r278533
2019-11-20 21:15:54 +00:00
Richard Sandiford
28cebdb178 Restrict bb-slp-40.c to targets with VnQI addition (PR 92366)
bb-slp-40.c fails on SPARC targets without VIS4 because it
requires addition on vectors of bytes.  There doesn't seem to be
an existing target selector for this, so I added vect_char_add.
(Wasn't sure whether to use vect_char_add, for consistency
with vect_no_int_add/vect_int_mult etc., or vect_add_char for
consistency with vect_shift_char etc.)

I took the target list from vect_int and removed targets that didn't
seem to support the operation (namely sparc*, since we don't seem to
have any test for VIS4, niagara7 or m8, and alpha*-*-*.)

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

gcc/
	PR testsuite/92366
	* doc/sourcebuild.texi (vect_char_add): Document.

gcc/testsuite/
	PR testsuite/92366
	* lib/target-supports.exp (check_effective_target_vect_char_add):
	New proc.
	* gcc.dg/vect/bb-slp-40.c: Require vect_char_add instead of vect_int.

From-SVN: r278532
2019-11-20 21:13:05 +00:00
Richard Sandiford
be12e7c726 Adjust expected output for bb-slp-21.c (PR 92527)
After r278246, we can try building the out[] store value from scalars
if the target has no multiplication support.  That's not necessarily
a good thing, but like most of vect/, this test is run with the cost
model disabled.

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

gcc/testsuite/
	PR testsuite/92527
	* gcc.dg/vect/bb-slp-21.c: Expect both SLP groups to be vectorized,
	regardless of whether the target supports multiplication.

From-SVN: r278531
2019-11-20 21:08:52 +00:00
Paolo Carlini
df2653441a typeck2.c (build_x_arrow): Early return if decay_conversion returns error_mark_node.
/gcc
2019-11-20  Paolo Carlini  <paolo.carlini@oracle.com>

	* typeck2.c (build_x_arrow): Early return if decay_conversion
	returns error_mark_node.

/testsuite
2019-11-20  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/parse/error43.C: Adjust expected error.

From-SVN: r278530
2019-11-20 21:03:05 +00:00
Alexandre Oliva
c013852d61 drop attempt to reuse cgraph callees for -fcallgraph-info
The information in cgraph callees is released long before we get to
the point in which -fcallgraph-info edges are dumped, or even
expanded.  It doesn't make sense to retain it longer: the edges
created for -fcallgraph-info are much smaller, and they don't even
coexist, so not even peak use grows.


for  gcc/ChangeLog

	* function.h (CALLEE_FROM_CGRAPH_P): Remove.
	* function.c (record_final_call): Record even calls that might
	have been in the cgraph.
	* toplev.c (dump_final_node_vcg): Skip iteration over cgraph
	callees.

From-SVN: r278529
2019-11-20 20:54:31 +00:00
Janne Blomqvist
aeebd94c77 Switch gcc ftp URL's to https
The FTP protocol is getting long in the tooth, and we should emphasize
HTTPS where that is available. This patch changes various gcc.gnu.org
URL's to instead use HTTPS.

For instance, kernel.org shut down FTP access in 2017, with the
explanation:

- The protocol is inefficient and requires adding awkward kludges to
  firewalls and load-balancing daemons
- FTP servers have no support for caching or accelerators, which has
  significant performance impacts
- Most software implementations have stagnated and see infrequent
  updates

ChangeLog:

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

        * configure.ac: Use https for gcc.gnu.org.
        * configure: Regenerated.

gcc/ChangeLog:

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

        * configure.ac: Use https for gcc.gnu.org.
        * configure: Regenerated.
        * doc/install.texi: Use https for gcc.gnu.org.
        * doc/sourcebuild.texi: Likewise.

gcc/testsuite/ChangeLog:

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

        * README: Use https for gcc.gnu.org.

libstdc++-v3/ChangeLog:

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

        * doc/html/api.html: Use https for gcc.gnu.org.
        * doc/xml/api.xml: Likewise.

maintainer-scripts/ChangeLog:

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

        * gcc_release: Use https for gcc.gnu.org.

From-SVN: r278526
2019-11-20 22:24:48 +02:00
Janne Blomqvist
acb156cc31 PR 92463 MPFR modernization: Revert r269139
Commit r269139 fixed an accidental dependency on MPFR 3.0. As we now
require at least MPFR 3.1.0+ we can revert it and instead use the
simpler MPFR 3.0+ code.

ChangeLog entry of the original commit was:

2019-02-23  David Malcolm  <dmalcolm@redhat.com>
            Jakub Jelinek  <jakub@redhat.com>

        PR middle-end/88074
        * simplify.c (norm2_do_sqrt, gfc_simplify_norm2): Use
        mpfr_number_p && !mpfr_zero_p instead of mpfr_regular_p.
        (norm2_add_squared): Likewise.  Use mp_exp_t rather than mpfr_exp_t.

ChangeLog for this commit:

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

	PR fortran/92463
	Revert r269139
	* simplify.c (norm2_do_sqrt, gfc_simplify_norm2): Use
	mpfr_regular_p instead of mpfr_number_p && !mpfr_zero_p.
	(norm2_add_squared): Likewise.  Use mpfr_exp_t rather than
	mp_exp_t.

From-SVN: r278525
2019-11-20 22:08:29 +02:00
Janne Blomqvist
c9d4cc5df2 PR 92463 MPFR modernization in GFortran
Now that we require a minimum of MPFR 3.1.0+ to build GCC, we can do
some modernization of the MPFR usage in the GFortran frontend.

This patch replaces

1) GMP_RND* with MPFR_RND*

2) mp_exp_t with mpfr_exp_t

3) mp_prec_t with mpfr_prec_t

4) mp_rnd_t with mpfr_rnd_t

gcc/fortran/ChangeLog:

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

	PR fortran/92463
	* arith.c (gfc_mpfr_to_mpz): Change mp_exp_t to mpfr_exp_t.
	(gfc_check_real_range): Likewise.
	* gfortran.h (GFC_RND_MODE): Change GMP_RNDN to MPFR_RNDN.
	* module.c (mio_gmp_real): Change mp_exp_t to mpfr_exp_t.
	* simplify.c (degrees_f): Change mp_rnd_t to mpfr_rnd_t.
	(radians_f): Likewise.
	(fullprec_erfc_scaled): Change mp_prec_t to mpfr_prec_t.
	(asympt_erfc_scaled): Likewise.
	(gfc_simplify_nearest): Change mp_exp_t to mpfr_exp_t, and
	GMP_RND* to MPFR_RND*.

From-SVN: r278523
2019-11-20 22:01:25 +02:00
Wilco Dijkstra
64eb1c8239 [AArch64] Fix vrbit_1.c test failure
The vrbit_1 test which was missing a flag to disable code sharing.
Committed as obvious.

    testsuite/
	* gcc.target/aarch64/simd/vrbit_1.c: Add -fno-ipa-icf.

From-SVN: r278519
2019-11-20 17:58:39 +00:00
Julian Brown
9200b53af2 AMD GCN symbol output with null cfun
gcc/
	* config/gcn/gcn.c (gcn_asm_output_symbol_ref): Handle null cfun.

Reviewed-by: Andrew Stubbs <ams@codesourcery.com>

From-SVN: r278518
2019-11-20 17:58:30 +00:00
Julian Brown
d88b27daa1 AMD GCN libgomp plugin queue-full condition locking fix
libgomp/
	* plugin/plugin-gcn.c (wait_for_queue_nonfull): Don't lock/unlock
	aq->mutex here.
	(queue_push_launch): Lock aq->mutex before calling
	wait_for_queue_nonfull.
	(queue_push_callback): Likewise.
	(queue_push_asyncwait): Likewise.
	(queue_push_placeholder): Likewise.

Reviewed-by: Andrew Stubbs <ams@codesourcery.com>

From-SVN: r278517
2019-11-20 17:56:30 +00:00
Julian Brown
8d2f4ddfd7 Fix host-to-device copies from rodata for AMD GCN
libgomp/
	* plugin/plugin-gcn.c (hsa_memory_copy_wrapper): New.
	(copy_data, GOMP_OFFLOAD_host2dev): Use above function.
	(GOMP_OFFLOAD_dev2host, GOMP_OFFLOAD_dev2dev): Check hsa_memory_copy
	return code.

Reviewed-by: Andrew Stubbs <ams@codesourcery.com>

From-SVN: r278516
2019-11-20 17:53:31 +00:00
David Malcolm
56e0452513 jit: fix ICE with GCC_JIT_BOOL_OPTION_SELFCHECK_GC since r278084 (PR jit/92483)
Since r278084 (part of the params refactoring), most of libgccjit's
test suite has been ICEing.

The root cause is that jit-playback.c injects params to its fake_args
here:

  /* Aggressively garbage-collect, to shake out bugs: */
  if (get_bool_option (GCC_JIT_BOOL_OPTION_SELFCHECK_GC))
    {
      ADD_ARG ("--param");
      ADD_ARG ("ggc-min-expand=0");
      ADD_ARG ("--param");
      ADD_ARG ("ggc-min-heapsize=0");
    }

(building a vec of char * where the char * are allocated using xstrdup)

and r278084 added this logic to decode_cmdline_options_to_array:

964	      /* Interpret "--param" "key=name" as "--param=key=name".  */
965	      const char *needle = "--param";
966	      if (i + 1 < argc && strcmp (opt, needle) == 0)
967		{
968		  const char *replacement
969		    = opts_concat (needle, "=", argv[i + 1], NULL);
970		  argv[++i] = replacement;
971		}

Note that at line 970 it manipulates the argv in-place, inserting a
new option allocated with opts_concat, which uses opts_obstack
(itself initialized from toplev::main).

jit-playback.c cleans up its fake arguments using "free", at which
point we have a free of the middle of an obstack and an ICE.

This patch fixes the issue by using the new syntax for the params.

Fixes all 60 FAILs in jit.sum, restoring the number of PASS results
from 2033 to 10469.

gcc/jit/ChangeLog:
	PR jit/92483
	* jit-playback.c (gcc::jit::playback::context::make_fake_args):
	Update GCC_JIT_BOOL_OPTION_SELFCHECK_GC for new --param syntax.

From-SVN: r278515
2019-11-20 17:51:41 +00:00
Julian Brown
e307b05f43 OpenACC "present" subarrays: runtime API return value and unmapping fixes
PR libgomp/92511

	libgomp/
	* oacc-mem.c (present_create_copy): Fix device pointer return value in
	case of "present" subarray.  Use tgt->tgt_start instead of tgt->to_free
	in non-present/create case.
	(delete_copyout): Change error condition to fail only on copies outside
	of mapped block.  Adjust error message accordingly.
	* testsuite/libgomp.oacc-c-c++-common/copyin-devptr-1.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/copyin-devptr-2.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/lib-20.c: Adjust expected error
	message.
	* testsuite/libgomp.oacc-c-c++-common/lib-23.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-22.c: Allow test to pass now.
	* testsuite/libgomp.oacc-c-c++-common/lib-30.c: Likewise.

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>

From-SVN: r278514
2019-11-20 17:51:09 +00:00
Jan Hubicka
070e348967 Implement inline call summaries.
* ipa-fnsummary.c (ipa_fn_summary::account_size_time): Add CALL
	parameter and update call_size_time_table.
	(ipa_fn_summary::max_size_time_table_size): New constant.
	(estimate_calls_size_and_time_1): Break out from ...
	(estimate_calls_size_and_time): ... here; implement summary production.
	(summarize_calls_size_and_time): New function.
	(ipa_call_context::estimate_size_and_time): Bypass
	estimate_calls_size_and_time for leaf functions.
	(ipa_update_overall_fn_summary): Likewise.
	* ipa-fnsummary.h (call_size_time_table): New.
	(ipa_fn_summary::account_size_time): Update prototype.

From-SVN: r278513
2019-11-20 17:03:43 +00:00
Joseph Myers
73248b1d26 Document -Wc11-c2x-compat.
My patch that added initial C2X support and associated command-line
options missed documenting -Wc11-c2x-compat although the other options
were properly documented.  This patch adds the missing documentation.

Tested with "make info" and "make pdf".

	* doc/invoke.texi (-Wc11-c2x-compat): Document.

From-SVN: r278510
2019-11-20 16:38:37 +00:00
Wilco Dijkstra
6271dd984d PR85678: Change default to -fno-common
GCC currently defaults to -fcommon.  As discussed in the PR, this is an ancient
C feature which is not conforming with the latest C standards.  On many targets
this means global variable accesses have a codesize and performance penalty.
This applies to C code only, C++ code is not affected by -fcommon.  It is about
time to change the default.

    gcc/
	PR85678
	* common.opt (fcommon): Change init to 1.
	* invoke.texi (-fcommon): Update documentation.

    testsuite/
	* g++.dg/lto/odr-6_1.c: Add -fcommon.
	* gcc.dg/alias-15.c: Likewise.
	* gcc.dg/fdata-sections-1.c: Likewise.	
	* gcc.dg/ipa/pr77653.c: Likewise.
	* gcc.dg/lto/20090729_0.c: Likewise.
	* gcc.dg/lto/20111207-1_0.c: Likewise.
	* gcc.dg/lto/c-compatible-types-1_0.c: Likewise.
	* gcc.dg/lto/pr55525_0.c: Likewise.
	* gcc.dg/lto/pr88077_0.c: Use long to avoid alignment warning.
	* gcc.dg/lto/pr88077_1.c: Add -fcommon.
	* gcc.target/aarch64/sve/peel_ind_1.c: Allow ANCHOR0.
	* gcc.target/aarch64/sve/peel_ind_2.c: Likewise.
	* gcc.target/aarch64/sve/peel_ind_3.c: Likewise.
	* gcc.target/i386/volatile-bitfields-2.c: Allow movl or movq.

From-SVN: r278509
2019-11-20 16:29:23 +00:00
Maciej W. Rozycki
83115e9eb8 libgomp/test: Add flags to find libatomic in build-tree testing
Add flags to find libatomic in build-tree testing, fixing a catastrophic
libgomp testsuite failure with `riscv*-*-linux*' targets, which imply
`-latomic' with the `-pthread' GCC option, implied in turn by the
`-fopenacc' and `-fopenmp' options, removing failures like:

.../bin/riscv64-linux-gnu-ld: cannot find -latomic
collect2: error: ld returned 1 exit status
compiler exited with status 1
FAIL: libgomp.c/../libgomp.c-c++-common/atomic-18.c (test for excess errors)
Excess errors:
.../bin/riscv64-linux-gnu-ld: cannot find -latomic

UNRESOLVED: libgomp.c/../libgomp.c-c++-common/atomic-18.c compilation failed to produce executable

and bringing overall test results for the `riscv64-linux-gnu' target
(here with the `x86_64-linux-gnu' host and RISC-V QEMU in the Linux user
emulation mode as the target board) from:

		=== libgomp Summary ===

# of expected passes		90
# of unexpected failures	3267
# of expected failures		2
# of unresolved testcases	3247
# of unsupported tests		548

to:

		=== libgomp Summary ===

# of expected passes		6834
# of unexpected failures	4
# of expected failures		4
# of unsupported tests		518

	libgomp/
	* testsuite/lib/libgomp.exp (libgomp_init): Add flags to find
	libatomic in build-tree testing.

From-SVN: r278505
2019-11-20 15:49:23 +00:00
Jan Hubicka
8e361de1b0 Workaround bogus warning in fibonacci_heap<K,V>::consolidate.
* fibonacci_heap.h (fibonacci_heap<K,V>::consolidate): Turn auto_vec
	to ordinary array.

From-SVN: r278504
2019-11-20 15:45:53 +00:00
Jan Hubicka
516fd7cedb Add pool_allocator for fibonaci heaps.
* fibonacci_heap.h (fibonacci_heap<K,V>::fibonacci_heap):
	Add allocator parameter.
	(fibonacci_heap<K,V>::~fibonacci_heap): Optimize destruction.
	(fibonacci_heap<K,V>::m_allocator): New.
	(fibonacci_heap<K,V>::m_own_allocator): New.
	(fibonacci_heap<K,V>::insert): Use allocator.
	(fibonacci_heap<K,V>::extract_min): Likewise.
	(fibonacci_heap<K,V>::union_with): Assert that both heaps share
	allocator.
	(fibonacci_heap<K,V>::consolidate): Allocate constant sized vector
	on stack.
	* fibonacci_heap.c: Include alloc-pool
	(test_empty_heap): Initialize allocator.
	(test_union): Likewise.
	* bb-reorder.c: Include alloc-pool.h.
	* tracer.c: Inlclude alloc-pool.h.

From-SVN: r278501
2019-11-20 15:04:34 +00:00
Martin Liska
f6fbdc385a Update comment in libsanitizer/*/libtool-version files.
2019-11-20  Martin Liska  <mliska@suse.cz>

	* libtool-version: Remove.
	* lsan/libtool-version: Upate comment to not mention libmudflap.
	* tsan/libtool-version: Likewise.
	* ubsan/libtool-version: Likewise.

From-SVN: r278500
2019-11-20 14:52:05 +00:00
Jan Hubicka
17b95f0ef0 lto-streamer-out.c (DFS::sccstack): Turn into auto-vec.
* lto-streamer-out.c (DFS::sccstack): Turn into auto-vec.
	Preallocate for 32 entries.
	(DFS::worklist): Likewise.
	(DFS::DFS): Do not initialize sccstack and worklist.
	(DFS::~DFS): Do not release sccstack.

From-SVN: r278498
2019-11-20 14:10:41 +00:00
Segher Boessenkool
bcb4b4b4ba rs6000: Fix UNORDERED without NaNs, for DFP (PR92573)
This is the analogue of r278103, but for DFP.


	PR target/92573
	* config/rs6000/dfp.md (dfptstsfi_<code>_<mode> for DFP_TEST and DDTD):
	Handle UNORDERED if !HONOR_NANS.

From-SVN: r278497
2019-11-20 14:38:52 +01:00
Jan Hubicka
041cb6154c Optimize updating of badness after applying inline
* ipa-inline.c (wrapper_heuristics_may_apply): Break out from ...
	(edge_badness): ... here.
	(inline_small_functions): Use monotonicity of badness calculation
	to avoid redundant updates.

From-SVN: r278496
2019-11-20 11:46:41 +00:00
Richard Biener
140ee00a96 tree-vect-slp.c (vect_analyze_slp_instance): Dump constructors we are actually analyzing.
2019-11-20  Richard Biener  <rguenther@suse.de>

	* tree-vect-slp.c (vect_analyze_slp_instance): Dump
	constructors we are actually analyzing.
	(vect_slp_check_for_constructors): Do not vectorize uniform
	constuctors, do not dump here.

	* gcc.dg/vect/bb-slp-42.c: Adjust.
	* gcc.dg/vect/bb-slp-40.c: Likewise.

From-SVN: r278495
2019-11-20 11:12:48 +00:00
Richard Biener
2439d584d5 re PR tree-optimization/92537 (ICE in vect_slp_analyze_node_operations, at tree-vect-slp.c:2775)
2019-11-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92537
	* tree-vect-slp.c (vect_analyze_slp_instance): Move CTOR
	vectorization validity check...
	(vect_slp_analyze_operations): ... here.

	* gfortran.dg/pr92537.f90: New testcase.

From-SVN: r278494
2019-11-20 10:40:09 +00:00
Christophe Lyon
8d8ae265dc [testsuite][arm] Fix asm-flag-[45].c tests
In asm-flag-4.c, we need to use dg-message instead of dg-error because
we have to match "sorry, unimplemented:" rather than "error:".  In
asm-flag-5.c, fix the dg-error syntax.

2019-11-20  Christophe Lyon  <christophe.lyon@linaro.org>

	* gcc.target/arm/asm-flag-4.c: Replace dg-error with dg-message.
	* gcc.target/arm/asm-flag-5.c: Add quotes around dg-error
	messages.

From-SVN: r278487
2019-11-20 10:31:10 +01:00
James Greenhalgh
267d74329b Remove my name from AArch64 port maintainers
* MAINTAINERS (aarch64 port): Remove my name, move to...
	(Write After Approval): ...Here.

From-SVN: r278486
2019-11-20 09:29:13 +00:00
Claudiu Zissulescu
f60689fa50 [ARC] Register ARC specific passes with a .def file.
New arc-passes.def to register ARC specific passes.

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

	* config/arc/arc-protos.h (make_pass_arc_ifcvt): Declare.
	(make_pass_arc_predicate_delay_insns): Likewise.
	* config/arc/arc.c (class pass_arc_ifcvt): Reformat text, add gate
	method, remove clone.
	(class pass_arc_predicate_delay_insns): Likewise.
	(arc_init): Remove registering of ARC specific passes.
	* config/arc/t-arc (PASSES_EXTRA): Add arc-passes.def.
	* config/arc/arc-passes.def: New file.

From-SVN: r278485
2019-11-20 09:39:21 +01:00
Jakub Jelinek
ee68672928 re PR c++/90767 (jumbled error message with this and const)
PR c++/90767
	* call.c (complain_about_no_candidates_for_method_call): If
	conv->from is not a type, pass to complain_about_bad_argument
	lvalue_type of conv->from.

	* g++.dg/diagnostic/pr90767-1.C: New test.
	* g++.dg/diagnostic/pr90767-2.C: New test.

From-SVN: r278484
2019-11-20 09:33:56 +01:00
Jakub Jelinek
d742b0c1a0 re PR middle-end/90840 (ICE in simplify_subreg, at simplify-rtx.c:6441)
PR middle-end/90840
	* expmed.c (store_bit_field_1): Handle the case where op0 is not a MEM
	and has a mode that doesn't have corresponding integral type.

	* gcc.c-torture/compile/pr90840.c: New test.

From-SVN: r278483
2019-11-20 09:32:56 +01:00
Jakub Jelinek
94cdd3b7ce re PR target/90867 (Multiplication or typecast of integer and double always zero when...)
PR target/90867
	* config/i386/i386-options.c (ix86_valid_target_attribute_tree): Don't
	clear opts->x_ix86_isa_flags{,2} here...
	(ix86_valid_target_attribute_inner_p): ... but here when seeing
	arch=.  Also clear opts->x_ix86_isa_flags{,2}_explicit.

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

From-SVN: r278482
2019-11-20 09:31:43 +01:00
Jakub Jelinek
7313f6cf21 re PR c/90898 (ICE in insert_clobber_before_stack_restore, at tree-ssa-ccp.c:2112)
PR c/90898
	* tree-ssa-ccp.c (insert_clobber_before_stack_restore): Remove
	assertion.
	(insert_clobbers_for_var): Fix a typo in function comment.

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

From-SVN: r278481
2019-11-20 09:29:35 +01:00
Jakub Jelinek
06e8db10cd re PR middle-end/91195 (incorrect may be used uninitialized smw (272711, 273474])
PR middle-end/91195
	* tree-ssa-phiopt.c (cond_store_replacement): Move lhs unsharing
	earlier.  Set TREE_NO_WARNING on the rhs1 of the artificially added
	load.

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

From-SVN: r278479
2019-11-20 09:26:52 +01:00
Georg-Johann Lay
c04341ec45 Make 0-series device specs work with older versions of avr-gcc.
PR target/92545
	* config/avr/specs.h (LINK_SPEC) <%(link_pm_base_address)>: Remove.
	* config/avr/gen-avr-mmcu-specs.c (print_mcu)
	<*link_pm_base_address>: Don't write spec.
	<*link_arch>: Add --defsym=__RODATA_PM_OFFSET__= as needed.

From-SVN: r278478
2019-11-20 08:19:44 +00:00
Richard Biener
3e00ba47b9 re PR c/92088 (aggregates with VLAs and nested functions are broken)
2019-11-20  Richard Biener  <rguenther@suse.de>

	PR c/92088
	c/
	* c-decl.c (grokdeclarator): Prevent inlining of nested
	function with VLA arguments.

	* builtins.c (compute_objsize): Deal with VLAs.

	* gcc.dg/torture/pr92088-1.c: New testcase.
	* gcc.dg/torture/pr92088-2.c: Likewise.

From-SVN: r278477
2019-11-20 07:33:19 +00:00
Paolo Carlini
54bf2539c5 cvt.c (ocp_convert): Use additional warning sentinel.
/cp
2019-11-20  Paolo Carlini  <paolo.carlini@oracle.com>

	* cvt.c (ocp_convert): Use additional warning sentinel.

/testsuite
2019-11-20  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/warn/multiple-sign-compare-warn-1.C: New.

From-SVN: r278475
2019-11-20 01:02:46 +00:00
GCC Administrator
56d475cab2 Daily bump.
From-SVN: r278474
2019-11-20 00:16:19 +00:00
Joseph Myers
8c5b727acc Add more pedwarns for [[]] C attributes on types.
The standard [[]] attributes currently defined in C2x are all not
valid on types not being defined at the time.

Use on such types results in a warning from attribs.c about attributes
appertaining to types (the warning that I think is bogus in general
for both C and C++, applying as it does to all [[]] attributes
including gnu:: ones that are perfectly meaningful on types not being
defined and work fine when __attribute__ syntax is used instead).  If
that warning is removed (as I intend to do in a subsequent patch),
warnings may or may not result from the attribute handlers, depending
on whether those particular attribute handlers consider the attributes
meaningful in such a context.  In C, however, the rules about where
each [[]] attribute is valid are constraints, so a pedwarn, not a
warning, is required.

Because some handlers are shared between standard and gnu::
attributes, there can be cases that are valid for the GNU attribute
variant but not for the standard one.  So in general it is not correct
to rely on the attribute handlers to give all required pedwarns
(although in some cases, a pedwarn in the attribute handler is in
appropriate way of diagnosing an invalid use); they not have the
information about whether the attribute was a gnu:: one and can
legitimately accept a wider range of uses for the gnu:: attributes.

This patch ensures appropriate diagnostics for invalid uses of C2x
standard attributes on types, and so helps pave the way for the
subsequent removal of the bogus check in attribs.c, by adding a check
run in the front end before calling decl_attributes; this check
removes the attributes from the list after calling pedwarn to avoid
subsequent duplicate warnings.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

gcc/c:
	* c-decl.c (c_warn_type_attributes): New function.
	(groktypename, grokdeclarator, finish_declspecs): Call
	c_warn_type_attributes before applying attributes to types.
	* c-tree.h (c_warn_type_attributes): Declare.

gcc/testsuite:
	* gcc.dg/c2x-attr-deprecated-2.c, gcc.dg/c2x-attr-fallthrough-2.c,
	gcc.dg/c2x-attr-maybe_unused-2.c: Expect errors for invalid uses
	of standard attributes on types.  Add more tests of invalid uses
	on types.

From-SVN: r278471
2019-11-20 00:13:51 +00:00
Ian Lance Taylor
0c6ce0ae55 libgo: better cmd/cgo handling for '.' in pkgpath
Updates cgo's gccgoPkgpathToSymbolNew() to bring it into
    conformance with the way that gccgo now handles package
    paths with embedded dots (see CL 200838). See also
    https://gcc.gnu.org/PR61880, a related bug. This CL is a
    copy of CL 207957 in the main Go repo.
    
    Updates golang/go#35623.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/207977

From-SVN: r278470
2019-11-19 23:04:08 +00:00
Jakub Jelinek
fce6467b1e re PR c++/92414 (internal compiler error: tree check: expected constructor, have error_mark in cxx_eval_store_expression, at cp/constexpr.c:4009)
PR c++/92414
	* constexpr.c (cxx_eval_outermost_constant_expr): If DECL_INITIAL
	on object is erroneous, return t without trying to evaluate
	a constexpr dtor.

	* g++.dg/cpp2a/constexpr-dtor4.C: New test.

From-SVN: r278468
2019-11-19 22:28:22 +01:00
Jason Merrill
8d5d90878e Consider parm types equivalence for operator rewrite tiebreaker.
The C++ committee continues to discuss how best to avoid breaking existing
code with the new rules for reversed operators.  A recent suggestion was to
base the tie-breaker on the parameter types of the candidates, which made a
lot of sense to me, so this patch implements that.

This patch also mentions that a candidate was reversed or rewritten when
printing the list of candidates, and warns about a comparison that becomes
recursive under the new rules.  There is no flag for this warning; people
can silence it by swapping the operands.

	* call.c (same_fn_or_template): Change to cand_parms_match.
	(joust): Adjust.
	(print_z_candidate): Mark rewritten/reversed candidates.
	(build_new_op_1): Warn about recursive call with reversed arguments.

From-SVN: r278465
2019-11-19 15:22:12 -05:00
Pat Haugen
9a8819b882 rs6000.c (move_to_end_of_ready): New, factored out from common code.
* config/rs6000/rs6000.c (move_to_end_of_ready): New, factored out
	from common code.
	(power6_sched_reorder2): Factored out from rs6000_sched_reorder2,
	call new function.
	(power9_sched_reorder2): Call new function.
	(rs6000_sched_reorder2): Likewise.

From-SVN: r278463
2019-11-19 19:49:37 +00:00
Richard Sandiford
dd46a542a8 Move ChangeLog entry to correct file
From-SVN: r278461
2019-11-19 18:58:44 +00:00