aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-05-23Adjust typo in testcase of my last commitliuhongt1-1/+1
gcc/testsuite/ChangeLog * gcc.target/i386/pr92658-avx512vl.c: Fix typo.
2020-05-22c++: Fix C++17 eval order for virtual op=.Jason Merrill2-0/+19
In a function call expression in C++17 evaluation of the function pointer is sequenced before evaluation of the function arguments, but that doesn't apply to function calls that were written using operator syntax. In particular, for operators with right-to-left ordering like assignment, we must not evaluate the LHS to find a virtual function before we evaluate the RHS. gcc/cp/ChangeLog: * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate the function address if the call used operator syntax. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/eval-order9.C: New test.
2020-05-23Daily bump.GCC Administrator1-1/+1
2020-05-22Suggest including <stdint.h> or <cstdint> for [u]int[8|16|32|64]_tMark Wielaard5-6/+176
Plus [u]intptr_t and associated constants. Refactor the bool, true, false, <stdbool.h> code so it fits into the new table based design. gcc/c-family/ChangeLog: * known-headers.cc (get_stdlib_header_for_name): Add a new stdlib_hint array for stdbool and stdint. gcc/testsuite/ChangeLog: * gcc.dg/spellcheck-stdint.c: New test. * g++.dg/spellcheck-stdint.C: Likewise.
2020-05-22Suggest including <stdbool.h> for bool, true and falseMark Wielaard4-0/+35
Currently gcc suggests to use _Bool instead of bool and doesn't give any suggestions when true or false are used, but undefined. This patch makes it so that (for C99 or higher) a fixit hint is emitted to include <stdbool.h>. gcc/c-family/ChangeLog: * known-headers.cc (get_stdlib_header_for_name): Return "<stdbool.h>" for "bool", "true" or "false" when STDLIB_C and flag_isoc99. gcc/testsuite/ChangeLog: * gcc.dg/spellcheck-stdbool.c: New test.
2020-05-22c++: -fsanitize=vptr and -fstrong-eval-order. [PR95221]Jason Merrill14-10/+39
With -fstrong-eval-order=all we evaluate the function address before the arguments. But this caused trouble with virtual functions and -fsanitize=vptr; we would do vptr sanitization as part of calculating the 'this' argument, and separately look at the vptr in order to find the function address. Without -fstrong-eval-order=all 'this' is evaluated first, but with that flag the function address is evaluated first, so we would access the null vptr before sanitizing it. Fixed by instrumenting the OBJ_TYPE_REF of a virtual function call instead of the 'this' argument. This issue suggests that we should be running the ubsan tests in multiple standard modes like the rest of the G++ testsuite, so I've made that change as well. gcc/cp/ChangeLog: * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual call, instrument the OBJ_TYPE_REF. gcc/testsuite/ChangeLog: * g++.dg/ubsan/ubsan.exp: Use g++-dg-runtest. * c-c++-common/ubsan/bounds-13.c: Adjust. * c-c++-common/ubsan/bounds-2.c: Adjust. * c-c++-common/ubsan/div-by-zero-1.c: Adjust. * c-c++-common/ubsan/div-by-zero-6.c: Adjust. * c-c++-common/ubsan/div-by-zero-7.c: Adjust. * c-c++-common/ubsan/overflow-add-1.c: Adjust. * c-c++-common/ubsan/overflow-add-2.c: Adjust. * c-c++-common/ubsan/overflow-int128.c: Adjust. * c-c++-common/ubsan/overflow-sub-1.c: Adjust. * c-c++-common/ubsan/overflow-sub-2.c: Adjust. * g++.dg/ubsan/pr85029.C: Adjust. * g++.dg/ubsan/vptr-14.C: Adjust.
2020-05-22analyzer: Add exit, and _exit replacement, to sm-signal.Mark Wielaard4-4/+72
Warn about using exit in signal handler and suggest _exit as alternative. gcc/analyzer/ChangeLog: * sm-signal.cc(signal_unsafe_call::emit): Possibly add gcc_rich_location note for replacement. (signal_unsafe_call::get_replacement_fn): New private function. (get_async_signal_unsafe_fns): Add "exit". gcc/testsuite/ChangeLog: * gcc.dg/analyzer/signal-exit.c: New testcase.
2020-05-22Silence warning introduced by my previous change.Jan Hubicka2-2/+5
* lto-streamer-out.c (DFS::DFS): Silence warning.
2020-05-22i386: Fix <rounding_insn><mode>2 expander [PR95255]Uros Bizjak4-5/+26
2020-05-22 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/95255 * config/i386/i386.md (<rounding_insn><mode>2): Do not try to expand non-sse4 ROUND_ROUNDEVEN rounding via SSE support routines. gcc/testsuite/ChangeLog: PR target/95255 * gcc.target/i386/pr95255.c: New test.
2020-05-22Avoid streaming stray references.Jan Hubicka4-18/+21
this patch avoids stremaing completely useless stray references to gobal decl stream. I am re-testing the patch (rebased to current tree) on x86_64-linux and intend to commit once testing finishes. gcc/ChangeLog: 2020-05-22 Jan Hubicka <hubicka@ucw.cz> * lto-streamer-out.c (lto_output_tree): Do not stream final ref if it is not needed. gcc/lto/ChangeLog: 2020-05-22 Jan Hubicka <hubicka@ucw.cz> * lto-common.c (lto_read_decls): Do not skip stray refs.
2020-05-22Add debug dump for integer_cst streaming.Jan Hubicka2-0/+7
* tree-streamer-out.c (streamer_write_integer_cst): Add debug dump.
2020-05-22Improve LTO streaming dumpsJan Hubicka4-29/+88
this patch cleans up dumping of streaming so it is clear how dump is organized and how much space individual components needs. Compiling: int a=1; main() { return a; } The output is now: Creating output block for function_body Streaming tree <result_decl 0x7ffff7457a50 D.1931> Start of LTO_trees of size 1 Encoding indexable <integer_type 0x7ffff7463000 sizetype> as 0 10 bytes ^^^ I do not think we should need 10 bytes to stream single indexable reference to 0 :) Start of LTO_trees of size 1 Encoding indexable <integer_type 0x7ffff74630a8 bitsizetype> as 1 10 bytes Streaming header of <result_decl 0x7ffff7457a50 D.1931> to function_body Streaming body of <result_decl 0x7ffff7457a50 D.1931> to function_body Encoding indexable <integer_type 0x7ffff74635e8 int> as 2 Encoding indexable <function_decl 0x7ffff757b500 main> as 0 Streaming ref to <integer_cst 0x7ffff744af18 32> Streaming ref to <integer_cst 0x7ffff744af30 4> 52 bytes ^^^ Instead of having multiple LTO_trees sections followed by the final tree it would make a lot of sense to have only one LTO_trees where the first tree is one lto_input_tree should return. This is easy to arrange in DFS walk - one does not need to pop after every SCC component but pop once at the end of walk. However this breaks handling of integer_csts because they may now become of LTO_trees block and streamed as header + body. This bypasses the separate code for shared integer_cst streaming. I think I want to stream everything into header and materialize the tree since it is not part of SCC anyway. Streaming tree <block 0x7ffff757e420> Streaming header of <block 0x7ffff757e420> to function_body Streaming body of <block 0x7ffff757e420> to function_body 8 bytes Streaming gimple stmt _2 = a; Streaming ref to <block 0x7ffff757e420> 4 bytes Streaming tree <mem_ref 0x7ffff7576f78> Start of LTO_trees of size 1 Encoding indexable <pointer_type 0x7ffff746b9d8> as 3 10 bytes Start of LTO_trees of size 1 Streaming header of <addr_expr 0x7ffff75893c0> to function_body Streaming body of <addr_expr 0x7ffff75893c0> to function_body Encoding indexable <var_decl 0x7ffff7fcfb40 a> as 0 15 bytes Streaming header of <mem_ref 0x7ffff7576f78> to function_body Streaming body of <mem_ref 0x7ffff7576f78> to function_body Streaming ref to <addr_expr 0x7ffff75893c0> Streaming ref to <integer_cst 0x7ffff75a3240 0> 42 bytes Streaming gimple stmt return _2; Outputting global stream 0: <function_decl 0x7ffff757b500 main> Streaming tree <function_decl 0x7ffff757b500 main> Start of LTO_tree_scc of size 1 Streaming header of <optimization_node 0x7ffff744b000> to decls Streaming body of <optimization_node 0x7ffff744b000> to decls 576 bytes Start of LTO_tree_scc of size 1 Streaming header of <target_option_node 0x7ffff744a018> to decls Streaming body of <target_option_node 0x7ffff744a018> to decls 68 bytes Streaming single tree Streaming header of <identifier_node 0x7ffff7577aa0 main> to decls Streaming body of <identifier_node 0x7ffff7577aa0 main> to decls 3 bytes Streaming single tree Streaming header of <identifier_node 0x7ffff758a8c0 t.c> to decls Streaming body of <identifier_node 0x7ffff758a8c0 t.c> to decls 3 bytes Streaming single tree Streaming header of <translation_unit_decl 0x7ffff7457ac8 t.c> to decls Streaming body of <translation_unit_decl 0x7ffff7457ac8 t.c> to decls Streaming ref to <identifier_node 0x7ffff758a8c0 t.c> 22 bytes Start of LTO_tree_scc of size 1 Streaming header of <function_type 0x7ffff74717e0> to decls Streaming body of <function_type 0x7ffff74717e0> to decls Streaming ref to <integer_type 0x7ffff74635e8 int> Streaming ref to <integer_cst 0x7ffff744adc8 8> Streaming ref to <integer_cst 0x7ffff744ade0 1> Streaming ref to <function_type 0x7ffff74717e0> 38 bytes Start of LTO_tree_scc of size 1 Streaming header of <function_type 0x7ffff75832a0> to decls Streaming body of <function_type 0x7ffff75832a0> to decls Streaming ref to <integer_type 0x7ffff74635e8 int> Streaming ref to <integer_cst 0x7ffff744adc8 8> Streaming ref to <integer_cst 0x7ffff744ade0 1> Streaming ref to <function_type 0x7ffff74717e0> 38 bytes Start of LTO_tree_scc of size 1 Streaming header of <function_decl 0x7ffff757b500 main> to decls Streaming body of <function_decl 0x7ffff757b500 main> to decls Streaming ref to <function_type 0x7ffff75832a0> Streaming ref to <identifier_node 0x7ffff7577aa0 main> Streaming ref to <translation_unit_decl 0x7ffff7457ac8 t.c> Streaming ref to <identifier_node 0x7ffff7577aa0 main> Streaming ref to <target_option_node 0x7ffff744a018> Streaming ref to <optimization_node 0x7ffff744b000> 58 bytes 806 bytes 0: <var_decl 0x7ffff7fcfb40 a> Streaming tree <var_decl 0x7ffff7fcfb40 a> Streaming single tree Streaming header of <identifier_node 0x7ffff758a870 a> to decls Streaming body of <identifier_node 0x7ffff758a870 a> to decls 3 bytes Streaming single tree Streaming ref to <integer_type 0x7ffff7463000 sizetype> 7 bytes Streaming single tree Streaming ref to <integer_type 0x7ffff74630a8 bitsizetype> 7 bytes Start of LTO_tree_scc of size 1 Streaming header of <var_decl 0x7ffff7fcfb40 a> to decls Streaming body of <var_decl 0x7ffff7fcfb40 a> to decls Streaming ref to <integer_type 0x7ffff74635e8 int> Streaming ref to <identifier_node 0x7ffff758a870 a> Streaming ref to <translation_unit_decl 0x7ffff7457ac8 t.c> Streaming ref to <integer_cst 0x7ffff744af18 32> Streaming ref to <integer_cst 0x7ffff744af30 4> Streaming ref to <identifier_node 0x7ffff758a870 a> Streaming ref to <integer_cst 0x7ffff7468090 1> 49 bytes 66 bytes gcc/ChangeLog: 2020-05-22 Jan Hubicka <hubicka@ucw.cz> * lto-section-out.c (lto_output_decl_index): Adjust dump indentation. * lto-streamer-out.c (create_output_block): Fix whitespace (lto_write_tree_1): Add (debug) dump. (DFS::DFS): Add dump. (DFS::DFS_write_tree_body): Do not dump here. (lto_output_tree): Improve dumping; do not stream ref when not needed. (produce_asm_for_decls): Fix whitespace. * tree-streamer-out.c (streamer_write_tree_header): Add dump.
2020-05-22Add missing vector truncmn2 expanders [PR92658]liuhongt6-4/+420
2020-05-22 Hongtao.liu <hongtao.liu@intel.com> gcc/ChangeLog: PR target/92658 * config/i386/sse.md (trunc<pmov_src_lower><mode>2): New expander (truncv32hiv32qi2): Ditto. (trunc<ssedoublemodelower><mode>2): Ditto. (trunc<mode><pmov_dst_3>2): Ditto. (trunc<mode><pmov_dst_mode_4>2): Ditto. (truncv2div2si2): Ditto. (truncv8div8qi2): Ditto. (avx512f_<code>v8div16qi2): Renaming from *avx512f_<code>v8div16qi2. (avx512vl_<code>v2div2si): Renaming from *avx512vl_<code>v2div2si2. (avx512vl_<code><mode>v2<ssecakarnum>qi2): Renaming from *avx512vl_<code><mode>v<ssescalarnum>qi2. gcc/testsuite/ChangeLog: * gcc.target/i386/pr92658-avx512f.c: New test. * gcc.target/i386/pr92658-avx512vl.c: Ditto. * gcc.target/i386/pr92658-avx512bw-trunc.c: Ditto.
2020-05-22x86: Handle -mavx512vpopcntdq for -march=nativeH.J. Lu2-3/+12
Add -mavx512vpopcntdq for -march=native if AVX512VPOPCNTDQ is available. PR target/95258 * config/i386/driver-i386.c (host_detect_local_cpu): Detect AVX512VPOPCNTDQ.
2020-05-22Fix up go related ignored locations.Jakub Jelinek2-2/+8
2020-05-22 Jakub Jelinek <jakub@redhat.com> * gcc-changelog/git_commit.py: Add trailing / to gcc/testsuite/go.test/test and replace gcc/go/frontend/ with gcc/go/gofrontend/ in ignored locations.
2020-05-22tree-optimization/95268 - fix commoning of clobbersRichard Biener4-11/+71
This fixes handling of clobbers when commoning stores. 2020-05-22 Richard Biener <rguenther@suse.de> PR tree-optimization/95268 * tree-ssa-sink.c (sink_common_stores_to_bb): Handle clobbers properly. * g++.dg/torture/pr95268.C: New testcase.
2020-05-22Fix hashing of prestreamed nodesJan Hubicka2-4/+10
this patch seems to solve basically all collisions while building cc1. From: [WPA] read 3312246 unshared trees [WPA] read 1144381 mergeable SCCs of average size 4.833785 [WPA] 8843938 tree bodies read in total [WPA] tree SCC table: size 524287, 197767 elements, collision ratio: 0.506446 [WPA] tree SCC max chain length 43 (size 1) [WPA] Compared 946614 SCCs, 775077 collisions (0.818789) to [WPA] read 3314520 unshared trees [WPA] read 1144763 mergeable SCCs of average size 4.835021 [WPA] 8849473 tree bodies read in total [WPA] tree SCC table: size 524287, 200574 elements, collision ratio: 0.486418 [WPA] tree SCC max chain length 2 (size 1) [WPA] Compared 944189 SCCs, 179 collisions (0.000190) The problem is that preloaded nodes all have hash code 0 because cache->nodes.length is not updated while streaming out. I also added an arbitrary constant to avoid clash with constant of 0 used to hash NULL pointers and 1 used to hash pointers inside SCC. * tree-streamer.c (record_common_node): Fix hash value of pre-streamed nodes.
2020-05-22Simplify streaming of SCC componentsJan Hubicka3-20/+23
this patch saves few bytes from SCC streaming. First we stream end markers that are fully ignored at stream in. Second I missed streaming of emtry_len in the previous change so it is pointlessly streamed for LTO_trees. Moreover entry_len is almost always 1 (always during gcc bootstrap) and thus it makes sense to avoid stremaing it in majority of cases. gcc/ChangeLog: 2020-05-21 Jan Hubicka <hubicka@ucw.cz> * lto-streamer-in.c (lto_read_tree): Do not stream end markers. (lto_input_scc): Optimize streaming of entry lengths. * lto-streamer-out.c (lto_write_tree): Do not stream end markers (DFS::DFS): Optimize stremaing of entry lengths
2020-05-22lto/95190 - amend -flto docs for diagnostic option handlingRichard Biener2-0/+14
This documents new GCC 10 behavior on diagnostic options and -flto. 2020-05-22 Richard Biener <rguenther@suse.de> PR lto/95190 * doc/invoke.texi (flto): Document behavior of diagnostic options.
2020-05-22enfoce SLP_TREE_VECTYPE for invariantsRichard Biener5-68/+279
This tries to enforce a set SLP_TREE_VECTYPE in vect_get_constant_vectors and provides some infrastructure for setting it in the vectorizable_* functions, amending those. 2020-05-22 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vect_is_simple_use): New overload. (vect_maybe_update_slp_op_vectype): New. * tree-vect-stmts.c (vect_is_simple_use): New overload accessing operands of SLP vs. non-SLP operation transparently. (vect_maybe_update_slp_op_vectype): New function updating the possibly shared SLP operands vector type. (vectorizable_operation): Be a bit more SLP vs non-SLP agnostic using the new vect_is_simple_use overload; update SLP invariant operand nodes vector type. (vectorizable_comparison): Likewise. (vectorizable_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_shift): Likewise. (vectorizable_store): Likewise. (vectorizable_condition): Likewise. (vectorizable_assignment): Likewise. * tree-vect-loop.c (vectorizable_reduction): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Enforce present SLP_TREE_VECTYPE and check it matches previous behavior.
2020-05-22tree-optimization/95248 - fix oversight in SM rewriteRichard Biener4-2/+38
This fixes a leftover early out in determining the sequence of stores to materialize. 2020-05-22 Richard Biener <rguenther@suse.de> PR tree-optimization/95248 * tree-ssa-loop-im.c (sm_seq_valid_bb): Remove bogus early out. * gcc.dg/torture/pr95248.c: New testcase.
2020-05-22Add missing ChangeLog entry.Martin Liska1-0/+5
2020-05-22add ctor/dtor to slp_treeRichard Biener3-55/+58
This adds constructor and destructor to slp_tree factoring common code. I've not changed the wrappers to overloaded CTORs since I hope to use object_allocator<> and am not sure whether that can be done in any fancy way yet. 2020-05-22 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (_slp_tree::_slp_tree): New. (_slp_tree::~_slp_tree): Likewise. * tree-vect-slp.c (_slp_tree::_slp_tree): Factor out code from allocators. (_slp_tree::~_slp_tree): Implement. (vect_free_slp_tree): Simplify. (vect_create_new_slp_node): Likewise. Add nops parameter. (vect_build_slp_tree_2): Adjust. (vect_analyze_slp_instance): Likewise.
2020-05-22Add gcc/testsuite/go.test/test to ignored locations for gcc_commit.py.Martin Liska1-0/+1
contrib/ChangeLog: 2020-05-22 Martin Liska <mliska@suse.cz> * gcc-changelog/git_commit.py: Add gcc/testsuite/go.test/test to ignored locations.
2020-05-22Daily bump.GCC Administrator1-1/+1
2020-05-21c++: Check constant array bounds later.Jason Merrill6-12/+13
We give a better diagnostic for non-constant array bounds in compute_array_index_type_loc, we don't need to diagnose it in the parser. But to avoid a regression on parse/varmod1.C we need to actually check non-dependent expressions in a template. gcc/cp/ChangeLog: * decl.c (compute_array_index_type_loc): Diagnose expressions in a template that can't be constant. * parser.c (cp_parser_direct_declarator): Don't check non-constant array bounds here. gcc/testsuite/ChangeLog: * c-c++-common/gomp/depend-iterator-2.c: Adjust. * g++.dg/ext/vla1.C: Adjust. * g++.dg/template/array9.C: Adjust. * g++.dg/template/error41.C: Adjust.
2020-05-21c++: Constant expression parsing and parameters.Jason Merrill4-3/+12
The difference between a "potential" constant-expression and a regular constant-expression is the treatment of parameters; in a constexpr function, a parameter is potentially constant when evaluating a call to that function, but it is not constant during parsing of the function. cp_parser_constant_expression should check the latter rather than the former. gcc/cp/ChangeLog: * cp-tree.h (is_rvalue_constant_expression): Declare. * constexpr.c (is_rvalue_constant_expression): New. * parser.c (cp_parser_constant_expression): Use it. * decl.c (cp_finish_decl): Try to treat a constexpr initializer in a template as constant.
2020-05-21c++: Improve error recovery for =.Jason Merrill7-8/+13
In a template we were happily embedding error_mark_node in a MODOP_EXPR, leading to confusion later. gcc/cp/ChangeLog: * typeck.c (build_x_modify_expr): Handle error_mark_node arguments. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/lambda/lambda-ice30.C: Adjust. * g++.dg/cpp0x/lambda/lambda-ice31.C: Adjust. * g++.dg/ext/fixed1.C: Adjust. * g++.dg/template/crash107.C: Adjust. * g++.dg/template/error35.C: Adjust. * g++.dg/template/sizeof-template-argument.C: Adjust.
2020-05-21c++: Improve error-recovery for parms.Jason Merrill2-7/+15
If a parameter is erroneous, we currently drop it, leading to "too many arguments" errors later. Treating the function as (...) avoids those errors. gcc/cp/ChangeLog: * decl.c (grokparms): Return NULL_TREE if any parms were erroneous. gcc/testsuite/ChangeLog: * g++.dg/parse/error33.C: Adjust.
2020-05-21coroutines: Partial reversion of r11-437-g5ef067eb14d4.Iain Sandoe1-1/+2
co_returns are statements, not expressions; they do not need to be wrapped in an EXPR_STMT. gcc/cp/ChangeLog: * coroutines.cc (finish_co_return_stmt): Revert change to use finish_expr_stmt.
2020-05-21Include memmodel.h in adjust-alignment.cRainer Orth2-0/+5
Commit dfa4fcdba374ed44d4aa1a22b2738f3f5c5b37af broke SPARC bootstrap: In file included from ./tm_p.h:4, from /vol/gcc/src/hg/master/local/gcc/adjust-alignment.c:28: /vol/gcc/src/hg/master/local/gcc/config/sparc/sparc-protos.h:45:47: error: use of enum 'memmodel' without previous declaration extern void sparc_emit_membar_for_model (enum memmodel, int, int); ^~~~~~~~ Fixed by including memmodel.h. Bootstrapped on sparc-sun-solaris2.11 and i386-pc-solaris2.11. 2020-05-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> gcc/ * adjust-alignment.c: Include memmodel.h.
2020-05-21config/i386/cpuid.h: Use hexadecimal in commentsH.J. Lu2-3/+8
Since Intel SDM uses hexadecimal, use hexadecimal in comments. PR target/95260 * config/i386/cpuid.h: Use hexadecimal in comments.
2020-05-21libstdc++: Enable simple invocation of runtest in testsuiteMatthias Kretz3-2/+8
2020-05-21 Matthias Kretz <kretz@kde.org> * testsuite/Makefile.am: Remove dup target_triplet and set tool, allowing runtest to work without arguments. * testsuite/Makefile.in: Regenerate. Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
2020-05-21c++: template instantiation during fold_for_warn [PR94038]Patrick Palka7-30/+180
Unfortunately, the previous fix to PR94038 is fragile. When the argument to fold_for_warn is a bare CALL_EXPR, then all is well: the result of maybe_constant_value from fold_for_warn (with uid_sensitive=true) is reused via the cv_cache in the subsequent call to maybe_constant_value from cp_fold (with uid_sensitive=false), so we avoid instantiating bar<int>. But when the argument to fold_for_warn is more complex, e.g. an INDIRECT_REF of a CALL_EXPR, as in the testcase below (due to bar<int>() returning const int& which we need to decay to int) then from fold_for_warn we call maybe_constant_value on the INDIRECT_REF, and from cp_fold we call it on the CALL_EXPR, so there is no reuse via the cv_cache and we therefore end up instantiating bar<int>. So for a more robust solution to this general issue of warning flags affecting code generation, it seems that we need a way to globally avoid template instantiation during constexpr evaluation whenever we're performing warning-dependent folding. To that end, this patch replaces the flag constexpr_ctx::uid_sensitive with a global flag uid_sensitive_constexpr_evaluation_p, and enables it during fold_for_warn using an RAII helper. The patch also adds a counter that keeps track of the number of times uid_sensitive_constexpr_evaluation_p is called and returned true, and we use this to determine whether the result of constexpr evaluation was restricted by the flag. This lets us safely update the cv_cache and fold_cache from fold_for_warn in the most common case where the flag did not restrict constexpr evaluation. gcc/cp/ChangeLog: PR c++/94038 * constexpr.c (constexpr_ctx::uid_sensitive): Remove field. (uid_sensitive_constexpr_evaluation_value): Define. (uid_sensitive_constexpr_evaluation_true_counter): Define. (uid_sensitive_constexpr_evaluation_p): Define. (uid_sensitive_constexpr_evaluation_sentinel): Define its constructor. (uid_sensitive_constexpr_evaluation_checker): Define its constructor and its evaluation_restricted_p method. (get_fundef_copy): Remove 'ctx' parameter. Use u_s_c_e_p instead of constexpr_ctx::uid_sensitive. (cxx_eval_call_expression): Use u_s_c_e_p instead, and test it last. Adjust call to get_fundef_copy. (instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the counter if necessary. (cxx_eval_outermost_constant_expr): Remove 'uid_sensitive' parameter. Adjust function body accordingly. (maybe_constant_value): Remove 'uid_sensitive' parameter and adjust function body accordingly. Set up a uid_sensitive_constexpr_evaluation_checker, and use it to conditionally update the cv_cache. * cp-gimplify.c (cp_fold): Set up a uid_sensitive_constexpr_evaluation_checker, and use it to conditionally update the fold_cache. * cp-tree.h (maybe_constant_value): Update declaration. (struct uid_sensitive_constexpr_evaluation_sentinel): Define. (struct sensitive_constexpr_evaluation_checker): Define. * expr.c (fold_for_warn): Set up a uid_sensitive_constexpr_evaluation_sentinel before calling the folding subroutines. Drop all but the first argument to maybe_constant_value. gcc/testsuite/ChangeLog: PR c++/94038 * g++.dg/warn/pr94038-2.C: New test.
2020-05-21libgcc: Move FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16H.J. Lu4-5/+18
Move FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16 to avoid changing libgcc ABI. gcc/ PR target/95212 * config/i386/i386-builtins.c (processor_features): Move F_AVX512VP2INTERSECT after F_AVX512BF16. (isa_names_table): Likewise. libgcc/ PR target/95212 * config/i386/cpuinfo.h (processor_features): Move FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16.
2020-05-21Fix a test-case warning.Martin Liska2-1/+9
PR target/95229 * g++.target/i386/pr95229.C: Fix error: unnamed type with no linkage used to declare variable ‘<unnamed class> e’ with linkage with -std=gnu++98.
2020-05-21Remove accidental testcase commitNathan Sidwell3-14/+5
* c-c++-common/cpp/cmd-1.c: Delete. * c-c++-common/cpp/cmd-1.h: Delete.
2020-05-21libgfortran: Use __builtin_cpu_is/__builtin_cpu_supportsH.J. Lu15-154/+158
* m4/matmul.m4: Don't include <config/i386/cpuinfo.h>. Use __builtin_cpu_is/__builtin_cpu_supports * generated/matmul_c10.c: Regenerated. * generated/matmul_c16.c: Likewise. * generated/matmul_c4.c: Likewise. * generated/matmul_c8.c: Likewise. * generated/matmul_i1.c: Likewise. * generated/matmul_i16.c: Likewise. * generated/matmul_i2.c: Likewise. * generated/matmul_i4.c: Likewise. * generated/matmul_i8.c: Likewise. * generated/matmul_r10.c: Likewise. * generated/matmul_r16.c: Likewise. * generated/matmul_r4.c: Likewise. * generated/matmul_r8.c: Likewise.
2020-05-21Add outline-atomics to target attribute.Martin Liska7-0/+79
* common/config/aarch64/aarch64-common.c (aarch64_handle_option): Handle OPT_moutline_atomics. * config/aarch64/aarch64.c: Add outline-atomics to aarch64_attributes. * doc/extend.texi: Document the newly added target attribute. * gcc.target/aarch64/target_attr_20.c: New test. * gcc.target/aarch64/target_attr_21.c: New test.
2020-05-21Prepare git_update_version.py for real usage.Martin Liska2-9/+13
* gcc-changelog/git_update_version.py: Prepare the script, the only missing piece is pushing of the updated branches.
2020-05-21Support DR entries for gcc-changelog.Martin Liska4-1/+41
* gcc-changelog/git_commit.py: Support DR entries/ * gcc-changelog/test_email.py: New test for it. * gcc-changelog/test_patches.txt: New patch for it.
2020-05-21mklog: support parsing of DR.Martin Liska3-1/+52
* mklog.py: Support DR parsing. * test_mklog.py: New test for DR parsing.
2020-05-21libstdc++: Avoid constraint recursion with iterator_traits (PR 93983)Jonathan Wakely3-4/+55
Checking whether a filesystem::path constructor argument is an iterator requires instantiating std::iterator_traits. In C++20 that checks for satisfaction of std::iterator_traits constraints, which checks if the type is copyable, which can end up recursing back to the path constructor. The fix in LWG 3420 is to reorder the cpp17-iterator concept's constraints to check if the type looks vaguely like an iterator before checking copyable. That avoids the recursion for types which definitely aren't iterators, but isn't foolproof. PR libstdc++/93983 * include/bits/iterator_concepts.h (__detail::__cpp17_iterator): Reorder constraints to avoid recursion when constructors use iterator_traits (LWG 3420). * testsuite/24_iterators/customization_points/lwg3420.cc: New test.
2020-05-21Daily bump.GCC Administrator1-1/+1
2020-05-21libstdc++: Use macro for nodiscard attributeJonathan Wakely2-2/+5
* include/experimental/socket (basic_socket::is_open() (basic_socket_acceptor::is_open()): Use _GLIBCXX_NODISCARD macro.
2020-05-21libstdc++: Better requirements checking in Networking TSJonathan Wakely3-27/+169
Define concepts and traits for checking type requirements. * include/experimental/bits/net.h (__endpoint, __protocol) (__acceptable_protocol, __inet_protocol): New concepts. (__detail::__is_endpoint): Move trait from <experimental/socket>. (__is_protocol, __is_acceptable_protocol, __is_inet_protocol): New traits. (__endpoint, __protocol, __acceptable_protocol): New variable templates. * include/experimental/socket (__is_endpoint): Move to net.h header. (basic_socket, basic_socket_acceptor): Check requirements.
2020-05-21libstdc++: Fix net::basic_socket::close(error_code&)Jonathan Wakely5-14/+189
Also add some missing member functions, nodiscard attributes, and noexcept-specifiers. * include/experimental/executor (use_future_t::use_future_t()): Fix incorrect noexcept-specifier. * include/experimental/internet (basic_resolver_results): Adjust whitespace. * include/experimental/socket (__basic_socket_impl::release): Add member function. (basic_socket(io_context&, const endpoint_type&)): Fix argument to target constructor. (basic_socket::release(), basic_socket::release(error_code&)): Add missing member functions. (basic_socket::is_open()): Add nodiscard attribute. (basic_socket::close(error_code&)): Pass argument to base function. (basic_socket_acceptor::release()) (basic_socket_acceptor::release(error_code&)): Add missing member functions. (basic_socket_acceptor::is_open()): Add nodiscard attribute. (basic_socket_streambuf::error()): Add noexcept. (basic_socket_iostream::error()): Likewise. * testsuite/experimental/net/socket/basic_socket.cc: New test.
2020-05-21libstdc++: Use 'using' for types in Networking TS headersJonathan Wakely6-90/+99
* include/experimental/buffer: Replace typedefs with alias-declarations. * include/experimental/executor: Likewise. * include/experimental/internet: Likewise. * include/experimental/socket: Likewise. * include/experimental/timer: Likewise.
2020-05-21i386: Do not use commutative operands with (use) RTX [PR95238]Uros Bizjak4-43/+103
2020-05-21 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/95218 * config/i386/mmx.md (*mmx_<code>v2sf): Do not mark operands 1 and 2 commutative. Manually swap operands. (*mmx_nabsv2sf2): Ditto. Partially revert: * config/i386/i386.md (*<code>tf2_1): Mark operands 1 and 2 commutative. (*nabstf2_1): Ditto. * config/i386/sse.md (*<code><mode>2): Mark operands 1 and 2 commutative. Do not swap operands. (*nabs<mode>2): Ditto.
2020-05-20Fix premature omission of ChangeLog entry in ChangeLog file..Jozef Lawrynowicz1-0/+6
* g++.dg/warn/Wconversion-null-2.C: Add explicit declarations for l() and g() with int, long, long long and __int20 arguments. * g++.dg/warn/Wconversion-null.C: Likewise.