Commit Graph

157896 Commits

Author SHA1 Message Date
Jakub Jelinek
aa11164a39 re PR tree-optimization/83086 (valgrind error in gimple-ssa-store-merging.c for recent build)
PR tree-optimization/83086
	* gimple-ssa-store-merging.c
	(imm_store_chain_info::try_coalesce_bswap): Test this_n.base_addr
	rather than n.base_addr.

From-SVN: r255002
2017-11-21 14:54:08 +01:00
Martin Liska
938f9248db Fix UBSAN errors in dse.c (PR rtl-optimization/82044).
2017-11-21  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/82044
	PR tree-optimization/82042
	* dse.c (check_mem_read_rtx): Check for overflow.

From-SVN: r255001
2017-11-21 13:39:14 +00:00
Aldy Hernandez
ddc1759a35 tree-ssa-threadbackward.c (find_jump_threads_backwards): Fix typo in comment.
* tree-ssa-threadbackward.c (find_jump_threads_backwards): Fix
	typo in comment.

From-SVN: r254999
2017-11-21 11:39:51 +00:00
Claudiu Zissulescu
13f5d5e082 Don't split call from its call arg location.
gcc/
2017-11-21  Claudiu Zissulescu  <claziss@synopsys.com>

	* cfgrtl.c (force_nonfallthru_and_redirect): Don't split a call
	and its corresponding call arg location note.

testsuite/
2017-11-21  Claudiu Zissulescu  <claziss@synopsys.com>

	* gcc.target/arc/loop-5.cpp: New test.

From-SVN: r254998
2017-11-21 12:37:42 +01:00
Claudiu Zissulescu
6fe5e235f9 [ARC] Reimplement exception handling support.
2016-06-09  Claudiu Zissulescu  <claziss@synopsys.com>
	    Andrew Burgess  <andrew.burgess@embecosm.com>

	* config/arc/arc-protos.h (arc_compute_frame_size): Delete
	declaration.
	(arc_return_slot_offset): Likewise.
	(arc_eh_return_address_location): New declaration.
	* config/arc/arc.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Define.
	(MUST_SAVE_REGISTER): Add exception handler case.
	(MUST_SAVE_RETURN_ADDR): Likewise.
	(arc_frame_pointer_required): Likewise.
	(arc_frame_pointer_needed): New function.
	(arc_compute_frame_size): Changed.
	(arc_expand_prologue): Likewise.
	(arc_expand_epilogue): Likewise.
	(arc_initial_elimination_offset): Likewise.
	(arc_return_slot_offset): Delete.
	(arc_eh_return_address_location): New function.
	(arc_builtin_setjmp_frame_value): Likewise.
	* config/arc/arc.h (EH_RETURN_DATA_REGNO): Use 2 registers.
	(EH_RETURN_STACKADJ_RTX): Define.
	(EH_RETURN_HANDLER_RTX): Likewise.
	* config/arc/arc.md (eh_return): Delete.

Co-Authored-By: Andrew Burgess <andrew.burgess@embecosm.com>

From-SVN: r254997
2017-11-21 12:37:30 +01:00
Aldy Hernandez
24d39222e8 print-tree.h (debug_vec_tree): Remove prototype.
* print-tree.h (debug_vec_tree): Remove prototype.
	* gdbinit.in (pvt): Remove macro.

From-SVN: r254996
2017-11-21 10:06:52 +00:00
Jakub Jelinek
97031af755 re PR tree-optimization/83047 (glibc/crypt/crypt_util.c gets miscompiled)
PR tree-optimization/83047
	* gimple-ssa-store-merging.c
	(imm_store_chain_info::output_merged_store): If the loads with the
	same vuse are in different basic blocks, for load_gsi pick a load
	location that is dominated by the other loads.

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

From-SVN: r254992
2017-11-21 09:41:47 +01:00
Jakub Jelinek
7768f20b0a P0428R2 - familiar template syntax for generic lambdas
P0428R2 - familiar template syntax for generic lambdas
	* parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
	for cxx2a and above, reword pedwarn for C++14/C++17.

	* g++.dg/cpp1y/lambda-generic-x.C: Adjust warnings and limit
	to c++17_down target.
	* g++.dg/cpp1y/lambda-generic-dep.C: Likewise.
	* g++.dg/cpp1y/lambda-generic-77914.C: Adjust error and limit
	to c++17_down target.
	* g++.dg/cpp2a/lambda-generic1.C: New test.
	* g++.dg/cpp2a/lambda-generic2.C: New test.
	* g++.dg/cpp2a/lambda-generic3.C: New test.
	* g++.dg/cpp2a/lambda-generic4.C: New test.
	* g++.dg/cpp2a/lambda-generic5.C: New test.

From-SVN: r254991
2017-11-21 09:39:57 +01:00
Jakub Jelinek
d44ed508a6 re PR c++/83059 (ICE on invalid C++ code: in tree_to_uhwi, at tree.c:6633)
PR c++/83059
	* c-common.c (get_atomic_generic_size): Use TREE_INT_CST_LOW
	instead of tree_to_uhwi, formatting fix.
	* config/i386/i386.c (ix86_memmodel_check): Start
	-Winvalid-memory-model diagnostics with lowercase letter.

	* c-c++-common/pr83059.c: New test.

From-SVN: r254990
2017-11-21 09:06:28 +01:00
Jakub Jelinek
8b87e0d125 re PR debug/82718 (Bad DWARF5 .debug_loclists generation)
PR debug/82718
	* dwarf2out.c (dw_loc_list): If crtl->has_bb_partition, temporarily
	set in_cold_section_p to the partition containing loc_list->first.
	When seeing loc_list->last_before_switch node, update secname and
	perform range_across_switch second partition handling only after that.

	* gcc.dg/debug/dwarf2/pr82718-1.c: New test.
	* gcc.dg/debug/dwarf2/pr82718-2.c: New test.

From-SVN: r254989
2017-11-21 08:59:03 +01:00
Jakub Jelinek
83087d6521 re PR debug/82933 (valgrind error in set_cur_line_info_table with -g)
PR debug/82933
	* run-rtl-passes.c: Include debug.h.
	(run_rtl_passes): Call debug_hooks->assembly_start.
	* dwarf2out.c (dwarf2out_assembly_start): Return early if invoked
	multiple times.

	* gcc.dg/rtl/x86_64/pr82933.c: New test.

From-SVN: r254987
2017-11-21 08:50:15 +01:00
Jakub Jelinek
644f013227 re PR target/82981 (unnecessary __multi3 call for mips64r6 linux kernel)
PR target/82981
	* internal-fn.c (expand_mul_overflow): Use OPTAB_WIDEN instead of
	OPTAB_DIRECT in calls to expand_simple_binop.

From-SVN: r254986
2017-11-21 08:49:14 +01:00
Sebastian Huber
b76602dcf2 RTEMS: Enable some libstdc++ features
libstdc++/

	* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Add rtems*.
	(GLIBCXX_ENABLE_FILESYSTEM_TS): Likewise.
	* configure: Regenerate.

From-SVN: r254985
2017-11-21 06:22:13 +00:00
Ian Lance Taylor
c9548fa4f1 libgo: fix makefile buglet
Fix a small bug in the libgo Makefile recipe that constructs the
    directory from which to pick up libgcc_s.so ; the gccgo invocation
    with -print-libgcc-file-name was missing the flags, which meant that
    for -m32 builds we'd see the 64-bit libgcc dir.
    
    Reviewed-on: https://go-review.googlesource.com/78836

From-SVN: r254984
2017-11-21 06:19:10 +00:00
Ian Lance Taylor
5e43a9eeca compiler: report error for ++/-- applied to a non-numeric type
This avoids a compiler crash.
    
    Fixes GCC PR 83071.
    
    Reviewed-on: https://go-review.googlesource.com/78875

From-SVN: r254983
2017-11-21 06:14:32 +00:00
Jerry DeLisle
8c09856788 re PR libfortran/78549 (Very slow formatted internal file output)
2017-11-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/78549
	* io/io.h (newunit_free): Add declaration. Clean some whitespace.
	* io/transfer.c (st_read_done, st_write_done): Call newunit_free.
	* io/unit.c (newunit_free): Change type from static void to void.

From-SVN: r254982
2017-11-21 02:17:11 +00:00
Eric Gallager
34b81eb96c Use -Wtraditional for "would be stringified in traditional C" (PR preprocessor/81794)
libcpp/ChangeLog:

2017-03-24  Eric Gallager  <egall@gwmail.gwu.edu>

	PR preprocessor/81794
	* macro.c (check_trad_stringification): Have warning be controlled
	by -Wtraditional.

gcc/testsuite/ChangeLog:

2017-09-17  Eric Gallager  <egall@gwmail.gwu.edu>

	PR preprocessor/81794
	* gcc.dg/pragma-diag-7.c: Update to include check for
	stringification.

From-SVN: r254981
2017-11-21 00:57:29 +00:00
David Malcolm
26edace69b C/C++: more stdlib header hints (PR c/81404)
This patch extends the C frontend's "knowledge" of the C stdlib within
get_c_name_hint to cover some more macros and functions, covering
a case reported in PR c/81404 ("INT_MAX"), so that rather than printing:

  t.c:5:12: error: 'INT_MAX' undeclared here (not in a function); did you mean '__INT_MAX__'?
   int test = INT_MAX;
              ^~~~~~~
              __INT_MAX__

we instead print:

  t.c:5:12: error: 'INT_MAX' undeclared here (not in a function)
   int test = INT_MAX;
              ^~~~~~~
  t.c:5:12: note: 'INT_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'?
  t.c:1:1:
  +#include <limits.h>

  t.c:5:12:
    int test = INT_MAX;
               ^~~~~~~

It also adds generalizes some of the code for this (and for the "std::"
namespace hints in the C++ frontend), moving it to a new
c-family/known-headers.cc and .h, and introducing a class known_headers.
This currently just works by scanning a hardcoded array of known
name/header associations, but perhaps in the future could be turned
into some kind of symbol database so that the compiler could record API
uses and use that to offer suggestions e.g.

foo.cc: error: 'myapi::foo' was not declared in this scope
foo.cc: note: 'myapi::foo" was declared in header 'myapi/private.h'
(included via 'myapi/public.h') when compiling 'bar.cc'; did you forget to
'#include "myapi/public.h"'?

or somesuch.

In any case, moving this to a class gives an easier way to locate the
hardcoded knowledge about the stdlib.

The patch also adds similar code to the C++ frontend covering
unqualified names in the standard library, so that rather than just
e.g.:

  t.cc:19:13: error: 'NULL' was not declared in this scope
   void *ptr = NULL;
               ^~~~

we can emit:

  t.cc:19:13: error: 'NULL' was not declared in this scope
   void *ptr = NULL;
               ^~~~
  t.cc:19:13: note: 'NULL' is defined in header '<cstddef>'; did you forget
  to '#include <cstddef>'?
  t.cc:1:1:
  +#include <cstddef>

  t.cc:19:13:
   void *ptr = NULL;
               ^~~~

(Also XFAIL for PR c++/80567 added for the C++ testcase; this is a
separate pre-existing bug exposed by the testcase for PR 81404).

gcc/ChangeLog:
	PR c/81404
	* Makefile.in (C_COMMON_OBJS): Add c-family/known-headers.o.

gcc/c-family/ChangeLog:
	PR c/81404
	* known-headers.cc: New file, based on material from c/c-decl.c.
	(suggest_missing_header): Copied as-is.
	(get_stdlib_header_for_name): New, based on get_c_name_hint but
	heavily edited to add C++ support.  Add some knowledge about
	<limits.h>, <stdint.h>, and <wchar.h>.
	* known-headers.h: Likewise.

gcc/c/ChangeLog:
	PR c/81404
	* c-decl.c: Include "c-family/known-headers.h".
	(get_c_name_hint): Rename to get_stdlib_header_for_name and move
	to known-headers.cc.
	(class suggest_missing_header): Move to known-header.h.
	(lookup_name_fuzzy): Call get_c_stdlib_header_for_name rather
	than get_c_name_hint.

gcc/cp/ChangeLog:
	PR c/81404
	* name-lookup.c: Include "c-family/known-headers.h"
	(lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
	potentially return a new suggest_missing_header hint.

gcc/testsuite/ChangeLog:
	PR c/81404
	* g++.dg/spellcheck-stdlib.C: New.
	* gcc.dg/spellcheck-stdlib.c (test_INT_MAX): New.

From-SVN: r254980
2017-11-21 00:50:39 +00:00
David Malcolm
b121225555 C: hints for missing stdlib includes for macros and types
The C frontend already "knows" about many common functions in
the C standard library:

  test.c: In function 'test':
  test.c:3:3: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
     printf ("hello world\n");
     ^~~~~~
  test.c:3:3: warning: incompatible implicit declaration of built-in function 'printf'
  test.c:3:3: note: include '<stdio.h>' or provide a declaration of 'printf'

and which header file they are in.

However it doesn't know about various types and macros:

test.c:1:13: error: 'NULL' undeclared here (not in a function)
 void *ptr = NULL;
             ^~~~

This patch uses the name_hint/deferred_diagnostic machinery to
add hints for missing C standard library headers for some of the
most common type and macro names.

For example, the above becomes:
test.c:1:13: error: 'NULL' undeclared here (not in a function)
 void *ptr = NULL;
             ^~~~
test.c:1:13: note: 'NULL' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?

gcc/c/ChangeLog:
	* c-decl.c (get_c_name_hint): New function.
	(class suggest_missing_header): New class.
	(lookup_name_fuzzy): Call get_c_name_hint and use it to
	suggest missing headers to the user.

gcc/testsuite/ChangeLog:
	* gcc.dg/spellcheck-stdlib.c: New test case.

From-SVN: r254979
2017-11-21 00:46:24 +00:00
David Malcolm
01ada12136 C++: provide macro used-before-defined hint (PR c++/72786)
This patch uses the name_hint/deferred_diagnostic to provide
a message in the C++ frontend if a macro is used before it is defined
e.g.:

test.c:6:24: error: expected ';' at end of member declaration
   virtual void clone() const OVERRIDE { }
                        ^~~~~
                             ;
test.c:6:30: error: 'OVERRIDE' does not name a type
   virtual void clone() const OVERRIDE { }
                              ^~~~~~~~
test.c:6:30: note: the macro 'OVERRIDE' had not yet been defined
test.c:15:0: note: it was later defined here
 #define OVERRIDE override

It's possible to do it from the C++ frontend as tokenization happens
up-front (and hence the macro already exists when the above is parsed);
I attempted to do it from the C frontend, but because the C frontend only
tokenizes on-demand during parsing, the macro isn't known about until
later.

gcc/cp/ChangeLog:
	PR c++/72786
	* name-lookup.c (class macro_use_before_def): New class.
	(lookup_name_fuzzy): Detect macro that were used before being
	defined, and report them as such.

gcc/ChangeLog:
	PR c++/72786
	* spellcheck.h (best_match::blithely_get_best_candidate): New
	accessor.

gcc/testsuite/ChangeLog:
	PR c++/72786
	* g++.dg/spellcheck-macro-ordering-2.C: New test case.
	* g++.dg/spellcheck-macro-ordering.C: Add dg-message directives
	for macro used-before-defined.

libcpp/ChangeLog:
	PR c++/72786
	* include/cpplib.h (cpp_macro_definition_location): New decl.
	* macro.c (cpp_macro_definition): New function.

From-SVN: r254978
2017-11-21 00:40:53 +00:00
Steve Ellcey
874b8068f6 re PR target/81356 (__builtin_strcpy is not good for copying an empty string on aarch64)
2017-11-20  Steve Ellcey  <sellcey@cavium.com>

	PR target/81356
	* gfortran.dg/pr45636.f90 (aarch64*-*-*): Remove from xfail list.

From-SVN: r254977
2017-11-21 00:18:14 +00:00
GCC Administrator
a121f8229d Daily bump.
From-SVN: r254976
2017-11-21 00:16:16 +00:00
Jason Merrill
753c2e693f Avoid duplicate visibility warning.
* decl2.c (constrain_class_visibility): Don't warn about artificial
	fields.

From-SVN: r254973
2017-11-20 17:37:45 -05:00
François Dumont
e324f9cb92 streambuf_iterator.h (istreambuf_iterator<>): Declare std::advance for istreambuf_iterator of char types to be friend.
2017-11-20  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/streambuf_iterator.h (istreambuf_iterator<>): Declare
	std::advance for istreambuf_iterator of char types to be friend.
	(std::advance(istreambuf_iterator&, _Distance)): New overload.
	* include/std/streambuf (basic_streambuf<>): Declare std::advance for
	istreambuf_iterator of char types to be friend.
	* testsuite/22_locale/money_get/get/char/9.cc: Have
	istreambuf_iterator created on the fly when calling money_get<>::get.
	* testsuite/22_locale/money_get/get/wchar_t/9.cc: Likewise.
	* testsuite/24_iterators/istreambuf_iterator/debug/1_neg.cc: New.
	* testsuite/24_iterators/istreambuf_iterator/debug/2_neg.cc: New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/char/1.cc: New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/char/1_neg.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/char/2.cc: New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/char/2_neg.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/char/3_neg.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/1.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/1_neg.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2_neg.cc:
	New.
	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/3_neg.cc:
	New.
	* testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc: Leverage
	on std::advance overload.
	* testsuite/25_algorithms/find/istreambuf_iterators/wchar_t/2.cc:
	Likewise.

From-SVN: r254972
2017-11-20 22:30:28 +00:00
Jonathan Wakely
9be0a9d6d2 Fix failing tests caused by duplicate dg-options
* testsuite/special_functions/18_riemann_zeta/check_value.cc: Fix
	duplicate dg-options directive.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	20_riemann_zeta/check_value_neg.cc: Likewise.

From-SVN: r254971
2017-11-20 21:48:31 +00:00
Jakub Jelinek
49e68526ab i386.c (parse_mtune_ctrl_str): Start diagnostics with lower case letter.
* config/i386/i386.c (parse_mtune_ctrl_str): Start diagnostics
	with lower case letter.

From-SVN: r254970
2017-11-20 22:03:47 +01:00
Uros Bizjak
121075d760 i386.md (bswaphi2): New expander.
* config/i386/i386.md (bswaphi2): New expander.
	(*bswaphi2_movbe): New insn pattern.
	(bswaphi -> rorhi pepehole2): New peephole pattern.

testsuite/ChangeLog:

	* gcc.target/i386/movbe-5.c: New test.

From-SVN: r254967
2017-11-20 20:52:14 +01:00
Paul Thomas
6017b8f0cf re PR fortran/79072 (ICE with class(*) pointer function result and character value)
2017-11-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/79072
	* trans-expr.c (trans_class_vptr_len_assignment): Set from_len
	if the temporary is unlimited polymorphic.
	* trans-stmt.c (trans_associate_var): Use the fake result decl
	to obtain the 'len' field from an explicit function result when
	in that function scope.

2017-11-20  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/79072
	* gfortran.dg/class_result_5.f90: New test.

From-SVN: r254966
2017-11-20 19:09:34 +00:00
Kito Cheng
ee1c213355 RISC-V: Implement __umulsidi3, umul_ppmm and __muluw3
2017-11-20  Kito Cheng  <kito.cheng@gmail.com>

        * longlong.h [__riscv] (__umulsidi3): Define.
        [__riscv] (umul_ppmm): Likewise.
        [__riscv] (__muluw3): Likewise.

From-SVN: r254965
2017-11-20 19:08:38 +00:00
Jakub Jelinek
d68ddd2b35 P0329R4: Designated Initialization
P0329R4: Designated Initialization
	* parser.c (cp_parser_initializer_clause): List in comment grammar
	designated-initializer-list.
	(cp_parser_initializer_list): Allow .identifier = without pedwarn for
	C++2A, parse .identifier { ... }.  Improve location_t argument to
	pedwarn.  Add pedwarn for [cst] = designators.  Diagnose ... in
	designated initializer list.  Diagnose mixing designated and
	non-designated initializer clauses for C++2A.  Diagnose duplicated
	identifiers in designators.
	* name-lookup.h (search_anon_aggr): New declaration.
	* name-lookup.c (fields_linear_search): Use search_anon_aggr.
	(search_anon_aggr): New function.
	* typeck2.c (process_init_constructor_record): Allow designator
	to skip over some non-static data members.  Handle anonymous
	aggregates.  Add diagnostics for designator order not matching
	member declaration order.

	* g++.dg/ext/desig2.C: Adjust comment, no sorry about designator
	refering to second member.
	(b): New variable and associated expected diagnostic.
	* g++.dg/ext/desig4.C: For C++2A expect diagnostics.
	* g++.dg/ext/desig5.C: Add dg-do dg-compile and empty dg-options.
	* g++.dg/ext/desig8.C: Likewise.
	* g++.dg/ext/desig9.C: New test.
	* g++.dg/ext/pr27019.C: Don't expect any diagnostics.
	* g++.dg/init/error2.C: Adjust expected diagnostics.
	* g++.dg/cpp0x/desig1.C: Add dg-options with -pedantic, expect
	warning on C99 designators.
	* g++.dg/cpp2a/desig1.C: New test.
	* g++.dg/cpp2a/desig2.C: New test.
	* g++.dg/cpp2a/desig3.C: New test.
	* g++.dg/cpp2a/desig4.C: New test.
	* g++.dg/cpp2a/desig5.C: New test.
	* g++.dg/cpp2a/desig6.C: New test.

From-SVN: r254964
2017-11-20 19:58:01 +01:00
David Malcolm
6c7a259b81 c-family: add name_hint/deferred_diagnostic
In various places we use lookup_name_fuzzy to provide a hint,
and can report messages of the form:
  error: unknown foo named 'bar'
or:
  error: unknown foo named 'bar'; did you mean 'SUGGESTION?

This patch provides a way for lookup_name_fuzzy to provide
both the suggestion above, and (optionally) additional hints
that can be printed e.g.

  note: did you forget to include <SOME_HEADER.h>?

This patch provides the mechanism and ports existing users
of lookup_name_fuzzy to the new return type.
There are no uses of such hints in this patch, but followup
patches provide various front-end specific uses of this.

gcc/c-family/ChangeLog:
	* c-common.h (enum lookup_name_fuzzy_kind): Move to name-hint.h.
	(lookup_name_fuzzy): Likewise.  Convert return type from
	const char * to name_hint.  Add location_t param.
	* name-hint.h: New header.

gcc/c/ChangeLog:
	* c-decl.c: Define INCLUDE_UNIQUE_PTR before including system.h.
	Include "c-family/name-hint.h"
	(implicit_decl_warning): Convert "hint" from
	const char * to name_hint.  Pass location to
	lookup_name_fuzzy.  Suppress any deferred diagnostic if the
	warning was not printed.
	(undeclared_variable): Likewise for "guessed_id".
	(lookup_name_fuzzy): Convert return type from const char *
	to name_hint.  Add location_t param.
	* c-parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
	Include "c-family/name-hint.h"
	(c_parser_declaration_or_fndef): Convert "hint" from
	const char * to name_hint.  Pass location to lookup_name_fuzzy.
	(c_parser_parameter_declaration): Likewise.

gcc/cp/ChangeLog:
	* name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
	Include "c-family/name-hint.h"
	(suggest_alternatives_for): Convert "fuzzy_name" from const char *
	to name_hint, and rename to "hint".  Pass location to
	lookup_name_fuzzy.
	(lookup_name_fuzzy): Convert return type from const char *
	to name_hint.  Add location_t param.
	* parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
	Include "c-family/name-hint.h"
	(cp_parser_diagnose_invalid_type_name): Convert
	"suggestion" from const char * to name_hint, and rename to "hint".
	Pass location to lookup_name_fuzzy.

From-SVN: r254963
2017-11-20 18:37:05 +00:00
Jeff Law
74ba745bdc Makefile.in (OBJS): Add gimple-ssa-evrp-analyze.o.
* Makefile.in (OBJS): Add gimple-ssa-evrp-analyze.o.
	* gimple-ssa-evrp-analyze.c: New file pulled from gimple-ssa-evrp.c.
	* gimple-ssa-evrp-analyze.h: New file pulled from gimple-ssa-evrp.c.
	* gimple-ssa-evrp.c: Remove bits moved into new files.  Include
	gimple-ssa-evrp-analyze.h.

From-SVN: r254961
2017-11-20 10:44:45 -07:00
Jeff Law
8c66dd9b33 gimple-ssa-evrp.c (evrp_dom_walker::before_dom_children): Do not set BB_VISITED here.
* gimple-ssa-evrp.c (evrp_dom_walker::before_dom_children): Do not
	set BB_VISITED here.
	(evrp_range_analyzer::enter): Set BB_VISITED here instead.

From-SVN: r254960
2017-11-20 10:29:33 -07:00
Nathan Sidwell
6aa80414a0 [PR c++/82878] pass-by-invisiref in lambda
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01115.html
	PR c++/82878
	PR c++/78495
	* call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
	ctor.
	* cp-gimplify.c	(cp_genericize_r): Restore THUNK dereference
	inhibibition check removed in previous c++/78495 change.

	PR c++/82878
	* g++.dg/cpp0x/pr82878.C: New.
	* g++.dg/cpp1z/inh-ctor38.C: Check moves too.

From-SVN: r254958
2017-11-20 14:39:00 +00:00
Ville Voutilainen
7b7b60c830 Implement LWG 2353
* include/bits/stl_iterator_base_funcs.h (next):
Use InputIterator instead of ForwardIterator.
* testsuite/24_iterators/operations/lwg2353.cc: New.
* testsuite/24_iterators/operations/next_neg.cc: Remove.

From-SVN: r254957
2017-11-20 16:21:42 +02:00
Bin Cheng
9cdcebf971 tree-predcom.c: Add general comment on Store-Store chains.
* tree-predcom.c: Add general comment on Store-Store chains.
	(split_data_refs_to_components): Postpone clearing eliminate_store_p
	flag in component.
	(get_chain_last_ref_at): Rename into...
	(get_chain_last_write_at): ...this.
	(get_chain_last_write_before_load): New function.
	(add_ref_to_chain): Promote type of chain from CT_STORE_LOAD to
	CT_STORE_STORE when write reference is added.
	(determine_roots_comp): Support load ref in CT_STORE_STORE chains.
	(is_inv_store_elimination_chain): Update get_chain_last_write_at call.
	(initialize_root_vars_store_elim_1): Ditto.
	(initialize_root_vars_store_elim_2): Ditto.  Replace rhs once default
	definition is created.
	(execute_pred_commoning_chain): Support load ref in CT_STORE_STORE
	chain by replacing it with dominant stored value.

	gcc/testsuite
	* gcc.dg/tree-ssa/predcom-dse-12.c: New test.

From-SVN: r254956
2017-11-20 14:20:08 +00:00
Bin Cheng
90ef577378 * tree-predcom.c (add_ref_to_chain): Remove check on distance.
From-SVN: r254955
2017-11-20 14:15:30 +00:00
Marc Glisse
50dec459c6 VRP: x+1 and -x cannot be INT_MIN
2017-11-20  Marc Glisse  <marc.glisse@inria.fr>

gcc/
	* vr-values.c (extract_range_from_binary_expr): Use a full range
	for VR_VARYING.

gcc/testsuite/
	PR testsuite/82951
	* gcc.c-torture/execute/20040409-1.c: Move invalid tests...
	* gcc.c-torture/execute/20040409-1w.c: ... here with -fwrapv.
	* gcc.c-torture/execute/20040409-2.c: Move invalid tests...
	* gcc.c-torture/execute/20040409-2w.c: ... here with -fwrapv.
	* gcc.c-torture/execute/20040409-3.c: Move invalid tests...
	* gcc.c-torture/execute/20040409-3w.c: ... here with -fwrapv.
	* gcc.dg/tree-ssa/cmpmul-1.c: Tweak condition.
	* gcc.dg/tree-ssa/vrp118.c: New file.

From-SVN: r254954
2017-11-20 13:26:39 +00:00
Rainer Orth
9aab553436 Add g++.dg/pr82836.C requirements
* g++.dg/pr82836.C: Require int128, __float128 support.
	Add __float128 options.
	(size_t): Define using __SIZE_TYPE__.

From-SVN: r254953
2017-11-20 13:03:06 +00:00
Jakub Jelinek
f370e36dc9 re PR c++/82781 (Vector extension operators return wrong result in constexpr)
PR c++/82781
	* constexpr.c (cxx_eval_vector_conditional_expression): New function.
	(cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
	of cxx_eval_conditional_expression.

	* g++.dg/ext/constexpr-pr82781.C: New test.

From-SVN: r254952
2017-11-20 13:57:50 +01:00
Igor Tsimbalist
1ebafce0bc re PR bootstrap/83015 (bootstrap comparison failure on ia64)
PR bootstrap/83015
	* config/cr16/unwind-cr16.c (uw_install_context): Add FRAMES
	parameter.
	* config/xtensa/unwind-dw2-xtensa.c: Likewise
	* config/ia64/unwind-ia64.c: Add frames parameter.
	* unwind-sjlj.c: Likewise.

From-SVN: r254951
2017-11-20 13:30:25 +01:00
Thomas Preud'homme
0a413fbc6c [ARM] Do no clobber r4 in Armv8-M nonsecure call
Expanders for Armv8-M nonsecure call unnecessarily clobber r4 despite
the libcall they perform not writing to r4.  Furthermore, the
requirement for the branch target address to be in r4 as expected by
the libcall is modeled in a convoluted way in the define_insn patterns:
the address is a register match_operand constrained by the match_dup
for the clobber which is guaranteed to be r4 due to the expander.

This patch simplifies all this by simply requiring the address to be in
r4 and removing the clobbers. Expanders are left alone because
cmse_nonsecure_call_clear_caller_saved relies on branch target memory
attributes which would be lost if expanding to reg:SI R4_REGNUM.

2017-11-20  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config/arm/arm.md (R4_REGNUM): Define constant.
    (nonsecure_call_internal): Remove r4 clobber.
    (nonsecure_call_value_internal): Likewise.
    * config/arm/thumb1.md (nonsecure_call_reg_thumb1_v5): Remove second
    clobber and resequence match_operands.
    (nonsecure_call_value_reg_thumb1_v5): Likewise.
    * config/arm/thumb2.md (nonsecure_call_reg_thumb2): Likewise.
    (nonsecure_call_value_reg_thumb2): Likewise.

From-SVN: r254950
2017-11-20 11:06:05 +00:00
Christophe Lyon
4acdaf98f9 [testsuite,arm] [Diagnostic Patch] don't print column zero
2017-11-20  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	* gcc.target/arm/pr69180.c: Use -: for no column in expected
	warnings.

From-SVN: r254949
2017-11-20 11:40:36 +01:00
Jakub Jelinek
4b84d9b8f9 re PR tree-optimization/78821 (GCC7: Copying whole 32 bits structure field by field not optimised into copying whole 32 bits at once)
PR tree-optimization/78821
	* gimple-ssa-store-merging.c (find_bswap_or_nop_load): Give up
	if base is TARGET_MEM_REF.  If base is not MEM_REF, set base_addr
	to the address of the base rather than the base itself.
	(find_bswap_or_nop_1): Just use pointer comparison for vuse check.
	(find_bswap_or_nop_finalize): New function.
	(find_bswap_or_nop): Use it.
	(bswap_replace): Return a tree rather than bool, change first
	argument from gimple * to gimple_stmt_iterator, allow inserting
	into an empty sequence, allow ins_stmt to be NULL - then emit
	all stmts into gsi.  Fix up MEM_REF address gimplification.
	(pass_optimize_bswap::execute): Adjust bswap_replace caller.
	(struct store_immediate_info): Add N and INS_STMT non-static
	data members.
	(store_immediate_info::store_immediate_info): Initialize them
	from newly added ctor args.
	(merged_store_group::apply_stores): Formatting fixes.  Sort by
	bitpos at the end.
	(stmts_may_clobber_ref_p): For stores call also
	refs_anti_dependent_p.
	(gather_bswap_load_refs): New function.
	(imm_store_chain_info::try_coalesce_bswap): New method.
	(imm_store_chain_info::coalesce_immediate_stores): Use it.
	(split_group): Handle LROTATE_EXPR and NOP_EXPR rhs_code specially.
	(imm_store_chain_info::output_merged_store): Fail if number of
	new estimated stmts is bigger or equal than old.  Handle LROTATE_EXPR
	and NOP_EXPR rhs_code.
	(pass_store_merging::process_store): Compute n and ins_stmt, if
	ins_stmt is non-NULL and the store rhs is otherwise invalid, use
	LROTATE_EXPR rhs_code.  Pass n and ins_stmt to store_immediate_info
	ctor.
	(pass_store_merging::execute): Calculate dominators.

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

From-SVN: r254948
2017-11-20 11:10:23 +01:00
Jakub Jelinek
dffec8ebdb tree-ssa-math-opts.c (nop_stats, [...]): Moved to ...
* tree-ssa-math-opts.c (nop_stats, bswap_stats, struct symbolic_number,
	BITS_PER_MARKER, MARKER_MASK, MARKER_BYTE_UNKNOWN, HEAD_MARKER, CMPNOP,
	CMPXCHG, do_shift_rotate, verify_symbolic_number_p,
	init_symbolic_number, find_bswap_or_nop_load, perform_symbolic_merge,
	find_bswap_or_nop_1, find_bswap_or_nop, pass_data_optimize_bswap,
	class pass_optimize_bswap, bswap_replace,
	pass_optimize_bswap::execute): Moved to ...
	* gimple-ssa-store-merging.c: ... this file.
	Include optabs-tree.h.
	(nop_stats, bswap_stats, do_shift_rotate, verify_symbolic_number_p,
	init_symbolic_number, find_bswap_or_nop_load, perform_symbolic_merge,
	find_bswap_or_nop_1, find_bswap_or_nop, bswap_replace): Put into
	anonymous namespace, remove static keywords.
	(pass_optimize_bswap::gate): Test BITS_PER_UNIT == 8 here...
	(pass_optimize_bswap::execute): ... rather than here.  Formatting fix.

From-SVN: r254947
2017-11-20 11:08:48 +01:00
Jan Hubicka
12b8cb2e5b re PR bootstrap/83062 (Bootstrap failure: libsanitizer/tsan/tsan_rtl.h:713:44: error: inlining failed in call to always_inline ‘void __tsan::MemoryRead(__tsan::ThreadState*, __sanitizer::uptr, __sanitizer: :uptr, int)’: caller is not optimized)
PR bootstrap/83062
	* ipa-inline.c (can_inline_edge_p): Fix typo in previous patch.

From-SVN: r254946
2017-11-20 09:55:02 +00:00
Aldy Hernandez
19a30b7123 vec.h (debug_helper): New function.
* vec.h (debug_helper): New function.
	(DEFINE_DEBUG_VEC): New macro.
	* hash-set.h (debug_helper): New function.
	(DEFINE_DEBUG_HASH_SET): New macro.
	* cfg.c (debug_slim (edge)): New function.
	Call DEFINE_DEBUG_VEC for edges.
	Call DEFINE_DEBUG_HASH_SET for edges.
	* cfghooks.c (debug_slim (basic_block)): New function.
	Call DEFINE_DEBUG_VEC for basic blocks.
	Call DEFINE_DEBUG_HASH_SET for basic blocks.
	* print-tree.c (debug_slim): New function to handle trees.
	Call DEFINE_DEBUG_VEC for trees.
	Call DEFINE_DEBUG_HASH_SET for trees.
	(debug (vec<tree, va_gc>) &): Remove.
	(debug (<vec<tree, va_gc>) *): Remove.
	* print-rtl.c (debug_slim): New function to handle const_rtx.
	Call DEFINE_DEBUG_VEC for rtx_def.
	Call DEFINE_DEBUG_VEC for rtx_insn.
	Call DEFINE_DEBUG_HASH_SET for rtx_def.
	Call DEFINE_DEBUG_HASH_SET for rtx_insn.
	* sel-sched-dump.c (debug (vec<rtx_insn *> &): Remove.
	(debug (vec<rtx_insn *> *ptr): Remove.
	(debug_insn_vector): Remove.
	* stor-layout.c (debug_rli): Call debug() instead of debug_vec_tree.

From-SVN: r254945
2017-11-20 08:32:57 +00:00
Tom de Vries
7cfaa4c643 Fix comparison mode in simplify_ternary_operation
2017-11-20  Tom de Vries  <tom@codesourcery.com>

	PR rtl-optimization/82020
	* simplify-rtx.c (simplify_ternary_operation): Fix comparison mode of
	IF_THEN_ELSE condition.

From-SVN: r254944
2017-11-20 08:20:35 +00:00
GCC Administrator
7476c7da18 Daily bump.
From-SVN: r254943
2017-11-20 00:16:19 +00:00
Eric Botcazou
3b36246bc2 re PR ada/83016 (gnat1: warning: command line option ‘-nostdinc++’ is valid for C++/ObjC++ but not for Ada)
PR ada/83016
	* gnatlink.adb (Process_Args): Accept multiple switches for --LINK.
	(Usage): Adjust.
	* gcc-interface/Makefile.in (GCC_LINK): Remove $(ADA_INCLUDES).
	(common-tools): Pass $(CC) as --GCC= and $(GCC_LINK) as --LINK= in
	the invocations of $(GNATLINK).
	(../../gnatdll$(exeext)): Likewise.
	(../../vxaddr2line$(exeext)): Likewise.
	(gnatmake-re): Likewise.
	(gnatlink-re): Likewise.

From-SVN: r254940
2017-11-19 22:36:25 +00:00