summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-07-26libstdc++: Minor codegen improvement for atomic wait spinloopThomas Rodgers
This patch merges the spin loops in the atomic wait implementation which is a minor codegen improvement. libstdc++-v3/ChangeLog: * include/bits/atomic_wait.h (__atomic_spin): Merge spin loops. (cherry picked from commit e75da2ace6b6f634237259ef62cfb2d3d34adb10)
2022-07-26d: Merge upstream dmd 76e3b41375, druntime 1462ebd1, phobos 5fef0d28f.Iain Buclaw
Updates D language version to v2.100.1. D front-end changes: - Fix delegate literal with inferred return value that requires following alias-this to not use class cast. - Fix internal error on variadic template type instantiated with two arrays of classes. - `scope(failure)' blocks that contain `return' statements are now deprecated. - Fix regression where wrong cast was inserted for ternary operator and non-int enums. - Fix internal error in code generation trying to reference _d_arraysetctor. - Fix memory corruption when array literal is passed to map in lambda, then returned from nested function. - Generate invariant id on the basis of location rather than a global counter. - Make `noreturn' conversions work. - Fix segfault when `.stringof' of template alias overloaded with function accessed by trait. - Empty array literal passed to scope param not 'falsey' anymore. Phobos changes: - Avoid copying ranges in std.algorithm.comparison.equal. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 76e3b41375. * dmd/VERSION: Bump version to v2.100.1. * decl.cc (DeclVisitor::visit (VarDeclaration *)): Evaluate RHS of noreturn declaration expressions first. * expr.cc (ExprVisitor::visit (AssignExp *)): Don't generate assignment for noreturn types. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 1462ebd1. * src/MERGE: Merge upstream phobos 5fef0d28f.
2022-07-26Fortran: error recovery from calculation of storage size of a symbol [PR103504]Harald Anlauf
gcc/fortran/ChangeLog: PR fortran/103504 * interface.cc (get_sym_storage_size): Array bounds and character length can only be of integer type. gcc/testsuite/ChangeLog: PR fortran/103504 * gfortran.dg/pr103504.f90: New test. (cherry picked from commit 600956c81c784f4a0cc9d10f6e03e01847afd961)
2022-07-26c++: ICE with erroneous template redeclaration [PR106311]Marek Polacek
Here we ICE trying to get DECL_SOURCE_LOCATION of the parm that happens to be error_mark_node in this ill-formed test. I kept running into this while reducing code, so it'd be good to have it fixed. PR c++/106311 gcc/cp/ChangeLog: * pt.cc (redeclare_class_template): Check DECL_P before accessing DECL_SOURCE_LOCATION. gcc/testsuite/ChangeLog: * g++.dg/template/redecl5.C: New test. (cherry picked from commit 2333b58c9892667545d0c2c3ecd2d7b947197511)
2022-07-25c++: aggregate prvalue as for range [PR106230]Jason Merrill
Since my PR94041 work on temporary lifetime in aggregate initialization, we end up calling build_vec_init to initialize the reference-extended temporary for the artificial __for_range variable. And build_vec_init uses finish_for_stmt to implement its loop. That function assumes that if __for_range is in current_binding_level, we're finishing a range-for, and we should fix up the variable as it goes out of scope. But when called from build_vec_init we aren't finishing a range-for, and do_poplevel doesn't remove the variable from scope because stmts_are_full_exprs_p is false. So let's check that here as well, and leave the DECL_NAME alone. PR c++/106230 gcc/cp/ChangeLog: * semantics.cc (finish_for_stmt): Check stmts_are_full_exprs_p. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/range-for38.C: New test.
2022-07-26Daily bump.GCC Administrator
2022-07-25RTEMS: Do not define _GNU_SOURCE by defaultSebastian Huber
gcc/ChangeLog: * config/rs6000/rtems.h (CPLUSPLUS_CPP_SPEC): Undef. (cherry picked from commit 556b816b820f6749910784cbaca8bb0bb822a970)
2022-07-25Daily bump.GCC Administrator
2022-07-24Daily bump.GCC Administrator
2022-07-23Daily bump.GCC Administrator
2022-07-22libstdc++: Do not optimize away storing pathname if it's neededJonathan Wakely
libstdc++-v3/ChangeLog: * src/c++17/fs_dir.cc (_Dir::_Dir) [!_GLIBCXX_HAVE_OPENAT]: Always store pathname if we don't have openat or unlinkat, because the full path is needed to open sub-directories and remove entries. (cherry picked from commit 835b19936bf30d693783bfa39145a4ce243bbd7c)
2022-07-22libstdc++: check for openat with dirfd in std::filesystemAlexandre Oliva
In the recent patch to check for openat, I missed an occurrence of dirfd in std::filesystem. for libstdc++-v3/ChangeLog * src/c++17/fs_dir.cc (dir_and_pathname): Use dirfd if _GLIBCXX_HAVE_OPENAT. (cherry picked from commit 486893b1d325d22d54c1380937943913a7501f91)
2022-07-22libstdc++: check for openatAlexandre Oliva
rtems6.0 has fdopendir, and fcntl.h defines AT_FDCWD and declares openat, but there's no openat in libc. Adjust dir-common.h to not assume ::openat just because of AT_FDCWD. for libstdc++-v3/ChangeLog * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for openat. * configure, config.h.in: Rebuilt. * src/filesystem/dir-common.h (openat): Use ::openat if _GLIBCXX_HAVE_OPENAT. * src/filesystem/dir.cc (dir_and_pathname): Use dirfd if _GLIBCXX_HAVE_OPENAT. (cherry picked from commit 93070671eae44f24ba822383e17571a39257c637)
2022-07-22libstdc++: Do not include <cxxabi.h> in <stacktrace>Jonathan Wakely
This avoids polluting the global namespace with the "abi" namespace alias. libstdc++-v3/ChangeLog: * include/std/stacktrace: Do not include <cxxabi.h>. (__cxa_demangle): Declare. (cherry picked from commit e112e37f2920bcc9185e53b754d9145aac912c72)
2022-07-22Daily bump.linaro-local/ci/tcwg_bmk_llvm_apm/llvm-release-aarch64-spec2k6-OsGCC Administrator
2022-07-21c++: defaulted friend op== [PR106361]Jason Merrill
Now non-member functions can be defaulted, so this assert is wrong. move_signature_fn_p already checks for ctor or op=. PR c++/106361 gcc/cp/ChangeLog: * decl.cc (move_fn_p): Remove assert. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/spaceship-eq14.C: New test.
2022-07-21c++: non-dependent call to consteval operator [PR105912]Patrick Palka
Here we're crashing when substituting a non-dependent call to a consteval operator, whose CALL_EXPR_OPERATOR_SYNTAX flag we try to propagate to the result, but the result isn't a CALL_EXPR since the selected function is consteval. This patch fixes this by checking the result of extract_call_expr accordingly. (Note that we can't check DECL_IMMEDIATE_FUNCTION_P here because we don't know which function was selected by overload resolution from here.) PR c++/105912 gcc/cp/ChangeLog: * call.cc (extract_call_expr): Return a NULL_TREE on failure instead of asserting. * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Guard against NULL_TREE extract_call_expr result. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/consteval31.C: New test. (cherry picked from commit f70c18524221dcefa6cd26cee7b55503181bd912)
2022-07-21c++: dependence of constrained memfn from current inst [PR105842]Patrick Palka
Here we incorrectly deem the calls to func1, func2 and tmpl2 as ambiguous ahead of time ultimately because we mishandle dependence of a constrained member function from the current instantiation. In type_dependent_expression_p, we already consider dependence of a TEMPLATE_DECL's constraints (via uses_outer_template_parms), but neglect to do the same for a FUNCTION_DECL (such as that for func1). And in satisfy_declaration_constraints, we give up if _any_ template argument is dependent, but for non-dependent member functions from the current instantiation (such as func2 and tmpl2), we can and must check constraints as long as the innermost arguments aren't dependent. PR c++/105842 gcc/cp/ChangeLog: * constraint.cc (satisfy_declaration_constraints): Refine early exit test for argument dependence. * cp-tree.h (uses_outer_template_parms_in_constraints): Declare. * pt.cc (template_class_depth): Handle TI_TEMPLATE being a FIELD_DECL. (usse_outer_template_parms): Factor out constraint dependence test into ... (uses_outer_template_parms_in_constraints): ... here. (type_dependent_expression_p): Use it for FUNCTION_DECL. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-memtmpl6.C: New test. (cherry picked from commit f07778f6f92111aa0abfd0f669b148a0bda537a9)
2022-07-21c++: function NTTP argument considered unused [PR53164, PR105848]Patrick Palka
Here at parse time the template argument f (an OVERLOAD) in A<f> gets resolved ahead of time to the FUNCTION_DECL f<int>, and we defer marking f<int> as used until instantiation (of g) as usual. Later when instantiating g the type A<f> (where f has already been resolved) is non-dependent, so tsubst_aggr_type avoids re-processing its template arguments, and we end up never actually marking f<int> as used (which means we never instantiate it) even though A<f>::h() later calls it, leading to a link error. This patch works around this issue by looking through ADDR_EXPR when calling mark_used on the substituted callee of a CALL_EXPR. PR c++/53164 PR c++/105848 gcc/cp/ChangeLog: * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Look through an ADDR_EXPR callee when calling mark_used. gcc/testsuite/ChangeLog: * g++.dg/template/fn-ptr3.C: New test. (cherry picked from commit 733a792a2b2e1662e738fa358b45a2720a8618a7)
2022-07-21c++: cv-quals of dummy obj for non-dep memfn call [PR105637]Patrick Palka
In non-dependent23.C below we expect the Base::foo calls to resolve to the second, third and fourth overloads respectively in light of the cv-qualifiers of 'this' in each case. But ever since r12-6075-g2decd2cabe5a4f, the calls incorrectly resolve to the first overload at instantiation time. This happens because the calls to Base::foo are all deemed non-dependent (ever since r7-755-g23cb72663051cd made us ignore 'this' dependence when considering the dependence of a non-static memfn call), hence we end up checking the call ahead of time, using as the object argument a dummy object of type Base. Since this object argument is cv-unqualified, the calls in turn resolve to the unqualified overload of baseDevice. Before r12-6075 this incorrect result would just get silently discarded and we'd end up redoing OR at instantiation time using 'this' as the object argument. But after r12-6075 we now reuse this incorrect result at instantiation time. This patch fixes this by making maybe_dummy_object respect the cv-quals of (the non-lambda) 'this' when returning a dummy object. Thus, ahead of time OR using a dummy object will give us the right answer that's consistent with the instantiation time answer. An earlier version of this patch didn't handle 'this'-capturing lambdas correctly, which broke lambda-this22.C below. PR c++/105637 gcc/cp/ChangeLog: * tree.cc (maybe_dummy_object): When returning a dummy object, respect the cv-quals of 'this' if available. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/lambda/lambda-this22.C: New test. * g++.dg/template/non-dependent23.C: New test. (cherry picked from commit 44a5bd6d933d86ed988fc4695aa00f122cf83eb4)
2022-07-21c++: don't substitute TEMPLATE_PARM_CONSTRAINTS [PR100374]Patrick Palka
This patch makes us avoid substituting into the TEMPLATE_PARM_CONSTRAINTS of each template parameter except as necessary for declaration matching, like we already do for the other constituent constraints of a declaration. This patch also improves the CA104 implementation of explicit specialization matching of a constrained function template inside a class template, by considering the function's combined constraints instead of just its trailing constraints. This allows us to correctly handle the first three explicit specializations in concepts-spec2.C below, but because we compare the constraints as a whole, it means we incorrectly accept the fourth explicit specialization which writes #3's constraints in a different way. For complete correctness here, determine_specialization should use tsubst_each_template_parm_constraints and template_parameter_heads_equivalent_p. PR c++/100374 gcc/cp/ChangeLog: * pt.cc (determine_specialization): Compare overall constraints not just the trailing constraints. (tsubst_each_template_parm_constraints): Define. (tsubst_friend_function): Use it. (tsubst_friend_class): Use it. (tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-spec2.C: New test. * g++.dg/cpp2a/concepts-template-parm11.C: New test. (cherry picked from commit 43c013df02fdb07f9b7a5e7e6669e6d69769d451)
2022-07-21c++: non-dep call with empty TYPE_BINFO [PR105758]Patrick Palka
Here the out-of-line definition of Z<T>::z causes duplicate_decls to change z's type from using the primary template type Z<T> (which is also the type of the injected class name) to the implicit instantiation Z<T>, and this latter type lacks a TYPE_BINFO (although its TYPE_CANONICAL was set by a special case in lookup_template_class to point to the former). Later, when processing the non-dependent call z->foo(0), build_over_call relies on the object argument's TYPE_BINFO to build the templated form for this call, which fails because the object argument type has empty TYPE_BINFO due to the above. It seems weird that the implicit instantiation Z<T> doesn't have the same TYPE_BINFO as the primary template type Z<T>, despite them being proclaimed equivalent via TYPE_CANONICAL. So I tried also setting TYPE_BINFO in the special case in lookup_template_class, but that led to some problems with constrained partial specializations of the form Z<T>. I'm not sure what, if anything, we ought to do about the subtle differences between these two versions of the same type. Fortunately it seems we don't need to rely on TYPE_BINFO at all in build_over_call here -- the z_candidate struct already contains the exact binfos we need to rebuild the BASELINK for the templated form. PR c++/105758 gcc/cp/ChangeLog: * call.cc (build_over_call): Use z_candidate::conversion_path and ::access_path instead of TYPE_BINFO when building the BASELINK for the templated form. gcc/testsuite/ChangeLog: * g++.dg/template/non-dependent24.C: New test. (cherry picked from commit 4f84f12066953186cce4328b7f178d3daa2fe96e)
2022-07-21c++: constrained partial spec forward decl [PR96363]Patrick Palka
Here during cp_parser_single_declaration for #2, we were calling associate_classtype_constraints for TPL<T> (the primary template type) before maybe_process_partial_specialization could get a chance to notice that we're in fact declaring a distinct constrained partial spec and not redeclaring the primary template. This caused us to emit a bogus error about differing constraints b/t the primary template and #2's constraints. This patch fixes this by moving the call to associate_classtype_constraints after the call to shadow_tag (which calls maybe_process_partial_specialization) and adjusting shadow_tag to use the return value of m_p_p_s. Moreover, if we later try to define a constrained partial specialization that's been declared earlier (as in the third testcase), then maybe_new_partial_specialization correctly notices it's a redeclaration and returns NULL_TREE. But in this case we also need to update TYPE to point to the redeclared partial spec (it'll otherwise continue pointing to the primary template type, eventually leading to a bogus error). PR c++/96363 gcc/cp/ChangeLog: * decl.cc (shadow_tag): Use the return value of maybe_process_partial_specialization. * parser.cc (cp_parser_single_declaration): Call shadow_tag before associate_classtype_constraints. * pt.cc (maybe_new_partial_specialization): Change return type to bool. Take 'type' argument by mutable reference. Set 'type' to point to the correct constrained specialization when appropriate. (maybe_process_partial_specialization): Adjust accordingly. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-partial-spec12.C: New test. * g++.dg/cpp2a/concepts-partial-spec12a.C: New test. * g++.dg/cpp2a/concepts-partial-spec13.C: New test. (cherry picked from commit 97dc78d705a90c1ae83c78a7f2e24942cc3a6257)
2022-07-21libgo: don't include <linux/fs.h> when building gen-sysinfo.goIan Lance Taylor
Removing this doesn't change anything at least with glibc 2.33. The include was added in https://go.dev/cl/6100049 but it's not clear why. Fixes PR go/106266 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294 (cherry picked from commit f35d65517a59565758107c5b1a51a5fa382f8d1a)
2022-07-21libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstreamMartin Liska
9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36 (cherry picked from commit 2701442d0cf6292f6624443c15813d6d1a3562fe)
2022-07-21libstdc++: Fix std::common_iterator assignment [PR100823]Jonathan Wakely
This fixes the following conformance problems reported in the PR: - Move constructor and move assignment should be defined. - Copy assignment from a valueless object should be allowed. Assignment is completely rewritten by this patch, as the previous version had a number of problems. The converting assignment failed to handle the case of assigning a new value to a valueless object, which should work. It only accepted lvalue arguments, so wasn't usable to implement the move assignment operator. Finally, it enforced the precondition that the argument is not valueless, which is correct for the converting assignment but not for the copy assignment. A new _M_assign member is added to handle all cases of assignment (copying from an lvalue, moving from an rvalue, and converting from a different type). The not valueless precondition is checked in the converting assignment before calling _M_assign, so isn't enforced for copy and move assignment. The new function no longer uses a switch, so handles valueless objects as the LHS or RHS of the assignment. libstdc++-v3/ChangeLog: PR libstdc++/100823 * include/bits/stl_iterator.h (common_iterator): Define move constructor and move assignment operator. (common_iterator::_M_assign): New function implementing assignment. (common_iterator::operator=): Use _M_assign. (common_iterator::_S_valueless): New constant. * testsuite/24_iterators/common_iterator/100823.cc: New test. (cherry picked from commit 56c999860bbbb2fd5091ba0985e2e5eaa90c6478)
2022-07-21libstdc++: Fix minor bugs in std::common_iteratorJonathan Wakely
The noexcept-specifier for some std::common_iterator constructors was incorrectly using an rvalue as the first argument of std::is_nothrow_assignable_v. This gave the wrong answer for some types, e.g. std::common_iterator<int*, S>, because an rvalue of scalar type cannot be assigned to. Also fix the friend declaration to use the same constraints as on the definition of the class template. G++ fails to diagnose this error, due to PR c++/96830. Finally, the copy constructor was using std::move for its argument in some cases, which should be removed. libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h (common_iterator): Fix incorrect uses of is_nothrow_assignable_v. Fix inconsistent constraints on friend declaration. Do not move argument in copy constructor. * testsuite/24_iterators/common_iterator/1.cc: Check for noexcept constructibnle/assignable. (cherry picked from commit 3b5567c3ec7e5759bdecc6a6fc0be2b65a93636e)
2022-07-21libstdc++: Make headers include their prerequisitesNathan Sidwell
These headers were relying on their includers having already included some prerequisites. That makes them unsuitable to be header-units. So directly include the needed headers. Reviewed-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: * include/bits/hashtable.h: Include required headers. * include/bits/hashtable_policy.h: Likewise. * include/bits/stl_heap.h: Likewise. * include/bits/stl_iterator_base_funcs.h: Likewise. (cherry picked from commit a44380541fee1c7ab14cc90a9af8d1aef3c72866)
2022-07-21libstdc++: Fix comment typosJonathan Wakely
libstdc++-v3/ChangeLog: * include/bits/utility.h: Fix comment typos. (cherry picked from commit c1fe8ddf6847a14152668064f163a2585e9dc894)
2022-07-21libstdc++: testsuite: Guard use of C99 std::log2Jonathan Wakely
This prevents the test from failing if the only thing not supported is the text printed to the log about the size of the floating-point type. libstdc++-v3/ChangeLog: * testsuite/20_util/from_chars/4.cc: Only use log2 if C99 math functions are available. (cherry picked from commit 30aea28bd30027e0a6be8e3077828256779954b3)
2022-07-21libstdc++: Simplify test by not using std::log2Jonathan Wakely
This test uses std::log2 without including <cmath>, but it doesn't need to use it at all. Just get the number of digits from numeric_limits instead. libstdc++-v3/ChangeLog: * testsuite/26_numerics/random/random_device/entropy.cc: Use numeric_limits<unsigned>::digits. (cherry picked from commit 78fd15fd4a641cfac28ce60bf43a3e1ca309537b)
2022-07-21libstdc++: Make __from_chars_alnum_to_val conversion explicitMarco Falke
The optimizations from commit r12-8175-ga54137c88061c7 introduced a clang integer sanitizer error. Fix this with an explicit static_cast, similar to the fix for PR 96766. libstdc++-v3/ChangeLog: * include/std/charconv (__from_chars_alnum_to_val): Replace implicit conversion from int to unsigned char with explicit cast. (cherry picked from commit 20ab3972240aff596a3fa98e9fb09ddc0658fbb3)
2022-07-21libstdc++: Fix experimental::filesystem::status on Windows [PR88881]Jonathan Wakely
Although the Filesystem TS isn't properly supported on Windows (unlike the C++17 Filesystem lib), most tests do pass. Two of the failures are due to PR 88881 which was only fixed for std::filesystem not the TS. This applies the fix to the TS implementation too. libstdc++-v3/ChangeLog: PR libstdc++/88881 * src/filesystem/ops.cc (has_trailing_slash): New helper function. (fs::status): Strip trailing slashes. (fs::symlink_status): Likewise. * testsuite/experimental/filesystem/operations/temp_directory_path.cc: Clean the environment before each test and use TMP instead of TMPDIR so the test passes on Windows. (cherry picked from commit 6c96b14a19a9e6c365eacc59868a866b99f9786d)
2022-07-21libstdc++: Fix lifetime bugs for non-TLS eh_globals [PR105880]Jonathan Wakely
This ensures that the single-threaded fallback buffer eh_globals is not destroyed during program termination, using the same immortalization technique used for error category objects. Also ensure that init._M_init can still be read after init has been destroyed, by making it a static data member. libstdc++-v3/ChangeLog: PR libstdc++/105880 * libsupc++/eh_globals.cc (eh_globals): Ensure constant init and prevent destruction during termination. (__eh_globals_init::_M_init): Replace with static member _S_init. (__cxxabiv1::__cxa_get_globals_fast): Update. (__cxxabiv1::__cxa_get_globals): Likewise. (cherry picked from commit 1e65f2ed99024f23c56f7b6a961898bcaa882a92)
2022-07-21Daily bump.GCC Administrator
2022-07-20Fortran: fix parsing of omp task affinity iterator clause [PR101330]Harald Anlauf
gcc/fortran/ChangeLog: PR fortran/101330 * openmp.cc (gfc_match_iterator): Remove left-over code from development that could lead to a crash on invalid input. gcc/testsuite/ChangeLog: PR fortran/101330 * gfortran.dg/gomp/affinity-clause-7.f90: New test. (cherry picked from commit 26bbe78f77f73bb66af1ac13d0deec888a3c6510)
2022-07-20Daily bump.GCC Administrator
2022-07-19c++: fix SIGFPE with -Wclass-memaccess [PR105634]Marek Polacek
Here we crash because we attempt to % by 0. Thus fixed. PR c++/105634 gcc/cp/ChangeLog: * call.cc (maybe_warn_class_memaccess): Avoid % by zero. gcc/testsuite/ChangeLog: * g++.dg/warn/Wclass-memaccess-7.C: New test.
2022-07-19middle-end/106331 - fix mem attributes for string op argumentsRichard Biener
get_memory_rtx tries hard to come up with a MEM_EXPR to record in the memory attributes but in the last fallback fails to properly account for an unknown offset and thus, as visible in this testcase, incorrect alignment computed from set_mem_attributes. The following rectifies both parts. PR middle-end/106331 * builtins.cc (get_memory_rtx): Compute alignment from the original address and set MEM_OFFSET to unknown when we create a MEM_EXPR from the base object of the address. * gfortran.dg/pr106331.f90: New testcase. (cherry picked from commit e4ff11a8f2e80adb8ada69bf35ee6a1ab18a9c85)
2022-07-19tree-optimization/106131 - wrong code with FRE rewritingRichard Biener
The following makes sure to not use the original TBAA type for looking up a value across an aggregate copy when we had to offset the read. 2022-06-30 Richard Biener <rguenther@suse.de> PR tree-optimization/106131 * tree-ssa-sccvn.cc (vn_reference_lookup_3): Force alias-set zero when offsetting the read looking through an aggregate copy. * g++.dg/torture/pr106131.C: New testcase. (cherry picked from commit 9701432ff79926a5dd3303be3417e0bd0c24140b)
2022-07-19tree-optimization/106112 - fix CSE from wider operationRichard Biener
The following fixes a mistake in looking up an extended operand in the CSE of a truncated operation. 2022-06-28 Richard Biener <rguenther@suse.de> PR tree-optimization/106112 * tree-ssa-sccvn.cc (valueized_wider_op): Properly extend a constant operand according to its type. * gcc.dg/torture/pr106112.c: New testcase. (cherry picked from commit 2dbb45d6dc0d20dc159b3d8e27ebb6825074827a)
2022-07-19middle-end/106027 - fix types in needle foldingRichard Biener
The fold_to_nonsharp_ineq_using_bound folding ends up creating invalid typed IL which confuses later foldings. The following fixes that. 2022-06-20 Richard Biener <rguenther@suse.de> PR middle-end/106027 * fold-const.cc (fold_to_nonsharp_ineq_using_bound): Use the type of the prevailing comparison for the new comparison type. (fold_binary_loc): Use proper types for the A < X && A + 1 > Y to A < X && A >= Y folding. * gcc.dg/pr106027.c: New testcase. (cherry picked from commit 713f2fd923442b1be620a44240ddf786ae0ab476)
2022-07-19tree-optimization/105971 - less surprising refs_may_alias_p_2Richard Biener
When DSE asks whether __real a is using __imag a it gets a surprising result when a is a FUNCTION_DECL. The following makes sure this case is less surprising to callers but keeping the bail-out for the non-decl case where it is true that PTA doesn't track aliases to code correctly. 2022-06-15 Richard Biener <rguenther@suse.de> PR tree-optimization/105971 * tree-ssa-alias.cc (refs_may_alias_p_2): Put bail-out for FUNCTION_DECL and LABEL_DECL refs after decl-decl disambiguation to leak less surprising alias results. * gcc.dg/torture/pr106971.c: New testcase. (cherry picked from commit 8c2733e16ec1c0cdda3db4cdc5ad158a96a658e8)
2022-07-19tree-optimization/105969 - FPE with array diagnosticsRichard Biener
For a [0][0] array we have to be careful when dividing by the element size which is zero for the outermost dimension. Luckily the division is only for an overflow check which is pointless for array size zero. 2022-06-15 Richard Biener <rguenther@suse.de> PR tree-optimization/105969 * gimple-ssa-sprintf.cc (get_origin_and_offset_r): Avoid division by zero in overflow check. * gcc.dg/pr105969.c: New testcase. (cherry picked from commit edb9330c29fe8a0a0b76df6fafd6a223a4d0e41f)
2022-07-19middle-end/105965 - add missing v_c_e <{ el }> simplificationRichard Biener
When we got the simplification of bit-field-ref to view-convert we lost the ability to detect FMAs since we cannot look through _1 = {_10}; _11 = VIEW_CONVERT_EXPR<float>(_1); the following amends the (view_convert CONSTRUCTOR) pattern to handle this case. 2022-06-14 Richard Biener <rguenther@suse.de> PR middle-end/105965 * match.pd (view_convert CONSTRUCTOR): Handle single-element CTOR case. * gcc.target/i386/pr105965.c: New testcase. (cherry picked from commit 90467f0ad649d0817f9e034596a0fb85605b55af)
2022-07-19tree-optimization/105946 - avoid accessing excess args from uninit diagRichard Biener
uninit diagnostics uses passing via reference and access attributes but that iterates over function type arguments which can in some cases appearantly outrun the actual arguments leading to ICEs. The following simply ignores not present arguments. 2022-06-14 Richard Biener <rguenther@suse.de> PR tree-optimization/105946 * tree-ssa-uninit.cc (maybe_warn_pass_by_reference): Do not look at arguments not specified in the function call. (cherry picked from commit e07a876c07601e1f3a27420f7d055d20193c362c)
2022-07-19target/105459 - allow delayed target option node fixupRichard Biener
The following avoids the need to massage the target optimization node at WPA time when we fixup the optimization node, copying FP related flags from callee to caller. The target is already set up to fixup, but that only works when not switching between functions. After fixing that the fixup is then done at LTRANS time when materializing the function. 2022-07-01 Richard Biener <rguenthert@suse.de> PR target/105459 * config/i386/i386-options.cc (ix86_set_current_function): Rebuild the target optimization node whenever necessary, not only when the optimization node didn't change. * gcc.dg/lto/pr105459_0.c: New testcase. (cherry picked from commit 4c94382a132a4b2b9d020806549a006fa6764d1b)
2022-07-19Daily bump.GCC Administrator
2022-07-18Daily bump.GCC Administrator
2022-07-17Daily bump.GCC Administrator