aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
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-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 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-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-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. Lu2-3/+10
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-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-21Daily bump.GCC Administrator1-1/+1
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.
2020-05-20TESTSUITE: Fix Wconversion-null*.C tests for aarch64 -mabi=ilp32Jozef Lawrynowicz2-4/+36
This fixes regressions for aarch64 with -mabi=ilp32 of the Wconversion-null*.C tests, introduced by 92ea8e1bccc. The "g (int)" declaration is required for that target where sizeof(int) == sizeof(long) == sizeof(void *). To handle the msp430/-mlarge case, an explicit declaration of "g (__int20)" is required. gcc/testsuite/ChangeLog: * 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.
2020-05-20c++: C++20 DR 2237, disallow simple-template-id in cdtor.Marek Polacek11-13/+62
This patch implements DR 2237 which says that a simple-template-id is no longer valid as the declarator-id of a constructor or destructor; see [diff.cpp17.class]#2. It is not explicitly stated but out-of-line destructors with a simple-template-id are also meant to be ill-formed now. (Out-of-line constructors like that are invalid since DR1435 I think.) This change only applies to C++20; it is not a DR against C++17. I'm not crazy about the diagnostic in constructors but ISTM that cp_parser_constructor_declarator_p shouldn't print errors. DR 2237 * parser.c (cp_parser_unqualified_id): Reject simple-template-id as the declarator-id of a destructor. (cp_parser_constructor_declarator_p): Reject simple-template-id as the declarator-id of a constructor. * g++.dg/DRs/dr2237.C: New test. * g++.dg/parse/constructor2.C: Add dg-error for C++20. * g++.dg/parse/dtor12.C: Likewise. * g++.dg/parse/dtor4.C: Likewise. * g++.dg/template/dtor4.C: Adjust dg-error. * g++.dg/template/error34.C: Likewise. * g++.old-deja/g++.other/inline15.C: Only run for C++17 and lesses. * g++.old-deja/g++.pt/ctor2.C: Add dg-error for C++20.
2020-05-20preprocessor: Revert premature changeNathan Sidwell4-2/+17
This part of the cleanup patch turns out to require more pieces to function correctly. I must have got confused over which tree I was testing. The very first map has a different pointer to the file name, so doesn't match with a pointer compare. We were relying on that. * c-common.c (try_to_locate_new_include_insertion_point): Revert change.
2020-05-20preprocessor: cleanups in c-common handlingNathan Sidwell4-11/+18
* c-common.c (try_to_locate_new_include_insertion_point): Use strcmp to compare filenames. * c-lex.c (init_c_lex): Move declaration to initialization. * c-opts.c (handle_deferred_opts): Move cpp_get_deps call into deferred count loop.
2020-05-20c++: Implement DR 2289, Uniqueness of structured binding names [PR94553]Marek Polacek6-13/+55
DR 2289 clarified that since structured bindings have no C compatibility implications, they should be unique in their declarative region, see [basic.scope.declarative]/4.2. The duplicate_decls hunk is the gist of the patch, but that alone would not be enough to detect the 'A' case: cp_parser_decomposition_declaration uses 13968 tree decl2 = start_decl (declarator, &decl_specs, SD_INITIALIZED, 13969 NULL_TREE, NULL_TREE, &elt_pushed_scope); to create the 'A' VAR_DECL but in this start_decl's grokdeclarator we don't do fit_decomposition_lang_decl because the declarator kind is not cdk_decomp, so then when start_decl calls maybe_push_decl, the decl 'A' isn't DECL_DECOMPOSITION_P and we don't detect this case. So I needed a way to signal to start_decl that it should fit_decomposition_lang_decl. In this patch, I'm adding SD_DECOMPOSITION flag to say that the variable is initialized and it should also be marked as DECL_DECOMPOSITION_P. DR 2289 PR c++/94553 * cp-tree.h (SD_DECOMPOSITION): New flag. * decl.c (duplicate_decls): Make sure a structured binding is unique in its declarative region. (start_decl): If INITIALIZED is SD_DECOMPOSITION, call fit_decomposition_lang_decl. (grokdeclarator): Compare INITIALIZED directly to SD_* flags. * parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION to start_decl. * g++.dg/cpp1z/decomp52.C: New test.
2020-05-20i386: Fix zero/sign extend expanders [PR95229]Uros Bizjak4-10/+54
2020-05-20 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/95229 * config/i386/sse.md (<code>v8qiv8hi2): Use simplify_gen_subreg instead of simplify_subreg. (<code>v8qiv8si2): Ditto. (<code>v4qiv4si2): Ditto. (<code>v4hiv4si2): Ditto. (<code>v8qiv8di2): Ditto. (<code>v4qiv4di2): Ditto. (<code>v2qiv2di2): Ditto. (<code>v4hiv4di2): Ditto. (<code>v2hiv2di2): Ditto. (<code>v2siv2di2): Ditto. gcc/testsuite/ChangeLog: PR target/95229 * g++.target/i386/pr95229.C: New test.
2020-05-20i386: Fix *pushsi2_rex64 constraints [PR95238]Uros Bizjak2-1/+7
2020-05-20 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/95238 * config/i386/i386.md (*pushsi2_rex64): Use "e" constraint instead of "i".
2020-05-20Avoid SCC hashing on unmergeable treesJan Hubicka6-125/+325
This is new incarantion of patch to identify unmergeable tree at streaming out time rather than streaming in and to avoid pickling them to sccs with with hash codes. Building cc1 plus this patch reduces: [WPA] read 4452927 SCCs of average size 1.986030 [WPA] 8843646 tree bodies read in total [WPA] tree SCC table: size 524287, 205158 elements, collision ratio: 0.505204 [WPA] tree SCC max chain length 43 (size 1) [WPA] Compared 947551 SCCs, 780270 collisions (0.823460) [WPA] Merged 944038 SCCs [WPA] Merged 5253521 tree bodies [WPA] Merged 590027 types ... [WPA] Size of mmap'd section decls: 99229066 bytes [WPA] Size of mmap'd section function_body: 18398837 bytes [WPA] Size of mmap'd section refs: 733678 bytes [WPA] Size of mmap'd section jmpfuncs: 2965981 bytes [WPA] Size of mmap'd section pureconst: 170248 bytes [WPA] Size of mmap'd section profile: 17985 bytes [WPA] Size of mmap'd section symbol_nodes: 3392736 bytes [WPA] Size of mmap'd section inline: 2693920 bytes [WPA] Size of mmap'd section icf: 435557 bytes [WPA] Size of mmap'd section offload_table: 0 bytes [WPA] Size of mmap'd section lto: 4320 bytes [WPA] Size of mmap'd section ipa_sra: 651660 bytes ... to ... [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) [WPA] Merged 943798 SCCs [WPA] Merged 5253336 tree bodies [WPA] Merged 590105 types .... [WPA] Size of mmap'd section decls: 81262144 bytes [WPA] Size of mmap'd section function_body: 14702611 bytes [WPA] Size of mmap'd section ext_symtab: 0 bytes [WPA] Size of mmap'd section refs: 733695 bytes [WPA] Size of mmap'd section jmpfuncs: 2332150 bytes [WPA] Size of mmap'd section pureconst: 170292 bytes [WPA] Size of mmap'd section profile: 17986 bytes [WPA] Size of mmap'd section symbol_nodes: 3393358 bytes [WPA] Size of mmap'd section inline: 2567939 bytes [WPA] Size of mmap'd section icf: 435633 bytes [WPA] Size of mmap'd section lto: 4320 bytes [WPA] Size of mmap'd section ipa_sra: 651824 bytes so results in about 22% reduction in global decl stream and 24% reduction on function bodies stream (which is read mostly by ICF) Martin, the zstd compression breaks the compression statistics (it works when GCC is configured for zlib) At first ltrans I get: [LTRANS] Size of mmap'd section decls: 3734248 bytes [LTRANS] Size of mmap'd section function_body: 4895962 bytes ... to ... [LTRANS] Size of mmap'd section decls: 3479850 bytes [LTRANS] Size of mmap'd section function_body: 3722935 bytes So 7% reduction of global stream and 31% reduction of function bodies. Stream in seems to get about 3% faster and stream out about 5% but it is close to noise factor of my experiment. I expect bigger speedups on Firefox but I did not test it today since my Firefox setup broke again. GCC is not very good example on the problem with anonymous namespace types since we do not have so many of them. Sice of object files in gcc directory is reduced by 11% (because hash numbers do not compress well I guess). The patch makes DFS walk to recognize trees that are not merged (anonymous namespace, local function/variable decls, anonymous types etc). As discussed on IRC this is now done during the SCC walk rather than during the hash computation. When local tree is discovered we know that SCC components of everything that is on the stack reffers to it and thus is also local. Moreover we mark trees into hash set in output block so if we get a cross edge referring to local tree it gets marked too. Patch also takes care of avoiding SCC wrappers around some trees. In particular 1) singleton unmergeable SCCs are now streamed inline in global decl stream This includes INTEGER_CSTs and IDENTIFIER_NODEs that are shared by different code than rest of tree merging. 2) We use LTO_trees instead of LTO_tree_scc to wrap unmergeable SCC components. It is still necessary to mark them because of forward references. LTO_trees has simple header with number of trees and then things are streamed same way as for LTO_tree_scc. That is tree headers first followed by pickled references so things may point to future. Of course it is not necessary for LTO_tree_scc to be single component and streamer out may group more components together, but I decided to not snowball the patch even more 3) In local streams when lto_output_tree is called and the topmost SCC components turns out to be singleton we stream the tree directly instead of LTO_tree_scc, hash code, pickled tree, reference to just stremaed tree. LTO_trees is used to wrap all trees needed to represent tree being streamed. It would make sense again to use only one LTO_trees rather than one per SCC but I think this can be done incrementally. In general local trees are now recognized by new predicate local_tree_p Bit subtle is handing of TRANLSATION_UNIT_DECL, INTEGER_CST and IDENTIFIER_NODE. TRANSLATION_UNIT_DECL a local tree but references to it does not make other trees local (because we also understand local decls now). So I check for it later after localness propagation is done. INTEGER_CST and IDENTIFIER_NODEs are merged but not via the tree merging machinery. So it makes sense to stream them as unmergeable trees but we still need to compute their hashes so SCCs referring them do not get too large collision chains. For this reason they are checked just prior stream out. lto-bootstrapped/regteted x86_64-linux, OK? gcc/ChangeLog: 2020-05-19 Jan Hubicka <hubicka@ucw.cz> * lto-streamer-in.c (lto_input_scc): Add SHARED_SCC parameter. (lto_input_tree_1): Strenghten sanity check. (lto_input_tree): Update call of lto_input_scc. * lto-streamer-out.c: Include ipa-utils.h (create_output_block): Initialize local_trees if merigng is going to happen. (destroy_output_block): Destroy local_trees. (DFS): Add max_local_entry. (local_tree_p): New function. (DFS::DFS): Initialize and maintain it. (DFS::DFS_write_tree): Decide on streaming format. (lto_output_tree): Stream inline singleton SCCs * lto-streamer.h (enum LTO_tags): Add LTO_trees. (struct output_block): Add local_trees. (lto_input_scc): Update prototype. gcc/lto/ChangeLog: 2020-05-19 Jan Hubicka <hubicka@ucw.cz> * lto-common.c (compare_tree_sccs_1): Sanity check that we never read TRANSLATION_UNIT_DECL. (process_dref): Break out from ... (unify_scc): ... here. (process_new_tree): Break out from ... (lto_read_decls): ... here; handle streaming of singleton trees. (print_lto_report_1): Update statistics.
2020-05-20Fortran : ProcPtr function results: 'ppr@' in error message PR39695Mark Eggleston8-4/+73
The value 'ppr@' is set in the name of result symbol, the actual name of the symbol is in the procedure name symbol pointed to by the result symbol's namespace (ns). When reporting errors for symbols that have the proc_pointer attribute check whether the result attribute is set and set the name accordingly. 2020-05-20 Mark Eggleston <markeggleston@gcc.gnu.org> gcc/fortran/ PR fortran/39695 * resolve.c (resolve_fl_procedure): Set name depending on whether the result attribute is set. For PROCEDURE/RESULT conflict use the name in sym->ns->proc_name->name. * symbol.c (gfc_add_type): Add check for function and result attributes use sym->ns->proc_name->name if both are set. Where the symbol cannot have a type use the name in sym->ns->proc_name->name. 2020-05-20 Mark Eggleston <markeggleston@gcc.gnu.org> gcc/testsuite/ PR fortran/39695 * gfortran.dg/pr39695_1.f90: New test. * gfortran.dg/pr39695_2.f90: New test. * gfortran.dg/pr39695_3.f90: New test. * gfortran.dg/pr39695_4.f90: New test.
2020-05-20c++: spec_hasher and TYPENAME_TYPE resolution [PR95223]Patrick Palka6-13/+44
After enabling sanitization of the specialization tables, we are triggering one of the hash table sanity checks in the below testcase. The reason is that when looking up the specialization j<int> in the type_specializations table, the sanity check finds that the existing entry j<n<t>::m> compares equal to j<int> but hashes differently. The discrepancy is due to structural_comptypes looking through TYPENAME_TYPEs (via resolve_typename_type), something which iterative_hash_template_arg doesn't do. So the TYPENAME_TYPE n<t>::m is considered equal to int, but the hashes of these two template arguments are different. It seems wrong for the result of a specialization table lookup to depend on the current scope, so this patch makes structural_comptypes avoid calling resolve_typename_type when comparing_specializations. In order for the below testcase to deterministically trigger the sanitization error without this patch, we also need to fix the location of the call to hash_table::verify within hash_table::find_with_hash. gcc/ChangeLog: PR c++/95223 * hash-table.h (hash_table::find_with_hash): Move up the call to hash_table::verify. gcc/cp/ChangeLog: PR c++/95223 * typeck.c (structural_comptypes): Don't perform context-dependent resolution of TYPENAME_TYPEs when comparing_specializations. gcc/testsuite/ChangeLog: PR c++/95223 * g++.dg/template/typename23.C: New test.
2020-05-20Fill up {,un}compression stats for ZSTD in LTO.Martin Liska2-0/+8
* lto-compress.c (lto_compression_zstd): Fill up num_compressed_il_bytes. (lto_uncompression_zstd): Likewise for num_uncompressed_il_bytes here.
2020-05-20Add missing testsuite/Changelog for PR94595 bug fix.Srinath Parvathaneni1-0/+59
2020-05-20tree-optimization/95219 - improve IV selection for inductionRichard Biener4-2/+28
This improves code generation with SSE2 for the testcase by making sure to only generate a single IV when the group size is a multiple of the vector size. It also adjusts the testcase which was passing before. 2020-05-20 Richard Biener <rguenther@suse.de> PR tree-optimization/95219 * tree-vect-loop.c (vectorizable_induction): Reduce group_size before computing the number of required IVs. * gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c: Adjust.
2020-05-20middle-end/95231 - revert parts of PR95171Richard Biener4-11/+15
I mistook the opportunity to also "fix" the [VEC_]COND_EXPR case for PR95171 but I was wrong in that it doesn't need the fix and in the actual fix as well. The following just reverts that part. 2020-05-20 Richard Biener <rguenther@suse.de> PR middle-end/95231 * tree-inline.c (remap_gimple_stmt): Revert adjusting COND_EXPR and VEC_COND_EXPR for a -fnon-call-exception boundary. * g++.dg/other/pr95231.C: New testcase.
2020-05-20Remove dangling line from gcc/ChangeLog.Martin Liska1-2/+0
2020-05-20[ARM]: Fix the wrong code-gen generated by MVE vector load/store intrinsics ↵Srinath Parvathaneni62-173/+645
(PR94959). Few MVE intrinsics like vldrbq_s32, vldrhq_s32 etc., the assembler instructions generated by current compiler are wrong. eg: vldrbq_s32 generates an assembly instructions `vldrb.s32 q0,[ip]`. But as per Arm-arm second argument in above instructions must also be a low register (<= r7). This patch fixes this issue by creating a new predicate "mve_memory_operand" and constraint "Ux" which allows low registers as arguments to the generated instructions depending on the mode of the argument. A new constraint "Ul" is created to handle loading to PC-relative addressing modes for vector store/load intrinsiscs. All the corresponding MVE intrinsic generating wrong code-gen as vldrbq_s32 are modified in this patch. gcc/ChangeLog: 2020-05-20 Srinath Parvathaneni <srinath.parvathaneni@arm.com> Andre Vieira <andre.simoesdiasvieira@arm.com> PR target/94959 * config/arm/arm-protos.h (arm_mode_base_reg_class): Function declaration. (mve_vector_mem_operand): Likewise. * config/arm/arm.c (thumb2_legitimate_address_p): For MVE target check the load from memory to a core register is legitimate for give mode. (mve_vector_mem_operand): Define function. (arm_print_operand): Modify comment. (arm_mode_base_reg_class): Define. * config/arm/arm.h (MODE_BASE_REG_CLASS): Modify to add check for TARGET_HAVE_MVE and expand to arm_mode_base_reg_class on TRUE. * config/arm/constraints.md (Ux): Likewise. (Ul): Likewise. * config/arm/mve.md (mve_mov): Replace constraint Us with Ux and also add support for missing Vector Store Register and Vector Load Register. Add a new alternative to support load from memory to PC (or label) in vector store/load. (mve_vstrbq_<supf><mode>): Modify constraint Us to Ux. (mve_vldrbq_<supf><mode>): Modify constriant Us to Ux, predicate to mve_memory_operand and also modify the MVE instructions to emit. (mve_vldrbq_z_<supf><mode>): Modify constraint Us to Ux. (mve_vldrhq_fv8hf): Modify constriant Us to Ux, predicate to mve_memory_operand and also modify the MVE instructions to emit. (mve_vldrhq_<supf><mode>): Modify constriant Us to Ux, predicate to mve_memory_operand and also modify the MVE instructions to emit. (mve_vldrhq_z_fv8hf): Likewise. (mve_vldrhq_z_<supf><mode>): Likewise. (mve_vldrwq_fv4sf): Likewise. (mve_vldrwq_<supf>v4si): Likewise. (mve_vldrwq_z_fv4sf): Likewise. (mve_vldrwq_z_<supf>v4si): Likewise. (mve_vld1q_f<mode>): Modify constriant Us to Ux. (mve_vld1q_<supf><mode>): Likewise. (mve_vstrhq_fv8hf): Modify constriant Us to Ux, predicate to mve_memory_operand. (mve_vstrhq_p_fv8hf): Modify constriant Us to Ux, predicate to mve_memory_operand and also modify the MVE instructions to emit. (mve_vstrhq_p_<supf><mode>): Likewise. (mve_vstrhq_<supf><mode>): Modify constriant Us to Ux, predicate to mve_memory_operand. (mve_vstrwq_fv4sf): Modify constriant Us to Ux. (mve_vstrwq_p_fv4sf): Modify constriant Us to Ux and also modify the MVE instructions to emit. (mve_vstrwq_p_<supf>v4si): Likewise. (mve_vstrwq_<supf>v4si): Likewise.Modify constriant Us to Ux. * config/arm/predicates.md (mve_memory_operand): Define. gcc/testsuite/ChangeLog: 2020-05-20 Srinath Parvathaneni <srinath.parvathaneni@arm.com> PR target/94959 * gcc.target/arm/mve/intrinsics/mve_vector_float2.c: Modify. * gcc.target/arm/mve/intrinsics/mve_vldr.c: New test. * gcc.target/arm/mve/intrinsics/mve_vldr_z.c: Likewise. * gcc.target/arm/mve/intrinsics/mve_vstr.c: Likewise. * gcc.target/arm/mve/intrinsics/mve_vstr_p.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_f16.c: Modify. * gcc.target/arm/mve/intrinsics/vld1q_f32.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_s16.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_s32.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_s8.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_u16.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_u32.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_u8.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_z_f16.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_z_f32.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_z_s16.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_z_s32.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_z_s8.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_z_u16.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_z_u32.c: Likewise. * gcc.target/arm/mve/intrinsics/vld1q_z_u8.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrbq_s8.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrbq_u8.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrbq_z_s8.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrbq_z_u8.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_s64.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_u64.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_s64.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_u64.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrhq_f16.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrhq_s16.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrhq_s32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrhq_u16.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrhq_u32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrhq_z_f16.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrhq_z_s16.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrhq_z_s32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrhq_z_u16.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrhq_z_u32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrwq_f32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_f32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_s32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_u32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_f32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_s32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_u32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrwq_s32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrwq_u32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrwq_z_f32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrwq_z_s32.c: Likewise. * gcc.target/arm/mve/intrinsics/vldrwq_z_u32.c: Likewise. * gcc.target/arm/mve/intrinsics/vuninitializedq_float.c: Likewise. * gcc.target/arm/mve/intrinsics/vuninitializedq_float1.c: Likewise. * gcc.target/arm/mve/intrinsics/vuninitializedq_int.c: Likewise. * gcc.target/arm/mve/intrinsics/vuninitializedq_int1.c: Likewise.
2020-05-20c/95141 - fix bogus integer overflow warningRichard Biener4-0/+20
This fixes an integer overflow warning that ultimatively happens because of TREE_OVERFLOW propagating through transforms and the existing guard against this, 375 if (TREE_OVERFLOW_P (ret) 376 && !TREE_OVERFLOW_P (op0) 377 && !TREE_OVERFLOW_P (op1)) 378 overflow_warning (EXPR_LOC_OR_LOC (expr, input_location, being insufficient. Rather than trying to use sth like walk_tree to exhaustively walk operands (with the possibility of introducing quadraticness when folding larger expressions recursively) the following amends the above with an ad-hoc test for a binary op0 with a possibly constant op1. 2020-05-30 Richard Biener <rguenther@suse.de> PR c/95141 gcc/c * c-fold.c (c_fully_fold_internal): Enhance guard on overflow_warning. gcc/testsuite * gcc.dg/pr95141.c: New testcase.
2020-05-20Fix alignment for local variable [PR90811]Kito Cheng5-0/+98
- The alignment for local variable was adjust during estimate_stack_frame_size, however it seems wrong spot to adjust that, expand phase will adjust that but it little too late to some gimple optimization, which rely on certain target hooks need to check alignment, forwprop is an example for that, result of simplify_builtin_call rely on the alignment on some target like ARM or RISC-V. - Exclude static local var and hard register var in the process of alignment adjustment. - This patch fix gfortran.dg/pr45636.f90 for arm and riscv. - Regression test on riscv32/riscv64 and x86_64-linux-gnu, no new fail introduced. gcc/ChangeLog PR target/90811 * Makefile.in (OBJS): Add adjust-alignment.o. * adjust-alignment.c (pass_data_adjust_alignment): New. (pass_adjust_alignment): New. (pass_adjust_alignment::execute): New. (make_pass_adjust_alignment): New. * tree-pass.h (make_pass_adjust_alignment): New. * passes.def: Add pass_adjust_alignment.
2020-05-20Daily bump.GCC Administrator1-1/+1
2020-05-19c++: Alias template instantiation template infoNathan Sidwell2-2/+20
I discovered that the alias instantiation machinery would setup template_info, and then sometime later overwrite that with equivalent info. This broke modules, because the template info, once set, is logically immutable. Let's just not do that. * pt.c (lookup_template_class_1): Do not reinit template_info of an alias here.
2020-05-19[aarch64] PR target/94591: Don't generate invalid REV64 insnsAlex Coplan4-1/+45
This fixes PR94591. The problem was the function aarch64_evpc_rev_local() matching vector permutations that were not reversals. In particular, prior to this patch, this function matched the identity permutation which led to generating bogus REV64 insns which were rejected by the assembler. gcc/ PR target/94591 * config/aarch64/aarch64.c (aarch64_evpc_rev_local): Don't match identity permutation. gcc/testsuite/ PR target/94591 * gcc.c-torture/execute/pr94591.c: New test.