David Malcolm [Thu, 20 Jul 2017 16:40:33 +0000 (20 12:40 -0400)]
FIXME: C: add c_expr::get_location
David Malcolm [Thu, 20 Jul 2017 17:52:06 +0000 (20 13:52 -0400)]
FIXME: C WIP: inform_about_return_type
David Malcolm [Tue, 30 May 2017 21:34:20 +0000 (30 17:34 -0400)]
FIXME: hack in usage of Nicolas Seriot's JSON test suite to json.c selftests
David Malcolm [Wed, 19 Jul 2017 15:09:59 +0000 (19 11:09 -0400)]
FIXME: DEFER: add gcc/testsuite/g++.dg/mismatching-const.C (WIP testcase, would need blt when done)
David Malcolm [Wed, 19 Jul 2017 14:37:18 +0000 (19 10:37 -0400)]
FIXME: DEFER: changes to gcc/testsuite/g++.dg/warn/Wsuggest-final.C (doesn't seem to be finished, presumably would need blt)
David Malcolm [Wed, 19 Jul 2017 14:29:25 +0000 (19 10:29 -0400)]
FIXME: DEFER: add gcc/testsuite/gcc.dg/noreturn-9.c (uses blt; appears to be unfinished)
David Malcolm [Tue, 18 Jul 2017 21:25:31 +0000 (18 17:25 -0400)]
FIXME: ipa-pure-const.c: WIP on suggesting attributes (needs blt, and lots of icky C vs C++ work)
David Malcolm [Tue, 18 Jul 2017 01:23:51 +0000 (17 21:23 -0400)]
Fix selftest::read_file for empty file
selftest::read_file currently assumes it has a non-empty file;
when loading an empty file it dies with an assertion failure,
or a write through NULL if assertions are disabled.
This patch fixes this case, removing this limitation.
gcc/ChangeLog:
* selftest.c (selftest::read_file): Handle 0-length files.
(selftest::test_read_empty_file): New function.
(selftest::selftest_c_tests): Call it.
David Malcolm [Wed, 19 Jul 2017 15:40:31 +0000 (19 11:40 -0400)]
*** Deferred ***
David Malcolm [Mon, 24 Jul 2017 21:23:30 +0000 (24 17:23 -0400)]
FIXME: workaround for layout ruler width when not at a tty
David Malcolm [Tue, 23 May 2017 16:58:19 +0000 (23 12:58 -0400)]
Language Server Protocol: work-in-progess on testsuite
This file adds the beginnings of a testsuite for the LSP
implementation.
The test cases are implemented in Python; they aren't currently
wired up to DejaGnu (I've been invoking them directly).
There's an automated test case, and a PyGTK UI.
Both require the language server to be manually started
(see the comments).
gcc/testsuite/ChangeLog:
* gcc.dg/lsp/lsp.py: New file.
* gcc.dg/lsp/test.c: New test file.
* gcc.dg/lsp/test.py: New test case.
* gcc.dg/lsp/toy-ide.py: New file.
David Malcolm [Tue, 23 May 2017 16:56:37 +0000 (23 12:56 -0400)]
Language Server Protocol: proof-of-concept GCC implementation
This patch implements a concrete subclass of the lsp::server
class implemented in the previous patch, wiring it up to GCC's
internal representation.
The patch is very much just a proof-of-concept; the only method it
implements is "textDocument/definition", to report the definition
of the symbol at a given source location; this is currently only
implemented when clicking on a struct-or-union-specifier
("struct foo" or "union foo" in the C frontend).
Notable other limitations include the complete absense of
support for change-monitoring, or the idea of where the "truth"
of the source is (filesystem vs memory). Also, this can only cope
with one source file and language at a time; a real implementation
would need some kind of multiplexing to cope with a project
consisting of multiple source files (and perhaps mixing C and C++).
gcc/ChangeLog:
* Makefile.in (OBJS): Add lsp-main.o.
* common.opt (-flsp): New option.
* lsp-main.c: New file.
* lsp-main.h: New file.
* toplev.c: Include "lsp-main.h".
(compile_file): Call serve_lsp if -flsp was used.
David Malcolm [Tue, 23 May 2017 16:56:02 +0000 (23 12:56 -0400)]
Language Server Protocol: add lsp::server abstract base class
This patch adds an lsp::server abstract base class for implementing
servers for the Language Server Protocol:
https://github.com/Microsoft/language-server-protocol
along with supporting classes mirroring those from the protocol
description.
The protocol is specified in camel case, and so these classes use
camel case, to mirror the protocol definition.
Only a small subset of the protocol is implemented, enough for
a proof-of-concept.
Ideally much/all of this would be autogenerated from the
protocol definition.
The patch also implements an ::lsp::jsonrpc_server subclass of
::jsonrpc::server, handling the marshalling from JSON-RPC to
an lsp::server instance as vfunc calls,
gcc/ChangeLog:
* Makefile.in (OBJS): Add lsp.o.
* lsp.c: New file.
* lsp.h: New file.
* selftest-run-tests.c (selftest::run_tests): Call
selftest::lsp_c_tests.
* selftest.h (selftest::lsp_c_tests): New decl.
David Malcolm [Tue, 23 May 2017 16:54:45 +0000 (23 12:54 -0400)]
Add implementation of JSON-RPC
This patch adds an abstract base class for implementing
JSON-RPC 2.0 servers, along with a class for wiring them
up to the HTTP server class implemented in the previous
patch, supporting the serving of JSON-RPC over HTTP on a port.
gcc/ChangeLog:
* Makefile.in (OBJS): Add json-rpc.o.
* json-rpc.c: New file.
* json-rpc.h: New file.
* selftest-run-tests.c (selftest::run_tests): Call
selftest::json_rpc_c_tests.
* selftest.h (selftest::json_rpc_c_tests.): New decl.
David Malcolm [Tue, 23 May 2017 16:50:55 +0000 (23 12:50 -0400)]
Add http-server.h and http-server.c
This patch implements an abstract class of HTTP server, as a subclass
of the server class implemented in the previous patch.
gcc/ChangeLog:
* Makefile.in (OBJS): Add http-server.o.
* http-server.c: New file.
* http-server.h: New file.
* selftest-run-tests.c (selftest::run_tests): Call
selftest::http_server_c_tests.
* selftest.h (selftest::http_server_c_tests): New decl.
David Malcolm [Tue, 23 May 2017 16:55:20 +0000 (23 12:55 -0400)]
Add server.h and server.c
This patch adds a "server" abstract base class for listening
on a port, for use by the later patches to implement an LSP server.
gcc/ChangeLog:
* Makefile.in (OBJS): Add server.o.
* server.c: New file.
* server.h: New file.
David Malcolm [Tue, 23 May 2017 16:53:40 +0000 (23 12:53 -0400)]
Add JSON implementation
This patch adds support to gcc for reading and writing JSON,
based on DOM-like trees of json::value instances.
gcc/ChangeLog:
* Makefile.in (OBJS): Add json.o.
* json.c: New file.
* json.h: New file.
* selftest-run-tests.c (selftest::run_tests): Call json_c_tests.
* selftest.h (selftest::json_c_tests): New decl.
David Malcolm [Tue, 18 Jul 2017 21:23:13 +0000 (18 17:23 -0400)]
C++: provide fix-it hints in -Wsuggest-override
This patch extends -Wsuggest-override so that the suggestions
contain fix-it hints, provided that it can get at the correct
location. Doing so requires the blt_node infrastructure.
gcc/cp/ChangeLog:
* class.c: Include "gcc-rich-location.h" and "blt.h".
(check_for_override): When suggesting functions that can be marked
"override", if the location is available via BLT nodes, add a
fix-it hint.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wsuggest-override.C: Add -fdiagnostics-show-caret and
-fblt to the options. Update expected output to show the fix-it
hints.
David Malcolm [Wed, 19 Jul 2017 01:17:29 +0000 (18 21:17 -0400)]
C++: highlight return types when complaining about mismatches
This patch uses the BLT infrastructure to highlight the return type
of a function when complaining about code within the function that
doesn't match it.
For example, given:
error: return-statement with a value, in function returning 'void' [-fpermissive]
return 42;
^~
the patch adds this note:
note: the return type was declared as 'void' here
void test_1 (void)
^~~~
gcc/cp/ChangeLog:
* cp-tree.h (attempt_to_highlight_return_type): New decl.
* decl.c (finish_function): Call attempt_to_highlight_return_type
when complaining about missing return statements in non-void
functions.
* typeck.c: Include "blt.h".
(get_location_of_return_type): New function.
(attempt_to_highlight_return_type): New function.
(check_return_expr): Call attempt_to_highlight_return_type when
complaining about return statements that mismatch the "void-ness"
of the function.
gcc/testsuite/ChangeLog:
* g++.dg/bad-return-type.C: New test case.
David Malcolm [Thu, 20 Jul 2017 18:53:06 +0000 (20 14:53 -0400)]
C: highlight return types when complaining about mismatches
This patch uses the BLT infrastructure to highlight the return type
of a function when complaining about code within the function that
doesn't match it.
For example, given:
warning: 'return' with a value, in function returning void
return 42;
^~
note: declared here
void test_1 (void)
^~~~~~
the patch converts the location and wording of the note to highlight
the return type:
warning: 'return' with a value, in function returning void
return 42;
^~
note: the return type was declared as 'void' here
void test_1 (void)
^~~~
gcc/c/ChangeLog:
* c-typeck.c (get_location_of_return_type): New function.
(attempt_to_highlight_return_type): New function.
(c_finish_return): Convert "inform" calls to calls to
attempt_to_highlight_return_type.
gcc/testsuite/ChangeLog:
* gcc.dg/bad-return-type.c: New test case.
David Malcolm [Tue, 18 Jul 2017 21:35:13 +0000 (18 17:35 -0400)]
C++: use BLT to highlight parameter of callee decl for mismatching types
This patch uses the BLT infrastructure to improve:
extern int callee_1 (int one, const char *two, float three);
int test_1 (int first, int second, float third)
{
return callee_1 (first, second, third);
}
from:
error: invalid conversion from 'int' to 'const char*' [-fpermissive]
return callee_1 (first, second, third);
^
note: initializing argument 2 of 'int callee_1(int, const char*, float)'
extern int callee_1 (int one, const char *two, float three);
^~~~~~~~
to:
error: invalid conversion from 'int' to 'const char*' [-fpermissive]
return callee_1 (first, second, third);
^
note: initializing argument 2 of 'int callee_1(int, const char*, float)'
extern int callee_1 (int one, const char *two, float three);
^~~~~~~~~~~~~~~
by locating the pertinent parameter within the decl, by traversing the
BLT tree (if present).
gcc/cp/ChangeLog:
* call.c: Include "blt.h".
(get_blt_node_for_function_decl): New function.
(get_fndecl_argument_location): New function.
(convert_like_real): Use the above when determining the location
for the note about a mismatching argument.
gcc/testsuite/ChangeLog:
* g++.dg/diagnostic/param-type-mismatch.C: Add -fblt to the
options. Update expected output to show that the pertinent
callee parameters are underlined.
David Malcolm [Tue, 18 Jul 2017 21:15:11 +0000 (18 17:15 -0400)]
C: use BLT to highlight parameter of callee decl for mismatching types
This patch to the C frontend uses the BLT infrastructure to improve:
extern int callee_1 (int one, const char *two, float three);
int test_1 (int first, int second, float third)
{
return callee_1 (first, second, third);
}
from:
warning: passing argument 2 of 'callee_1' makes pointer from integer without a cast [-Wint-conversion]
return callee_1 (first, second, third);
^~~~~~
note: expected 'const char *' but argument is of type 'int'
extern int callee_1 (int one, const char *two, float three);
^~~~~~~~
to:
warning: passing argument 2 of 'callee_1' makes pointer from integer without a cast [-Wint-conversion]
return callee_1 (first, second, third);
^~~~~~
note: expected 'const char *' but argument is of type 'int'
extern int callee_1 (int one, const char *two, float three);
^~~~~~~~~~~~~~~
by locating the pertinent parameter within the decl, by traversing the
BLT tree (if present).
gcc/c/ChangeLog:
* c-typeck.c: Include "blt.h".
(get_fndecl_argument_location): New function.
(convert_for_assignment): Replace calls to "inform" with...
(inform_for_arg): ...this new function, attempting to highlight
the pertinent parameter.
gcc/testsuite/ChangeLog:
* gcc.dg/param-type-mismatch.c: Add -fblt to options. Update
expected underlining to show the pertinent parameters.
David Malcolm [Thu, 20 Jul 2017 16:40:04 +0000 (20 12:40 -0400)]
C++ frontend: capture BLT information
This patch extends the C++ frontend so that it optionally builds a BLT tree,
by using an auto_blt_node class within the recursive descent through the
parser, so that its ctor/dtors build the blt_node hierarchy; this is
rapidly (I hope) rejected in the no -fblt case, so that nothing is built
by default.
This version of the parser captures a blt_node for every token consumed by
cp_parser_require, so there are a lot of leaf nodes in the resulting tree.
Caveat: currently the patch blithely ignores "tentative parsing" (for
the sake of posting this kit sooner rather than later).
All of this is largely a no-op if -fblt is not provided.
gcc/cp/ChangeLog:
* cp-tree.h (class blt_node): Forward decl.
(struct cp_parameter_declarator): Add "bltnode" field.
(struct cp_declarator): Likewise.
* decl.c: Include "blt.h"
(grokdeclarator): Rename to...
(grokdeclarator_1): ...this.
(grokdeclarator): Reintroduce by calling grokdeclarator_1,
and associating any bltnode in the declarator with the new tree.
* parser.c: Include "blt.h".
(class auto_blt_node): New class.
(AUTO_BLT_NODE): New macro.
AUTO_BLT_NODE_WITH_RETURN): New macro.
(CURRENT_BLT_NODE): New macro.
(BLT_ADD_NEXT_TOKEN): New macro.
(ADD_NODE_FOR_NEXT_TOKEN): New macro.
(BLT_SET_TREE): New macro.
(add_node_for_next_token): New functions.
(auto_blt_node::auto_blt_node): New ctor.
(auto_blt_node::~auto_blt_node): New dtor.
(auto_blt_node::set_tree): New method.
(make_declarator): Initialize the bltnode field.
(make_parameter_declarator): Add new "bltnode" param.
(cp_parser_identifier): Add AUTO_BLT_NODE.
(cp_parser_translation_unit): Likewise.
(cp_parser_primary_expression): Likewise.
(cp_parser_id_expression): Likewise.
(cp_parser_unqualified_id): Likewise.
(cp_parser_postfix_expression): Likewise; add BLT_ADD_NEXT_TOKEN.
(cp_parser_parenthesized_expression_list): Add AUTO_BLT_NODE.
(cp_parser_unary_expression): Add AUTO_BLT_NODE.
(cp_parser_assignment_expression): Likewise.
(cp_parser_declaration_seq_opt): Likewise.
(cp_parser_declaration): Likewise.
(cp_parser_block_declaration): Likewise.
(cp_parser_simple_declaration): Likewise.
(cp_parser_decl_specifier_seq): Likewise; add
ADD_NODE_FOR_NEXT_TOKEN in various places.
(cp_parser_template_declaration): Add AUTO_BLT_NODE.
(cp_parser_template_parameter_list): Likewise.
(cp_parser_explicit_instantiation): Likewise.
(cp_parser_explicit_specialization): Likewise.
(cp_parser_type_specifier): Likewise; add ADD_NODE_FOR_NEXT_TOKEN
in various places.
(update_blt_for_function_definition): New function.
(cp_parser_init_declarator): Call
update_blt_for_function_definition.
(cp_parser_declarator): Add AUTO_BLT_NODE.
(cp_parser_direct_declarator): Likewise; add BLT_ADD_NEXT_TOKEN;
set the bltnode of the declarator.
(cp_parser_cv_qualifier_seq_opt): Add AUTO_BLT_NODE; add
ADD_NODE_FOR_NEXT_TOKEN.
(cp_parser_parameter_declaration_clause): Add AUTO_BLT_NODE; add
BLT_ADD_NEXT_TOKEN in various places. Add BLT_SET_TREE.
(cp_parser_parameter_declaration_list): Add AUTO_BLT_NODE; add
BLT_SET_TREE in various places.
(cp_parser_parameter_declaration): Add AUTO_BLT_NODE; pass
CURRENT_BLT_NODE to make_parameter_declarator.
(cp_parser_class_specifier_1): Add AUTO_BLT_NODE; add BLT_SET_TREE.
(cp_parser_class_head): Add AUTO_BLT_NODE.
(cp_parser_class_key): Likewise.
(cp_parser_member_declaration): Likewise. Ensure decl is
initialized, and associate it with the blt_node.
(cp_parser_type_id_list): Add AUTO_BLT_NODE.
(cp_parser_try_block): Likewise.
(cp_parser_function_try_block): Likewise.
(cp_parser_handler_seq): Likewise.
(cp_parser_handler): Likewise.
(cp_parser_exception_declaration): Likewise.
(cp_parser_throw_expression): Likewise.
(cp_parser_asm_specification_opt): Likewise.
(cp_parser_require): Call BLT_ADD_NEXT_TOKEN.
(c_parse_file): Implement -fdump-blt. Set the_blt_root_node.
* parser.h (class blt_node): Forward decl.
(struct cp_parser): Add fields "blt_root_node" and "blt_current_node".
* pt.c: Include "blt.h".
(build_template_decl): Associate any blt_node for the decl with the
template instantation.
David Malcolm [Thu, 20 Jul 2017 16:37:47 +0000 (20 12:37 -0400)]
C frontend: capture BLT information
This patch extends the C frontend so that it optionally builds a BLT tree,
by using an auto_blt_node class within the recursive descent through the
parser, so that its ctor/dtors build the blt_node hierarchy; this is
rapidly (I hope) rejected in the no -fblt case, so that nothing is built
by default.
gcc/c/ChangeLog:
* c-decl.c: Include "blt.h".
(build_array_declarator): Initialize bltnode field of new
declarator.
(start_decl): Associate this decl with any bltnode of the
declarator.
(start_function): Likewise.
(build_attrs_declarator): Initialize bltnode field of new
declarator.
(build_function_declarator): Add bltnode param, and use it to
initialize the bltnode field of the new declarator.
(build_id_declarator): Likewise.
(make_pointer_declarator): Likewise.
* c-parser.c: Include "blt.h".
(struct c_parser): Add fields "last_token_location",
"blt_root_node", "blt_current_node".
(class auto_blt_node): New class.
(AUTO_BLT_NODE): New macro.
(CURRENT_BLT_NODE): New macro.
(auto_blt_node::auto_blt_node): New ctor.
(auto_blt_node::~auto_blt_node): New dtor.
(auto_blt_node::set_tree): New method.
(c_parser_consume_token): Update last_token_location.
(c_parser_translation_unit): Add AUTO_BLT_NODE.
(c_parser_external_declaration): Likewise.
(c_parser_declspecs): Likewise, in multiple places.
(c_parser_struct_or_union_specifier): Likewise. Set the tree
on the struct-contents and the struct-or-union-specifier.
(c_parser_struct_declaration): Add AUTO_BLT_NODE.
(c_parser_declarator): Likewise.
(c_parser_direct_declarator): Likewise. Set up the bltnode of
the declarator.
(c_parser_direct_declarator_inner): Pass the bltnode to the
declarator.
(c_parser_parms_declarator): Add AUTO_BLT_NODE.
(c_parser_parameter_declaration): Likewise.
(c_parser_expr_no_commas): Likewise.
(c_parser_expression): Likewise.
(c_parser_expr_list): Likewise.
(c_parse_file): Handle -fdump-blt; set the_blt_root_node.
* c-tree.h (class blt_node): Add forward decl.
(struct c_declarator): Add "bltnode" field.
(build_function_declarator): Add blt_node * param.
David Malcolm [Thu, 20 Jul 2017 16:08:23 +0000 (20 12:08 -0400)]
Core of BLT implementation
This patch implements the core of the new "blt" type: an optional
"on-the-side" hierarchical recording of source ranges, associated
with grammar productions, with a spare mapping to our regular
"tree" type.
Caveats:
* the name is a placeholder (see the comment in blt.h)
* I'm ignoring memory management for now (e.g. how do these get freed?)
gcc/ChangeLog:
* Makefile.in (OBJS): Add blt.o.
* blt.c: New file.
* blt.def: New file.
* blt.h: New file.
gcc/c-family/ChangeLog:
* c.opt (fblt): New option.
(fdump-blt): New option.
gcc/ChangeLog:
* selftest-run-tests.c (selftest::run_tests): Call
selftest::blt_c_tests.
* selftest.h (selftest::blt_c_tests): New decl.
David Malcolm [Thu, 20 Jul 2017 15:41:49 +0000 (20 11:41 -0400)]
diagnostics: support prefixes within diagnostic_show_locus
This patch reworks diagnostic_show_locus so that it respects
the prefix of the pretty_printer.
This is used later in the patch kit for embedding source dumps
within a hierarchical tree-like dump, by using the ASCII art for the
tree as the prefix.
gcc/c-family/ChangeLog:
* c-opts.c (c_diagnostic_finalizer): Move call to
pp_destroy_prefix to before call to diagnostic_show_locus.
gcc/ChangeLog:
* diagnostic-show-locus.c (layout::print_source_line):
Call pp_emit_prefix.
(layout::should_print_annotation_line_p): Likewise.
(layout::print_leading_fixits): Likewise.
(layout::print_trailing_fixits): Likewise, for first correction.
(layout::print_trailing_fixits): Replace call to move_to_column
with a call to print_newline, to avoid emitting a prefix after
last line.
(layout::move_to_column): Call pp_emit_prefix.
(layout::show_ruler): Likewise.
(diagnostic_show_locus): Remove save/restore of prefix.
(selftest::test_diagnostic_context::test_diagnostic_context): Set
prefixing rule to DIAGNOSTICS_SHOW_PREFIX_NEVER.
(selftest::test_one_liner_fixit_remove): Verify the interaction of
pp_set_prefix with rulers and fix-it hints.
* diagnostic.c (default_diagnostic_start_span_fn): Don't modify
the prefix.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
(custom_diagnostic_finalizer): Reset pp_indentation of printer.
David Malcolm [Wed, 19 Jul 2017 15:06:13 +0000 (19 11:06 -0400)]
Add param-type-mismatch.c/C testcases as a baseline
Amongst other things, this patch kit aims to improve our handling
of mismatched types within function calls.
For example, given:
extern int callee_1 (int one, const char *two, float three);
int test_1 (int first, int second, float third)
{
return callee_1 (first, second, third);
}
the C++ FE currently reports:
error: invalid conversion from 'int' to 'const char*' [-fpermissive]
return callee_1 (first, second, third);
^
note: initializing argument 2 of 'int callee_1(int, const char*, float)'
extern int callee_1 (int one, const char *two, float three);
^~~~~~~~
when it ought to underline the pertinent parts of the code:
error: invalid conversion from 'int' to 'const char*' [-fpermissive]
return callee_1 (first, second, third);
^~~~~~
note: initializing argument 2 of 'int callee_1(int, const char*, float)'
extern int callee_1 (int one, const char *two, float three);
^~~~~~~~~~~~~~~
The C FE currently does better, underlining the pertinent argument at
the callsite (due to the "vec<location_t> arg_loc" passed around
when the call is created); but, like the C++ frontend, it doesn't
underline the pertinent parameter at the decl of the callee.
This patch adds a pair of test cases to exercise various cases of
this in the C and C++ frontends, to establish a baseline for how
we currently handle these; the "TODO" comments in the test cases
note the aspects where we could do better (some of which are fixed
by this kit).
gcc/testsuite/ChangeLog:
* g++.dg/diagnostic/param-type-mismatch.C: New test acse.
* gcc.dg/param-type-mismatch.c: New test case.
wschmidt [Mon, 17 Jul 2017 19:12:11 +0000 (17 19:12 +0000)]
2017-07-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/81162
* gcc.dg/pr81162.c: Move this to...
* gcc.dg/ubsan/pr81162.c: ...here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250284 138bc75d-0d04-0410-961f-82ee72b054a4
reichelt [Mon, 17 Jul 2017 16:58:00 +0000 (17 16:58 +0000)]
* parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
friend outside class and obsolete auto as storage-class-specifier.
* g++.dg/diagnostic/friend1.C: New test.
* g++.dg/cpp0x/auto1.C: Add check for fix-it hint.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250282 138bc75d-0d04-0410-961f-82ee72b054a4
nathan [Mon, 17 Jul 2017 16:52:31 +0000 (17 16:52 +0000)]
* class.c (maybe_warn_about_overly_private_class): Ignore public
copy ctors.
* g++.dg/warn/ctor-dtor-privacy-3.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250281 138bc75d-0d04-0410-961f-82ee72b054a4
nathan [Mon, 17 Jul 2017 15:57:59 +0000 (17 15:57 +0000)]
* class.c (type_has_user_declared_move_constructor,
type_has_user_declared_move_assign): Combine into ...
(classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
* cp-tree.h (type_has_user_declared_move_constructor,
type_has_user_declared_move_assign): Combine into ...
(classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
* method.c (maybe_explain_implicit_delete): Use it.
(lazily_declare_fn): Use it.
* tree.c (type_has_nontrivial_copy_init): Use it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250280 138bc75d-0d04-0410-961f-82ee72b054a4
edlinger [Mon, 17 Jul 2017 15:54:32 +0000 (17 15:54 +0000)]
2017-07-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
* lib/gcc-dg.exp: Increase expect's match buffer size.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250279 138bc75d-0d04-0410-961f-82ee72b054a4
chefmax [Mon, 17 Jul 2017 14:58:00 +0000 (17 14:58 +0000)]
2017-07-17 Yury Gribov <tetra2005@gmail.com>
gcc/
* tree-vrp.c (compare_assert_loc): Fix comparison function
to return predictable results.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250278 138bc75d-0d04-0410-961f-82ee72b054a4
claziss [Mon, 17 Jul 2017 12:59:56 +0000 (17 12:59 +0000)]
[ARC] Deprecate mexpand-adddi option.
Emitting subregs in the expand will result in broken code due to LRA handling of them. Issue observed while turning on mlra and mexpand-adddi options using dejagnu test suite. Deprecate this
option.
gcc/
2017-04-26 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.md (adddi3): Remove support for mexpand-adddi
option.
(subdi3): Likewise.
* config/arc/arc.opt (mexpand-adddi): Deprecate it.
* doc/invoke.texi (mexpand-adddi): Update text.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250276 138bc75d-0d04-0410-961f-82ee72b054a4
claziss [Mon, 17 Jul 2017 12:59:45 +0000 (17 12:59 +0000)]
[ARC] [LRA] Avoid emitting COND_EXEC during expand.
Emmitting COND_EXEC rtxes during expand does introduces errors due to LRA handling of them. Issue discovered while running dejagnu test suit with mlra option on.
gcc/
2017-07-17 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.md (clzsi2): Expand to an arc_clzsi2 instruction
that also clobbers the CC register. The old expand code is moved
to ...
(*arc_clzsi2): ... here.
(ctzsi2): Expand to an arc_ctzsi2 instruction that also clobbers
the CC register. The old expand code is moved to ...
(arc_ctzsi2): ... here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250275 138bc75d-0d04-0410-961f-82ee72b054a4
claziss [Mon, 17 Jul 2017 12:32:02 +0000 (17 12:32 +0000)]
[ARC] Enable indexed loads for elf targers.
Enable indexed loads only for elf target, as the linux ones need more testing.
gcc/
2017-02-28 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.opt (mindexed-loads): Use initial value
TARGET_INDEXED_LOADS_DEFAULT.
(mauto-modify-reg): Use initial value
TARGET_AUTO_MODIFY_REG_DEFAULT.
* config/arc/elf.h (TARGET_INDEXED_LOADS_DEFAULT): Define.
(TARGET_AUTO_MODIFY_REG_DEFAULT): Likewise.
* config/arc/linux.h (TARGET_INDEXED_LOADS_DEFAULT): Define.
(TARGET_AUTO_MODIFY_REG_DEFAULT): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250274 138bc75d-0d04-0410-961f-82ee72b054a4
nathan [Mon, 17 Jul 2017 11:54:03 +0000 (17 11:54 +0000)]
* semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
semantics, simplify implementation.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250272 138bc75d-0d04-0410-961f-82ee72b054a4
marxin [Mon, 17 Jul 2017 11:44:54 +0000 (17 11:44 +0000)]
Do not allow -fgnu-tm w/ -fsanitize={kernel-,}address (PR sanitizer/81302).
2017-07-17 Martin Liska <mliska@suse.cz>
PR sanitizer/81302
* opts.c (finish_options): Do not allow -fgnu-tm
w/ -fsanitize={kernel-,}address. Say sorry.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250271 138bc75d-0d04-0410-961f-82ee72b054a4
amker [Mon, 17 Jul 2017 11:40:54 +0000 (17 11:40 +0000)]
PR target/81369
* tree-loop-distribution.c (classify_partition): Only assert on
numer of iterations.
(merge_dep_scc_partitions): Delete prameter. Update function call.
(distribute_loop): Remove code handling loop with unknown niters.
(pass_loop_distribution::execute): Skip loop with unknown niters.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250270 138bc75d-0d04-0410-961f-82ee72b054a4
amker [Mon, 17 Jul 2017 11:38:15 +0000 (17 11:38 +0000)]
PR target/81369
* tree-loop-distribution.c (merge_dep_scc_partitions): Sink call to
function sort_partitions_by_post_order.
gcc/testsuite
* gcc.dg/tree-ssa/pr81369.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250269 138bc75d-0d04-0410-961f-82ee72b054a4
amker [Mon, 17 Jul 2017 11:34:30 +0000 (17 11:34 +0000)]
PR tree-optimization/81374
* tree-loop-distribution.c (pass_loop_distribution::execute): Record
the max index of basic blocks, rather than number of basic blocks.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250268 138bc75d-0d04-0410-961f-82ee72b054a4
claziss [Mon, 17 Jul 2017 11:04:37 +0000 (17 11:04 +0000)]
[ARC] Consolidate PIC implementation.
This patch refactors a number of functions and compiler hooks into using a
single function which checks if a rtx is suited for pic or not. Removed
functions are arc_legitimate_pc_offset_p and arc_legitimate_pic_operand_p
beeing replaced by calls to arc_legitimate_pic_addr_p. Thus we have an
unitary way of checking a rtx beeing pic.
gcc/
2017-07-17 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc-protos.h (arc_legitimate_pc_offset_p): Remove
proto.
(arc_legitimate_pic_operand_p): Likewise.
* config/arc/arc.c (arc_legitimate_pic_operand_p): Remove
function.
(arc_needs_pcl_p): Likewise.
(arc_legitimate_pc_offset_p): Likewise.
(arc_legitimate_pic_addr_p): Remove LABEL_REF case, as this
function is also used in constrains.md.
(arc_legitimate_constant_p): Use arc_legitimate_pic_addr_p to
validate pic constants. Handle CONST_INT, CONST_DOUBLE, MINUS and
PLUS. Only return true/false in known cases, otherwise assert.
(arc_legitimate_address_p): Remove arc_legitimate_pic_addr_p as it
is already called in arc_legitimate_constant_p.
* config/arc/arc.h (CONSTANT_ADDRESS_P): Consider also LABEL for
pic addresses.
(LEGITIMATE_PIC_OPERAND_P): Use
arc_raw_symbolic_reference_mentioned_p function.
* config/arc/constraints.md (Cpc): Use arc_legitimate_pic_addr_p
function.
(Cal): Likewise.
(C32): Likewise.
gcc/testsuite
2017-07-17 Claudiu Zissulescu <claziss@synopsys.com>
* gcc.target/arc/pr9000674901.c: New file.
* gcc.target/arc/pic-1.c: Likewise.
* gcc.target/arc/pr9001191897.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250267 138bc75d-0d04-0410-961f-82ee72b054a4
claziss [Mon, 17 Jul 2017 10:46:55 +0000 (17 10:46 +0000)]
[PATCH] [ARC] Add support for naked functions.
gcc/
2017-07-17 Claudiu Zissulescu <claziss@synopsys.com>
Andrew Burgess <andrew.burgess@embecosm.com>
* config/arc/arc-protos.h (arc_compute_function_type): Change prototype.
(arc_return_address_register): New function.
* config/arc/arc.c (arc_handle_fndecl_attribute): New function.
(arc_handle_fndecl_attribute): Add naked attribute.
(TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Define.
(TARGET_WARN_FUNC_RETURN): Likewise.
(arc_allocate_stack_slots_for_args): New function.
(arc_warn_func_return): Likewise.
(machine_function): Change type fn_type.
(arc_compute_function_type): Consider new naked function type,
change function return type.
(arc_must_save_register): Adapt to handle new
arc_compute_function_type's return type.
(arc_expand_prologue): Likewise.
(arc_expand_epilogue): Likewise.
(arc_return_address_regs): Delete.
(arc_return_address_register): New function.
(arc_epilogue_uses): Use above function.
* config/arc/arc.h (arc_return_address_regs): Delete prototype.
(arc_function_type): Change encoding, add naked type.
(ARC_INTERRUPT_P): Change to handle the new encoding.
(ARC_FAST_INTERRUPT_P): Likewise.
(ARC_NORMAL_P): Define.
(ARC_NAKED_P): Likewise.
(arc_compute_function_type): Delete prototype.
* config/arc/arc.md (in_ret_delay_slot): Use
arc_return_address_register function.
(simple_return): Likewise.
(p_return_i): Likewise.
gcc/testsuite
2017-07-17 Claudiu Zissulescu <claziss@synopsys.com>
Andrew Burgess <andrew.burgess@embecosm.com>
* gcc.target/arc/naked-1.c: New file.
* gcc.target/arc/naked-2.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250266 138bc75d-0d04-0410-961f-82ee72b054a4
jakub [Mon, 17 Jul 2017 10:20:41 +0000 (17 10:20 +0000)]
PR tree-optimization/81428
* match.pd (X / X -> one): Don't optimize _Fract divisions, as 1
can't be built for those types.
* gcc.dg/fixed-point/pr81428.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250265 138bc75d-0d04-0410-961f-82ee72b054a4
gjl [Mon, 17 Jul 2017 09:32:42 +0000 (17 09:32 +0000)]
Remove stuff dead since r239246.
* config/avr/avr-arch.h (avr_inform_devices): Remove dead proto.
* config/avr/avr-devices.c (mcu_name, comparator, avr_mcus_str)
(avr_inform_devices): Remove dead stuff.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250264 138bc75d-0d04-0410-961f-82ee72b054a4
gjl [Mon, 17 Jul 2017 09:13:36 +0000 (17 09:13 +0000)]
* gcc_update (files_and_dependencies)
[gcc/config/avr/avr-tables.opt]: Remove dead entry.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250263 138bc75d-0d04-0410-961f-82ee72b054a4
tnfchris [Mon, 17 Jul 2017 09:12:57 +0000 (17 09:12 +0000)]
2017-07-17 Tamar Christina <tamar.christina@arm.com>
* config/arm/arm_neon.h: Fix softp typo.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250262 138bc75d-0d04-0410-961f-82ee72b054a4
jakub [Mon, 17 Jul 2017 09:10:23 +0000 (17 09:10 +0000)]
PR tree-optimization/81365
* tree-ssa-phiprop.c (propagate_with_phi): When considering hoisting
aggregate moves onto bb predecessor edges, make sure there are no
loads that could alias the lhs in between the start of bb and the
loads from *phi.
* g++.dg/torture/pr81365.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250261 138bc75d-0d04-0410-961f-82ee72b054a4
gjl [Mon, 17 Jul 2017 08:56:06 +0000 (17 08:56 +0000)]
PR 80929
* config/avr/avr.c (avr_mul_highpart_cost): New static function.
(avr_rtx_costs_1) [TRUNCATE]: Use it to compute mul_highpart cost.
[LSHIFTRT, outer_code = TRUNCATE]: Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250258 138bc75d-0d04-0410-961f-82ee72b054a4
jakub [Mon, 17 Jul 2017 08:14:16 +0000 (17 08:14 +0000)]
PR tree-optimization/81396
* tree-ssa-math-opts.c (struct symbolic_number): Add n_ops field.
(init_symbolic_number): Initialize it to 1.
(perform_symbolic_merge): Add n_ops from both operands into the new
n_ops.
(find_bswap_or_nop): Don't consider n->n == cmpnop computations
without base_addr as useless if they need more than one operation.
(bswap_replace): Handle !bswap case for NULL base_addr.
* gcc.dg/tree-ssa/pr81396.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250257 138bc75d-0d04-0410-961f-82ee72b054a4
vries [Mon, 17 Jul 2017 07:49:22 +0000 (17 07:49 +0000)]
Insert diverging jump alap in nvptx_single
2017-07-17 Tom de Vries <tom@codesourcery.com>
PR target/81069
* config/nvptx/nvptx.c (nvptx_single): Insert diverging branch as late
as possible.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250256 138bc75d-0d04-0410-961f-82ee72b054a4
sh [Mon, 17 Jul 2017 05:27:13 +0000 (17 05:27 +0000)]
[SPARC/RTEMS] Add __FIX_LEON3FT_B2BST
In case the LEON3FT back-to-back store workaround is active
(sparc_fix_b2bst), then define the builtin define __FIX_LEON3FT_B2BST on
RTEMS. The intended use case for this is operating system code in
assembly language. See also:
https://lists.rtems.org/pipermail/devel/2017-July/018463.html
gcc/
* gcc/config/sparc/rtemself.h (TARGET_OS_CPP_BUILTINS): Add
conditional builtin define __FIX_LEON3FT_B2BST.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250254 138bc75d-0d04-0410-961f-82ee72b054a4
sh [Mon, 17 Jul 2017 05:18:42 +0000 (17 05:18 +0000)]
[RTEMS] Add multilibs for LEON3FT back-to-back store workaround
Replace MULTILIB_EXCEPTIONS with MULTILIB_REQUIRED for readability.
-mfix-gr712rc and -mfix-ut700 are currently equivalent.
gcc/
* config/sparc/t-rtems: Add mfix-gr712rc multilibs. Replace
MULTILIB_EXCEPTIONS with MULTILIB_REQUIRED. Match -mfix-gr712rc
with -mfix-ut700.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250252 138bc75d-0d04-0410-961f-82ee72b054a4
gccadmin [Mon, 17 Jul 2017 00:16:33 +0000 (17 00:16 +0000)]
Daily bump.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250251 138bc75d-0d04-0410-961f-82ee72b054a4
ebotcazou [Sun, 16 Jul 2017 22:03:54 +0000 (16 22:03 +0000)]
PR rtl-optimization/81424
* optabs.c (prepare_cmp_insn): Use copy_to_reg instead of force_reg
to remove potential trapping from operands if -fnon-call-exceptions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250246 138bc75d-0d04-0410-961f-82ee72b054a4
hubicka [Sun, 16 Jul 2017 18:25:26 +0000 (16 18:25 +0000)]
* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Use
profile_proability for scalling.
* scale_profile_for_vect_loop.c (scale_profile_for_vect_loop): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250245 138bc75d-0d04-0410-961f-82ee72b054a4
hubicka [Sun, 16 Jul 2017 16:36:48 +0000 (16 16:36 +0000)]
* cgraph.c (cgraph_edge::redirect_call_stmt_to_caller): Cleanup.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250243 138bc75d-0d04-0410-961f-82ee72b054a4
hubicka [Sun, 16 Jul 2017 16:35:00 +0000 (16 16:35 +0000)]
* cfgloopmanip.c (scale_loop_profile): Avoid use of REG_BR_PROB_BASE
fixpoint arithmetics.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250242 138bc75d-0d04-0410-961f-82ee72b054a4
hubicka [Sun, 16 Jul 2017 16:30:40 +0000 (16 16:30 +0000)]
* tree-ssa-loop-unswitch.c (hoist_guard): Avoid use of REG_BR_PROB_BASE
fixpoint arithmetics.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250241 138bc75d-0d04-0410-961f-82ee72b054a4
hubicka [Sun, 16 Jul 2017 16:28:57 +0000 (16 16:28 +0000)]
* asan.c (create_cond_insert_point): Avoid use of REG_BR_PROB_BASE
fixpoint arithmetics.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250240 138bc75d-0d04-0410-961f-82ee72b054a4
hubicka [Sun, 16 Jul 2017 16:10:58 +0000 (16 16:10 +0000)]
* profile-count.h (profile_probability::from_reg_br_prob_note,
profile_probability::to_reg_br_prob_note): New functions.
* doc/rtl.texi (REG_BR_PROB_NOTE): Update documentation.
* reg-notes.h (REG_BR_PROB, REG_BR_PRED): Update docs.
* predict.c (probability_reliable_p): Update.
(edge_probability_reliable_p): Update.
(br_prob_note_reliable_p): Update.
(invert_br_probabilities): Update.
(add_reg_br_prob_note): New function.
(combine_predictions_for_insn): Update.
* asan.c (asan_clear_shadow): Update.
* cfgbuild.c (compute_outgoing_frequencies): Update.
* cfgrtl.c (force_nonfallthru_and_redirect): Update.
(update_br_prob_note): Update.
(rtl_verify_edges): Update.
(purge_dead_edges): Update.
(fixup_reorder_chain): Update.
* emit-rtl.c (try_split): Update.
* ifcvt.c (cond_exec_process_insns): Update.
(cond_exec_process_if_block): Update.
(dead_or_predicable): Update.
* internal-fn.c (expand_addsub_overflow): Update.
(expand_neg_overflow): Update.
(expand_mul_overflow): Update.
* loop-doloop.c (doloop_modify): Update.
* loop-unroll.c (compare_and_jump_seq): Update.
* optabs.c (emit_cmp_and_jump_insn_1): Update.
* predict.h: Update.
* reorg.c (mostly_true_jump): Update.
* rtl.h: Update.
* config/aarch64/aarch64.c (aarch64_emit_unlikely_jump): Update.
* config/alpha/alpha.c (emit_unlikely_jump): Update.
* config/arc/arc.c: (emit_unlikely_jump): Update.
* config/arm/arm.c: (emit_unlikely_jump): Update.
* config/bfin/bfin.c (cbranch_predicted_taken_p): Update.
* config/frv/frv.c (frv_print_operand_jump_hint): Update.
* config/i386/i386.c (ix86_expand_split_stack_prologue): Update.
(ix86_print_operand): Update.
(ix86_split_fp_branch): Update.
(predict_jump): Update.
* config/ia64/ia64.c (ia64_print_operand): Update.
* config/mmix/mmix.c (mmix_print_operand): Update.
* config/powerpcspe/powerpcspe.c (output_cbranch): Update.
(rs6000_expand_split_stack_prologue): Update.
* config/rs6000/rs6000.c: Update.
* config/s390/s390.c (s390_expand_vec_strlen): Update.
(s390_expand_vec_movstr): Update.
(s390_expand_cs_tdsi): Update.
(s390_expand_split_stack_prologue): Update.
* config/sh/sh.c (sh_print_operand): Update.
(expand_cbranchsi4): Update.
(expand_cbranchdi4): Update.
* config/sparc/sparc.c (output_v9branch): Update.
* config/spu/spu.c (get_branch_target): Update.
(ea_load_store_inline): Update.
* config/tilegx/tilegx.c (cbranch_predicted_p): Update.
* config/tilepro/tilepro.c: Update.
* gcc.dg/predict-8.c: Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250239 138bc75d-0d04-0410-961f-82ee72b054a4
ebotcazou [Sun, 16 Jul 2017 13:36:27 +0000 (16 13:36 +0000)]
* gimplify.c (mostly_copy_tree_r): Revert latest change.
(gimplify_save_expr): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250238 138bc75d-0d04-0410-961f-82ee72b054a4
hubicka [Sun, 16 Jul 2017 11:21:39 +0000 (16 11:21 +0000)]
* ipa-visibility.c (function_and_variable_visibility): Fix pasto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250237 138bc75d-0d04-0410-961f-82ee72b054a4
hubicka [Sun, 16 Jul 2017 11:19:44 +0000 (16 11:19 +0000)]
* ipa-fnsummary.c (pass_data_ipa_fn_summary): Use
TV_IPA_FNSUMMARY.
* timevar.def (TV_IPA_FNSUMMARY): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250236 138bc75d-0d04-0410-961f-82ee72b054a4
ebotcazou [Sun, 16 Jul 2017 10:43:15 +0000 (16 10:43 +0000)]
* config/sparc/sparc.md (divdf3_fix): Add NOP to prevent back
to back store errata sensitive sequence from being generated.
(sqrtdf2_fix): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250234 138bc75d-0d04-0410-961f-82ee72b054a4
hubicka [Sun, 16 Jul 2017 10:06:00 +0000 (16 10:06 +0000)]
* tree-ssa-threadupdate.c (compute_path_counts,
update_joiner_offpath_counts): Use profile_probability.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250233 138bc75d-0d04-0410-961f-82ee72b054a4
reichelt [Sun, 16 Jul 2017 09:57:50 +0000 (16 09:57 +0000)]
Add forgotten Changelog entries for
* parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
in old-style cast diagnostic.
* typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
in useless cast diagnostic.
* error.c (type_to_string): Remove enum special handling.
* g++.dg/cpp1z/direct-enum-init1.C: Revert special enum handling.
* g++.dg/warn/pr12242.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250232 138bc75d-0d04-0410-961f-82ee72b054a4
reichelt [Sun, 16 Jul 2017 09:55:18 +0000 (16 09:55 +0000)]
* parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
in old-style cast diagnostic.
* typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
in useless cast diagnostic.
* error.c (type_to_string): Remove enum special handling.
* g++.dg/cpp1z/direct-enum-init1.C: Revert special enum handling.
* g++.dg/warn/pr12242.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250231 138bc75d-0d04-0410-961f-82ee72b054a4
gccadmin [Sun, 16 Jul 2017 00:16:22 +0000 (16 00:16 +0000)]
Daily bump.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250230 138bc75d-0d04-0410-961f-82ee72b054a4
ian [Sat, 15 Jul 2017 17:50:18 +0000 (15 17:50 +0000)]
* Makefile.am (CHECK_ENV): Set GOROOT.
(ECHO_ENV): Report setting GOROOT.
* Makefile.in: Rebuild.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250226 138bc75d-0d04-0410-961f-82ee72b054a4
ebotcazou [Sat, 15 Jul 2017 17:01:03 +0000 (15 17:01 +0000)]
PR ada/81446
* system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250224 138bc75d-0d04-0410-961f-82ee72b054a4
redi [Sat, 15 Jul 2017 15:43:22 +0000 (15 15:43 +0000)]
Reorder std::scoped_lock parameters as per P0739R0 DR status
* include/std/mutex (scoped_lock): Reorder std::adopt_lock_t parameter
as per P0739R0.
* testsuite/30_threads/scoped_lock/cons/1.cc: Reorder arguments.
* testsuite/30_threads/scoped_lock/cons/deduction.cc: Test deduction
with std::adopt_lock_t.
* testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Check
feature-test macro.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250223 138bc75d-0d04-0410-961f-82ee72b054a4
thopre01 [Sat, 15 Jul 2017 11:16:28 +0000 (15 11:16 +0000)]
Revert "[ARM] Fix definition of __ARM_FEATURE_NUMERIC_MAXMIN"
This reverts commit r250206.
2017-07-15 Thomas Preud'homme <thomas.preudhomme@arm.com>
Revert:
2017-07-14 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc
* config/arm/arm-c.c (arm_cpu_builtins): Define
__ARM_FEATURE_NUMERIC_MAXMIN solely based on TARGET_VFP5.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250222 138bc75d-0d04-0410-961f-82ee72b054a4
gccadmin [Sat, 15 Jul 2017 00:16:21 +0000 (15 00:16 +0000)]
Daily bump.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250221 138bc75d-0d04-0410-961f-82ee72b054a4
ian [Fri, 14 Jul 2017 22:25:26 +0000 (14 22:25 +0000)]
libgo: don't copy semt into runtime.inc
https://gcc.gnu.org/PR81449 reports a problem with the definition semt
in runtime.inc on some systems. Since the C code in libgo/runtime
doesn't need semt, just don't copy it into runtime.inc.
Reviewed-on: https://go-review.googlesource.com/48593
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250217 138bc75d-0d04-0410-961f-82ee72b054a4
ian [Fri, 14 Jul 2017 22:21:37 +0000 (14 22:21 +0000)]
cmd/go: use gccSupportsFlag for -fsplit-stack
Don't assume that all (or only) 386/amd64 compilers support
-fsplit-stack.
Reviewed-on: https://go-review.googlesource.com/48592
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250216 138bc75d-0d04-0410-961f-82ee72b054a4
kelvin [Fri, 14 Jul 2017 20:16:57 +0000 (14 20:16 +0000)]
gcc/ChangeLog:
2017-07-14 Kelvin Nilsen <kelvin@gcc.gnu.org>
* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add
array entries to represent __ieee128 versions of the
scalar_test_data_class, scalar_test_neg, scalar_extract_exp,
scalar_extract_sig, and scalar_insert_exp built-in functions.
(altivec_resolve_overloaded_builtin): Add special case handling
for the __builtin_scalar_insert_exp function, as represented by
the P9V_BUILTIN_VEC_VSIEDP constant.
* config/rs6000/rs6000-builtin.def (VSEEQP): Add scalar extract
exponent support for __ieee128 argument.
(VSESQP): Add scalar extract signature support for __ieee128
argument.
(VSTDCNQP): Add scalar test negative support for __ieee128
argument.
(VSIEQP): Add scalar insert exponent support for __int128 argument
with __ieee128 result.
(VSIEQPF): Add scalar insert exponent support for __ieee128
argument with __ieee128 result.
(VSTDCQP): Add scalar test data class support for __ieee128
argument.
(VSTDCNQP): Add overload support for scalar test negative with
__ieee128 argument.
(VSTDCQP): Add overload support for scalar test data class
__ieee128 argument.
* config/rs6000/vsx.md (UNSPEC_VSX_SXSIG) Replace
UNSPEC_VSX_SXSIGDP.
(UNSPEC_VSX_SIEXPQP): New constant.
(xsxexpqp): New insn for VSX scalar extract exponent quad
precision.
(xsxsigqp): New insn for VSX scalar extract significand quad
precision.
(xsiexpqpf): New insn for VSX scalar insert exponent quad
precision with floating point argument.
(xststdcqp): New expand for VSX scalar test data class quad
precision.
(xststdcnegqp): New expand for VSX scalar test negative quad
precision.
(xststdcqp): New insn to match expansions for VSX scalar test data
class quad precision and VSX scalar test negative quad precision.
* config/rs6000/rs6000.c (rs6000_expand_binop_builtin): Add
special case operand checking to enforce that second operand of
VSX scalar test data class with quad precision argument is a 7-bit
unsigned literal.
* doc/extend.texi (PowerPC AltiVec Built-in Functions): Add
prototypes and descriptions of __ieee128 versions of
scalar_extract_exp, scalar_extract_sig, scalar_insert_exp,
scalar_test_data_class, and scalar_test_neg built-in functions.
gcc/testsuite/ChangeLog:
2017-07-14 Kelvin Nilsen <kelvin@gcc.gnu.org>
* gcc.target/powerpc/bfp/scalar-cmp-exp-eq-3.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-eq-4.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-gt-3.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-gt-4.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-lt-3.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-lt-4.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-3.c: New test.
* gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-4.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-exp-3.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-exp-4.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-exp-5.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-exp-6.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-exp-7.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-sig-3.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-sig-4.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-sig-5.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-sig-6.c: New test.
* gcc.target/powerpc/bfp/scalar-extract-sig-7.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-10.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-11.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-12.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-13.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-14.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-15.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-6.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-7.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-8.c: New test.
* gcc.target/powerpc/bfp/scalar-insert-exp-9.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-10.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-11.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-12.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-13.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-14.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-15.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-8.c: New test.
* gcc.target/powerpc/bfp/scalar-test-data-class-9.c: New test.
* gcc.target/powerpc/bfp/scalar-test-neg-4.c: New test.
* gcc.target/powerpc/bfp/scalar-test-neg-5.c: New test.
* gcc.target/powerpc/bfp/scalar-test-neg-6.c: New test.
* gcc.target/powerpc/bfp/scalar-test-neg-7.c: New test.
* gcc.target/powerpc/bfp/scalar-test-neg-8.c: New test.
* gcc.target/powerpc/bfp/vec-extract-exp-4.c: New test.
* gcc.target/powerpc/bfp/vec-extract-exp-5.c: New test.
* gcc.target/powerpc/bfp/vec-extract-sig-4.c: New test.
* gcc.target/powerpc/bfp/vec-extract-sig-5.c: New test.
* gcc.target/powerpc/bfp/vec-insert-exp-10.c: New test.
* gcc.target/powerpc/bfp/vec-insert-exp-11.c: New test.
* gcc.target/powerpc/bfp/vec-insert-exp-8.c: New test.
* gcc.target/powerpc/bfp/vec-insert-exp-9.c: New test.
* gcc.target/powerpc/bfp/vec-test-data-class-8.c: New test.
* gcc.target/powerpc/bfp/vec-test-data-class-9.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250214 138bc75d-0d04-0410-961f-82ee72b054a4
redi [Fri, 14 Jul 2017 19:13:49 +0000 (14 19:13 +0000)]
Constrain std::variant constructor for class template argument deduction
2017-07-14 Jason Merrill <jason@redhat.com>
Jonathan Wakely <jwakely@redhat.com>
* include/std/variant (variant::variant(_Tp&&)): Constrain to remove
the constructor for empty variants from the candidate functions
during class template argument deduction.
* testsuite/20_util/variant/deduction.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250213 138bc75d-0d04-0410-961f-82ee72b054a4
wschmidt [Fri, 14 Jul 2017 18:06:45 +0000 (14 18:06 +0000)]
[gcc]
2016-07-14 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/81162
* gimple-ssa-strength-reduction.c (replace_mult_candidate): Don't
replace a negate with an add.
[gcc/testsuite]
2016-07-14 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/81162
* gcc.dg/pr81162.c: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250212 138bc75d-0d04-0410-961f-82ee72b054a4
msebor [Fri, 14 Jul 2017 16:16:23 +0000 (14 16:16 +0000)]
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/ssa-dse-30.c: Correct test to look for memmove
that bcopy is expected to be transformed to.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250209 138bc75d-0d04-0410-961f-82ee72b054a4
jgreenhalgh [Fri, 14 Jul 2017 15:48:57 +0000 (14 15:48 +0000)]
[Patch ARM] Document the +crypto extension on CPUs.
We don't document the list of CPU names which can take a +crypto extension
in the ARM port. This patch fixes that oversight.
gcc/
2017-14-07 James Greenhalgh <james.greenhalgh@arm.com>
* doc/invoke.texi (arm/-mcpu): Document +crypto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250207 138bc75d-0d04-0410-961f-82ee72b054a4
thopre01 [Fri, 14 Jul 2017 15:26:28 +0000 (14 15:26 +0000)]
[ARM] Fix definition of __ARM_FEATURE_NUMERIC_MAXMIN
Definition of __ARM_FEATURE_NUMERIC_MAXMIN checks for
TARGET_ARM_ARCH >= 8 and TARGET_NEON being true in addition to
TARGET_VFP5. However, instructions covered by this macro are part of
FPv5 which is available in ARMv7E-M architecture. This commit fixes the
macro to only check for TARGET_VFP5.
2017-07-14 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc/
* config/arm/arm-c.c (arm_cpu_builtins): Define
__ARM_FEATURE_NUMERIC_MAXMIN solely based on TARGET_VFP5.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250206 138bc75d-0d04-0410-961f-82ee72b054a4
thopre01 [Fri, 14 Jul 2017 15:26:19 +0000 (14 15:26 +0000)]
[ARM] Add support for ARM Cortex-R52 processor
2017-07-14 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc/
* config/arm/arm-cpus.in (cortex-r52): Add new entry.
(armv8-r): Set ARM Cortex-R52 as default CPU.
* config/arm/arm-tables.opt: Regenerate.
* config/arm/arm-tune.md: Regenerate.
* config/arm/driver-arm.c (arm_cpu_table): Add entry for ARM
Cortex-R52.
* doc/invoke.texi: Mention -mtune=cortex-r52 and availability of fp.dp
extension for -mcpu=cortex-r52.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250205 138bc75d-0d04-0410-961f-82ee72b054a4
thopre01 [Fri, 14 Jul 2017 15:26:09 +0000 (14 15:26 +0000)]
[ARM] Rewire -mfpu=fp-armv8 as VFPv5 + D32 + DP
fp-armv8 is currently defined as a double precision FPv5 with 32 D
registers *and* a special FP_ARMv8 bit. However FP for ARMv8 should only
bring 32 D registers on top of FPv5-D16 so this FP_ARMv8 bit is
spurious. As a consequence, many instruction patterns which are guarded
by TARGET_FPU_ARMV8 are unavailable to FPv5-D16 and FPv5-SP-D16.
This commit gets rid of TARGET_FPU_ARMV8 and rewire all uses to
expressions based on TARGET_VFP5, TARGET_VFPD32 and TARGET_VFP_DOUBLE.
It also redefine ISA_FP_ARMv8 to include the D32 capability to
distinguish it from FPv5-D16. At last, it sets the +fp.sp for ARMv8-R to
enable FPv5-SP-D16 (ie FP for ARMv8 with single precision only and 16 D
registers).
2017-07-14 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc/
* config/arm/arm-isa.h (isa_bit_FP_ARMv8): Delete enumerator.
(ISA_FP_ARMv8): Define as ISA_FPv5 and ISA_FP_D32.
* config/arm/arm-cpus.in (armv8-r): Define fp.sp as enabling FPv5.
(fp-armv8): Define it as FP_ARMv8 only.
config/arm/arm.h (TARGET_FPU_ARMV8): Delete.
(TARGET_VFP_FP16INST): Define using TARGET_VFP5 rather than
TARGET_FPU_ARMV8.
config/arm/arm.c (arm_rtx_costs_internal): Replace checks against
TARGET_FPU_ARMV8 by checks against TARGET_VFP5.
* config/arm/arm-builtins.c (arm_builtin_vectorized_function): Define
first ARM_CHECK_BUILTIN_MODE definition using TARGET_VFP5 rather
than TARGET_FPU_ARMV8.
* config/arm/arm-c.c (arm_cpu_builtins): Likewise for
__ARM_FEATURE_NUMERIC_MAXMIN macro definition.
* config/arm/arm.md (cmov<mode>): Condition on TARGET_VFP5 rather than
TARGET_FPU_ARMV8.
* config/arm/neon.md (neon_vrint): Likewise.
(neon_vcvt): Likewise.
(neon_<fmaxmin_op><mode>): Likewise.
(<fmaxmin><mode>3): Likewise.
* config/arm/vfp.md (l<vrint_pattern><su_optab><mode>si2): Likewise.
* config/arm/predicates.md (arm_cond_move_operator): Check against
TARGET_VFP5 rather than TARGET_FPU_ARMV8 and fix spacing.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250204 138bc75d-0d04-0410-961f-82ee72b054a4
dmalcolm [Fri, 14 Jul 2017 15:09:00 +0000 (14 15:09 +0000)]
c/c++: Add fix-it hints for suggested missing #includes
gcc/c-family/ChangeLog:
* c-common.c (try_to_locate_new_include_insertion_point): New
function.
(per_file_includes_t): New typedef.
(added_includes_t): New typedef.
(added_includes): New variable.
(maybe_add_include_fixit): New function.
* c-common.h (maybe_add_include_fixit): New decl.
gcc/c/ChangeLog:
* c-decl.c (implicitly_declare): When suggesting a missing
#include, provide a fix-it hint.
gcc/cp/ChangeLog:
* name-lookup.c (get_std_name_hint): Add '<' and '>' around
the header names.
(maybe_suggest_missing_header): Update for addition of '<' and '>'
to above. Provide a fix-it hint.
* pt.c: Include "gcc-rich-location.h"
(listify): Attempt to add fix-it hint for missing
#include <initializer_list>.
* rtti.c: Include "gcc-rich-location.h".
(typeid_ok_p): Attempt to add fix-it hint for missing
#include <typeinfo>.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/missing-initializer_list-include.C: New test case.
* g++.dg/lookup/missing-std-include-2.C: New test case.
* g++.dg/lookup/missing-std-include-3.C: New test case.
* g++.dg/rtti/missing-typeinfo-include.C: New test case.
* gcc.dg/missing-header-fixit-1.c: New test case.
* gcc.dg/missing-header-fixit-2.c: New test case.
* gcc.dg/missing-header-fixit-2.h: New header.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250203 138bc75d-0d04-0410-961f-82ee72b054a4
jgreenhalgh [Fri, 14 Jul 2017 09:18:09 +0000 (14 09:18 +0000)]
[Patch][Aarch64] Refactor comments in aarch64_print_operand
This patch refactors comments in config/aarch64/aarch64.c aarch64_print_operand
to provide a table of aarch64 specific formating options.
---
gcc/
2017-07-14 Jackson Woodruff <jackson.woodruff@arm.com>
* config/aarch64/aarch64.c (aarch64_print_operand): Move comments
to top of function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250202 138bc75d-0d04-0410-961f-82ee72b054a4
ktkachov [Fri, 14 Jul 2017 09:11:20 +0000 (14 09:11 +0000)]
Update comment in gimple-ssa-store-merging.c
* gimple-ssa-store-merging.c (clear_bit_region): Replace reference to
loop in comment with memset.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250201 138bc75d-0d04-0410-961f-82ee72b054a4
jakub [Fri, 14 Jul 2017 09:10:45 +0000 (14 09:10 +0000)]
PR sanitizer/81066
* sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969.
* sanitizer_common/sanitizer_linux.cc: Likewise.
* sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise.
* tsan/tsan_platform_linux.cc: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250200 138bc75d-0d04-0410-961f-82ee72b054a4
marxin [Fri, 14 Jul 2017 07:44:33 +0000 (14 07:44 +0000)]
Remove Java references in source code.
2017-07-14 Martin Liska <mliska@suse.cz>
* cfgexpand.c (expand_gimple_basic_block): Remove dead comment.
* dwarf2out.c (is_java): Remove the function.
(output_pubname): Remove usage of the function.
(lower_bound_default): Remove usage of DW_LANG_Java.
(gen_compile_unit_die): Likewise.
* gcc.c: Remove compiler defaults for .java and .zip files.
* gimple-expr.c (remove_suffix): Change as there's no longer
extension than 4-letter one.
* gimplify.c (mostly_copy_tree_r): Remove Java-special part.
(gimplify_save_expr): Likewise.
* ipa-utils.h (polymorphic_type_binfo_p): Remove the comment
as it's possible even for other languages than Java.
* langhooks.h (struct lang_hooks): Remove Java from a comment.
* lto-opts.c (lto_write_options): Remove reference to Java.
* opts.c (strip_off_ending): Update file extension handling.
* tree-cfg.c (verify_gimple_call): Remove comment with Java.
* tree-eh.c (lower_resx): Likewise.
* tree.c (free_lang_data_in_type): Remove dead code.
(find_decls_types_r): Likewise.
(build_common_builtin_nodes): Remove Java from a comment.
(verify_type): Remove dead code.
* varasm.c (assemble_external): Remove Java from a comment.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250199 138bc75d-0d04-0410-961f-82ee72b054a4
marxin [Fri, 14 Jul 2017 07:21:40 +0000 (14 07:21 +0000)]
Add additional quotes to opts.c.
2017-07-14 Martin Liska <mliska@suse.cz>
* opts.c (finish_options): Add quotes.
(common_handle_option): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250198 138bc75d-0d04-0410-961f-82ee72b054a4
marxin [Fri, 14 Jul 2017 07:05:27 +0000 (14 07:05 +0000)]
Remove Pascal language in source code.
2017-07-14 Martin Liska <mliska@suse.cz>
* dbxout.c (get_lang_number): Do not handle GNU Pascal.
* dbxout.h (extern void dbxout_stab_value_internal_label_diff):
Remove N_SO_PASCAL.
* dwarf2out.c (lower_bound_default): Do not handle
DW_LANG_Pascal83.
(gen_compile_unit_die): Likewise.
* gcc.c: Remove default extension binding for GNU Pascal.
* stmt.c: Remove Pascal language from a comment.
* xcoffout.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250197 138bc75d-0d04-0410-961f-82ee72b054a4
gccadmin [Fri, 14 Jul 2017 00:16:19 +0000 (14 00:16 +0000)]
Daily bump.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250195 138bc75d-0d04-0410-961f-82ee72b054a4
dmalcolm [Thu, 13 Jul 2017 19:30:42 +0000 (13 19:30 +0000)]
diagnostics: fix crash when consolidating out-of-order fix-it hints (PR c/81405)
PR c/81405 identifies a crash when printing fix-it hints from
-Wmissing-braces when there are excess elements.
The fix-it hints are bogus (which I've filed separately as PR c/81432),
but they lead to a crash within the fix-it consolidation logic I added
in r247548, in line_corrections::add_hint.
The root cause is that some of the fix-it hints are out-of-order
with respect to the column numbers they affect, which can lead to negative
values when computing the gap between the fix-it hints, leading to bogus
memcpy calls that generate out-of-bounds buffer accesses.
The fix is to sort the fix-it hints after filtering them, ensuring that
the gap >= 0. The patch also adds numerous assertions to the code, both
directly, and by moving the memcpy calls and their args behind
interfaces (themselves containing gcc_assert).
This fixes the crash; it doesn't fix the bug in -Wmissing-braces that
leads to the bogus hints.
gcc/ChangeLog:
PR c/81405
* diagnostic-show-locus.c (fixit_cmp): New function.
(layout::layout): Sort m_fixit_hints.
(column_range::column_range): Assert that the values are valid.
(struct char_span): New struct.
(correction::overwrite): New method.
(struct source_line): New struct.
(line_corrections::add_hint): Add assertions. Reimplement memcpy
calls in terms of classes source_line and char_span, and
correction::overwrite.
(selftest::test_overlapped_fixit_printing_2): New function.
(selftest::diagnostic_show_locus_c_tests): Call it.
gcc/testsuite/ChangeLog:
PR c/81405
* gcc.dg/Wmissing-braces-fixits.c: Add coverage for PR c/81405. */
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250187 138bc75d-0d04-0410-961f-82ee72b054a4
willschm [Thu, 13 Jul 2017 14:09:12 +0000 (13 14:09 +0000)]
[gcc]
2017-07-12 Will Schmidt <will_schmidt@vnet.ibm.com>
* config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Return
early if there is no lhs.
[testsuite]
2017-07-12 Will Schmidt <will_schmidt@vnet.ibm.com>
* gcc.target/powerpc/fold-vec-missing-lhs: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250185 138bc75d-0d04-0410-961f-82ee72b054a4
marxin [Thu, 13 Jul 2017 13:54:26 +0000 (13 13:54 +0000)]
Cleanup #2 of Pascal references.
2017-07-13 Martin Liska <mliska@suse.cz>
* dwarf2out.c (gen_pointer_type_die): Remove dead code.
(gen_reference_type_die): Likewise.
* stor-layout.c: Remove Pascal-related comment.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250184 138bc75d-0d04-0410-961f-82ee72b054a4
jason [Thu, 13 Jul 2017 13:04:04 +0000 (13 13:04 +0000)]
P0512R0 - Deduction from an initializer list.
* pt.c (do_class_deduction): Do list deduction in two phases.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250183 138bc75d-0d04-0410-961f-82ee72b054a4
jason [Thu, 13 Jul 2017 13:00:32 +0000 (13 13:00 +0000)]
* g++.old-deja/g++.bugs/900520_03.C: Limit error to c++14_down.
* g++.old-deja/g++.law/array2.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250182 138bc75d-0d04-0410-961f-82ee72b054a4
nathan [Thu, 13 Jul 2017 12:38:32 +0000 (13 12:38 +0000)]
revert previous premature commit
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250181 138bc75d-0d04-0410-961f-82ee72b054a4
nathan [Thu, 13 Jul 2017 12:35:52 +0000 (13 12:35 +0000)]
* libcp1plugin.cc (plugin_build_decl): Use
DECL_CXX_{CON,DE}STRUCTOR directly.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250180 138bc75d-0d04-0410-961f-82ee72b054a4
marxin [Thu, 13 Jul 2017 12:13:29 +0000 (13 12:13 +0000)]
Add quotes to error messages related to Sanitizers.
2017-07-13 Martin Liska <mliska@suse.cz>
* opts.c (finish_options): Add quotes to error messages.
(parse_sanitizer_options): Likewise.
2017-07-13 Martin Liska <mliska@suse.cz>
* c-c++-common/ubsan/sanitize-all-1.c: Update scanned pattern.
* c-c++-common/ubsan/sanitize-recover-1.c:Likewise.
* c-c++-common/ubsan/sanitize-recover-2.c:Likewise.
* c-c++-common/ubsan/sanitize-recover-5.c:Likewise.
* c-c++-common/ubsan/sanitize-recover-7.c:Likewise.
* c-c++-common/ubsan/sanitize-recover-8.c:Likewise.
* c-c++-common/ubsan/sanitize-recover-9.c:Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250179 138bc75d-0d04-0410-961f-82ee72b054a4