aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-03-15Update gcc sv.po.Joseph Myers1-434/+287
* sv.po: Update.
2021-03-15c++: Fix 2 testcases [PR 99601]Nathan Sidwell2-3/+3
I'd failed to correctly restrict some checks to lp64 x86 targets. PR c++/99601 gcc/testsuite/ * g++.dg/modules/builtin-3_a.C: Fix lp64 x86 detection. * g++.dg/modules/builtin-3_b.C: Fix lp64 x86 detection.
2021-03-15libstdc++-v3: Update VTV vars for libtool link commands [PR99172]Caroline Tice3-2/+14
This fixes PR 99172 Currently when GCC is configured with --enable-vtable-verify, the libstdc++-v3 Makefiles add "-fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end" to libtool link commands. The "-fvtable-verify=std" piece causes alternate versions of libtool (such as slibtool) to fail, unable to find "-lvtv" (GNU libtool just removes that piece). This patch updates the libstdc++-v3 Makefiles to not pass "-fvtable-verify=std" to the libtool link commands.
2021-03-15coroutines : Convert await_ready () expressions to bool [PR99047].Iain Sandoe2-1/+90
The awaiter.await_ready() should be converted per [expr.await]/3 (3.6) await-ready is the expression e.await_ready(), contextually converted to bool. gcc/cp/ChangeLog: PR c++/99047 * coroutines.cc (expand_one_await_expression): If the await_ready() expression is not a boolean then convert it as required. gcc/testsuite/ChangeLog: PR c++/99047 * g++.dg/coroutines/pr99047.C: New test.
2021-03-15coroutines : Handle rethrow from unhandled_exception [PR98704].Iain Sandoe2-21/+145
Although there is still some discussion in CWG 2451 on this, the implementors are agreed on the intent. When promise.unhandled_exception () is entered, the coroutine is considered to be still running - returning from the method will cause the final await expression to be evaluated. If the method throws, that action is considered to make the coroutine suspend (since, otherwise, it would be impossible to reclaim its resources, since one cannot destroy a running coro). The wording issue is to do with how to represent the place at which the coroutine should be considered suspended. For the implementation here, that place is immediately before the promise life-time ends. A handler for the rethrown exception, can thus call xxxx.destroy() which will run DTORs for the promise and any parameter copies [as needed] then the coroutine frame will be deallocated. At present, we also set "done=true" in this case (for compatibility with other current implementations). One might consider 'done()' to be misleading in the case of an abnormal termination - that is also part of the CWG 2451 discussion. gcc/cp/ChangeLog: PR c++/98704 * coroutines.cc (build_actor_fn): Make destroy index 1 correspond to the abnormal unhandled_exception() exit. Substitute the proxy for the resume index. (coro_rewrite_function_body): Arrange to reset the resume index and make done = true for a rethrown exception from unhandled_exception (). (morph_fn_to_coro): Adjust calls to build_actor_fn and coro_rewrite_function_body. gcc/testsuite/ChangeLog: PR c++/98704 * g++.dg/coroutines/torture/pr98704.C: New test.
2021-03-15coroutines : Handle for await expressions in for stmts [PR98480].Iain Sandoe5-0/+428
The handling of await expressions in the init, condition and iteration expressions of for loops had been omitted. Fixed thus. gcc/cp/ChangeLog: PR c++/98480 * coroutines.cc (replace_continue): Rewrite continue into 'goto label'. (await_statement_walker): Handle await expressions in the initializer, condition and iteration expressions of for loops. gcc/testsuite/ChangeLog: PR c++/98480 * g++.dg/coroutines/pr98480.C: New test. * g++.dg/coroutines/torture/co-await-24-for-init.C: New test. * g++.dg/coroutines/torture/co-await-25-for-condition.C: New test. * g++.dg/coroutines/torture/co-await-26-for-iteration-expr.C: New test.
2021-03-15coroutines : Avoid generating empty statements [PR96749].Iain Sandoe3-20/+123
In the compiler-only idiom: " a = (target expr creats temp, op uses temp) " the target expression variable needs to be promoted to a frame one (if the expression has a suspend point). However, the only uses of the var are in the second part of the compound expression - and we were creating an empty statement corresponding to the (now unused) first arm. This then produces the spurious warnings noted. Fixed by avoiding generation of a separate variable nest for isolated target expressions (or similarly isolated co_awaits used in a function call). gcc/cp/ChangeLog: PR c++/96749 * coroutines.cc (flatten_await_stmt): Allow for the case where a target expression variable only has uses in the second part of a compound expression. (maybe_promote_temps): Avoid emiting empty statements. gcc/testsuite/ChangeLog: PR c++/96749 * g++.dg/coroutines/pr96749-1.C: New test. * g++.dg/coroutines/pr96749-2.C: New test.
2021-03-15libstdc++, testsuite, Darwin : Adjust for names used in system headers.Iain Sandoe1-0/+5
For all current Darwin SDKs inttypes.h has: extern intmax_t imaxabs(intmax_t j); So we need to exclude j from the defined test symbols. libstdc++-v3/ChangeLog: * testsuite/17_intro/names.cc: Exclude j from the list of test symbols for Darwin.
2021-03-15libstdc++, Darwin, ppc : Add new long double symbols.Iain Sandoe1-0/+3
We need to add the symbols for to_chars and from_chars for the long double cases. libstdc++-v3/ChangeLog: * config/os/bsd/darwin/ppc-extra.ver: Add matching for to_chars and from_chars for long double.
2021-03-15tree-optimization/98834 - fix optimization regression with _b_c_pRichard Biener2-1/+82
The following makes FRE optimize a load we formerly required SRA + CCP for which now run after we get rid of all __builtin_constant_p calls. 2021-03-15 Richard Biener <rguenther@suse.de> PR tree-optimization/98834 * tree-ssa-sccvn.c (vn_reference_lookup_3): Handle missing subsetting by truncating the access size. * g++.dg/opt/pr98834.C: New testcase.
2021-03-15libstdc++: Implement missing operator overloads in max_size_type.hPatrick Palka2-2/+112
This implements operator++, operator-- and operator<=> for the integer-class types defined in max_size_type.h, which I overlooked when originally implementing the class. libstdc++-v3/ChangeLog: * include/bits/max_size_type.h (__max_size_type::operator _Tp): Fix formatting. (__max_size_type::operator++): Define. (__max_size_type::operator--): Likewise. (__max_size_type::operator<=>): Conditionally define (in place of the other comparison operators). (__max_diff_type::operator _Tp): Fix formatting. (__max_diff_type::operator++): Define. (__max_diff_type::operator--): Likewise. (__max_diff_type::operator<=>): Conditionally define (in place of the other comparison operators). * testsuite/std/ranges/iota/max_size_type.cc (test01): Test these operator overloads.
2021-03-15analyzer: fix missing comma in initializerMartin Liska1-1/+1
Fixes the following valid warning: gcc/analyzer/sm-file.cc:250:5: warning: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Wstring-concatenation] gcc/analyzer/ChangeLog: * sm-file.cc (get_file_using_fns): Add missing comma in initializer.
2021-03-15znver3 tuning part 1Jan Hubicka2-1/+135
2021-03-15 Jan Hubicka <hubicka@ucw.cz> * config/i386/i386-options.c (processor_cost_table): Add znver3_cost. * config/i386/x86-tune-costs.h (znver3_cost): New gobal variable; copy of znver2_cost.
2021-03-15Handle EXEC_IOLENGTH in doloop_contained_procedure_code.Thomas Koenig3-0/+36
This rather obvious patch fixes an ICE on valid which came about because I did not handle EXEC_IOLENGTH as start of an I/O statement when checking for the DO loop variable. This is an 11 regression. gcc/fortran/ChangeLog: PR fortran/99345 * frontend-passes.c (doloop_contained_procedure_code): Properly handle EXEC_IOLENGTH. gcc/testsuite/ChangeLog: PR fortran/99345 * gfortran.dg/do_check_16.f90: New test. * gfortran.dg/do_check_17.f90: New test.
2021-03-15Fortran: Fix problem with allocate initialization [PR99545].Paul Thomas2-1/+41
2021-03-15 Paul Thomas <pault@gcc.gnu.org> gcc/fortran/ChangeLog PR fortran/99545 * trans-stmt.c (gfc_trans_allocate): Mark the initialization assignment by setting init_flag. gcc/testsuite/ChangeLog PR fortran/99545 * gfortran.dg/pr99545.f90: New test.
2021-03-15OpenMP: Fix 'omp declare target' handling for vars [PR99509]Tobias Burnus3-6/+59
For variables with 'declare target' attribute, varpool_node::get_create marks variables as offload; however, if the node already exists, it is not updated. C/C++ may tag decl with 'declare target implicit', which may only be after varpool creation turned into 'declare target' or 'declare target link'; in this case, the tagging has to happen in the FE. gcc/c/ChangeLog: PR c++/99509 * c-decl.c (finish_decl): For 'omp declare target implicit' vars, ensure that the varpool node is marked as offloadable. gcc/cp/ChangeLog: PR c++/99509 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars, ensure that the varpool node is marked as offloadable. libgomp/ChangeLog: PR c++/99509 * testsuite/libgomp.c-c++-common/declare_target-1.c: New test.
2021-03-15Fix -Wstring-concatenation warning.Martin Liska1-1/+1
Fix the following clang warning: gcc/spellcheck.c:477:3: warning: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Wstring-concatenation] gcc/ChangeLog: * spellcheck.c: Add missing comma in initialization.
2021-03-14testsuite: fix typo in testcase pr99492.cDavid Edelsohn1-3/+3
gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr99492.c: Fix typo.
2021-03-15Daily bump.GCC Administrator4-1/+25
2021-03-14PR fortran/99112 - ICE with runtime diagnostics for SIZE intrinsic functionHarald Anlauf3-10/+59
Add/fix handling of runtime checks for CLASS arguments with ALLOCATABLE or POINTER attribute. gcc/fortran/ChangeLog: * trans-expr.c (gfc_conv_procedure_call): Fix runtime checks for CLASS arguments. * trans-intrinsic.c (gfc_conv_intrinsic_size): Likewise. gcc/testsuite/ChangeLog: * gfortran.dg/pr99112.f90: New test. Co-authored-by: Paul Thomas <pault@gcc.gnu.org>
2021-03-14i386: Some more -mavx512vl -mno-avx512bw fixes [PR99321]Uros Bizjak1-34/+24
2021-03-14 Uroš Bizjak <ubizjak@gmail.com> gcc/ * config/i386/sse.md (*vec_extract<mode>): Merge alternative 0 with alternative 2 and alternative 1 with alternative 3 using YW register constraint. (*vec_extract<PEXTR_MODE12:mode>_zext): Merge alternatives using YW register constraint. (*vec_extractv16qi_zext): Ditto. (*vec_extractv4si): Merge alternatives 4 and 5 using Yw register constraint. (*ssse3_palignr<mode>_perm): Use Yw instead of v for alternative 3.
2021-03-14Daily bump.GCC Administrator5-1/+47
2021-03-13PR tree-optimization/99489 - ICE calling strncat after strcatMartin Sebor2-1/+42
gcc/ChangeLog: PR tree-optimization/99489 * builtins.c (gimple_call_alloc_size): Fail gracefully when argument is not a call statement. gcc/testsuite/ChangeLog: PR tree-optimization/99489 * gcc.dg/Wstringop-truncation-9.c: New test.
2021-03-13Fortran: Fix for class defined operators [PR99125].Paul Thomas3-3/+27
2021-03-13 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/99125 * trans-array.c (gfc_conv_expr_descriptor): For deferred length length components use the ss_info string length instead of gfc_get_expr_charlen. Make sure that the deferred string length is a variable before assigning to it. Otherwise use the expr. * trans-expr.c (gfc_conv_string_length): Make sure that the deferred string length is a variable before assigning to it. gcc/testsuite/ PR fortran/99125 * gfortran.dg/alloc_deferred_comp_1.f90: New test.
2021-03-13match.pd: Don't optimize vector X + (X << C) -> X * (1 + (1 << C)) if there ↵Jakub Jelinek2-2/+21
is no mult support [PR99544] E.g. on aarch64, the target has V2DImode addition and shift by scalar optabs, but doesn't have V2DImode multiply. The following testcase ICEs because this simplification is done after last lowering, but generally, even if it is done before that, turning it into a multiplication will not be an improvement because that means scalarization, while the former can be done in vectors. It would be nice if we added expansion support for vector multiplication by uniform constants using shifts and additions like we have for scalar multiplication, but that is something that can be done in stage1. 2021-03-13 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/99544 * match.pd (X + (X << C) -> X * (1 + (1 << C))): Don't simplify if for vector types multiplication can't be done in type's mode. * gcc.dg/gomp/pr99544.c: New test.
2021-03-12misc/cgo/testcarchive: don't use == for string equality in C codeIan Lance Taylor2-2/+2
Backport of https://golang.org/cl/300993. For PR go/99553 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/301458
2021-03-12MAINTAINERS: Add myself for write after approvalEugene Rozenfeld1-0/+1
ChangeLog: 2021-03-12 Eugene Rozenfeld <erozen@microsoft.com> * MAINTAINERS (Write After Approval): Add myself.
2021-03-12sim: drop dep on configure-gdbMike Frysinger2-2/+0
I'm not entirely sure why this is here since the sim doesn't use anything from the gdb/ dir directly, and the commit that added it included a bunch more changes and doesn't seem to call out this dep specifically. ChangeLog: * Makefile.def: Remove all-sim dependency on configure-gdb. * Makefile.in: Regenerated.
2021-03-13Daily bump.GCC Administrator8-1/+152
2021-03-12c++: ICE with using-decl [PR 99238]Nathan Sidwell5-45/+52
This ICE was caused by a stray TREE_VISITED marker. The lookup machinery was leaving it there due to the way I'd arranged for it to be cleared. That was presuming the name_lookup::value field didn't change, and that wasn't always true in the using-decl processing. I took the opportunity to break out a helper, and then call it immediately after lookups, rather than wait until destructor time. Added some asserts the module machinery to catch further cases of this. PR c++/99238 gcc/cp/ * module.cc (depset::hash::add_binding_entity): Assert not visited. (depset::add::add_specializations): Likewise. * name-lookup.c (name_lookup::dedup): New. (name_lookup::~name_lookup): Assert not deduping. (name_lookup::restore_state): Likewise. (name_lookup::add_overload): Replace outlined code with dedup call. (name_lookup::add_value): Likewise. (name_lookup::search_namespace_only): Likewise. (name_lookup::adl_namespace_fns): Likewise. (name_lookup::adl_class_fns): Likewise. (name_lookup::search_adl): Likewise. Add clearing dedup call. (name_lookup::search_qualified): Likewise. (name_lookup::search_unqualified): Likewise. gcc/testsuite/ * g++.dg/modules/pr99238.h: New. * g++.dg/modules/pr99238_a.H: New. * g++.dg/modules/pr99238_b.H: New.
2021-03-12Fix memory constraint bug in SPARC back-endEric Botcazou4-20/+16
It's a bug exposed by the recent LRA changes, whereby the T constraint fails to behave properly when LRA is enabled (unlike when reload is enabled). The patch also gets rid of the awkward W constraint, which is strictly equivalent to m in 64-bit mode and, as a result, renames the w constraint into W. gcc/ PR target/99422 * config/sparc/constraints.md (w): Rename to... (W): ... this and ditch previous implementation. * config/sparc/sparc.md (*movdi_insn_sp64): Replace W with m. (*movdf_insn_sp64): Likewise. (*mov<VM64:mode>_insn_sp64): Likewise. * config/sparc/sync.md (*atomic_compare_and_swap<mode>_1): Replace w with W. (atomic_compare_and_swap_leon3_1): Likewise. (*atomic_compare_and_swapdi_v8plus): Likewise. * config/sparc/sparc.c (memory_ok_for_ldd): Remove useless test on architecture and add missing address validity check during LRA.
2021-03-12Fortran/OpenMP: Accept implicit-save DATA vars for threadprivate [PR99514]Tobias Burnus2-5/+16
gcc/fortran/ChangeLog: PR fortran/99514 * resolve.c (resolve_symbol): Accept vars which are in DATA and hence (either) implicit SAVE (or in common). gcc/testsuite/ChangeLog: PR fortran/99514 * gfortran.dg/gomp/threadprivate-1.f90: New test.
2021-03-12Fortran/OpenMP: Fix use_device_{ptr,addr} with assumed-size array [PR98858]Tobias Burnus2-1/+92
gcc/ChangeLog: PR fortran/98858 * gimplify.c (omp_add_variable): Handle NULL_TREE as size occuring for assumed-size arrays in use_device_{ptr,addr}. libgomp/ChangeLog: PR fortran/98858 * testsuite/libgomp.fortran/use_device_ptr-3.f90: New test.
2021-03-12Fortran: Fix libgfortran I/O race with newunit_free [PR99529]Tobias Burnus2-9/+24
libgfortran/ChangeLog: * io/transfer.c (st_read_done_worker, st_write_done_worker): Call unlock_unit here, add unit_lock lock around newunit_free call. (st_read_done, st_write_done): Only call unlock_unit when not calling the worker function. * io/unit.c (set_internal_unit): Don't reset the unit_number to the same number as this cause race warnings.
2021-03-12i386: Hopefully last set of -mavx512vl -mno-avx512bw fixes [PR99321]Jakub Jelinek4-239/+332
This is the final patch of the series started with https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566139.html and continued with https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566356.html This time, I went through all the remaining instructions marked by gas as requiring both AVX512BW and AVX512VL and for each checked tmp-mddump.md, figure out if it ever could be a problem (e.g. instructions that require AVX512BW+AVX512VL, but didn't exist before AVX512F are usually fine, the patterns have the right conditions, the bugs are typically on pre-AVX512F patterns where we have just blindly added v while they actually can't access those unless AVX512BW+AVX512VL), added test where possible (the test doesn't cover MMX though)and fixed md bugs. For mmx pextr[bw]/pinsr[bw] patterns it introduces per discussions a new YW constraint that only requires AVX512BW and not AVX512VL, because those instructions only require the former and not latter when using EVEX encoding. There are some other interesting details, e.g. most of the 8 interleave patterns (vpunck[hl]{bw,wd}) had correctly && <mask_avx512vl_condition> && <mask_avx512bw_condition> in the conditions because for masking it needs to be always EVEX encoded and then it needs both VL+BW, but 2 of those 8 had just && <mask_avx512vl_condition> and so again would run into the -mavx512vl -mno-avx512bw problems. Another problem different from others was mmx eq/gt comparisons, that was using Yv constraints, so would happily accept %xmm16+ registers for -mavx512vl, but there actually are no such EVEX encoded instructions, as AVX512 comparisons work with %k* registers instead. The newly added testcase without the patch fails with: /tmp/ccVROLo2.s: Assembler messages: /tmp/ccVROLo2.s:9: Error: unsupported instruction `vpabsb' /tmp/ccVROLo2.s:20: Error: unsupported instruction `vpabsb' /tmp/ccVROLo2.s:31: Error: unsupported instruction `vpabsw' /tmp/ccVROLo2.s:42: Error: unsupported instruction `vpabsw' /tmp/ccVROLo2.s:53: Error: unsupported instruction `vpaddsb' /tmp/ccVROLo2.s:64: Error: unsupported instruction `vpaddsb' /tmp/ccVROLo2.s:75: Error: unsupported instruction `vpaddsw' /tmp/ccVROLo2.s:86: Error: unsupported instruction `vpaddsw' /tmp/ccVROLo2.s:97: Error: unsupported instruction `vpsubsb' /tmp/ccVROLo2.s:108: Error: unsupported instruction `vpsubsb' /tmp/ccVROLo2.s:119: Error: unsupported instruction `vpsubsw' /tmp/ccVROLo2.s:130: Error: unsupported instruction `vpsubsw' /tmp/ccVROLo2.s:141: Error: unsupported instruction `vpaddusb' /tmp/ccVROLo2.s:152: Error: unsupported instruction `vpaddusb' /tmp/ccVROLo2.s:163: Error: unsupported instruction `vpaddusw' /tmp/ccVROLo2.s:174: Error: unsupported instruction `vpaddusw' /tmp/ccVROLo2.s:185: Error: unsupported instruction `vpsubusb' /tmp/ccVROLo2.s:196: Error: unsupported instruction `vpsubusb' /tmp/ccVROLo2.s:207: Error: unsupported instruction `vpsubusw' /tmp/ccVROLo2.s:218: Error: unsupported instruction `vpsubusw' /tmp/ccVROLo2.s:258: Error: unsupported instruction `vpaddusw' /tmp/ccVROLo2.s:269: Error: unsupported instruction `vpavgb' /tmp/ccVROLo2.s:280: Error: unsupported instruction `vpavgb' /tmp/ccVROLo2.s:291: Error: unsupported instruction `vpavgw' /tmp/ccVROLo2.s:302: Error: unsupported instruction `vpavgw' /tmp/ccVROLo2.s:475: Error: unsupported instruction `vpmovsxbw' /tmp/ccVROLo2.s:486: Error: unsupported instruction `vpmovsxbw' /tmp/ccVROLo2.s:497: Error: unsupported instruction `vpmovzxbw' /tmp/ccVROLo2.s:508: Error: unsupported instruction `vpmovzxbw' /tmp/ccVROLo2.s:548: Error: unsupported instruction `vpmulhuw' /tmp/ccVROLo2.s:559: Error: unsupported instruction `vpmulhuw' /tmp/ccVROLo2.s:570: Error: unsupported instruction `vpmulhw' /tmp/ccVROLo2.s:581: Error: unsupported instruction `vpmulhw' /tmp/ccVROLo2.s:592: Error: unsupported instruction `vpsadbw' /tmp/ccVROLo2.s:603: Error: unsupported instruction `vpsadbw' /tmp/ccVROLo2.s:643: Error: unsupported instruction `vpshufhw' /tmp/ccVROLo2.s:654: Error: unsupported instruction `vpshufhw' /tmp/ccVROLo2.s:665: Error: unsupported instruction `vpshuflw' /tmp/ccVROLo2.s:676: Error: unsupported instruction `vpshuflw' /tmp/ccVROLo2.s:687: Error: unsupported instruction `vpslldq' /tmp/ccVROLo2.s:698: Error: unsupported instruction `vpslldq' /tmp/ccVROLo2.s:709: Error: unsupported instruction `vpsrldq' /tmp/ccVROLo2.s:720: Error: unsupported instruction `vpsrldq' /tmp/ccVROLo2.s:899: Error: unsupported instruction `vpunpckhbw' /tmp/ccVROLo2.s:910: Error: unsupported instruction `vpunpckhbw' /tmp/ccVROLo2.s:921: Error: unsupported instruction `vpunpckhwd' /tmp/ccVROLo2.s:932: Error: unsupported instruction `vpunpckhwd' /tmp/ccVROLo2.s:943: Error: unsupported instruction `vpunpcklbw' /tmp/ccVROLo2.s:954: Error: unsupported instruction `vpunpcklbw' /tmp/ccVROLo2.s:965: Error: unsupported instruction `vpunpcklwd' /tmp/ccVROLo2.s:976: Error: unsupported instruction `vpunpcklwd' 2021-03-12 Jakub Jelinek <jakub@redhat.com> PR target/99321 * config/i386/constraints.md (YW): New internal constraint. * config/i386/sse.md (v_Yw): Add V4TI, V2TI, V1TI and TI cases. (*<sse2_avx2>_<insn><mode>3<mask_name>, *<sse2_avx2>_uavg<mode>3<mask_name>, *abs<mode>2, *<s>mul<mode>3_highpart<mask_name>): Use <v_Yw> instead of v in constraints. (<sse2_avx2>_psadbw): Use YW instead of v in constraints. (*avx2_pmaddwd, *sse2_pmaddwd, *<code>v8hi3, *<code>v16qi3, avx2_pmaddubsw256, ssse3_pmaddubsw128): Merge last two alternatives into one, use Yw instead of former x,v. (ashr<mode>3, <insn><mode>3): Use <v_Yw> instead of x in constraints of the last alternative. (<sse2_avx2>_packsswb<mask_name>, <sse2_avx2>_packssdw<mask_name>, <sse2_avx2>_packuswb<mask_name>, <sse4_1_avx2>_packusdw<mask_name>, *<ssse3_avx2>_pmulhrsw<mode>3<mask_name>, <ssse3_avx2>_palignr<mode>, <ssse3_avx2>_pshufb<mode>3<mask_name>): Merge last two alternatives into one, use <v_Yw> instead of former x,v. (avx2_interleave_highv32qi<mask_name>, vec_interleave_highv16qi<mask_name>): Use Yw instead of v in constraints. Add && <mask_avx512bw_condition> to condition. (avx2_interleave_lowv32qi<mask_name>, vec_interleave_lowv16qi<mask_name>, avx2_interleave_highv16hi<mask_name>, vec_interleave_highv8hi<mask_name>, avx2_interleave_lowv16hi<mask_name>, vec_interleave_lowv8hi<mask_name>, avx2_pshuflw_1<mask_name>, sse2_pshuflw_1<mask_name>, avx2_pshufhw_1<mask_name>, sse2_pshufhw_1<mask_name>, avx2_<code>v16qiv16hi2<mask_name>, sse4_1_<code>v8qiv8hi2<mask_name>, *sse4_1_<code>v8qiv8hi2<mask_name>_1, <sse2_avx2>_<insn><mode>3): Use Yw instead of v in constraints. * config/i386/mmx.md (Yv_Yw): New define_mode_attr. (*mmx_<insn><mode>3, mmx_ashr<mode>3, mmx_<insn><mode>3): Use <Yv_Yw> instead of Yv in constraints. (*mmx_<insn><mode>3, *mmx_mulv4hi3, *mmx_smulv4hi3_highpart, *mmx_umulv4hi3_highpart, *mmx_pmaddwd, *mmx_<code>v4hi3, *mmx_<code>v8qi3, mmx_pack<s_trunsuffix>swb, mmx_packssdw, mmx_punpckhbw, mmx_punpcklbw, mmx_punpckhwd, mmx_punpcklwd, *mmx_uavgv8qi3, *mmx_uavgv4hi3, mmx_psadbw): Use Yw instead of Yv in constraints. (*mmx_pinsrw, *mmx_pinsrb, *mmx_pextrw, *mmx_pextrw_zext, *mmx_pextrb, *mmx_pextrb_zext): Use YW instead of Yv in constraints. (*mmx_eq<mode>3, mmx_gt<mode>3): Use x instead of Yv in constraints. (mmx_andnot<mode>3, *mmx_<code><mode>3): Split last alternative into two, one with just x, another isa avx512vl with v. * gcc.target/i386/avx512vl-pr99321-2.c: New test.
2021-03-12c++: Fix up calls to immediate functions returning reference [PR99507]Jakub Jelinek2-0/+10
build_cxx_call calls convert_from_reference at the end, so if an immediate function returns a reference, we were constant evaluating not just that call, but that call wrapped in an INDIRECT_REF. That unfortunately means it can constant evaluate to something non-addressable, so if code later needs to take its address it will fail. The following patch fixes that by undoing the convert_from_reference wrapping for the cxx_constant_value evaluation and readdding it ad the end. 2021-03-12 Jakub Jelinek <jakub@redhat.com> PR c++/99507 * call.c (build_over_call): For immediate evaluation of functions that return references, undo convert_from_reference effects before calling cxx_constant_value and call convert_from_reference afterwards. * g++.dg/cpp2a/consteval19.C: New test.
2021-03-12analyzer: document new paramMartin Liska1-0/+4
gcc/ChangeLog: * doc/invoke.texi: Add missing param documentation.
2021-03-12gcc-changelog: allow ChangeLog deletion in a commitMartin Liska5-2/+40
contrib/ChangeLog: * gcc-changelog/git_commit.py: Allow deletion of ChangeLog files. * gcc-changelog/setup.cfg: Set line limit to 120 characters. * gcc-changelog/test_email.py: Add test. * gcc-changelog/test_patches.txt: Likewise. * gcc-changelog/git_email.py: Fix parsing of deleted files.
2021-03-12Daily bump.GCC Administrator7-1/+284
2021-03-11compiler: create temporaries for heap variablesIan Lance Taylor6-56/+99
The compiler generally doesn't create a temporary for an expression that is a variable, because it's normally valid to simply reload the value from the variable. However, if the variable is in the heap, then loading the value is a pointer indirection. The process of creating GCC IR can cause the variable load and the pointer indirection to be split, such that the second evaluation only does the pointer indirection. If there are conditionals in between the two uses, this can cause the second use to load the pointer from an uninitialized register. Avoid this by introducing a new Expression method that returns whether it is safe to evaluate an expression multiple times, and use it everywhere. The test case is https://golang.org/cl/300789. Fixes golang/go#44383 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/300809
2021-03-11analyzer: new implementation of shortest feasible path [PR96374]David Malcolm20-106/+1366
The analyzer builds an exploded graph of (point,state) pairs and when it finds a problem, records a diagnostic at the relevant exploded node. Once it has finished exploring the graph, the analyzer needs to generate the shortest feasible path through the graph to each diagnostic's node. This is used: - for rejecting diagnostics that are infeasible (due to impossible sets of constraints), - for use in determining which diagnostic to use in each deduplication set (the one with the shortest path), and - for building checker_paths for the "winning" diagnostics, giving a list of events Prior to this patch the analyzer simply found the shortest path to the node, and then checked it for feasibility, which could lead to falsely rejecting diagnostics: "the shortest path, if feasible" is not the same as "the shortest feasible path" (PR analyzer/96374). An example is PR analyzer/93355, where this issue causes the analyzer to fail to emit a leak warning for a missing fclose on an error-handling path in intl/localealias.c. This patch implements a new algorithm for finding the shortest feasible path to an exploded node: instead of simply finding the shortest path, the new algorithm uses a worklist to iteratively build a tree of path prefixes, which are feasible paths by construction, until a path to the target node is found. The worklist is prioritized, so that the first feasible path discovered is the shortest possible feasible path. The algorithm continues trying paths until the target node is reached or a limit is exceeded, in which case the diagnostic is treated as being infeasible (which could still be a false negative, but is much less likely to happen than before). Iteratively building a tree of paths allows for work to be reused, and the tree can be dumped in .dot form (via a new -fdump-analyzer-feasibility option), making it much easier to debug compared to other approaches I tried. Doing so fixes the missing leak warning for PR analyzer/93355 and various other test cases. Testing: - I manually verified that the behavior is determistic using 50 builds of pr93355-localealias.c. All dumps were identical. - I manually verified that it still builds with --disable-analyzer. - Lightly tested with valgrind; no additional issues. - Lightly performance tested, showing a slight speed regression to the analyzer relative to before the patch, but correctness for this issue is more important than the slight performance hit for the analyzer. gcc/ChangeLog: PR analyzer/96374 * Makefile.in (ANALYZER_OBJS): Add analyzer/feasible-graph.o and analyzer/trimmed-graph.o. * doc/analyzer.texi (Analyzer Paths): Rewrite description of feasibility checking to reflect new implementation. * doc/invoke.texi (-fdump-analyzer-feasibility): Document new option. * shortest-paths.h (shortest_paths::get_shortest_distance): New. gcc/analyzer/ChangeLog: PR analyzer/96374 * analyzer.opt (-param=analyzer-max-infeasible-edges=): New param. (fdump-analyzer-feasibility): New flag. * diagnostic-manager.cc: Include "analyzer/trimmed-graph.h" and "analyzer/feasible-graph.h". (epath_finder::epath_finder): Convert m_sep to a pointer and only create it if !flag_analyzer_feasibility. (epath_finder::~epath_finder): New. (epath_finder::m_sep): Convert to a pointer. (epath_finder::get_best_epath): Add param "diag_idx" and use it when logging. Rather than finding the shortest path and then checking feasibility, instead use explore_feasible_paths unless !flag_analyzer_feasibility, in which case simply use the shortest path, and note if it is infeasible. Update for m_sep becoming a pointer. (class feasible_worklist): New. (epath_finder::explore_feasible_paths): New. (epath_finder::process_worklist_item): New. (class dump_eg_with_shortest_path): New. (epath_finder::dump_trimmed_graph): New. (epath_finder::dump_feasible_graph): New. (saved_diagnostic::saved_diagnostic): Add "idx" param, using it on new field m_idx. (saved_diagnostic::to_json): Dump m_idx. (saved_diagnostic::calc_best_epath): Pass m_idx to get_best_epath. Remove assertion that m_problem was set when m_best_epath is NULL. (diagnostic_manager::add_diagnostic): Pass an index when created saved_diagnostic instances. * diagnostic-manager.h (saved_diagnostic::saved_diagnostic): Add "idx" param. (saved_diagnostic::get_index): New accessor. (saved_diagnostic::m_idx): New field. * engine.cc (exploded_node::dump_dot): Call args.dump_extra_info. Move code to... (exploded_node::dump_processed_stmts): ...this new function and... (exploded_node::dump_saved_diagnostics): ...this new function. Add index of each diagnostic. (exploded_edge::dump_dot): Move bulk of code to... (exploded_edge::dump_dot_label): ...this new function. * exploded-graph.h (eg_traits::dump_args_t::dump_extra_info): New vfunc. (exploded_node::dump_processed_stmts): New decl. (exploded_node::dump_saved_diagnostics): New decl. (exploded_edge::dump_dot_label): New decl. * feasible-graph.cc: New file. * feasible-graph.h: New file. * trimmed-graph.cc: New file. * trimmed-graph.h: New file. gcc/testsuite/ChangeLog: PR analyzer/96374 * gcc.dg/analyzer/dot-output.c: Add -fdump-analyzer-feasibility to options. * gcc.dg/analyzer/feasibility-1.c (test_6): Remove xfail. (test_7): New. * gcc.dg/analyzer/pr93355-localealias-feasibility-2.c: Remove xfail. * gcc.dg/analyzer/pr93355-localealias-feasibility-3.c: Remove xfails. * gcc.dg/analyzer/pr93355-localealias-feasibility.c: Remove -fno-analyzer-feasibility from options. * gcc.dg/analyzer/pr93355-localealias.c: Likewise. * gcc.dg/analyzer/unknown-fns-4.c: Remove xfail.
2021-03-11analyzer: support reverse direction in shortest-paths.hDavid Malcolm3-37/+125
This patch generalizes shortest-path.h so that it can be used to find the shortest path from each node to a given target node (on top of the existing support for finding the shortest path from a given origin node to each node). I've marked this as "analyzer" as this is the only code using shortest-paths.h. This patch is required by followup work to fix PR analyzer/96374. gcc/analyzer/ChangeLog: * diagnostic-manager.cc (epath_finder::epath_finder): Update shortest_paths init for new param. gcc/ChangeLog: * digraph.cc (selftest::test_shortest_paths): Update shortest_paths init for new param. Add test of SPS_TO_GIVEN_TARGET. * shortest-paths.h (enum shortest_path_sense): New. (shortest_paths::shortest_paths): Add "sense" param. Update for renamings. Generalize to use "sense" param. (shortest_paths::get_shortest_path): Rename param. (shortest_paths::m_sense): New field. (shortest_paths::m_prev): Rename... (shortest_paths::m_best_edge): ...to this. (shortest_paths::get_shortest_path): Update for renamings. Conditionalize flipping of path on sense of traversal.
2021-03-11analyzer: gracefully handle impossible paths in shortest-paths.hDavid Malcolm2-24/+83
This bulletproofs the shortest_paths code against unreachable nodes, gracefully handling them, rather than failing an assertion. I've marked this as "analyzer" as this is the only code using shortest-paths.h. This patch is required by followup work to fix PR analyzer/96374. gcc/ChangeLog: * digraph.cc (selftest::test_shortest_paths): Add test coverage for paths from B and C. * shortest-paths.h (shortest_paths::shortest_paths): Handle unreachable nodes, rather than asserting.
2021-03-11libstdc++: Add a fallback 128-bit integer class type and use itPatrick Palka3-24/+332
This implements a minimal integer class type that emulates 128-bit unsigned arithmetic using a pair of 64-bit integers, which the floating-point std::to_chars implementation then uses as a drop-in replacement for unsigned __int128 on targets that lack the latter. After this patch, we now fully support formatting of large long double types on such targets. Since Ryu performs 128-bit division/modulus only by 2, 5 and 10, this integer class type supports only these divisors rather than general division/modulus. libstdc++-v3/ChangeLog: * src/c++17/floating_to_chars.cc: Simplify the file as if __SIZEOF_INT128__ is always defined. [!defined __SIZEOF_INT128__]: Include "uint128_t.h". Define a base-10 to_chars overload for the uint128_t class type. * src/c++17/uint128_t.h: New file. * testsuite/20_util/to_chars/long_double.cc: No longer expect an execution FAIL on targets that have a large long double type but lack __int128.
2021-03-11libstdc++: Remove Ryu's uint128_t aliasesPatrick Palka4-9/+3
This makes Ryu consistently use the uint128_t alias that's defined in floating_to_chars.cc. libstdc++-v3/ChangeLog: * src/c++17/ryu/LOCAL_PATCHES: Update. * src/c++17/ryu/d2s_intrinsics.h: Don't define uint128_t. * src/c++17/ryu/generic_128.h: Likewise. * src/c++17/ryu/ryu_generic_128.h (struct floating_decimal_128): Use uint128_t instead of __uint128_t. (generic_binary_to_decimal): Likewise.
2021-03-11libstdc++: Add a LOCAL_PATCHES file to Ryu source directoryPatrick Palka1-0/+1
This file keeps track of the local modifications we've made to our copy of Ryu. libstdc++-v3/ChangeLog: * src/c++17/ryu/LOCAL_PATCHES: New file.
2021-03-11libstdc++: Factor out uses of __int128 into a type aliasPatrick Palka1-9/+16
Since Ryu has the alias uint128_t for this same purpose, it seems best for us to use this name as well, so as to minimize the amount of local modifications we'd need to make to our copy of Ryu. (In a subsequent patch, we're going to remove Ryu's aliases so that it uses this one defined in floating_to_chars.cc.) libstdc++-v3/ChangeLog: * src/c++17/floating_to_chars.cc (uint128_t): New conditionally defined alias of unsigned __int128. (floating_type_traits_binary128::mantissa_t): Use uint128_t instead of unsigned __int128. (floating_type_traits<long double>::mantissa_t) [LONG_DOUBLE_KIND == LDK_IBM128]: Likewise. (get_ieee_repr): Likewise. Make casts from uint_t to mantissa_t and uint32_t explicit. Simplify the extraction of mantissa, exponent and sign bit.
2021-03-11aix: Use lcomm for TLS static data.David Edelsohn4-9/+5
GCC on AIX generates thread local uninitialized data in the common section, which could conflict with another module. This patch changes the code generation to place static uninitialized thread local data into the local common section specified with .lcomm. This change also removes the need to create a file-local name for the TBSS data. gcc/ChangeLog: 2021-03-11 David Edelsohn <dje.gcc@gmail.com> PR target/99094 * config/rs6000/rs6000.c (rs6000_xcoff_file_start): Don't create xcoff_tbss_section_name. * config/rs6000/xcoff.h (ASM_OUTPUT_TLS_COMMON): Use .lcomm. * xcoffout.c (xcoff_tbss_section_name): Delete. * xcoffout.h (xcoff_tbss_section_name): Delete.
2021-03-11c++: Fix unhiding friend with imports [PR 99248]Nathan Sidwell5-3/+19
This was a simple thinko about which object held the reference to the binding vector. I also noticed stale code in the tree dumper, as I recently removed the flags from a lazy number. PR c++/99248 gcc/cp/ * name-lookup.c (lookup_elaborated_type_1): Access slot not bind when there's a binding vector. * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing. gcc/testsuite/ * g++.dg/modules/pr99248.h: New. * g++.dg/modules/pr99248_a.H: New. * g++.dg/modules/pr99248_b.H: New.
2021-03-11libstdc++: Make barrier::arrival_token a move-only class typeJonathan Wakely1-6/+18
The standard only specifies that barrier::arrival_token is a move constructible and move assignable type. We originally used a scoped enum type, but that means we do not diagnose non-portable code that makes copies of arrival tokens (or compares them for equality, or uses them as keys in map!) This wraps the enum in a move-only class type, so that users are forced to pass it correctly. The move constructor and move assignment operator of the new class do not zero out the moved-from token, as that would add additional instructions. That means that passing a moved-from token will work with our implementation, despite being a bug in the user code. We could consider doing that zeroing out in debug mode. libstdc++-v3/ChangeLog: * include/std/barrier (barrier::arrival_token): New move-only class that encapsulates the underlying token value.