From f0530882d99abc410bb080051aa04e5cea848f18 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 22 Mar 2022 18:42:27 -0400 Subject: [PATCH 001/157] c++: FIX_TRUNC_EXPR in tsubst [PR102990] This is a crash where a FIX_TRUNC_EXPR gets into tsubst_copy_and_build where it hits gcc_unreachable (). The history of tsubst_copy_and_build/FIX_TRUNC_EXPR is such that it was introduced in r181478, but it did the wrong thing, whereupon it was turned into gcc_unreachable () in r258821 (see this thread: ). In a template, we should never create a FIX_TRUNC_EXPR (that's what conv_unsafe_in_template_p is for). But in this test we are NOT in a template when we call digest_nsdmi_init which ends up calling convert_like, converting 1.0e+0 to int, so convert_to_integer_1 gives us a FIX_TRUNC_EXPR. But then when we get to parsing f's parameters, we are in a template when processing decltype(Helpers{}), and since r268321, when the compound literal isn't instantiation-dependent and the type isn't type-dependent, finish_compound_literal falls back to the normal processing, so it calls digest_init, which does fold_non_dependent_init and since the FIX_TRUNC_EXPR isn't dependent, we instantiate and therefore crash in tsubst_copy_and_build. The fateful call to fold_non_dependent_init comes from massage_init_elt, We shouldn't be calling f_n_d_i on the result of get_nsdmi. This we can avoid by eschewing calling f_n_d_i on CONSTRUCTORs; their elements have already been folded. PR c++/102990 gcc/cp/ChangeLog: * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/nsdmi-template22.C: New test. * g++.dg/cpp0x/nsdmi-template23.C: New test. --- gcc/cp/typeck2.cc | 13 +++++++++---- gcc/testsuite/g++.dg/cpp0x/nsdmi-template22.C | 13 +++++++++++++ gcc/testsuite/g++.dg/cpp0x/nsdmi-template23.C | 13 +++++++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/nsdmi-template22.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/nsdmi-template23.C diff --git a/gcc/cp/typeck2.cc b/gcc/cp/typeck2.cc index a4c825fc34d..cebe6acf487 100644 --- a/gcc/cp/typeck2.cc +++ b/gcc/cp/typeck2.cc @@ -1433,10 +1433,15 @@ massage_init_elt (tree type, tree init, int nested, int flags, new_flags |= LOOKUP_AGGREGATE_PAREN_INIT; init = digest_init_r (type, init, nested ? 2 : 1, new_flags, complain); /* When we defer constant folding within a statement, we may want to - defer this folding as well. */ - tree t = fold_non_dependent_init (init, complain); - if (TREE_CONSTANT (t)) - init = t; + defer this folding as well. Don't call this on CONSTRUCTORs because + their elements have already been folded, and we must avoid folding + the result of get_nsdmi. */ + if (TREE_CODE (init) != CONSTRUCTOR) + { + tree t = fold_non_dependent_init (init, complain); + if (TREE_CONSTANT (t)) + init = t; + } return init; } diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-template22.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template22.C new file mode 100644 index 00000000000..4ed2501035c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template22.C @@ -0,0 +1,13 @@ +// PR c++/102990 +// { dg-do compile { target c++11 } } + +struct knob_t { + /* Let's create a FIX_TRUNC_EXPR. */ + int value = 1.0; +}; + +struct Helpers { + knob_t inputs; +}; + +template void f(decltype(Helpers{})); diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-template23.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template23.C new file mode 100644 index 00000000000..240cab4347a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template23.C @@ -0,0 +1,13 @@ +// PR c++/102990 +// { dg-do compile { target c++11 } } + +struct knob_t { + /* Let's create a FLOAT_EXPR. */ + double value = 1UL; +}; + +struct Helpers { + knob_t inputs; +}; + +template void f(decltype(Helpers{})); From 346ab5a54a831ad9c78afcbd8dfe98e0e07e3070 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 22 Mar 2022 01:10:44 -0400 Subject: [PATCH 002/157] c++: delayed parse DMI [PR96645] With the changes for PR81359 and PR88368 to make get_nsdmi errors be treated as substitution failure, we have the problem that if we check std::is_default_constructible for a complete class that still has unparsed default member initializers, we get an answer (false) that will be wrong once the DMIs have been parsed. The traits avoid this problem for regular incomplete classes by giving an error if the operand is incomplete; we should do the same if get_nsdmi is going to fail due to unparsed DMI. PR c++/96645 gcc/cp/ChangeLog: * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare. * class.cc (type_has_default_ctor_to_be_synthesized): New. (type_has_non_user_provided_default_constructor_1): Support it. (type_has_non_user_provided_default_constructor): Now a wrapper. * method.cc (complain_about_unparsed_dmi): New. (constructible_expr): Call it. gcc/testsuite/ChangeLog: * g++.dg/ext/is_constructible3.C: Expect error. * g++.dg/ext/is_constructible7.C: New test. --- gcc/cp/class.cc | 25 ++++++++++++++--- gcc/cp/cp-tree.h | 1 + gcc/cp/method.cc | 24 +++++++++++++++++ gcc/testsuite/g++.dg/ext/is_constructible3.C | 2 +- gcc/testsuite/g++.dg/ext/is_constructible7.C | 28 ++++++++++++++++++++ 5 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/g++.dg/ext/is_constructible7.C diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc index 40e17140db5..c75b889cb84 100644 --- a/gcc/cp/class.cc +++ b/gcc/cp/class.cc @@ -5415,10 +5415,11 @@ type_has_user_provided_or_explicit_constructor (tree t) /* Returns true iff class T has a non-user-provided (i.e. implicitly declared or explicitly defaulted in the class body) default - constructor. */ + constructor. If SYNTH, only return true if it hasn't been + implicitly defined yet. */ -bool -type_has_non_user_provided_default_constructor (tree t) +static bool +type_has_non_user_provided_default_constructor_1 (tree t, bool synth) { if (!TYPE_HAS_DEFAULT_CONSTRUCTOR (t)) return false; @@ -5431,12 +5432,28 @@ type_has_non_user_provided_default_constructor (tree t) if (TREE_CODE (fn) == FUNCTION_DECL && default_ctor_p (fn) && !user_provided_p (fn)) - return true; + { + if (synth) + return !DECL_INITIAL (fn); + return true; + } } return false; } +bool +type_has_non_user_provided_default_constructor (tree t) +{ + return type_has_non_user_provided_default_constructor_1 (t, false); +} + +bool +type_has_default_ctor_to_be_synthesized (tree t) +{ + return type_has_non_user_provided_default_constructor_1 (t, true); +} + /* TYPE is being used as a virtual base, and has a non-trivial move assignment. Return true if this is due to there being a user-provided move assignment in TYPE or one of its subobjects; if there isn't, then diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 2f718852ac1..02734a42f1b 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -6720,6 +6720,7 @@ extern tree in_class_defaulted_default_constructor (tree); extern bool user_provided_p (tree); extern bool type_has_user_provided_constructor (tree); extern bool type_has_non_user_provided_default_constructor (tree); +extern bool type_has_default_ctor_to_be_synthesized (tree); extern bool vbase_has_user_provided_move_assign (tree); extern tree default_init_uninitialized_part (tree); extern bool trivial_default_constructor_is_constexpr (tree); diff --git a/gcc/cp/method.cc b/gcc/cp/method.cc index 903ee666ef3..e0fe2177730 100644 --- a/gcc/cp/method.cc +++ b/gcc/cp/method.cc @@ -2056,6 +2056,28 @@ assignable_expr (tree to, tree from) return r; } +/* An unparsed default member initializer prevents calling a defaulted default + constructor; make checking std::is_constructible ill-formed until the DMI + has been parsed, to avoid caching the wrong value. */ + +static bool +complain_about_unparsed_dmi (tree t) +{ + if (type_has_default_ctor_to_be_synthesized (t) + && TYPE_HAS_COMPLEX_DFLT (t)) + for (tree f = TYPE_FIELDS (t); f; f = DECL_CHAIN (f)) + if (TREE_CODE (f) == FIELD_DECL + && DECL_INITIAL (f) + && TREE_CODE (DECL_INITIAL (f)) == DEFERRED_PARSE) + { + error ("default member initializer for %qD required by %qs before " + "the end of its enclosing class", f, "std::is_constructible"); + inform (location_of (f), "defined here"); + return true; + } + return false; +} + /* The predicate condition for a template specialization is_constructible shall be satisfied if and only if the following variable definition would be well-formed for some invented @@ -2070,6 +2092,8 @@ constructible_expr (tree to, tree from) cp_unevaluated cp_uneval_guard; if (CLASS_TYPE_P (to)) { + if (!from && complain_about_unparsed_dmi (to)) + return error_mark_node; tree ctype = to; vec *args = NULL; if (!TYPE_REF_P (to)) diff --git a/gcc/testsuite/g++.dg/ext/is_constructible3.C b/gcc/testsuite/g++.dg/ext/is_constructible3.C index c7c58746cd0..305751d28e2 100644 --- a/gcc/testsuite/g++.dg/ext/is_constructible3.C +++ b/gcc/testsuite/g++.dg/ext/is_constructible3.C @@ -8,7 +8,7 @@ struct A { B() = default; }; - static constexpr bool v = __is_constructible (B); + static constexpr bool v = __is_constructible (B); // { dg-error "member initializer" } }; diff --git a/gcc/testsuite/g++.dg/ext/is_constructible7.C b/gcc/testsuite/g++.dg/ext/is_constructible7.C new file mode 100644 index 00000000000..76a63bba5d0 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/is_constructible7.C @@ -0,0 +1,28 @@ +// PR c++/96645 +// { dg-do compile { target c++11 } } + +template +struct bool_constant +{ + static constexpr bool value = B; + using type = bool_constant; +}; + +using true_type = bool_constant; + +template +struct is_default_constructible + : bool_constant<__is_constructible(T)> // { dg-error "default member init" } +{ }; + +void testVarStruct() +{ + struct DataWithStruct { + struct A { + int number = 5; // compiles, if remove initialization + }; + + // { dg-prune-output "could not convert" } + is_default_constructible::type t = true_type{}; + }; +} From 9fdac7e16c940fb6264e6ddaf99c761f1a64a054 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Thu, 17 Mar 2022 14:39:37 -0400 Subject: [PATCH 003/157] c++: ICE with template code in constexpr [PR104284] Since r9-6073 cxx_eval_store_expression preevaluates the value to be stored, and that revealed a crash where a template code (here, code=IMPLICIT_CONV_EXPR) leaks into cxx_eval*. It happens because we're performing build_vec_init while processing a template, which calls get_temp_regvar which creates an INIT_EXPR. This INIT_EXPR's RHS contains an rvalue conversion so we create an IMPLICIT_CONV_EXPR. Its operand is not type-dependent and the whole INIT_EXPR is not type-dependent. So we call build_non_dependent_expr which, with -fchecking=2, calls fold_non_dependent_expr. At this point the expression still has an IMPLICIT_CONV_EXPR, which ought to be handled in instantiate_non_dependent_expr_internal. However, tsubst_copy_and_build doesn't handle INIT_EXPR; it will just call tsubst_copy which does nothing when args is null. So we fail to replace the IMPLICIT_CONV_EXPR and ICE. The problem is that we call build_vec_init in a template in the first place. We can avoid doing so by checking p_t_d before calling build_aggr_init in check_initializer. PR c++/104284 gcc/cp/ChangeLog: * decl.cc (check_initializer): Don't call build_aggr_init in a template. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/constexpr-104284-1.C: New test. * g++.dg/cpp1y/constexpr-104284-2.C: New test. * g++.dg/cpp1y/constexpr-104284-3.C: New test. * g++.dg/cpp1y/constexpr-104284-4.C: New test. --- gcc/cp/decl.cc | 4 +++ .../g++.dg/cpp1y/constexpr-104284-1.C | 34 ++++++++++++++++++ .../g++.dg/cpp1y/constexpr-104284-2.C | 33 +++++++++++++++++ .../g++.dg/cpp1y/constexpr-104284-3.C | 33 +++++++++++++++++ .../g++.dg/cpp1y/constexpr-104284-4.C | 35 +++++++++++++++++++ 5 files changed, 139 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/constexpr-104284-1.C create mode 100644 gcc/testsuite/g++.dg/cpp1y/constexpr-104284-2.C create mode 100644 gcc/testsuite/g++.dg/cpp1y/constexpr-104284-3.C create mode 100644 gcc/testsuite/g++.dg/cpp1y/constexpr-104284-4.C diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 68741bbf5d2..69f60a6dc0f 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -7332,6 +7332,10 @@ check_initializer (tree decl, tree init, int flags, vec **cleanups) && !(init && BRACE_ENCLOSED_INITIALIZER_P (init) && CP_AGGREGATE_TYPE_P (type) && (CLASS_TYPE_P (type) + /* The call to build_aggr_init below could end up + calling build_vec_init, which may break when we + are processing a template. */ + || processing_template_decl || !TYPE_NEEDS_CONSTRUCTING (type) || type_has_extended_temps (type)))) || (DECL_DECOMPOSITION_P (decl) && TREE_CODE (type) == ARRAY_TYPE)) diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-104284-1.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-104284-1.C new file mode 100644 index 00000000000..809c26a6161 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-104284-1.C @@ -0,0 +1,34 @@ +// PR c++/104284 +// { dg-do compile { target c++14 } } +// { dg-additional-options "-fchecking=2" } + +struct S { + char c{}; +}; + +auto x1 = [](auto) { constexpr S s[]{{}}; }; +auto x2 = [](auto) { constexpr S s[]{{'a'}}; }; +#if __cpp_designated_initializers >= 201707L +auto x3 = [](auto) { constexpr S s[]{{.c = 'a'}}; }; +#endif +auto x4 = [](auto) { constexpr S s[]{'a'}; }; +auto x5 = [](auto) { constexpr S s[]{{{}}}; }; + +template +constexpr void g () +{ + constexpr S s1[]{{}}; + static_assert(s1[0].c == '\0', ""); + constexpr S s2[]{{'a'}}; + static_assert(s2[0].c == 'a', ""); +#if __cpp_designated_initializers >= 201707L + constexpr S s3[]{{.c = 'a'}}; + static_assert(s3[0].c == 'a', ""); +#endif + constexpr S s4[]{'a'}; + static_assert(s4[0].c == 'a', ""); + constexpr S s5[]{{{}}}; + static_assert(s5[0].c == '\0', ""); +} + +static_assert ((g(), true), ""); diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-104284-2.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-104284-2.C new file mode 100644 index 00000000000..704d37de129 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-104284-2.C @@ -0,0 +1,33 @@ +// PR c++/104284 +// { dg-do compile { target c++14 } } +// { dg-additional-options "-fchecking=2" } + +struct S { + char a; + constexpr S() : a{'a'} { } + constexpr S(char a_) : a{a_} { } +}; + +auto x1 = [](auto) { constexpr S s[]{{}}; }; +auto x2 = [](auto) { constexpr S s[]{{'a'}}; }; +auto x3 = [](auto) { constexpr S s[]{'a'}; }; +auto x4 = [](auto) { constexpr S s[]{{{}}}; }; + +template +constexpr void g() +{ + constexpr S s1[]{{}}; + static_assert(s1[0].a == 'a', ""); + constexpr S s2[]{{'a'}}; + static_assert(s2[0].a == 'a', ""); + constexpr S s3[]{'a'}; + static_assert(s3[0].a == 'a', ""); + constexpr S s4[]{{{}}}; + static_assert(s4[0].a == '\0', ""); +} + +void +f () +{ + g(); +} diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-104284-3.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-104284-3.C new file mode 100644 index 00000000000..6f23b255f9c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-104284-3.C @@ -0,0 +1,33 @@ +// PR c++/104284 +// { dg-do compile { target c++14 } } +// { dg-additional-options "-fchecking=2" } +// Like constexpr-104284.C, but the function template is not +// constexpr. In that case, we were still calling build_vec_init +// in a template, just not crashing. + +struct S { + char c{}; +}; + +template +void g () +{ + constexpr S s1[]{{}}; + static_assert(s1[0].c == '\0', ""); + constexpr S s2[]{{'a'}}; + static_assert(s2[0].c == 'a', ""); +#if __cpp_designated_initializers >= 201707L + constexpr S s3[]{{.c = 'a'}}; + static_assert(s3[0].c == 'a', ""); +#endif + constexpr S s4[]{'a'}; + static_assert(s4[0].c == 'a', ""); + constexpr S s5[]{{{}}}; + static_assert(s5[0].c == '\0', ""); +} + +void +f () +{ + g(); +} diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-104284-4.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-104284-4.C new file mode 100644 index 00000000000..a99d3255a47 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-104284-4.C @@ -0,0 +1,35 @@ +// PR c++/104284 +// { dg-do run { target c++14 } } +// { dg-additional-options "-fchecking=2" } + +struct S { + char c{}; +}; + +template +constexpr void g () +{ + S s1[]{{}}; + if (s1[0].c != '\0') + __builtin_abort (); + S s2[]{{'a'}}; + if (s2[0].c != 'a') + __builtin_abort (); +#if __cpp_designated_initializers >= 201707L + S s3[]{{.c = 'a'}}; + if (s3[0].c != 'a') + __builtin_abort (); +#endif + S s4[]{'a'}; + if (s4[0].c != 'a') + __builtin_abort (); + S s5[]{{{}}}; + if (s5[0].c != '\0') + __builtin_abort (); +} + +int +main () +{ + g(); +} From 21079cb82bff1048596b935bbf6a86f49e78a2f3 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Thu, 24 Mar 2022 23:42:29 +0000 Subject: [PATCH 004/157] Change my MAINTAINERS information I have changed employers and need to withdraw as SLSR maintainer for now. Adding myself under a new email address under the DCO session. Thanks! 2021-03-24 Bill Schmidt * MAINTAINERS: Change my information. --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 54d55f01e99..ef7f26e8444 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -252,7 +252,6 @@ testsuite Rainer Orth testsuite Mike Stump register allocation Vladimir Makarov gdbhooks.py David Malcolm -SLSR Bill Schmidt jit David Malcolm gen* on machine desc Richard Sandiford static analyzer David Malcolm @@ -720,6 +719,7 @@ Gaius Mulley Siddhesh Poyarekar Navid Rahimi Trevor Saunders +Bill Schmidt Nathan Sidwell Edward Smith-Rowland Petter Tomner From 6fc4a993cebc960c9556d840dc7c109b1b08b295 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 25 Mar 2022 00:17:18 +0000 Subject: [PATCH 005/157] Daily bump. --- ChangeLog | 4 +++ gcc/ChangeLog | 49 +++++++++++++++++++++++++ gcc/DATESTAMP | 2 +- gcc/ada/ChangeLog | 6 ++++ gcc/cp/ChangeLog | 42 ++++++++++++++++++++++ gcc/testsuite/ChangeLog | 80 +++++++++++++++++++++++++++++++++++++++++ libatomic/ChangeLog | 5 +++ 7 files changed, 187 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index aee29354f01..a2260e97bc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2022-03-24 Bill Schmidt + + * MAINTAINERS: Change my information. + 2022-03-16 Chung-Ju Wu * MAINTAINERS: Add myself to DCO section. diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9640ffe4b03..bddb065e8bb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,52 @@ +2022-03-24 Alexandre Oliva + + PR debug/104564 + * gimple-harden-conditionals.cc (detach_value): Keep temps + anonymous. + +2022-03-24 Alexandre Oliva + + PR middle-end/104975 + * gimple-harden-conditionals.cc + (pass_harden_compares::execute): Force split in case of + multiple edges. + +2022-03-24 Jakub Jelinek + + PR c++/105035 + * fold-const.cc (operand_equal_p) : If either + field0 or field1 is not a FIELD_DECL, return false. + +2022-03-24 Richard Biener + + * tree-predcom.cc (chain::chain): Add CTOR. + (component::component): Likewise. + (pcom_worker::release_chain): Use delete. + (release_components): Likewise. + (pcom_worker::filter_suitable_components): Likewise. + (pcom_worker::split_data_refs_to_components): Use new. + (make_invariant_chain): Likewise. + (make_rooted_chain): Likewise. + (pcom_worker::combine_chains): Likewise. + * tree-vect-loop.cc (vect_create_epilog_for_reduction): + Make sure to release previously constructed scalar_results. + * tree-vect-stmts.cc (vectorizable_load): Use auto_vec + for vec_offsets. + * vr-values.cc (simplify_using_ranges::~simplify_using_ranges): + Release m_flag_set_edges. + +2022-03-24 Siddhesh Poyarekar + + PR tree-optimization/104970 + * tree-object-size.cc (parm_object_size): Restrict size + computation scenarios to explicit access attributes. + +2022-03-24 Kewen Lin + + PR target/104967 + * config/rs6000/rs6000-c.cc (find_instance): Skip instances with null + function types. + 2022-03-23 Richard Biener PR target/102125 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index a4374e63098..575162361cc 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20220324 +20220325 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index fac0026e732..932a666a38f 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2022-03-24 Pascal Obry + + PR ada/104767 + * libgnat/g-sercom__mingw.adb (Close): Reset port handle to -1. + * libgnat/g-sercom__linux.adb (Close): Likewise. + 2022-03-10 Richard Biener PR ada/104861 diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 215aad519db..6a1524b78ea 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,45 @@ +2022-03-24 Marek Polacek + + PR c++/104284 + * decl.cc (check_initializer): Don't call build_aggr_init in + a template. + +2022-03-24 Jason Merrill + + PR c++/96645 + * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare. + * class.cc (type_has_default_ctor_to_be_synthesized): New. + (type_has_non_user_provided_default_constructor_1): Support it. + (type_has_non_user_provided_default_constructor): Now a wrapper. + * method.cc (complain_about_unparsed_dmi): New. + (constructible_expr): Call it. + +2022-03-24 Marek Polacek + + PR c++/102990 + * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs. + +2022-03-24 Patrick Palka + + PR c++/104620 + * call.cc (build_over_call): Use cxx_constant_value_sfinae + instead of cxx_constant_value to evaluate a consteval call. + * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter + and pass it to cxx_eval_outermost_constant_expr. + * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter. + * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to + cxx_constant_value_sfinae. + +2022-03-24 Jakub Jelinek + + PR c++/104994 + * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing + through extern thread_local declarations. Change wording from + declaration to definition. + (potential_constant_expression_1): Don't diagnose extern thread_local + declarations. Change wording from declared to defined. + * decl.cc (start_decl): Likewise. + 2022-03-23 Jason Merrill PR c++/103337 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d41b8e9fc0d..e87cc860d4f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,83 @@ +2022-03-24 Marek Polacek + + PR c++/104284 + * g++.dg/cpp1y/constexpr-104284-1.C: New test. + * g++.dg/cpp1y/constexpr-104284-2.C: New test. + * g++.dg/cpp1y/constexpr-104284-3.C: New test. + * g++.dg/cpp1y/constexpr-104284-4.C: New test. + +2022-03-24 Jason Merrill + + PR c++/96645 + * g++.dg/ext/is_constructible3.C: Expect error. + * g++.dg/ext/is_constructible7.C: New test. + +2022-03-24 Marek Polacek + + PR c++/102990 + * g++.dg/cpp0x/nsdmi-template22.C: New test. + * g++.dg/cpp0x/nsdmi-template23.C: New test. + +2022-03-24 Patrick Palka + + PR c++/104620 + * g++.dg/cpp23/consteval-if2.C: XFAIL two dg-error tests where + the argument to the non-constant non-dependent consteval call is + wrapped by NON_DEPENDENT_EXPR. + * g++.dg/cpp2a/consteval30.C: New test. + +2022-03-24 Alexandre Oliva + + PR debug/104564 + * c-c++-common/torture/harden-comp.c: Adjust. + * c-c++-common/torture/harden-cond.c: Adjust. + +2022-03-24 Alexandre Oliva + + PR middle-end/104975 + * gcc.dg/pr104975.c: New. + +2022-03-24 Jakub Jelinek + + PR target/102024 + * gcc.dg/compat/pr102024_main.c: New test. + * gcc.dg/compat/pr102024_test.h: New test. + * gcc.dg/compat/pr102024_x.c: New test. + * gcc.dg/compat/pr102024_y.c: New test. + * g++.dg/compat/pr102024_main.C: New test. + * g++.dg/compat/pr102024_test.h: New test. + * g++.dg/compat/pr102024_x.C: New test. + * g++.dg/compat/pr102024_y.C: New test. + +2022-03-24 Jakub Jelinek + + PR c++/105035 + * g++.dg/warn/Wduplicated-cond2.C: New test. + +2022-03-24 Siddhesh Poyarekar + + PR tree-optimization/104970 + * gcc.dg/builtin-dynamic-object-size-0.c (test_parmsz_simple2, + test_parmsz_simple3, test_parmsz_extern, test_parmsz_internal, + test_parmsz_internal2, test_parmsz_internal3): New tests. + (main): Use them. + +2022-03-24 Jakub Jelinek + + PR c++/104994 + * g++.dg/diagnostic/constexpr1.C: Change expected diagnostic wording + from declared to defined. + * g++.dg/cpp23/constexpr-nonlit1.C: Likewise. + (garply): Change dg-error into dg-bogus. + * g++.dg/cpp23/constexpr-nonlit2.C: Change expected diagnostic wording + from declaration to definition. + * g++.dg/cpp23/constexpr-nonlit6.C: Change expected diagnostic wording + from declared to defined. + * g++.dg/cpp23/constexpr-nonlit7.C: New test. + * g++.dg/cpp2a/constexpr-try5.C: Change expected diagnostic wording + from declared to defined. + * g++.dg/cpp2a/consteval3.C: Likewise. + 2022-03-23 David Malcolm PR analyzer/104979 diff --git a/libatomic/ChangeLog b/libatomic/ChangeLog index 645257a3f0c..0038339d581 100644 --- a/libatomic/ChangeLog +++ b/libatomic/ChangeLog @@ -1,3 +1,8 @@ +2022-03-24 Tom de Vries + + PR target/105011 + * tas_n.c (libat_test_and_set): Fix return value. + 2022-03-17 Jakub Jelinek PR target/104688 From 319ba7e241e7e21f9eb481f075310796f13d2035 Mon Sep 17 00:00:00 2001 From: Avinash Sonawane Date: Tue, 22 Mar 2022 07:32:44 +0530 Subject: [PATCH 006/157] Docs: Document that taint analyzer checker disables some warnings [PR103533] gcc/ChangeLog: PR analyzer/103533 * doc/invoke.texi: Document that enabling taint analyzer checker disables some warnings from `-fanalyzer`. Signed-off-by: Avinash Sonawane --- gcc/doc/invoke.texi | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 4da4a1170f5..8b16b35ec12 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -421,14 +421,13 @@ Objective-C and Objective-C++ Dialects}. -fanalyzer-checker=@var{name} @gol -fno-analyzer-feasibility @gol -fanalyzer-fine-grained @gol --fanalyzer-state-merge @gol --fanalyzer-state-purge @gol +-fno-analyzer-state-merge @gol +-fno-analyzer-state-purge @gol -fanalyzer-transitivity @gol -fanalyzer-verbose-edges @gol -fanalyzer-verbose-state-changes @gol -fanalyzer-verbosity=@var{level} @gol -fdump-analyzer @gol --fdump-analyzer-stderr @gol -fdump-analyzer-callgraph @gol -fdump-analyzer-exploded-graph @gol -fdump-analyzer-exploded-nodes @gol @@ -438,6 +437,7 @@ Objective-C and Objective-C++ Dialects}. -fdump-analyzer-feasibility @gol -fdump-analyzer-json @gol -fdump-analyzer-state-purge @gol +-fdump-analyzer-stderr @gol -fdump-analyzer-supergraph @gol -Wno-analyzer-double-fclose @gol -Wno-analyzer-double-free @gol @@ -9659,22 +9659,24 @@ Enabling this option effectively enables the following warnings: -Wanalyzer-free-of-non-heap @gol -Wanalyzer-malloc-leak @gol -Wanalyzer-mismatching-deallocation @gol --Wanalyzer-possible-null-argument @gol --Wanalyzer-possible-null-dereference @gol -Wanalyzer-null-argument @gol -Wanalyzer-null-dereference @gol +-Wanalyzer-possible-null-argument @gol +-Wanalyzer-possible-null-dereference @gol -Wanalyzer-shift-count-negative @gol -Wanalyzer-shift-count-overflow @gol -Wanalyzer-stale-setjmp-buffer @gol +@ignore -Wanalyzer-tainted-allocation-size @gol -Wanalyzer-tainted-array-index @gol -Wanalyzer-tainted-divisor @gol -Wanalyzer-tainted-offset @gol -Wanalyzer-tainted-size @gol +@end ignore -Wanalyzer-unsafe-call-within-signal-handler @gol -Wanalyzer-use-after-free @gol --Wanalyzer-use-of-uninitialized-value @gol -Wanalyzer-use-of-pointer-in-stale-stack-frame @gol +-Wanalyzer-use-of-uninitialized-value @gol -Wanalyzer-write-to-const @gol -Wanalyzer-write-to-string-literal @gol } @@ -10015,6 +10017,25 @@ such as the @code{taint} checker that implements @option{-Wanalyzer-tainted-array-index}, and this option is required to enable them. +@emph{Note:} currently, @option{-fanalyzer-checker=taint} disables the +following warnings from @option{-fanalyzer}: + +@gccoptlist{ @gol +-Wanalyzer-double-fclose @gol +-Wanalyzer-double-free @gol +-Wanalyzer-exposure-through-output-file @gol +-Wanalyzer-file-leak @gol +-Wanalyzer-free-of-non-heap @gol +-Wanalyzer-malloc-leak @gol +-Wanalyzer-mismatching-deallocation @gol +-Wanalyzer-null-argument @gol +-Wanalyzer-null-dereference @gol +-Wanalyzer-possible-null-argument @gol +-Wanalyzer-possible-null-dereference @gol +-Wanalyzer-unsafe-call-within-signal-handler @gol +-Wanalyzer-use-after-free @gol +} + @item -fno-analyzer-feasibility @opindex fanalyzer-feasibility @opindex fno-analyzer-feasibility From 5f6197d7c197f9d2b7fb2e1a19dac39a023755e8 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 24 Mar 2022 20:58:10 -0400 Subject: [PATCH 007/157] analyzer: add region::tracked_p to optimize state objects [PR104954] PR analyzer/104954 tracks that -fanalyzer was taking a very long time on a particular source file in the Linux kernel: drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c One issue occurs with the repeated use of dynamic debug lines e.g. via the DC_LOG_BANDWIDTH_CALCS macro, such as in print_bw_calcs_dceip in drivers/gpu/drm/amd/display/dc/calcs/calcs_logger.h: DC_LOG_BANDWIDTH_CALCS("#####################################################################"); DC_LOG_BANDWIDTH_CALCS("struct bw_calcs_dceip"); DC_LOG_BANDWIDTH_CALCS("#####################################################################"); [...snip dozens of lines...] DC_LOG_BANDWIDTH_CALCS("[bw_fixed] dmif_request_buffer_size: %d", bw_fixed_to_int(dceip->dmif_request_buffer_size)); When this is configured to use __dynamic_pr_debug, each of these becomes code like: do { static struct _ddebug __attribute__((__aligned__(8))) __attribute__((__section__("__dyndbg"))) __UNIQUE_ID_ddebug277 = { [...snip...] }; if (arch_static_branch(&__UNIQUE_ID_ddebug277.key, false)) __dynamic_pr_debug(&__UNIQUE_ID_ddebug277, [...the message...]); } while (0); The analyzer was naively seeing each call to __dynamic_pr_debug, noting that the __UNIQUE_ID_nnnn object escapes. At each call, as successive __UNIQUE_ID_nnnn object escapes, there are N escaped objects, and thus N need clobbering, and so we have O(N^2) clobbering of escaped objects overall, leading to huge amounts of pointless work: print_bw_calcs_data has 225 uses of DC_LOG_BANDWIDTH_CALCS, many of which are in loops. This patch adds a way to identify declarations that aren't interesting to the analyzer, so that we don't attempt to create binding_clusters for them (i.e. we don't store any state for them in our state objects). This is implemented by adding a new region::tracked_p, implemented for declarations by walking the existing IPA data the first time the analyzer sees a declaration, setting it to false for global vars that have no loads/stores/aliases, and "sufficiently safe" address-of ipa-refs. The patch gives a large speedup of -fanalyzer on the above kernel source file: Before After Total cc1 wallclock time: 180s 36s analyzer wallclock time: 162s 17s % spent in analyzer: 90% 47% gcc/analyzer/ChangeLog: PR analyzer/104954 * analyzer.opt (-fdump-analyzer-untracked): New option. * engine.cc (impl_run_checkers): Handle it. * region-model-asm.cc (region_model::on_asm_stmt): Don't attempt to clobber regions with !tracked_p (). * region-model-manager.cc (dump_untracked_region): New. (region_model_manager::dump_untracked_regions): New. (frame_region::dump_untracked_regions): New. * region-model.h (region_model_manager::dump_untracked_regions): New decl. * region.cc (ipa_ref_requires_tracking): New. (symnode_requires_tracking_p): New. (decl_region::calc_tracked_p): New. * region.h (region::tracked_p): New vfunc. (frame_region::dump_untracked_regions): New decl. (class decl_region): Note that this is also used fo SSA names. (decl_region::decl_region): Initialize m_tracked. (decl_region::tracked_p): New. (decl_region::calc_tracked_p): New decl. (decl_region::m_tracked): New. * store.cc (store::get_or_create_cluster): Assert that we don't try to create clusters for base regions that aren't trackable. (store::mark_as_escaped): Don't mark base regions that we're not tracking. gcc/ChangeLog: PR analyzer/104954 * doc/invoke.texi (Static Analyzer Options): Add -fdump-analyzer-untracked. gcc/testsuite/ChangeLog: PR analyzer/104954 * gcc.dg/analyzer/asm-x86-dyndbg-1.c: New test. * gcc.dg/analyzer/asm-x86-dyndbg-2.c: New test. * gcc.dg/analyzer/many-unused-locals.c: New test. * gcc.dg/analyzer/untracked-1.c: New test. * gcc.dg/analyzer/unused-local-1.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/analyzer.opt | 4 + gcc/analyzer/engine.cc | 3 + gcc/analyzer/region-model-asm.cc | 3 +- gcc/analyzer/region-model-manager.cc | 41 ++++++ gcc/analyzer/region-model.h | 2 + gcc/analyzer/region.cc | 88 ++++++++++++ gcc/analyzer/region.h | 24 +++- gcc/analyzer/store.cc | 6 +- gcc/doc/invoke.texi | 5 + .../gcc.dg/analyzer/asm-x86-dyndbg-1.c | 126 ++++++++++++++++++ .../gcc.dg/analyzer/asm-x86-dyndbg-2.c | 77 +++++++++++ .../gcc.dg/analyzer/many-unused-locals.c | 69 ++++++++++ gcc/testsuite/gcc.dg/analyzer/untracked-1.c | 99 ++++++++++++++ .../gcc.dg/analyzer/unused-local-1.c | 22 +++ 14 files changed, 565 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/analyzer/asm-x86-dyndbg-1.c create mode 100644 gcc/testsuite/gcc.dg/analyzer/asm-x86-dyndbg-2.c create mode 100644 gcc/testsuite/gcc.dg/analyzer/many-unused-locals.c create mode 100644 gcc/testsuite/gcc.dg/analyzer/untracked-1.c create mode 100644 gcc/testsuite/gcc.dg/analyzer/unused-local-1.c diff --git a/gcc/analyzer/analyzer.opt b/gcc/analyzer/analyzer.opt index b9d2ece273c..a0ba2c94fb3 100644 --- a/gcc/analyzer/analyzer.opt +++ b/gcc/analyzer/analyzer.opt @@ -250,4 +250,8 @@ fdump-analyzer-supergraph Common RejectNegative Var(flag_dump_analyzer_supergraph) Dump the analyzer supergraph to a SRCFILE.supergraph.dot file. +fdump-analyzer-untracked +Common RejectNegative Var(flag_dump_analyzer_untracked) +Emit custom warnings with internal details intended for analyzer developers. + ; This comment is to ensure we retain the blank line above. diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc index 0f40e064a22..d8b61955aa6 100644 --- a/gcc/analyzer/engine.cc +++ b/gcc/analyzer/engine.cc @@ -5811,6 +5811,9 @@ impl_run_checkers (logger *logger) if (flag_dump_analyzer_json) dump_analyzer_json (sg, eg); + if (flag_dump_analyzer_untracked) + eng.get_model_manager ()->dump_untracked_regions (); + delete purge_map; } diff --git a/gcc/analyzer/region-model-asm.cc b/gcc/analyzer/region-model-asm.cc index 3bf2a02432c..c7389f0e38d 100644 --- a/gcc/analyzer/region-model-asm.cc +++ b/gcc/analyzer/region-model-asm.cc @@ -267,7 +267,8 @@ region_model::on_asm_stmt (const gasm *stmt, region_model_context *ctxt) iter != reachable_regs.end_mutable_base_regs (); ++iter) { const region *base_reg = *iter; - if (base_reg->symbolic_for_unknown_ptr_p ()) + if (base_reg->symbolic_for_unknown_ptr_p () + || !base_reg->tracked_p ()) continue; binding_cluster *cluster = m_store.get_or_create_cluster (base_reg); diff --git a/gcc/analyzer/region-model-manager.cc b/gcc/analyzer/region-model-manager.cc index bc8f554580b..61c7fb32628 100644 --- a/gcc/analyzer/region-model-manager.cc +++ b/gcc/analyzer/region-model-manager.cc @@ -1740,6 +1740,47 @@ store_manager::log_stats (logger *logger, bool show_objs) const m_symbolic_binding_key_mgr); } +/* Emit a warning showing DECL_REG->tracked_p () for use in DejaGnu tests + (using -fdump-analyzer-untracked). */ + +static void +dump_untracked_region (const decl_region *decl_reg) +{ + tree decl = decl_reg->get_decl (); + if (TREE_CODE (decl) != VAR_DECL) + return; + warning_at (DECL_SOURCE_LOCATION (decl), 0, + "track %qD: %s", + decl, (decl_reg->tracked_p () ? "yes" : "no")); +} + +/* Implementation of -fdump-analyzer-untracked. */ + +void +region_model_manager::dump_untracked_regions () const +{ + for (auto iter : m_globals_map) + { + const decl_region *decl_reg = iter.second; + dump_untracked_region (decl_reg); + } + for (auto frame_iter : m_frame_regions) + { + const frame_region *frame_reg = frame_iter.second; + frame_reg->dump_untracked_regions (); + } +} + +void +frame_region::dump_untracked_regions () const +{ + for (auto iter : m_locals) + { + const decl_region *decl_reg = iter.second; + dump_untracked_region (decl_reg); + } +} + } // namespace ana #endif /* #if ENABLE_ANALYZER */ diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h index d9e21432032..13a2ea94a3f 100644 --- a/gcc/analyzer/region-model.h +++ b/gcc/analyzer/region-model.h @@ -349,6 +349,8 @@ public: logger *get_logger () const { return m_logger; } + void dump_untracked_regions () const; + private: bool too_complex_p (const complexity &c) const; bool reject_if_too_complex (svalue *sval); diff --git a/gcc/analyzer/region.cc b/gcc/analyzer/region.cc index 2020ef4e4b5..9c9e043c658 100644 --- a/gcc/analyzer/region.cc +++ b/gcc/analyzer/region.cc @@ -1167,6 +1167,94 @@ decl_region::get_svalue_for_initializer (region_model_manager *mgr) const return m.get_rvalue (path_var (init, 0), NULL); } +/* Subroutine of symnode_requires_tracking_p; return true if REF + within CONTEXT_FNDECL might imply that we should be tracking the + value of a decl. */ + +static bool +ipa_ref_requires_tracking (const ipa_ref *ref, tree context_fndecl) +{ + /* If we have a load/store/alias of the symbol, then we'll track + the decl's value. */ + if (ref->use != IPA_REF_ADDR) + return true; + + if (ref->stmt == NULL) + return true; + + switch (ref->stmt->code) + { + default: + return true; + case GIMPLE_CALL: + { + cgraph_node *context_cnode = cgraph_node::get (context_fndecl); + cgraph_edge *edge = context_cnode->get_edge (ref->stmt); + if (!edge) + return true; + if (edge->callee == NULL) + return true; /* e.g. call through function ptr. */ + if (edge->callee->definition) + return true; + /* If we get here, then this ref is a pointer passed to + a function we don't have the definition for. */ + return false; + } + break; + case GIMPLE_ASM: + { + const gasm *asm_stmt = as_a (ref->stmt); + if (gimple_asm_noutputs (asm_stmt) > 0) + return true; + if (gimple_asm_nclobbers (asm_stmt) > 0) + return true; + /* If we get here, then this ref is the decl being passed + by pointer to asm with no outputs. */ + return false; + } + break; + } +} + +/* Determine if the decl for SYMNODE should have binding_clusters + in our state objects; return false to optimize away tracking + certain decls in our state objects, as an optimization. */ + +static bool +symnode_requires_tracking_p (symtab_node *symnode) +{ + gcc_assert (symnode); + if (symnode->externally_visible) + return true; + tree context_fndecl = DECL_CONTEXT (symnode->decl); + if (context_fndecl == NULL) + return true; + if (TREE_CODE (context_fndecl) != FUNCTION_DECL) + return true; + for (auto ref : symnode->ref_list.referring) + if (ipa_ref_requires_tracking (ref, context_fndecl)) + return true; + + /* If we get here, then we don't have uses of this decl that require + tracking; we never read from it or write to it explicitly. */ + return false; +} + +/* Subroutine of decl_region ctor: determine whether this decl_region + can have binding_clusters; return false to optimize away tracking + of certain decls in our state objects, as an optimization. */ + +bool +decl_region::calc_tracked_p (tree decl) +{ + /* Precondition of symtab_node::get. */ + if (TREE_CODE (decl) == VAR_DECL + && (TREE_STATIC (decl) || DECL_EXTERNAL (decl) || in_lto_p)) + if (symtab_node *symnode = symtab_node::get (decl)) + return symnode_requires_tracking_p (symnode); + return true; +} + /* class field_region : public region. */ /* Implementation of region::dump_to_pp vfunc for field_region. */ diff --git a/gcc/analyzer/region.h b/gcc/analyzer/region.h index dbeb485e81f..5150be76d0b 100644 --- a/gcc/analyzer/region.h +++ b/gcc/analyzer/region.h @@ -197,6 +197,11 @@ public: bool symbolic_for_unknown_ptr_p () const; + /* For most base regions it makes sense to track the bindings of the region + within the store. As an optimization, some are not tracked (to avoid + bloating the store object with redundant binding clusters). */ + virtual bool tracked_p () const { return true; } + const complexity &get_complexity () const { return m_complexity; } bool is_named_decl_p (const char *decl_name) const; @@ -319,6 +324,9 @@ public: unsigned get_num_locals () const { return m_locals.elements (); } + /* Implemented in region-model-manager.cc. */ + void dump_untracked_regions () const; + private: const frame_region *m_calling_frame; function *m_fun; @@ -633,13 +641,15 @@ template <> struct default_hash_traits namespace ana { /* Concrete region subclass representing the memory occupied by a - variable (whether for a global or a local). */ + variable (whether for a global or a local). + Also used for representing SSA names, as if they were locals. */ class decl_region : public region { public: decl_region (unsigned id, const region *parent, tree decl) - : region (complexity (parent), id, parent, TREE_TYPE (decl)), m_decl (decl) + : region (complexity (parent), id, parent, TREE_TYPE (decl)), m_decl (decl), + m_tracked (calc_tracked_p (decl)) {} enum region_kind get_kind () const FINAL OVERRIDE { return RK_DECL; } @@ -648,6 +658,8 @@ public: void dump_to_pp (pretty_printer *pp, bool simple) const FINAL OVERRIDE; + bool tracked_p () const FINAL OVERRIDE { return m_tracked; } + tree get_decl () const { return m_decl; } int get_stack_depth () const; @@ -657,7 +669,15 @@ public: const svalue *get_svalue_for_initializer (region_model_manager *mgr) const; private: + static bool calc_tracked_p (tree decl); + tree m_decl; + + /* Cached result of calc_tracked_p, so that we can quickly determine when + we don't to track a binding_cluster for this decl (to avoid bloating + store objects). + This can be debugged using -fdump-analyzer-untracked. */ + bool m_tracked; }; } // namespace ana diff --git a/gcc/analyzer/store.cc b/gcc/analyzer/store.cc index ec11433dffc..62733b9777f 100644 --- a/gcc/analyzer/store.cc +++ b/gcc/analyzer/store.cc @@ -2654,6 +2654,9 @@ store::get_or_create_cluster (const region *base_reg) /* We shouldn't create clusters for dereferencing an UNKNOWN ptr. */ gcc_assert (!base_reg->symbolic_for_unknown_ptr_p ()); + /* We shouldn't create clusters for base regions that aren't trackable. */ + gcc_assert (base_reg->tracked_p ()); + if (binding_cluster **slot = m_cluster_map.get (base_reg)) return *slot; @@ -2742,7 +2745,8 @@ store::mark_as_escaped (const region *base_reg) gcc_assert (base_reg); gcc_assert (base_reg->get_base_region () == base_reg); - if (base_reg->symbolic_for_unknown_ptr_p ()) + if (base_reg->symbolic_for_unknown_ptr_p () + || !base_reg->tracked_p ()) return; binding_cluster *cluster = get_or_create_cluster (base_reg); diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 8b16b35ec12..afb21d9154c 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -439,6 +439,7 @@ Objective-C and Objective-C++ Dialects}. -fdump-analyzer-state-purge @gol -fdump-analyzer-stderr @gol -fdump-analyzer-supergraph @gol +-fdump-analyzer-untracked @gol -Wno-analyzer-double-fclose @gol -Wno-analyzer-double-free @gol -Wno-analyzer-exposure-through-output-file @gol @@ -10212,6 +10213,10 @@ control flow graphs in the program, with interprocedural edges for calls and returns. The second dump contains annotations showing nodes in the ``exploded graph'' and diagnostics associated with them. +@item -fdump-analyzer-untracked +@opindex fdump-analyzer-untracked +Emit custom warnings with internal details intended for analyzer developers. + @end table @node Debugging Options diff --git a/gcc/testsuite/gcc.dg/analyzer/asm-x86-dyndbg-1.c b/gcc/testsuite/gcc.dg/analyzer/asm-x86-dyndbg-1.c new file mode 100644 index 00000000000..cce3f6b80bc --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/asm-x86-dyndbg-1.c @@ -0,0 +1,126 @@ +/* Test reduced from use of dynamic_pr_debug on Linux kernel, to verify that + we treat the static struct _ddebug as not needing to be tracked by the + analyzer, thus optimizing away bloat in the analyzer's state tracking. */ + +/* { dg-do compile { target x86_64-*-* } } */ +/* { dg-additional-options "-fdump-analyzer-untracked" } */ + +/* Adapted from various files in the Linux kernel, all of which have: */ +/* SPDX-License-Identifier: GPL-2.0 */ + +typedef _Bool bool; +#define true 1 +#define false 0 + +typedef struct { + int counter; +} atomic_t; + +/* Adapted from include/linux/compiler_attributes.h */ +#define __always_inline inline __attribute__((__always_inline__)) + +/* Adapted from include/linux/compiler-gcc.h */ +#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) + +/* Adapted from include/linux/jump_label.h, which has: */ + +struct static_key { + atomic_t enabled; + union { + /* [...snip...] */ + struct jump_entry *entries; + /* [...snip...] */ + }; +}; + +struct static_key_true { + struct static_key key; +}; + +struct static_key_false { + struct static_key key; +}; + +extern bool ____wrong_branch_error(void); + +/* Adapted from arch/x86/include/asm/jump_label.h */ + +#define JUMP_TABLE_ENTRY \ + ".pushsection __jump_table, \"aw\" \n\t" \ + /*_ASM_ALIGN*/ "\n\t" \ + ".long 1b - . \n\t" \ + ".long %l[l_yes] - . \n\t" \ + /*_ASM_PTR*/ "%c0 + %c1 - .\n\t" \ + ".popsection \n\t" + +static __always_inline bool arch_static_branch(struct static_key * const key, const bool branch) +{ + asm_volatile_goto("1:" + /*".byte " __stringify(BYTES_NOP5) "\n\t" */ + JUMP_TABLE_ENTRY + : : "i" (key), "i" (branch) : : l_yes); + + return false; +l_yes: + return true; +} + +static __always_inline bool arch_static_branch_jump(struct static_key * const key, const bool branch) +{ + asm_volatile_goto("1:" + "jmp %l[l_yes]\n\t" + JUMP_TABLE_ENTRY + : : "i" (key), "i" (branch) : : l_yes); + + return false; +l_yes: + return true; +} + +/* Adapted from include/linux/dynamic_debug.h */ + +struct _ddebug { + /* [...snip...] */ + const char *function; + const char *filename; + const char *format; + unsigned int lineno:18; + /* [...snip...] */ + unsigned int flags:8; + union { + struct static_key_true dd_key_true; + struct static_key_false dd_key_false; + } key; +} __attribute__((aligned(8))); + +extern void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...); + +static void expanded_dynamic_pr_debug(void) { + do { + static struct _ddebug __attribute__((__aligned__(8))) + __attribute__((__section__("__dyndbg"))) __UNIQUE_ID_ddebug277 = { /* { dg-warning "track '__UNIQUE_ID_ddebug277': no" } */ + .function = __func__, + .filename = __FILE__, + .format = ("hello world"), + .lineno = __LINE__, + .flags = 0}; + if (({ + bool branch; + if (__builtin_types_compatible_p( + typeof(*&__UNIQUE_ID_ddebug277.key.dd_key_false), + struct static_key_true)) + branch = arch_static_branch_jump( + &(&__UNIQUE_ID_ddebug277.key.dd_key_false)->key, false); + else if (__builtin_types_compatible_p( + typeof(*&__UNIQUE_ID_ddebug277.key.dd_key_false), + struct static_key_false)) + branch = arch_static_branch( + &(&__UNIQUE_ID_ddebug277.key.dd_key_false)->key, false); + else + branch = ____wrong_branch_error(); + __builtin_expect(!!(branch), 0); + })) + __dynamic_pr_debug(&__UNIQUE_ID_ddebug277, + "hello world"); + } while (0); +} diff --git a/gcc/testsuite/gcc.dg/analyzer/asm-x86-dyndbg-2.c b/gcc/testsuite/gcc.dg/analyzer/asm-x86-dyndbg-2.c new file mode 100644 index 00000000000..8111709206f --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/asm-x86-dyndbg-2.c @@ -0,0 +1,77 @@ +/* Test reduced from use of dynamic_pr_debug on Linux kernel, to verify that + we treat the static struct _ddebug as not needing to be tracked by the + analyzer, thus optimizing away bloat in the analyzer's state tracking. */ + +/* { dg-do compile { target x86_64-*-* } } */ +/* { dg-additional-options "-fdump-analyzer-untracked" } */ + +/* Adapted from various files in the Linux kernel, all of which have: */ +/* SPDX-License-Identifier: GPL-2.0 */ + +typedef _Bool bool; +#define true 1 +#define false 0 + +typedef struct {} atomic_t; + +/* Adapted from include/linux/compiler_attributes.h */ +#define __always_inline inline __attribute__((__always_inline__)) + +/* Adapted from include/linux/compiler-gcc.h */ +#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) + +/* Adapted from include/linux/jump_label.h, which has: */ + +struct static_key {}; + +/* Adapted from arch/x86/include/asm/jump_label.h */ + +static __always_inline bool arch_static_branch(struct static_key * const key, const bool branch) +{ + asm_volatile_goto("1:" + : : "i" (key), "i" (branch) : : l_yes); + + return false; +l_yes: + return true; +} + +static __always_inline bool arch_static_branch_jump(struct static_key * const key, const bool branch) +{ + asm_volatile_goto("1:" + : : "i" (key), "i" (branch) : : l_yes); + + return false; +l_yes: + return true; +} + +/* Adapted from include/linux/dynamic_debug.h */ + +struct _ddebug { + /* [...snip...] */ + const char *function; + const char *filename; + const char *format; + unsigned int lineno:18; + /* [...snip...] */ + unsigned int flags:8; + struct static_key key; +} __attribute__((aligned(8))); + +extern void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...); + +static void expanded_dynamic_pr_debug(void) { + do { + static struct _ddebug __attribute__((__aligned__(8))) + __attribute__((__section__("__dyndbg"))) __UNIQUE_ID_ddebug277 = { /* { dg-warning "track '__UNIQUE_ID_ddebug277': no" } */ + .function = __func__, + .filename = __FILE__, + .format = ("hello world"), + .lineno = __LINE__, + .flags = 0}; + if (arch_static_branch(&__UNIQUE_ID_ddebug277.key, false)) + __dynamic_pr_debug(&__UNIQUE_ID_ddebug277, + "hello world"); + } while (0); +} diff --git a/gcc/testsuite/gcc.dg/analyzer/many-unused-locals.c b/gcc/testsuite/gcc.dg/analyzer/many-unused-locals.c new file mode 100644 index 00000000000..6b5c85557c9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/many-unused-locals.c @@ -0,0 +1,69 @@ +struct st +{ + const char *m_filename; + int m_line; + const char *m_function; +}; + +extern void debug (struct st *); + +#define TEST_x_1(NAME) \ + do \ + { \ + static struct st NAME = { __FILE__, __LINE__, __func__ }; \ + debug (&NAME); \ + } \ + while (0) + +#define TEST_x_10(PREFIX) \ + do \ + { \ + TEST_x_1(PREFIX ## _1); \ + TEST_x_1(PREFIX ## _2); \ + TEST_x_1(PREFIX ## _3); \ + TEST_x_1(PREFIX ## _4); \ + TEST_x_1(PREFIX ## _5); \ + TEST_x_1(PREFIX ## _6); \ + TEST_x_1(PREFIX ## _7); \ + TEST_x_1(PREFIX ## _8); \ + TEST_x_1(PREFIX ## _9); \ + TEST_x_1(PREFIX ## _10); \ + } \ + while(0) + +#define TEST_x_100(PREFIX) \ + do \ + { \ + TEST_x_10(PREFIX ## _1); \ + TEST_x_10(PREFIX ## _2); \ + TEST_x_10(PREFIX ## _3); \ + TEST_x_10(PREFIX ## _4); \ + TEST_x_10(PREFIX ## _5); \ + TEST_x_10(PREFIX ## _6); \ + TEST_x_10(PREFIX ## _7); \ + TEST_x_10(PREFIX ## _8); \ + TEST_x_10(PREFIX ## _9); \ + TEST_x_10(PREFIX ## _10); \ + } \ + while(0) + +#define TEST_x_1000(PREFIX) \ + do \ + { \ + TEST_x_100(PREFIX ## _1); \ + TEST_x_100(PREFIX ## _2); \ + TEST_x_100(PREFIX ## _3); \ + TEST_x_100(PREFIX ## _4); \ + TEST_x_100(PREFIX ## _5); \ + TEST_x_100(PREFIX ## _6); \ + TEST_x_100(PREFIX ## _7); \ + TEST_x_100(PREFIX ## _8); \ + TEST_x_100(PREFIX ## _9); \ + TEST_x_100(PREFIX ## _10); \ + } \ + while(0) + +void test_many (void) +{ + TEST_x_1000(s); +} diff --git a/gcc/testsuite/gcc.dg/analyzer/untracked-1.c b/gcc/testsuite/gcc.dg/analyzer/untracked-1.c new file mode 100644 index 00000000000..b7536c399fd --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/untracked-1.c @@ -0,0 +1,99 @@ +/* { dg-additional-options "-fdump-analyzer-untracked" } */ + +struct st +{ + const char *m_filename; + int m_line; +}; + +typedef struct boxed_int { int value; } boxed_int; + +extern void extern_fn (struct st *); +static void __attribute__((noinline)) internal_fn (struct st *) {} +extern int extern_get_int (void); + +void test_0 (void) +{ + /* Not ever referenced; will get optimized away before + analyzer ever sees it, so no message. */ + static struct st s1 = { __FILE__, __LINE__ }; +} + +void test_1 (void) +{ + static struct st s1 = { __FILE__, __LINE__ }; /* { dg-warning "track 's1': no" } */ + extern_fn (&s1); +} + +static struct st s2 = { __FILE__, __LINE__ }; /* { dg-warning "track 's2': yes" } */ + +void test_2 (void) +{ + extern_fn (&s2); +} + +void test_3 (void) +{ + struct st s3 = { __FILE__, __LINE__ }; /* { dg-warning "track 's3': yes" } */ + extern_fn (&s3); +} + +extern void called_by_test_4 (int *); + +int test_4 (void) +{ + int i; /* { dg-warning "track 'i': yes" } */ + called_by_test_4 (&i); + return i; +} + +void test_5 (int i) +{ + boxed_int bi5 = { i }; /* { dg-warning "track 'bi5': yes" } */ +} + +int test_6 (int i) +{ + static boxed_int bi6; /* { dg-warning "track 'bi6': yes" } */ + bi6.value = i; + return bi6.value; +} + +int test_7 (void) +{ + boxed_int bi7; /* { dg-warning "track 'bi7': yes" } */ + return bi7.value; /* { dg-warning "use of uninitialized value 'bi7.value'" "uninit" } */ +} + +void test_8 (void) +{ + static struct st s8 = { __FILE__, __LINE__ }; /* { dg-warning "track 's8': no" } */ + extern_fn (&s8); + extern_fn (&s8); +} + +void test_9 (void) +{ + static struct st s9 = { __FILE__, __LINE__ }; /* { dg-warning "track 's9': yes" } */ + internal_fn (&s9); +} + +int test_10 (void) +{ + static struct st s10 = { __FILE__, __LINE__ }; /* { dg-warning "track 's10': yes" } */ + extern_fn (&s10); + return s10.m_line; +} + +int test_11 (void) +{ + static struct st s10 = { __FILE__, __LINE__ }; /* { dg-warning "track 's10': yes" } */ + s10.m_line = extern_get_int (); + return 42; +} + +int test_12 (void (*fnptr) (struct st *)) +{ + static struct st s12 = { __FILE__, __LINE__ }; /* { dg-warning "track 's12': yes" } */ + fnptr (&s12); +} diff --git a/gcc/testsuite/gcc.dg/analyzer/unused-local-1.c b/gcc/testsuite/gcc.dg/analyzer/unused-local-1.c new file mode 100644 index 00000000000..361cdced6e3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/unused-local-1.c @@ -0,0 +1,22 @@ +/* { dg-additional-options "-fdump-analyzer-untracked" } */ + +struct st +{ + const char *m_filename; + int m_line; + const char *m_function; +}; + +extern void debug (struct st *); + +void test (void) +{ + { + static struct st s1 = { __FILE__, __LINE__, __func__ }; /* { dg-warning "track 's1': no" } */ + debug (&s1); + } + { + static struct st s2 = { __FILE__, __LINE__, __func__ }; /* { dg-warning "track 's2': no" } */ + debug (&s2); + } +} From 748f36a48b506f52e10bcdeb750a7fe9c30c26f3 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Fri, 25 Mar 2022 10:47:49 +0100 Subject: [PATCH 008/157] doc/invoke.texi: Move @ignore block out of @gccoptlist [PR103533] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With TeX output ("make pdf"), @gccoptlist's content end up in a single line such that TeX does not find the matching '@end ignore' for the '@ignore' block – failing with a runaway error. Solution is to move the @ignore block after the closing '}'. (Follow up to r12-7808-g319ba7e241e7e21f9eb481f075310796f13d2035 ) gcc/ PR analyzer/103533 * doc/invoke.texi (Static Analyzer Options): Move @ignore block after @gccoptlist's '}' for 'make pdf'. --- gcc/doc/invoke.texi | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index afb21d9154c..28307105541 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -9667,13 +9667,6 @@ Enabling this option effectively enables the following warnings: -Wanalyzer-shift-count-negative @gol -Wanalyzer-shift-count-overflow @gol -Wanalyzer-stale-setjmp-buffer @gol -@ignore --Wanalyzer-tainted-allocation-size @gol --Wanalyzer-tainted-array-index @gol --Wanalyzer-tainted-divisor @gol --Wanalyzer-tainted-offset @gol --Wanalyzer-tainted-size @gol -@end ignore -Wanalyzer-unsafe-call-within-signal-handler @gol -Wanalyzer-use-after-free @gol -Wanalyzer-use-of-pointer-in-stale-stack-frame @gol @@ -9681,6 +9674,13 @@ Enabling this option effectively enables the following warnings: -Wanalyzer-write-to-const @gol -Wanalyzer-write-to-string-literal @gol } +@ignore +-Wanalyzer-tainted-allocation-size @gol +-Wanalyzer-tainted-array-index @gol +-Wanalyzer-tainted-divisor @gol +-Wanalyzer-tainted-offset @gol +-Wanalyzer-tainted-size @gol +@end ignore This option is only available if GCC was configured with analyzer support enabled. From 45e955b0a936eafc9838cdc00dcc31b3799b321b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 25 Mar 2022 11:22:15 +0100 Subject: [PATCH 009/157] fortran: Fix up initializers of param(0) PARAMETERs [PR103691] On the gfortran.dg/pr103691.f90 testcase the Fortran ICE emits static real(kind=4) a[0] = {[0 ... -1]=2.0e+0}; That is an invalid RANGE_EXPR where the maximum is smaller than the minimum. The following patch fixes that. If TYPE_MAX_VALUE is smaller than TYPE_MIN_VALUE, the array is empty and so doesn't need any initializer, if the two are equal, we don't need to bother with a RANGE_EXPR and can just use that INTEGER_CST as the index and finally for the 2+ values in the range it uses a RANGE_EXPR as before. 2022-03-25 Jakub Jelinek PR fortran/103691 * trans-array.cc (gfc_conv_array_initializer): If TYPE_MAX_VALUE is smaller than TYPE_MIN_VALUE (i.e. empty array), ignore the initializer; if TYPE_MIN_VALUE is equal to TYPE_MAX_VALUE, use just the TYPE_MIN_VALUE as index instead of RANGE_EXPR. --- gcc/fortran/trans-array.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index cfb6eac11c7..b3f8871ff22 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -6267,10 +6267,17 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr) else gfc_conv_structure (&se, expr, 1); - CONSTRUCTOR_APPEND_ELT (v, build2 (RANGE_EXPR, gfc_array_index_type, - TYPE_MIN_VALUE (TYPE_DOMAIN (type)), - TYPE_MAX_VALUE (TYPE_DOMAIN (type))), - se.expr); + if (tree_int_cst_lt (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), + TYPE_MIN_VALUE (TYPE_DOMAIN (type)))) + break; + else if (tree_int_cst_equal (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), + TYPE_MAX_VALUE (TYPE_DOMAIN (type)))) + range = TYPE_MIN_VALUE (TYPE_DOMAIN (type)); + else + range = build2 (RANGE_EXPR, gfc_array_index_type, + TYPE_MIN_VALUE (TYPE_DOMAIN (type)), + TYPE_MAX_VALUE (TYPE_DOMAIN (type))); + CONSTRUCTOR_APPEND_ELT (v, range, se.expr); break; case EXPR_ARRAY: From 711c7f079bc0d250e6c5c4450828453c1096542c Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 25 Mar 2022 12:35:33 +0100 Subject: [PATCH 010/157] Fix issue for pointers to anonymous types with -fdump-ada-spec This used to work long ago but broke at some point. gcc/c-family/ * c-ada-spec.cc (dump_ada_import): Deal with the "section" attribute (dump_ada_node) : Do not modify and pass the name, but the referenced type instead. Deal with the anonymous original type of a typedef'ed type. In the actual access case, follow the chain of external subtypes. : Tidy up control flow. --- gcc/c-family/c-ada-spec.cc | 89 +++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 35 deletions(-) diff --git a/gcc/c-family/c-ada-spec.cc b/gcc/c-family/c-ada-spec.cc index aeb429136b6..f291e150934 100644 --- a/gcc/c-family/c-ada-spec.cc +++ b/gcc/c-family/c-ada-spec.cc @@ -1526,6 +1526,15 @@ dump_ada_import (pretty_printer *buffer, tree t, int spc) newline_and_indent (buffer, spc + 5); + tree sec = lookup_attribute ("section", DECL_ATTRIBUTES (t)); + if (sec) + { + pp_string (buffer, "Linker_Section => \""); + pp_string (buffer, TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (sec)))); + pp_string (buffer, "\", "); + newline_and_indent (buffer, spc + 5); + } + pp_string (buffer, "External_Name => \""); if (is_stdcall) @@ -2179,10 +2188,11 @@ dump_ada_node (pretty_printer *buffer, tree node, tree type, int spc, } else { - const unsigned int quals = TYPE_QUALS (TREE_TYPE (node)); + tree ref_type = TREE_TYPE (node); + const unsigned int quals = TYPE_QUALS (ref_type); bool is_access = false; - if (VOID_TYPE_P (TREE_TYPE (node))) + if (VOID_TYPE_P (ref_type)) { if (!name_only) pp_string (buffer, "new "); @@ -2197,9 +2207,8 @@ dump_ada_node (pretty_printer *buffer, tree node, tree type, int spc, else { if (TREE_CODE (node) == POINTER_TYPE - && TREE_CODE (TREE_TYPE (node)) == INTEGER_TYPE - && id_equal (DECL_NAME (TYPE_NAME (TREE_TYPE (node))), - "char")) + && TREE_CODE (ref_type) == INTEGER_TYPE + && id_equal (DECL_NAME (TYPE_NAME (ref_type)), "char")) { if (!name_only) pp_string (buffer, "new "); @@ -2214,28 +2223,11 @@ dump_ada_node (pretty_printer *buffer, tree node, tree type, int spc, } else { - tree type_name = TYPE_NAME (TREE_TYPE (node)); - - /* Generate "access " instead of "access " - if the subtype comes from another file, because subtype - declarations do not contribute to the limited view of a - package and thus subtypes cannot be referenced through - a limited_with clause. */ - if (type_name - && TREE_CODE (type_name) == TYPE_DECL - && DECL_ORIGINAL_TYPE (type_name) - && TYPE_NAME (DECL_ORIGINAL_TYPE (type_name))) - { - const expanded_location xloc - = expand_location (decl_sloc (type_name, false)); - if (xloc.line - && xloc.file - && xloc.file != current_source_file) - type_name = DECL_ORIGINAL_TYPE (type_name); - } + tree stub = TYPE_STUB_DECL (ref_type); + tree type_name = TYPE_NAME (ref_type); /* For now, handle access-to-access as System.Address. */ - if (TREE_CODE (TREE_TYPE (node)) == POINTER_TYPE) + if (TREE_CODE (ref_type) == POINTER_TYPE) { if (package_prefix) { @@ -2251,7 +2243,7 @@ dump_ada_node (pretty_printer *buffer, tree node, tree type, int spc, if (!package_prefix) pp_string (buffer, "access"); - else if (AGGREGATE_TYPE_P (TREE_TYPE (node))) + else if (AGGREGATE_TYPE_P (ref_type)) { if (!type || TREE_CODE (type) != FUNCTION_DECL) { @@ -2281,12 +2273,41 @@ dump_ada_node (pretty_printer *buffer, tree node, tree type, int spc, pp_string (buffer, "all "); } - if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (node)) && type_name) - dump_ada_node (buffer, type_name, TREE_TYPE (node), spc, - is_access, true); - else - dump_ada_node (buffer, TREE_TYPE (node), TREE_TYPE (node), - spc, false, true); + /* If this is the anonymous original type of a typedef'ed + type, then use the name of the latter. */ + if (!type_name + && stub + && DECL_CHAIN (stub) + && TREE_CODE (DECL_CHAIN (stub)) == TYPE_DECL + && DECL_ORIGINAL_TYPE (DECL_CHAIN (stub)) == ref_type) + ref_type = TREE_TYPE (DECL_CHAIN (stub)); + + /* Generate "access " instead of "access " + if the subtype comes from another file, because subtype + declarations do not contribute to the limited view of a + package and thus subtypes cannot be referenced through + a limited_with clause. */ + else if (is_access) + while (type_name + && TREE_CODE (type_name) == TYPE_DECL + && DECL_ORIGINAL_TYPE (type_name) + && TYPE_NAME (DECL_ORIGINAL_TYPE (type_name))) + { + const expanded_location xloc + = expand_location (decl_sloc (type_name, false)); + if (xloc.line + && xloc.file + && xloc.file != current_source_file) + { + ref_type = DECL_ORIGINAL_TYPE (type_name); + type_name = TYPE_NAME (ref_type); + } + else + break; + } + + dump_ada_node (buffer, ref_type, ref_type, spc, is_access, + true); } } } @@ -2361,10 +2382,8 @@ dump_ada_node (pretty_printer *buffer, tree node, tree type, int spc, else pp_string (buffer, "address"); } - break; } - - if (name_only) + else if (name_only) dump_ada_decl_name (buffer, node, limited_access); else { From 0b0fc52b0412cc1608f4f0edb8a0ab2495619c4e Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 25 Mar 2022 08:43:45 +0100 Subject: [PATCH 011/157] middle-end/105049 - fix uniform_vector_p and vector CTOR gimplification We have return VIEW_CONVERT_EXPR( VEC_PERM_EXPR < {<<< Unknown tree: compound_literal_expr V D.1984 = { 0 }; >>>, { 0 }} , {<<< Unknown tree: compound_literal_expr V D.1985 = { 0 }; >>>, { 0 }} , { 0, 0 } > & {(short int) SAVE_EXPR , (short int) SAVE_EXPR }); where we gimplify the init CTORs to _1 = {{ 0 }, { 0 }}; _2 = {{ 0 }, { 0 }}; instead of to vector constants. That later runs into a bug in uniform_vector_p which doesn't handle CTORs of vector elements correctly. The following adjusts uniform_vector_p to handle CTORs of vector elements. 2022-03-25 Richard Biener PR middle-end/105049 * tree.cc (uniform_vector_p): Recurse for VECTOR_CST or CONSTRUCTOR first elements. * gcc.dg/pr105049.c: New testcase. --- gcc/testsuite/gcc.dg/pr105049.c | 12 ++++++++++++ gcc/tree.cc | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr105049.c diff --git a/gcc/testsuite/gcc.dg/pr105049.c b/gcc/testsuite/gcc.dg/pr105049.c new file mode 100644 index 00000000000..b0518c6a181 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr105049.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fno-tree-forwprop" } */ + +typedef short __attribute__((__vector_size__ (sizeof(short)))) V; +typedef short __attribute__((__vector_size__ (2*sizeof(short)))) U; +char c; + +U +foo (void) +{ + return __builtin_shufflevector ((V){}, (V){}, 0, 0) & c; +} diff --git a/gcc/tree.cc b/gcc/tree.cc index b8017af6cfc..ec200e9a7eb 100644 --- a/gcc/tree.cc +++ b/gcc/tree.cc @@ -10266,6 +10266,8 @@ uniform_vector_p (const_tree vec) if (i != nelts) return NULL_TREE; + if (TREE_CODE (first) == CONSTRUCTOR || TREE_CODE (first) == VECTOR_CST) + return uniform_vector_p (first); return first; } From 8570cce7c705f2ec3ffaeb8e47d58af22a075ebd Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 25 Mar 2022 10:06:41 +0100 Subject: [PATCH 012/157] [libgomp, testsuite] Scale down some OpenACC test-cases When a display manager is running on an nvidia card, all CUDA kernel launches get a 5 seconds watchdog timer. Consequently, when running the libgomp testsuite with nvptx accelerator and GOMP_NVPTX_JIT=-O0 we run into a few FAILs like this: ... libgomp: cuStreamSynchronize error: the launch timed out and was terminated FAIL: libgomp.oacc-c/../libgomp.oacc-c-c++-common/parallel-dims.c \ -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O0 \ execution test ... Fix this by scaling down the failing test-cases by default, and reverting to the original behaviour for GCC_TEST_RUN_EXPENSIVE=1. Tested on x86_64-linux with nvptx accelerator. libgomp/ChangeLog: 2022-03-25 Tom de Vries PR libgomp/105042 * testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Reduce execution time. * testsuite/libgomp.oacc-c-c++-common/vred2d-128.c: Same. * testsuite/libgomp.oacc-fortran/parallel-dims.f90: Same. --- .../libgomp.oacc-c-c++-common/parallel-dims.c | 45 +++++++++++-------- .../libgomp.oacc-c-c++-common/vred2d-128.c | 6 +++ .../libgomp.oacc-fortran/parallel-dims.f90 | 18 ++++++-- 3 files changed, 46 insertions(+), 23 deletions(-) diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c index b1cfe37df8a..6798e23ef70 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c @@ -1,6 +1,8 @@ /* OpenACC parallelism dimensions clauses: num_gangs, num_workers, vector_length. */ +/* { dg-additional-options "-DEXPENSIVE" { target run_expensive_tests } } */ + /* { dg-additional-options "--param=openacc-kernels=decompose" } */ /* { dg-additional-options "-fopt-info-all-omp" } @@ -49,6 +51,11 @@ static int acc_vector () return __builtin_goacc_parlevel_id (GOMP_DIM_VECTOR); } +#ifdef EXPENSIVE +#define N 100 +#else +#define N 50 +#endif int main () { @@ -76,7 +83,7 @@ int main () { /* We're actually executing with num_gangs (1). */ gangs_actual = 1; - for (int i = 100 * gangs_actual; i > -100 * gangs_actual; --i) + for (int i = N * gangs_actual; i > -N * gangs_actual; --i) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); @@ -115,7 +122,7 @@ int main () reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-optimized {assigned OpenACC gang loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ - for (int i = 100 * gangs_actual; i > -100 * gangs_actual; --i) + for (int i = N * gangs_actual; i > -N * gangs_actual; --i) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); @@ -154,7 +161,7 @@ int main () reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-optimized {assigned OpenACC worker loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ - for (int i = 100 * workers_actual; i > -100 * workers_actual; --i) + for (int i = N * workers_actual; i > -N * workers_actual; --i) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); @@ -200,7 +207,7 @@ int main () reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-optimized {assigned OpenACC vector loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ - for (int i = 100 * vectors_actual; i > -100 * vectors_actual; --i) + for (int i = N * vectors_actual; i > -N * vectors_actual; --i) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); @@ -250,7 +257,7 @@ int main () } /* As we're executing GR not GP, don't multiply with a "gangs_actual" factor. */ - for (int i = 100 /* * gangs_actual */; i > -100 /* * gangs_actual */; --i) + for (int i = N /* * gangs_actual */; i > -N /* * gangs_actual */; --i) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); @@ -291,7 +298,7 @@ int main () reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-optimized {assigned OpenACC gang loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ - for (int i = 100 * gangs_actual; i > -100 * gangs_actual; --i) + for (int i = N * gangs_actual; i > -N * gangs_actual; --i) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); @@ -348,7 +355,7 @@ int main () reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-optimized {assigned OpenACC worker loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ - for (int i = 100 * workers_actual; i > -100 * workers_actual; --i) + for (int i = N * workers_actual; i > -N * workers_actual; --i) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); @@ -411,7 +418,7 @@ int main () reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-optimized {assigned OpenACC worker loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ - for (int i = 100 * workers_actual; i > -100 * workers_actual; --i) + for (int i = N * workers_actual; i > -N * workers_actual; --i) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); @@ -468,7 +475,7 @@ int main () reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-optimized {assigned OpenACC vector loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ - for (int i = 100 * vectors_actual; i > -100 * vectors_actual; --i) + for (int i = N * vectors_actual; i > -N * vectors_actual; --i) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); @@ -528,7 +535,7 @@ int main () reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-optimized {assigned OpenACC vector loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ - for (int i = 100 * vectors_actual; i > -100 * vectors_actual; --i) + for (int i = N * vectors_actual; i > -N * vectors_actual; --i) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); @@ -602,20 +609,20 @@ int main () /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-optimized {assigned OpenACC gang loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ - for (int i = 100 * gangs_actual; i > -100 * gangs_actual; --i) + for (int i = N * gangs_actual; i > -N * gangs_actual; --i) #pragma acc loop /* { dg-line l_loop_j[incr c_loop_j] } */ \ worker \ reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_j$c_loop_j } */ /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_j$c_loop_j } */ /* { dg-optimized {assigned OpenACC worker loop parallelism} {} { target *-*-* } l_loop_j$c_loop_j } */ - for (int j = 100 * workers_actual; j > -100 * workers_actual; --j) + for (int j = N * workers_actual; j > -N * workers_actual; --j) #pragma acc loop /* { dg-line l_loop_k[incr c_loop_k] } */ \ vector \ reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_k$c_loop_k } */ /* { dg-optimized {assigned OpenACC vector loop parallelism} {} { target *-*-* } l_loop_k$c_loop_k } */ - for (int k = 100 * vectors_actual; k > -100 * vectors_actual; --k) + for (int k = N * vectors_actual; k > -N * vectors_actual; --k) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); @@ -664,7 +671,7 @@ int main () /* { dg-note {variable 'i' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ - for (int i = 100; i > -100; --i) + for (int i = N; i > -N; --i) { /* This is to make the loop unparallelizable. */ asm volatile ("" : : : "memory"); @@ -714,7 +721,7 @@ int main () /* { dg-note {variable 'i' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ - for (int i = 100; i > -100; --i) + for (int i = N; i > -N; --i) { /* This is to make the loop unparallelizable. */ asm volatile ("" : : : "memory"); @@ -745,7 +752,7 @@ int main () /* { dg-note {variable 'i' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute$c_compute } */ /* { dg-warning {using 'vector_length \(32\)', ignoring 1} {} { target openacc_nvidia_accel_selected } l_compute$c_compute } */ { - for (int i = 100; i > -100; i--) + for (int i = N; i > -N; i--) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); @@ -789,20 +796,20 @@ int main () /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ /* { dg-optimized {assigned OpenACC gang loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ - for (int i = 100; i > -100; i--) + for (int i = N; i > -N; i--) #pragma acc loop /* { dg-line l_loop_j[incr c_loop_j] } */ \ worker \ reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_j$c_loop_j } */ /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_j$c_loop_j } */ /* { dg-optimized {assigned OpenACC worker loop parallelism} {} { target *-*-* } l_loop_j$c_loop_j } */ - for (int j = 100; j > -100; j--) + for (int j = N; j > -N; j--) #pragma acc loop /* { dg-line l_loop_k[incr c_loop_k] } */ \ vector \ reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_k$c_loop_k } */ /* { dg-optimized {assigned OpenACC vector loop parallelism} {} { target *-*-* } l_loop_k$c_loop_k } */ - for (int k = 100 * vectors_actual; k > -100 * vectors_actual; k--) + for (int k = N * vectors_actual; k > -N * vectors_actual; k--) { gangs_min = gangs_max = acc_gang (); workers_min = workers_max = acc_worker (); diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vred2d-128.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vred2d-128.c index 489f26ad9f2..9c182d90a0d 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vred2d-128.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vred2d-128.c @@ -1,10 +1,16 @@ /* Test large vector lengths. */ +/* { dg-additional-options "-DEXPENSIVE" { target run_expensive_tests } } */ + /* { dg-additional-options -Wuninitialized } */ #include +#ifdef EXPENSIVE #define n 10000 +#else +#define n 2500 +#endif int a1[n], a2[n]; #define gentest(name, outer, inner) \ diff --git a/libgomp/testsuite/libgomp.oacc-fortran/parallel-dims.f90 b/libgomp/testsuite/libgomp.oacc-fortran/parallel-dims.f90 index cd3f3555b78..d2050e69eb9 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/parallel-dims.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/parallel-dims.f90 @@ -5,6 +5,9 @@ ! { dg-do run } ! { dg-prune-output "command-line option '-fintrinsic-modules-path=.*' is valid for Fortran but not for C" } +! { dg-additional-options "-DEXPENSIVE" { target run_expensive_tests } } +! { dg-additional-options "-cpp" } + ! { dg-additional-options "-fopt-info-note-omp" } ! { dg-additional-options "--param=openacc-privatization=noisy" } ! { dg-additional-options "-foffload=-fopt-info-note-omp" } @@ -44,6 +47,13 @@ program main integer :: vectors_actual integer :: i, j, k + +#ifdef EXPENSIVE + integer, parameter :: N = 100 +#else + integer, parameter :: N = 50 +#endif + call acc_init (acc_device_default) ! OpenACC parallel construct. @@ -69,7 +79,7 @@ program main !$acc serial & !$acc reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) ! { dg-warning "using .vector_length \\(32\\)., ignoring 1" "" { target openacc_nvidia_accel_selected } } ! { dg-note {variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } - do i = 100, -99, -1 + do i = N, -(N-1), -1 gangs_min = acc_gang (); gangs_max = acc_gang (); workers_min = acc_worker (); @@ -108,14 +118,14 @@ program main end if !$acc loop gang reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } - do i = 100, -99, -1 + do i = N, -(N-1), -1 !$acc loop worker reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) ! { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } ! { dg-note {variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-2 } - do j = 100, -99, -1 + do j = N, -(N-1), -1 !$acc loop vector reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) ! { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } - do k = 100 * vectors_actual, -99 * vectors_actual, -1 + do k = N * vectors_actual, -(N-1) * vectors_actual, -1 gangs_min = acc_gang (); gangs_max = acc_gang (); workers_min = acc_worker (); From d0b938a7612fb7acf1f181da9577235c83ede59e Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Wed, 23 Mar 2022 17:12:29 -0400 Subject: [PATCH 013/157] c++: alignas and alignof void [PR104944] I started looking into this PR because in GCC 4.9 we were able to detect the invalid struct alignas(void) S{}; but I broke it in r210262. It's ill-formed code in C++: [dcl.align]/3: "An alignment-specifier of the form alignas(type-id) has the same effect as alignas(alignof(type-id))", and [expr.align]/1: "The operand shall be a type-id representing a complete object type, or an array thereof, or a reference to one of those types." and void is not a complete type. It's also invalid in C: 6.7.5: _Alignas(type-name) is equivalent to _Alignas(_Alignof(type-name)) 6.5.3.4: "The _Alignof operator shall not be applied to a function type or an incomplete type." We have a GNU extension whereby we treat sizeof(void) as 1, but I assume it doesn't apply to alignof, at least in C++. However, __alignof__(void) is still accepted with a -Wpedantic warning. We still say "invalid application of 'alignof'" rather than 'alignas' in the void diagnostic, but I felt that fixing that may not be suitable as part of this patch. The "incomplete type" diagnostic still always prints '__alignof__'. PR c++/104944 gcc/cp/ChangeLog: * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void). (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with complain == true. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/alignas20.C: New test. --- gcc/cp/typeck.cc | 21 +++++++++++++++------ gcc/testsuite/g++.dg/cpp0x/alignas20.C | 26 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/alignas20.C diff --git a/gcc/cp/typeck.cc b/gcc/cp/typeck.cc index 516fa574ef6..26a7cb4b50d 100644 --- a/gcc/cp/typeck.cc +++ b/gcc/cp/typeck.cc @@ -1873,9 +1873,9 @@ compparms (const_tree parms1, const_tree parms2) } -/* Process a sizeof or alignof expression where the operand is a - type. STD_ALIGNOF indicates whether an alignof has C++11 (minimum alignment) - or GNU (preferred alignment) semantics; it is ignored if op is +/* Process a sizeof or alignof expression where the operand is a type. + STD_ALIGNOF indicates whether an alignof has C++11 (minimum alignment) + or GNU (preferred alignment) semantics; it is ignored if OP is SIZEOF_EXPR. */ tree @@ -1899,6 +1899,13 @@ cxx_sizeof_or_alignof_type (location_t loc, tree type, enum tree_code op, else return error_mark_node; } + else if (VOID_TYPE_P (type) && std_alignof) + { + if (complain) + error_at (loc, "invalid application of %qs to a void type", + OVL_OP_INFO (false, op)->name); + return error_mark_node; + } bool dependent_p = dependent_type_p (type); if (!dependent_p) @@ -2132,11 +2139,13 @@ cxx_alignas_expr (tree e) /* [dcl.align]/3: When the alignment-specifier is of the form - alignas(type-id ), it shall have the same effect as - alignas(alignof(type-id )). */ + alignas(type-id), it shall have the same effect as + alignas(alignof(type-id)). */ return cxx_sizeof_or_alignof_type (input_location, - e, ALIGNOF_EXPR, true, false); + e, ALIGNOF_EXPR, + /*std_alignof=*/true, + /*complain=*/true); /* If we reach this point, it means the alignas expression if of the form "alignas(assignment-expression)", so we should follow diff --git a/gcc/testsuite/g++.dg/cpp0x/alignas20.C b/gcc/testsuite/g++.dg/cpp0x/alignas20.C new file mode 100644 index 00000000000..01a55f3d4a4 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alignas20.C @@ -0,0 +1,26 @@ +// PR c++/104944 +// { dg-do compile { target c++11 } } +// { dg-options "-Wpedantic" } + +struct inc; + +struct alignas(inc) S1 { }; // { dg-error "invalid application" } +struct alignas(void) S2 { }; // { dg-error "invalid application" } + +template +struct alignas(T) S4 {}; // { dg-error "invalid application" } + +template +struct alignas(T) S5 {}; // { dg-error "invalid application" } + +S4 s1; +S5 s2; + +void +g () +{ + auto s1 = alignof(void); // { dg-error "invalid application" } + auto s2 = alignof(const void); // { dg-error "invalid application" } + auto s3 = __alignof(void); // { dg-warning "invalid application" } + auto s4 = alignof(inc); // { dg-error "invalid application" } +} From fe705dce2e1e3e4e5e0c69d7f9adaf7f2777cdc8 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 25 Mar 2022 14:31:25 +0100 Subject: [PATCH 014/157] tree-optimization/105053 - fix reduction chain epilogue generation When we optimize permutations in a reduction chain we have to be careful to select the correct live-out stmt, otherwise the reduction result will be unused and the retained scalar code will execute only the number of vector iterations. 2022-03-25 Richard Biener PR tree-optimization/105053 * tree-vect-loop.cc (vect_create_epilog_for_reduction): Pick the correct live-out stmt for a reduction chain. * g++.dg/vect/pr105053.cc: New testcase. --- gcc/testsuite/g++.dg/vect/pr105053.cc | 25 +++++++++++++++++++++++++ gcc/tree-vect-loop.cc | 14 +++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/g++.dg/vect/pr105053.cc diff --git a/gcc/testsuite/g++.dg/vect/pr105053.cc b/gcc/testsuite/g++.dg/vect/pr105053.cc new file mode 100644 index 00000000000..6deef8458fc --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr105053.cc @@ -0,0 +1,25 @@ +// { dg-require-effective-target c++11 } +// { dg-require-effective-target int32plus } + +#include +#include +#include + +int main() +{ + const int n = 4; + std::vector> vec + = { { 1597201307, 1817606674, 0. }, + { 1380347796, 1721941769, 0.}, + {837975613, 1032707773, 0.}, + {1173654292, 2020064272, 0.} } ; + int sup1 = 0; + for(int i=0;i(vec[i]),std::get<1>(vec[i]))); + int sup2 = 0; + for(int i=0;i(vec[i])),std::get<1>(vec[i])); + if (sup1 != sup2) + std::abort (); + return 0; +} diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 7a74633e0b4..d7bc34636bd 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -5271,9 +5271,17 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo, /* All statements produce live-out values. */ live_out_stmts = SLP_TREE_SCALAR_STMTS (slp_node); else if (slp_node) - /* The last statement in the reduction chain produces the live-out - value. */ - single_live_out_stmt[0] = SLP_TREE_SCALAR_STMTS (slp_node)[group_size - 1]; + { + /* The last statement in the reduction chain produces the live-out + value. Note SLP optimization can shuffle scalar stmts to + optimize permutations so we have to search for the last stmt. */ + for (k = 0; k < group_size; ++k) + if (!REDUC_GROUP_NEXT_ELEMENT (SLP_TREE_SCALAR_STMTS (slp_node)[k])) + { + single_live_out_stmt[0] = SLP_TREE_SCALAR_STMTS (slp_node)[k]; + break; + } + } unsigned vec_num; int ncopies; From 25725506b85f478076770942d76799c54310c696 Mon Sep 17 00:00:00 2001 From: "Vladimir N. Makarov" Date: Fri, 25 Mar 2022 12:22:08 -0400 Subject: [PATCH 015/157] [PR104971] LRA: check live hard regs to remove a dead insn LRA removes insn modifying sp for given PR test set. We should also have checked living hard regs to prevent this. The patch fixes this. gcc/ChangeLog: PR middle-end/104971 * lra-lives.cc (process_bb_lives): Check hard_regs_live for hard regs to clear remove_p flag. --- gcc/lra-lives.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/lra-lives.cc b/gcc/lra-lives.cc index 796f00629b4..a755464ee81 100644 --- a/gcc/lra-lives.cc +++ b/gcc/lra-lives.cc @@ -724,7 +724,10 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p) bool remove_p = true; for (reg = curr_id->regs; reg != NULL; reg = reg->next) - if (reg->type != OP_IN && sparseset_bit_p (pseudos_live, reg->regno)) + if (reg->type != OP_IN + && (reg->regno < FIRST_PSEUDO_REGISTER + ? TEST_HARD_REG_BIT (hard_regs_live, reg->regno) + : sparseset_bit_p (pseudos_live, reg->regno))) { remove_p = false; break; From 3ab5c8cd03d92bf4ec41e351820349d92fbc40c4 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Fri, 18 Mar 2022 08:30:00 +0000 Subject: [PATCH 016/157] arm: Revert Auto-vectorization for MVE: add pack/unpack patterns PR target/104882 This reverts commit r12-1434-g046a3beb1673bf to fix PR target/104882. As discussed in the PR, it turns out that the MVE ISA has no natural mapping with GCC's vec_pack_trunc / vec_unpack standard patterns, unlike Neon or SVE for instance. This patch also adds the executable testcase provided in the PR. This test passes at -O3 because the generated code does not need to use the pack/unpack patterns, hence the use of -O2 which now triggers vectorization since a few months ago. 2022-03-18 Christophe Lyon PR target/104882 Revert 2021-06-11 Christophe Lyon gcc/ * config/arm/mve.md (mve_vec_unpack_lo_): Delete. (mve_vec_unpack_hi_): Delete. (@mve_vec_pack_trunc_lo_): Delete. (mve_vmovntq_): Remove '@' prefix. * config/arm/neon.md (vec_unpack_hi_): Move back from vec-common.md. (vec_unpack_lo_): Likewise. (vec_pack_trunc_): Rename from neon_quad_vec_pack_trunc_. * config/arm/vec-common.md (vec_unpack_hi_): Delete. (vec_unpack_lo_): Delete. (vec_pack_trunc_): Delete. PR target/104882 gcc/testsuite/ * gcc.target/arm/simd/mve-vclz.c: Update expected results. * gcc.target/arm/simd/mve-vshl.c: Likewise. * gcc.target/arm/simd/mve-vec-pack.c: Delete. * gcc.target/arm/simd/mve-vec-unpack.c: Delete. * gcc.target/arm/simd/pr104882.c: New test. --- gcc/config/arm/mve.md | 35 +-------- gcc/config/arm/neon.md | 39 +++++++++- gcc/config/arm/vec-common.md | 71 ------------------- gcc/testsuite/gcc.target/arm/simd/mve-vclz.c | 7 +- .../gcc.target/arm/simd/mve-vec-pack.c | 26 ------- .../gcc.target/arm/simd/mve-vec-unpack.c | 29 -------- gcc/testsuite/gcc.target/arm/simd/mve-vshl.c | 5 +- gcc/testsuite/gcc.target/arm/simd/pr104882.c | 16 +++++ 8 files changed, 59 insertions(+), 169 deletions(-) delete mode 100644 gcc/testsuite/gcc.target/arm/simd/mve-vec-pack.c delete mode 100644 gcc/testsuite/gcc.target/arm/simd/mve-vec-unpack.c create mode 100644 gcc/testsuite/gcc.target/arm/simd/pr104882.c diff --git a/gcc/config/arm/mve.md b/gcc/config/arm/mve.md index 908bedc9254..369d7a79f6c 100644 --- a/gcc/config/arm/mve.md +++ b/gcc/config/arm/mve.md @@ -535,26 +535,6 @@ [(set_attr "type" "mve_move") ]) -(define_insn "mve_vec_unpack_lo_" - [(set (match_operand: 0 "register_operand" "=w") - (SE: (vec_select: - (match_operand:MVE_3 1 "register_operand" "w") - (match_operand:MVE_3 2 "vect_par_constant_low" ""))))] - "TARGET_HAVE_MVE" - "vmovlb.%# %q0, %q1" - [(set_attr "type" "mve_move")] -) - -(define_insn "mve_vec_unpack_hi_" - [(set (match_operand: 0 "register_operand" "=w") - (SE: (vec_select: - (match_operand:MVE_3 1 "register_operand" "w") - (match_operand:MVE_3 2 "vect_par_constant_high" ""))))] - "TARGET_HAVE_MVE" - "vmovlt.%# %q0, %q1" - [(set_attr "type" "mve_move")] -) - ;; ;; [vcvtpq_s, vcvtpq_u]) ;; @@ -2219,23 +2199,10 @@ [(set_attr "type" "mve_move") ]) -;; vmovnb pattern used by the vec_pack_trunc expander to avoid the -;; need for an uninitialized input operand. -(define_insn "@mve_vec_pack_trunc_lo_" - [ - (set (match_operand: 0 "s_register_operand" "=w") - (unspec: [(match_operand:MVE_5 1 "s_register_operand" "w")] - VMOVNBQ_S)) - ] - "TARGET_HAVE_MVE" - "vmovnb.i%# %q0, %q1" - [(set_attr "type" "mve_move") -]) - ;; ;; [vmovntq_s, vmovntq_u]) ;; -(define_insn "@mve_vmovntq_" +(define_insn "mve_vmovntq_" [ (set (match_operand: 0 "s_register_operand" "=w") (unspec: [(match_operand: 1 "s_register_operand" "0") diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index f270ded4978..275bcc1435e 100644 --- a/gcc/config/arm/neon.md +++ b/gcc/config/arm/neon.md @@ -6005,6 +6005,43 @@ if (BYTES_BIG_ENDIAN) [(set_attr "type" "neon_shift_imm_long")] ) +(define_expand "vec_unpack_hi_" + [(match_operand: 0 "register_operand") + (SE: (match_operand:VU 1 "register_operand"))] + "TARGET_NEON && !BYTES_BIG_ENDIAN" + { + rtvec v = rtvec_alloc (/2) ; + rtx t1; + int i; + for (i = 0; i < (/2); i++) + RTVEC_ELT (v, i) = GEN_INT ((/2) + i); + + t1 = gen_rtx_PARALLEL (mode, v); + emit_insn (gen_neon_vec_unpack_hi_ (operands[0], + operands[1], + t1)); + DONE; + } +) + +(define_expand "vec_unpack_lo_" + [(match_operand: 0 "register_operand") + (SE: (match_operand:VU 1 "register_operand"))] + "TARGET_NEON && !BYTES_BIG_ENDIAN" + { + rtvec v = rtvec_alloc (/2) ; + rtx t1; + int i; + for (i = 0; i < (/2) ; i++) + RTVEC_ELT (v, i) = GEN_INT (i); + t1 = gen_rtx_PARALLEL (mode, v); + emit_insn (gen_neon_vec_unpack_lo_ (operands[0], + operands[1], + t1)); + DONE; + } +) + (define_insn "neon_vec_mult_lo_" [(set (match_operand: 0 "register_operand" "=w") (mult: (SE: (vec_select: @@ -6220,7 +6257,7 @@ if (BYTES_BIG_ENDIAN) ; because the ordering of vector elements in Q registers is different from what ; the semantics of the instructions require. -(define_insn "neon_quad_vec_pack_trunc_" +(define_insn "vec_pack_trunc_" [(set (match_operand: 0 "register_operand" "=&w") (vec_concat: (truncate: diff --git a/gcc/config/arm/vec-common.md b/gcc/config/arm/vec-common.md index f13009090af..fd878cba22d 100644 --- a/gcc/config/arm/vec-common.md +++ b/gcc/config/arm/vec-common.md @@ -580,77 +580,6 @@ "ARM_HAVE__ARITH && !TARGET_REALLY_IWMMXT" ) - -;; vmovl[tb] are not available for V4SI on MVE -(define_expand "vec_unpack_hi_" - [(set (match_operand: 0 "register_operand") - (SE: (vec_select: - (match_operand:VU 1 "register_operand") - (match_dup 2))))] - "ARM_HAVE__ARITH - && !TARGET_REALLY_IWMMXT - && ! (mode == V4SImode && TARGET_HAVE_MVE) - && !BYTES_BIG_ENDIAN" - { - rtvec v = rtvec_alloc (/2); - int i; - for (i = 0; i < (/2); i++) - RTVEC_ELT (v, i) = GEN_INT ((/2) + i); - - operands[2] = gen_rtx_PARALLEL (mode, v); - } -) - -;; vmovl[tb] are not available for V4SI on MVE -(define_expand "vec_unpack_lo_" - [(set (match_operand: 0 "register_operand") - (SE: (vec_select: - (match_operand:VU 1 "register_operand") - (match_dup 2))))] - "ARM_HAVE__ARITH - && !TARGET_REALLY_IWMMXT - && ! (mode == V4SImode && TARGET_HAVE_MVE) - && !BYTES_BIG_ENDIAN" - { - rtvec v = rtvec_alloc (/2); - int i; - for (i = 0; i < (/2) ; i++) - RTVEC_ELT (v, i) = GEN_INT (i); - - operands[2] = gen_rtx_PARALLEL (mode, v); - - } -) - -;; vmovn[tb] are not available for V2DI on MVE -(define_expand "vec_pack_trunc_" - [(set (match_operand: 0 "register_operand") - (vec_concat: - (truncate: - (match_operand:VN 1 "register_operand")) - (truncate: - (match_operand:VN 2 "register_operand"))))] - "ARM_HAVE__ARITH - && !TARGET_REALLY_IWMMXT - && ! (mode == V2DImode && TARGET_HAVE_MVE) - && !BYTES_BIG_ENDIAN" - { - if (TARGET_NEON) - { - emit_insn (gen_neon_quad_vec_pack_trunc_ (operands[0], operands[1], - operands[2])); - } - else - { - rtx tmpreg = gen_reg_rtx (mode); - emit_insn (gen_mve_vec_pack_trunc_lo (mode, tmpreg, operands[1])); - emit_insn (gen_mve_vmovntq (VMOVNTQ_S, mode, - operands[0], tmpreg, operands[2])); - } - DONE; - } -) - (define_expand "vec_init" [(match_operand:VDQX 0 "s_register_operand") (match_operand 1 "" "")] diff --git a/gcc/testsuite/gcc.target/arm/simd/mve-vclz.c b/gcc/testsuite/gcc.target/arm/simd/mve-vclz.c index 5d6e991cfc6..7068736bc28 100644 --- a/gcc/testsuite/gcc.target/arm/simd/mve-vclz.c +++ b/gcc/testsuite/gcc.target/arm/simd/mve-vclz.c @@ -21,9 +21,8 @@ FUNC(u, uint, 16, clz) FUNC(s, int, 8, clz) FUNC(u, uint, 8, clz) -/* 16 and 8-bit versions still use 32-bit intermediate temporaries, so for - instance instead of using vclz.i8, we need 4 vclz.i32, leading to a total of - 14 vclz.i32 expected in this testcase. */ -/* { dg-final { scan-assembler-times {vclz\.i32 q[0-9]+, q[0-9]+} 14 } } */ +/* 16 and 8-bit versions are not vectorized because they need pack/unpack + patterns since __builtin_clz uses 32-bit parameter and return value. */ +/* { dg-final { scan-assembler-times {vclz\.i32 q[0-9]+, q[0-9]+} 2 } } */ /* { dg-final { scan-assembler-times {vclz\.i16 q[0-9]+, q[0-9]+} 2 { xfail *-*-* } } } */ /* { dg-final { scan-assembler-times {vclz\.i8 q[0-9]+, q[0-9]+} 2 { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.target/arm/simd/mve-vec-pack.c b/gcc/testsuite/gcc.target/arm/simd/mve-vec-pack.c deleted file mode 100644 index 43642b2fec5..00000000000 --- a/gcc/testsuite/gcc.target/arm/simd/mve-vec-pack.c +++ /dev/null @@ -1,26 +0,0 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target arm_v8_1m_mve_ok } */ -/* { dg-add-options arm_v8_1m_mve } */ -/* { dg-additional-options "-O3" } */ - -#include - -#define FUNC(SIGN, TYPE, DSTBITS, BITS, NAME) \ - void test_ ## NAME ##_ ## SIGN ## BITS (TYPE##DSTBITS##_t * __restrict__ dest, \ - TYPE##BITS##_t *a) { \ - int i; \ - for (i=0; i < (256 / BITS); i++) { \ - dest[i] = a[i]; \ - } \ - } - -FUNC(s, int, 16, 32, pack) -FUNC(u, uint, 16, 32, pack) -FUNC(s, int, 8, 16, pack) -FUNC(u, uint, 8, 16, pack) - -/* { dg-final { scan-assembler-times {vmovnt\.i32\tq[0-9]+, q[0-9]+} 2 } } */ -/* { dg-final { scan-assembler-times {vmovnb\.i32\tq[0-9]+, q[0-9]+} 2 } } */ -/* { dg-final { scan-assembler-times {vmovnt\.i16\tq[0-9]+, q[0-9]+} 2 } } */ -/* { dg-final { scan-assembler-times {vmovnb\.i16\tq[0-9]+, q[0-9]+} 2 } } */ -/* { dg-final { scan-assembler-not {vldr\.64\td[0-9]+, \.L} } } */ diff --git a/gcc/testsuite/gcc.target/arm/simd/mve-vec-unpack.c b/gcc/testsuite/gcc.target/arm/simd/mve-vec-unpack.c deleted file mode 100644 index cdc62f854ad..00000000000 --- a/gcc/testsuite/gcc.target/arm/simd/mve-vec-unpack.c +++ /dev/null @@ -1,29 +0,0 @@ -/* { dg-do compile } */ -/* { dg-require-effective-target arm_v8_1m_mve_ok } */ -/* { dg-add-options arm_v8_1m_mve } */ -/* { dg-additional-options "-O3" } */ - -#include - -#define FUNC(SIGN, TYPE, DSTBITS, BITS, NAME) \ - void test_ ## NAME ##_ ## SIGN ## BITS (TYPE##DSTBITS##_t * __restrict__ dest, \ - TYPE##BITS##_t *a) { \ - int i; \ - for (i=0; i < (128 / BITS); i++) { \ - dest[i] = a[i]; \ - } \ - } - -FUNC(s, int, 32, 16, unpack) -FUNC(u, uint, 32, 16, unpack) -FUNC(s, int, 16, 8, unpack) -FUNC(u, uint, 16, 8, unpack) - -/* { dg-final { scan-assembler-times {vmovlt\.s16 q[0-9]+, q[0-9]+} 1 } } */ -/* { dg-final { scan-assembler-times {vmovlb\.s16 q[0-9]+, q[0-9]+} 1 } } */ -/* { dg-final { scan-assembler-times {vmovlt\.u16 q[0-9]+, q[0-9]+} 1 } } */ -/* { dg-final { scan-assembler-times {vmovlb\.u16 q[0-9]+, q[0-9]+} 1 } } */ -/* { dg-final { scan-assembler-times {vmovlt\.s8 q[0-9]+, q[0-9]+} 1 } } */ -/* { dg-final { scan-assembler-times {vmovlb\.s8 q[0-9]+, q[0-9]+} 1 } } */ -/* { dg-final { scan-assembler-times {vmovlt\.u8 q[0-9]+, q[0-9]+} 1 } } */ -/* { dg-final { scan-assembler-times {vmovlb\.u8 q[0-9]+, q[0-9]+} 1 } } */ diff --git a/gcc/testsuite/gcc.target/arm/simd/mve-vshl.c b/gcc/testsuite/gcc.target/arm/simd/mve-vshl.c index 91dd942d818..7a0644997c8 100644 --- a/gcc/testsuite/gcc.target/arm/simd/mve-vshl.c +++ b/gcc/testsuite/gcc.target/arm/simd/mve-vshl.c @@ -56,10 +56,7 @@ FUNC_IMM(u, uint, 8, 16, <<, vshlimm) /* MVE has only 128-bit vectors, so we can vectorize only half of the functions above. */ /* We only emit vshl.u, which is equivalent to vshl.s anyway. */ -/* 16 and 8-bit versions still use 32-bit intermediate temporaries, so for - instance instead of using vshl.u8, we need 4 vshl.i32, leading to a total of - 14 vshl.i32 expected in this testcase. */ -/* { dg-final { scan-assembler-times {vshl.u[0-9]+\tq[0-9]+, q[0-9]+} 14 } } */ +/* { dg-final { scan-assembler-times {vshl.u[0-9]+\tq[0-9]+, q[0-9]+} 2 } } */ /* We emit vshl.i when the shift amount is an immediate. */ /* { dg-final { scan-assembler-times {vshl.i[0-9]+\tq[0-9]+, q[0-9]+} 6 } } */ diff --git a/gcc/testsuite/gcc.target/arm/simd/pr104882.c b/gcc/testsuite/gcc.target/arm/simd/pr104882.c new file mode 100644 index 00000000000..ae9709af42f --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/simd/pr104882.c @@ -0,0 +1,16 @@ +/* { dg-do run } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ +/* { dg-additional-options "-O2" } */ + +int i; +char src[1072]; +char dst[72]; +int main() { + for (i = 0; i < 128; i++) + src[i] = i; + __builtin_memcpy(dst, src, 7); + for (i = 0; i < 7; i++) + if (dst[i] != i) + __builtin_abort(); +} From 674ec679059bca34099618b1987287b60ab12029 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 23 Mar 2022 12:16:25 +0000 Subject: [PATCH 017/157] libstdc++: Add more doxygen comments in libstdc++-v3/ChangeLog: * include/std/bit (bit_cast, byteswap, endian): Add doxygen comments. --- libstdc++-v3/include/std/bit | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit index a40f1ce99df..ef19d649e32 100644 --- a/libstdc++-v3/include/std/bit +++ b/libstdc++-v3/include/std/bit @@ -69,6 +69,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #define __cpp_lib_bit_cast 201806L /// Create a value of type `To` from the bits of `from`. + /** + * @tparam _To A trivially-copyable type. + * @param __from A trivially-copyable object of the same size as `_To`. + * @return An object of type `_To`. + * @since C++20 + */ template [[nodiscard]] constexpr _To @@ -86,6 +92,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #define __cpp_lib_byteswap 202110L /// Reverse order of bytes in the object representation of `value`. + /** + * @tparam _Tp An integral type. + * @param __value An object of integer type. + * @return An object of the same type, with the bytes reversed. + * @since C++23 + */ template [[nodiscard]] constexpr enable_if_t::value, _Tp> @@ -444,7 +456,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #define __cpp_lib_endian 201907L - /// Byte order + /// Byte order constants + /** + * The platform endianness can be checked by comparing `std::endian::native` + * to one of `std::endian::big` or `std::endian::little`. + * + * @since C++20 + */ enum class endian { little = __ORDER_LITTLE_ENDIAN__, From bdd7b679e8497c07e25726f6ab6429e4c4d429c7 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 25 Mar 2022 13:53:34 -0700 Subject: [PATCH 018/157] x86: Use -msse2 on gcc.target/i386/pr95483-1.c Replace -msse with -msse2 since requires SSE2. PR testsuite/105055 * gcc.target/i386/pr95483-1.c: Replace -msse with -msse2. --- gcc/testsuite/gcc.target/i386/pr95483-1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/i386/pr95483-1.c b/gcc/testsuite/gcc.target/i386/pr95483-1.c index 6b008261f35..0f3e0bf9280 100644 --- a/gcc/testsuite/gcc.target/i386/pr95483-1.c +++ b/gcc/testsuite/gcc.target/i386/pr95483-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -msse" } */ +/* { dg-options "-O2 -msse2" } */ /* { dg-final { scan-assembler-times "pxor\[ \\t\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "pinsrw\[ \\t\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "pextrw\[ \\t\]+\[^\n\]*%xmm\[0-9\]+\[^\n\]*(?:\n|\[ \\t\]+#)" 1 } } */ From 81faedaa8e2819fc0ffda4ce0a888065a6d7a535 Mon Sep 17 00:00:00 2001 From: Peter Bergner Date: Fri, 25 Mar 2022 17:59:07 -0500 Subject: [PATCH 019/157] rs6000: Update testsuite to use -mdejagnu-cpu= and -mdejagnu-tune= options This patch updates the POWER testsuite test cases using -mcpu= and -mtune= to use the preferred -mdejagnu-cpu= and -mdejagnu-tune= options. This also obviates the need for the dg-skip-if directive, since the user cannot override the -mcpu= value being used to compile the test case. 2022-03-25 Peter Bergner gcc/testsuite/ * g++.dg/pr65240-1.C: Use -mdejagnu-cpu=. Remove dg-skip-if. * g++.dg/pr65240-2.C: Likewise. * g++.dg/pr65240-3.C: Likewise. * g++.dg/pr65240-4.C: Likewise. * g++.dg/pr65242.C: Likewise. * g++.dg/pr67211.C: Likewise. * g++.dg/pr69667.C: Likewise. * g++.dg/pr71294.C: Likewise. * g++.dg/pr84279.C: Likewise. * g++.dg/torture/ppc-ldst-array.C: Likewise. * gfortran.dg/nint_p7.f90: Likewise. * gfortran.dg/pr102860.f90: Likewise. * gcc.target/powerpc/fusion.c: Use -mdejagnu-cpu= and -mdejagnu-tune=. * gcc.target/powerpc/fusion2.c: Likewise. * gcc.target/powerpc/int_128bit-runnable.c: Use -mdejagnu-cpu=. * gcc.target/powerpc/test_mffsl.c: Likewise. * gfortran.dg/pr47614.f: Likewise. * gfortran.dg/pr58968.f: Likewise. --- gcc/testsuite/g++.dg/pr65240-1.C | 3 +-- gcc/testsuite/g++.dg/pr65240-2.C | 3 +-- gcc/testsuite/g++.dg/pr65240-3.C | 3 +-- gcc/testsuite/g++.dg/pr65240-4.C | 3 +-- gcc/testsuite/g++.dg/pr65242.C | 3 +-- gcc/testsuite/g++.dg/pr67211.C | 3 +-- gcc/testsuite/g++.dg/pr69667.C | 3 +-- gcc/testsuite/g++.dg/pr71294.C | 3 +-- gcc/testsuite/g++.dg/pr84279.C | 3 +-- gcc/testsuite/g++.dg/torture/ppc-ldst-array.C | 3 +-- gcc/testsuite/gcc.target/powerpc/fusion.c | 2 +- gcc/testsuite/gcc.target/powerpc/fusion2.c | 2 +- gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c | 2 +- gcc/testsuite/gcc.target/powerpc/test_mffsl.c | 2 +- gcc/testsuite/gfortran.dg/nint_p7.f90 | 3 +-- gcc/testsuite/gfortran.dg/pr102860.f90 | 3 +-- gcc/testsuite/gfortran.dg/pr47614.f | 2 +- gcc/testsuite/gfortran.dg/pr58968.f | 2 +- 18 files changed, 18 insertions(+), 30 deletions(-) diff --git a/gcc/testsuite/g++.dg/pr65240-1.C b/gcc/testsuite/g++.dg/pr65240-1.C index d2e25b65fca..ff8910df6a1 100644 --- a/gcc/testsuite/g++.dg/pr65240-1.C +++ b/gcc/testsuite/g++.dg/pr65240-1.C @@ -1,8 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-require-effective-target powerpc_p8vector_ok } */ -/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ -/* { dg-options "-mcpu=power8 -O3 -ffast-math -mcmodel=small -mno-fp-in-toc -Wno-return-type" } */ +/* { dg-options "-mdejagnu-cpu=power8 -O3 -ffast-math -mcmodel=small -mno-fp-in-toc -Wno-return-type" } */ /* target/65240, compiler got a 'insn does not satisfy its constraints' error. */ diff --git a/gcc/testsuite/g++.dg/pr65240-2.C b/gcc/testsuite/g++.dg/pr65240-2.C index 38d5020bd19..bdb7a62d73d 100644 --- a/gcc/testsuite/g++.dg/pr65240-2.C +++ b/gcc/testsuite/g++.dg/pr65240-2.C @@ -1,8 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-require-effective-target powerpc_p8vector_ok } */ -/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ -/* { dg-options "-mcpu=power8 -O3 -ffast-math -mcmodel=small -mfp-in-toc -Wno-return-type" } */ +/* { dg-options "-mdejagnu-cpu=power8 -O3 -ffast-math -mcmodel=small -mfp-in-toc -Wno-return-type" } */ /* target/65240, compiler got a 'insn does not satisfy its constraints' error. */ diff --git a/gcc/testsuite/g++.dg/pr65240-3.C b/gcc/testsuite/g++.dg/pr65240-3.C index e8463c91494..f37db9025d1 100644 --- a/gcc/testsuite/g++.dg/pr65240-3.C +++ b/gcc/testsuite/g++.dg/pr65240-3.C @@ -1,8 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-require-effective-target powerpc_p8vector_ok } */ -/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ -/* { dg-options "-mcpu=power8 -O3 -ffast-math -mcmodel=medium -Wno-return-type" } */ +/* { dg-options "-mdejagnu-cpu=power8 -O3 -ffast-math -mcmodel=medium -Wno-return-type" } */ /* target/65240, compiler got a 'insn does not satisfy its constraints' error. */ diff --git a/gcc/testsuite/g++.dg/pr65240-4.C b/gcc/testsuite/g++.dg/pr65240-4.C index a119752d18e..efb6a6c06e7 100644 --- a/gcc/testsuite/g++.dg/pr65240-4.C +++ b/gcc/testsuite/g++.dg/pr65240-4.C @@ -1,8 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-require-effective-target powerpc_vsx_ok } */ -/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ -/* { dg-options "-mcpu=power7 -O3 -ffast-math -Wno-return-type" } */ +/* { dg-options "-mdejagnu-cpu=power7 -O3 -ffast-math -Wno-return-type" } */ /* target/65240, compiler got a 'insn does not satisfy its constraints' error. */ diff --git a/gcc/testsuite/g++.dg/pr65242.C b/gcc/testsuite/g++.dg/pr65242.C index be2ddaa85b2..662f375015f 100644 --- a/gcc/testsuite/g++.dg/pr65242.C +++ b/gcc/testsuite/g++.dg/pr65242.C @@ -1,8 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-require-effective-target powerpc_p8vector_ok } */ -/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ -/* { dg-options "-mcpu=power8 -O3" } */ +/* { dg-options "-mdejagnu-cpu=power8 -O3" } */ class A { public: diff --git a/gcc/testsuite/g++.dg/pr67211.C b/gcc/testsuite/g++.dg/pr67211.C index cb3d342c122..ac241818ab5 100644 --- a/gcc/testsuite/g++.dg/pr67211.C +++ b/gcc/testsuite/g++.dg/pr67211.C @@ -1,8 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-require-effective-target powerpc_p8vector_ok } */ -/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ -/* { dg-options "-mcpu=power7 -mtune=power8 -O3 -w" } */ +/* { dg-options "-mdejagnu-cpu=power7 -mdejagnu-tune=power8 -O3 -w" } */ /* target/67211, compiler got a 'insn does not satisfy its constraints' error. */ diff --git a/gcc/testsuite/g++.dg/pr69667.C b/gcc/testsuite/g++.dg/pr69667.C index 76f7cb3d40b..422116dd599 100644 --- a/gcc/testsuite/g++.dg/pr69667.C +++ b/gcc/testsuite/g++.dg/pr69667.C @@ -1,8 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-require-effective-target powerpc_p8vector_ok } */ -/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ -/* { dg-options "-mcpu=power8 -w -std=c++14" } */ +/* { dg-options "-mdejagnu-cpu=power8 -w -std=c++14" } */ /* target/69667, compiler got internal compiler error: Max. number of generated reload insns per insn is achieved (90) */ diff --git a/gcc/testsuite/g++.dg/pr71294.C b/gcc/testsuite/g++.dg/pr71294.C index 67675dd7e30..716fa0d44b2 100644 --- a/gcc/testsuite/g++.dg/pr71294.C +++ b/gcc/testsuite/g++.dg/pr71294.C @@ -1,7 +1,6 @@ // { dg-do compile { target { powerpc64*-*-* && lp64 } } } // { dg-require-effective-target powerpc_p8vector_ok } */ -// { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } -// { dg-options "-mcpu=power8 -O3 -fstack-protector" } +// { dg-options "-mdejagnu-cpu=power8 -O3 -fstack-protector" } // PAR target/71294 failed because RELOAD could not figure how create a V2DI // vector that auto vectorization created with each element being the same diff --git a/gcc/testsuite/g++.dg/pr84279.C b/gcc/testsuite/g++.dg/pr84279.C index b2b5b8eabab..e78201c30db 100644 --- a/gcc/testsuite/g++.dg/pr84279.C +++ b/gcc/testsuite/g++.dg/pr84279.C @@ -2,8 +2,7 @@ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-require-effective-target powerpc_p8vector_ok } */ /* { dg-require-effective-target fpic } */ -/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ -/* { dg-options "-O3 -mcpu=power8 -g -fPIC -fvisibility=hidden -fstack-protector-strong" } */ +/* { dg-options "-O3 -mdejagnu-cpu=power8 -g -fPIC -fvisibility=hidden -fstack-protector-strong" } */ template struct E { T e; }; struct J { diff --git a/gcc/testsuite/g++.dg/torture/ppc-ldst-array.C b/gcc/testsuite/g++.dg/torture/ppc-ldst-array.C index 75862e2b5be..fef69e7cf09 100644 --- a/gcc/testsuite/g++.dg/torture/ppc-ldst-array.C +++ b/gcc/testsuite/g++.dg/torture/ppc-ldst-array.C @@ -1,6 +1,5 @@ /* { dg-do compile { target { powerpc64*-*-* } } } */ -/* { dg-skip-if "do not override mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ -/* { dg-options "-mcpu=power8" } */ +/* { dg-options "-mdejagnu-cpu=power8" } */ /* When compiled with C++, this code was breaking because of different tree representations of arrays between C and C++. */ diff --git a/gcc/testsuite/gcc.target/powerpc/fusion.c b/gcc/testsuite/gcc.target/powerpc/fusion.c index 876b9f54d5a..2a115580439 100644 --- a/gcc/testsuite/gcc.target/powerpc/fusion.c +++ b/gcc/testsuite/gcc.target/powerpc/fusion.c @@ -1,7 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-require-effective-target powerpc_p8vector_ok } */ -/* { dg-options "-mdejagnu-cpu=power7 -mtune=power8 -O3 -dp" } */ +/* { dg-options "-mdejagnu-cpu=power7 -mdejagnu-tune=power8 -O3 -dp" } */ #define LARGE 0x12345 diff --git a/gcc/testsuite/gcc.target/powerpc/fusion2.c b/gcc/testsuite/gcc.target/powerpc/fusion2.c index b3f457a28e2..40ca00a7405 100644 --- a/gcc/testsuite/gcc.target/powerpc/fusion2.c +++ b/gcc/testsuite/gcc.target/powerpc/fusion2.c @@ -2,7 +2,7 @@ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-skip-if "" { powerpc*le-*-* } } */ /* { dg-require-effective-target powerpc_p8vector_ok } */ -/* { dg-options "-mdejagnu-cpu=power7 -mtune=power8 -O3" } */ +/* { dg-options "-mdejagnu-cpu=power7 -mdejagnu-tune=power8 -O3" } */ vector double fusion_vector (vector double *p) { return p[2]; } diff --git a/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c index 1356793635a..1afb00262a1 100644 --- a/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c +++ b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mcpu=power10 -save-temps" } */ +/* { dg-options "-mdejagnu-cpu=power10 -save-temps" } */ /* { dg-require-effective-target power10_hw } */ /* Check that the expected 128-bit instructions are generated if the processor diff --git a/gcc/testsuite/gcc.target/powerpc/test_mffsl.c b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c index f1f960c51c7..3a04dd2b33a 100644 --- a/gcc/testsuite/gcc.target/powerpc/test_mffsl.c +++ b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c @@ -1,5 +1,5 @@ /* { dg-do run { target { powerpc*-*-* } } } */ -/* { dg-options "-O2 -std=c99 -mcpu=power9" } */ +/* { dg-options "-O2 -std=c99 -mdejagnu-cpu=power9" } */ /* { dg-require-effective-target p9vector_hw } */ #ifdef DEBUG diff --git a/gcc/testsuite/gfortran.dg/nint_p7.f90 b/gcc/testsuite/gfortran.dg/nint_p7.f90 index 8f3552293c5..2239824a7fb 100644 --- a/gcc/testsuite/gfortran.dg/nint_p7.f90 +++ b/gcc/testsuite/gfortran.dg/nint_p7.f90 @@ -1,8 +1,7 @@ ! Fortran ! { dg-do compile { target { powerpc*-*-* } } } ! { dg-require-effective-target powerpc_vsx_ok } -! { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } -! { dg-options "-O2 -mcpu=power7 -ffast-math" } +! { dg-options "-O2 -mdejagnu-cpu=power7 -ffast-math" } ! { dg-final { scan-assembler-times "xsrdpi" 2 } } subroutine test_nint(x4,x8) diff --git a/gcc/testsuite/gfortran.dg/pr102860.f90 b/gcc/testsuite/gfortran.dg/pr102860.f90 index d0a7356c0f5..6b1feaa9d79 100644 --- a/gcc/testsuite/gfortran.dg/pr102860.f90 +++ b/gcc/testsuite/gfortran.dg/pr102860.f90 @@ -1,8 +1,7 @@ ! PR middle-end/102860 ! { dg-do compile { target { powerpc*-*-* } } } ! { dg-require-effective-target powerpc_vsx_ok } -! { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power10" } } -! { dg-options "-O2 -mcpu=power10" } +! { dg-options "-O2 -mdejagnu-cpu=power10" } function foo(a) integer(kind=4) :: a(1024) diff --git a/gcc/testsuite/gfortran.dg/pr47614.f b/gcc/testsuite/gfortran.dg/pr47614.f index 6be2c96074e..d772eef257f 100644 --- a/gcc/testsuite/gfortran.dg/pr47614.f +++ b/gcc/testsuite/gfortran.dg/pr47614.f @@ -1,6 +1,6 @@ ! { dg-do run { target { powerpc*-*-* } } } ! { dg-skip-if "" { powerpc*-*-darwin* } } -! { dg-options "-O3 -funroll-loops -ffast-math -mcpu=power4" } +! { dg-options "-O3 -funroll-loops -ffast-math -mdejagnu-cpu=power4" } ! { dg-options "-O3 -funroll-loops -ffast-math" { target powerpc64le*-*-linux* } } diff --git a/gcc/testsuite/gfortran.dg/pr58968.f b/gcc/testsuite/gfortran.dg/pr58968.f index b6ea17f4ae2..a7f1e1e710b 100644 --- a/gcc/testsuite/gfortran.dg/pr58968.f +++ b/gcc/testsuite/gfortran.dg/pr58968.f @@ -1,6 +1,6 @@ C PR rtl-optimization/58968.f C { dg-do compile { target powerpc*-*-* } } -C { dg-options "-mcpu=power7 -O3 -w -ffast-math -funroll-loops" } +C { dg-options "-mdejagnu-cpu=power7 -O3 -w -ffast-math -funroll-loops" } SUBROUTINE MAKTABS(IW,SOME,LBOX1,LBOX2,LBOX3,NSPACE,NA,NB, * LBST,X, * NX,IAMA,IAMI,IBMA,IBMI,MNUM,IDIM,MSTA,IBO, From 75d1c8fea9541dee5a4ce0aa7d8c199574fd42b9 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Sat, 26 Mar 2022 05:31:22 +0100 Subject: [PATCH 020/157] reload: Adjust comment in find_reloads about subset, not intersection gcc: * reload.cc (find_reloads): Align comment with code where considering the intersection of register classes then tweaking the regclass for the current alternative or rejecting it. --- gcc/reload.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gcc/reload.cc b/gcc/reload.cc index 664082a533d..3ed901e3944 100644 --- a/gcc/reload.cc +++ b/gcc/reload.cc @@ -3635,9 +3635,11 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known, a hard reg and this alternative accepts some register, see if the class that we want is a subset of the preferred class for this register. If not, - but it intersects that class, use the preferred class - instead. If it does not intersect the preferred - class, show that usage of this alternative should be + but it intersects that class, we'd like to use the + intersection, but the best we can do is to use the + preferred class, if it is instead a subset of the + class we want in this alternative. If we can't use + it, show that usage of this alternative should be discouraged; it will be discouraged more still if the register is `preferred or nothing'. We do this because it increases the chance of reusing our spill @@ -3664,9 +3666,10 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known, if (! reg_class_subset_p (this_alternative[i], preferred_class[i])) { - /* Since we don't have a way of forming the intersection, - we just do something special if the preferred class - is a subset of the class we have; that's the most + /* Since we don't have a way of forming a register + class for the intersection, we just do + something special if the preferred class is a + subset of the class we have; that's the most common case anyway. */ if (reg_class_subset_p (preferred_class[i], this_alternative[i])) From 1806829e08f14e4cacacec43d7845cc2dad2ddc8 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 26 Mar 2022 08:11:58 +0100 Subject: [PATCH 021/157] c++: Fix up __builtin_{bit_cast,convertvector} parsing Jonathan reported on IRC that we don't parse __builtin_bit_cast (type, val).field etc. The problem is that for these 2 builtins we return from cp_parser_postfix_expression instead of setting postfix_expression to the cp_build_* value and falling through into the postfix regression suffix handling loop. 2022-03-26 Jakub Jelinek * parser.cc (cp_parser_postfix_expression) : Don't return cp_build_{vec,convert,bit_cast} result right away, instead set postfix_expression to it and break. * c-c++-common/builtin-convertvector-3.c: New test. * g++.dg/cpp2a/bit-cast15.C: New test. --- gcc/cp/parser.cc | 12 ++++++++---- .../c-c++-common/builtin-convertvector-3.c | 11 +++++++++++ gcc/testsuite/g++.dg/cpp2a/bit-cast15.C | 19 +++++++++++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/c-c++-common/builtin-convertvector-3.c create mode 100644 gcc/testsuite/g++.dg/cpp2a/bit-cast15.C diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 15ad6400730..d3c22ee6227 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -7525,8 +7525,10 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, } /* Look for the closing `)'. */ parens.require_close (parser); - return cp_build_vec_convert (expression, type_location, type, - tf_warning_or_error); + postfix_expression + = cp_build_vec_convert (expression, type_location, type, + tf_warning_or_error); + break; } case RID_BUILTIN_BIT_CAST: @@ -7551,8 +7553,10 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, expression = cp_parser_assignment_expression (parser); /* Look for the closing `)'. */ parens.require_close (parser); - return cp_build_bit_cast (type_location, type, expression, - tf_warning_or_error); + postfix_expression + = cp_build_bit_cast (type_location, type, expression, + tf_warning_or_error); + break; } default: diff --git a/gcc/testsuite/c-c++-common/builtin-convertvector-3.c b/gcc/testsuite/c-c++-common/builtin-convertvector-3.c new file mode 100644 index 00000000000..882cd551ef8 --- /dev/null +++ b/gcc/testsuite/c-c++-common/builtin-convertvector-3.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +typedef int v4si __attribute__((vector_size (4 * sizeof (int)))); +typedef double v4df __attribute__((vector_size (4 * sizeof (double)))); +double +foo (void) +{ + v4si a = { 1, 2, 3, 4 }; + return __builtin_convertvector (a, v4df)[1]; +} diff --git a/gcc/testsuite/g++.dg/cpp2a/bit-cast15.C b/gcc/testsuite/g++.dg/cpp2a/bit-cast15.C new file mode 100644 index 00000000000..5326af0503d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/bit-cast15.C @@ -0,0 +1,19 @@ +// { dg-do compile } + +struct S { short a, b; }; +struct T { float a[4]; }; +struct U { int b[4]; }; + +#if __SIZEOF_FLOAT__ == __SIZEOF_INT__ +int +f1 (T &x) +{ + return __builtin_bit_cast (U, x).b[1]; +} + +float +f2 (int (&x)[4]) +{ + return __builtin_bit_cast (T, x).a[2]; +} +#endif From 0268c547de3e3559e056ce597eb168db5c4e5f74 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 26 Mar 2022 11:20:58 +0100 Subject: [PATCH 022/157] Add another commit to ignore We can't handle r12-7818-g3ab5c8cd03d92bf4ec41e351820349d92fbc40c4 * gcc-changelog/git_update_version.py: Add 3ab5c8cd03d92bf4ec41e351820349d92fbc40c4 to ignored commits. --- contrib/gcc-changelog/git_update_version.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/gcc-changelog/git_update_version.py b/contrib/gcc-changelog/git_update_version.py index 1837c1a8d7f..8cd337d5434 100755 --- a/contrib/gcc-changelog/git_update_version.py +++ b/contrib/gcc-changelog/git_update_version.py @@ -30,7 +30,8 @@ current_timestamp = datetime.datetime.now().strftime('%Y%m%d\n') IGNORED_COMMITS = ( 'c2be82058fb40f3ae891c68d185ff53e07f14f45', '04a040d907a83af54e0a98bdba5bfabc0ef4f700', - '2e96b5f14e4025691b57d2301d71aa6092ed44bc') + '2e96b5f14e4025691b57d2301d71aa6092ed44bc', + '3ab5c8cd03d92bf4ec41e351820349d92fbc40c4') def read_timestamp(path): From 31e989a2785bee8d507f2a06b5d3bd8c45989ab5 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sat, 26 Mar 2022 10:22:39 +0000 Subject: [PATCH 023/157] Daily bump. --- contrib/ChangeLog | 5 ++++ gcc/ChangeLog | 42 +++++++++++++++++++++++++++++++ gcc/DATESTAMP | 2 +- gcc/analyzer/ChangeLog | 28 +++++++++++++++++++++ gcc/c-family/ChangeLog | 9 +++++++ gcc/cp/ChangeLog | 14 +++++++++++ gcc/fortran/ChangeLog | 8 ++++++ gcc/testsuite/ChangeLog | 55 +++++++++++++++++++++++++++++++++++++++++ libgomp/ChangeLog | 8 ++++++ libstdc++-v3/ChangeLog | 5 ++++ 10 files changed, 175 insertions(+), 1 deletion(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 485b9beac36..5af9673def0 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,8 @@ +2022-03-26 Jakub Jelinek + + * gcc-changelog/git_update_version.py: Add + 3ab5c8cd03d92bf4ec41e351820349d92fbc40c4 to ignored commits. + 2022-03-10 Jonathan Wakely PR other/102664 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bddb065e8bb..6fc58ceb63f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,45 @@ +2022-03-26 Hans-Peter Nilsson + + * reload.cc (find_reloads): Align comment with code where + considering the intersection of register classes then tweaking the + regclass for the current alternative or rejecting it. + +2022-03-25 Vladimir N. Makarov + + PR middle-end/104971 + * lra-lives.cc (process_bb_lives): Check hard_regs_live for hard + regs to clear remove_p flag. + +2022-03-25 Richard Biener + + PR tree-optimization/105053 + * tree-vect-loop.cc (vect_create_epilog_for_reduction): Pick + the correct live-out stmt for a reduction chain. + +2022-03-25 Richard Biener + + PR middle-end/105049 + * tree.cc (uniform_vector_p): Recurse for VECTOR_CST or + CONSTRUCTOR first elements. + +2022-03-25 Tobias Burnus + + PR analyzer/103533 + * doc/invoke.texi (Static Analyzer Options): Move + @ignore block after @gccoptlist's '}' for 'make pdf'. + +2022-03-25 David Malcolm + + PR analyzer/104954 + * doc/invoke.texi (Static Analyzer Options): Add + -fdump-analyzer-untracked. + +2022-03-25 Avinash Sonawane + + PR analyzer/103533 + * doc/invoke.texi: Document that enabling taint analyzer + checker disables some warnings from `-fanalyzer`. + 2022-03-24 Alexandre Oliva PR debug/104564 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 575162361cc..8b0bfd64c7b 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20220325 +20220326 diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index 293548ac796..a76d61e3cbb 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,3 +1,31 @@ +2022-03-25 David Malcolm + + PR analyzer/104954 + * analyzer.opt (-fdump-analyzer-untracked): New option. + * engine.cc (impl_run_checkers): Handle it. + * region-model-asm.cc (region_model::on_asm_stmt): Don't attempt + to clobber regions with !tracked_p (). + * region-model-manager.cc (dump_untracked_region): New. + (region_model_manager::dump_untracked_regions): New. + (frame_region::dump_untracked_regions): New. + * region-model.h (region_model_manager::dump_untracked_regions): + New decl. + * region.cc (ipa_ref_requires_tracking): New. + (symnode_requires_tracking_p): New. + (decl_region::calc_tracked_p): New. + * region.h (region::tracked_p): New vfunc. + (frame_region::dump_untracked_regions): New decl. + (class decl_region): Note that this is also used fo SSA names. + (decl_region::decl_region): Initialize m_tracked. + (decl_region::tracked_p): New. + (decl_region::calc_tracked_p): New decl. + (decl_region::m_tracked): New. + * store.cc (store::get_or_create_cluster): Assert that we + don't try to create clusters for base regions that aren't + trackable. + (store::mark_as_escaped): Don't mark base regions that we're not + tracking. + 2022-03-23 David Malcolm PR analyzer/104979 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index b68c145482a..c28da277ec0 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,12 @@ +2022-03-25 Eric Botcazou + + * c-ada-spec.cc (dump_ada_import): Deal with the "section" attribute + (dump_ada_node) : Do not modify and pass the name, but + the referenced type instead. Deal with the anonymous original type + of a typedef'ed type. In the actual access case, follow the chain + of external subtypes. + : Tidy up control flow. + 2022-03-21 Qian Jianhua * c-ada-spec.cc: Change array length diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6a1524b78ea..f17a9c9a5ac 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +2022-03-26 Jakub Jelinek + + * parser.cc (cp_parser_postfix_expression) + : Don't + return cp_build_{vec,convert,bit_cast} result right away, instead + set postfix_expression to it and break. + +2022-03-25 Marek Polacek + + PR c++/104944 + * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void). + (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with + complain == true. + 2022-03-24 Marek Polacek PR c++/104284 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 95ca6993395..a2aac51bd2e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2022-03-25 Jakub Jelinek + + PR fortran/103691 + * trans-array.cc (gfc_conv_array_initializer): If TYPE_MAX_VALUE is + smaller than TYPE_MIN_VALUE (i.e. empty array), ignore the + initializer; if TYPE_MIN_VALUE is equal to TYPE_MAX_VALUE, use just + the TYPE_MIN_VALUE as index instead of RANGE_EXPR. + 2022-03-23 Tobias Burnus PR fortran/103560 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e87cc860d4f..516c382f0c3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,58 @@ +2022-03-26 Jakub Jelinek + + * c-c++-common/builtin-convertvector-3.c: New test. + * g++.dg/cpp2a/bit-cast15.C: New test. + +2022-03-25 Peter Bergner + + * g++.dg/pr65240-1.C: Use -mdejagnu-cpu=. Remove dg-skip-if. + * g++.dg/pr65240-2.C: Likewise. + * g++.dg/pr65240-3.C: Likewise. + * g++.dg/pr65240-4.C: Likewise. + * g++.dg/pr65242.C: Likewise. + * g++.dg/pr67211.C: Likewise. + * g++.dg/pr69667.C: Likewise. + * g++.dg/pr71294.C: Likewise. + * g++.dg/pr84279.C: Likewise. + * g++.dg/torture/ppc-ldst-array.C: Likewise. + * gfortran.dg/nint_p7.f90: Likewise. + * gfortran.dg/pr102860.f90: Likewise. + * gcc.target/powerpc/fusion.c: Use -mdejagnu-cpu= and -mdejagnu-tune=. + * gcc.target/powerpc/fusion2.c: Likewise. + * gcc.target/powerpc/int_128bit-runnable.c: Use -mdejagnu-cpu=. + * gcc.target/powerpc/test_mffsl.c: Likewise. + * gfortran.dg/pr47614.f: Likewise. + * gfortran.dg/pr58968.f: Likewise. + +2022-03-25 H.J. Lu + + PR testsuite/105055 + * gcc.target/i386/pr95483-1.c: Replace -msse with -msse2. + +2022-03-25 Richard Biener + + PR tree-optimization/105053 + * g++.dg/vect/pr105053.cc: New testcase. + +2022-03-25 Marek Polacek + + PR c++/104944 + * g++.dg/cpp0x/alignas20.C: New test. + +2022-03-25 Richard Biener + + PR middle-end/105049 + * gcc.dg/pr105049.c: New testcase. + +2022-03-25 David Malcolm + + PR analyzer/104954 + * gcc.dg/analyzer/asm-x86-dyndbg-1.c: New test. + * gcc.dg/analyzer/asm-x86-dyndbg-2.c: New test. + * gcc.dg/analyzer/many-unused-locals.c: New test. + * gcc.dg/analyzer/untracked-1.c: New test. + * gcc.dg/analyzer/unused-local-1.c: New test. + 2022-03-24 Marek Polacek PR c++/104284 diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index e1e60b98a31..5c4009a9ede 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,11 @@ +2022-03-25 Tom de Vries + + PR libgomp/105042 + * testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Reduce + execution time. + * testsuite/libgomp.oacc-c-c++-common/vred2d-128.c: Same. + * testsuite/libgomp.oacc-fortran/parallel-dims.f90: Same. + 2022-03-23 Tobias Burnus PR middle-end/104285 diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 6b272418e40..50eee8017ab 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2022-03-25 Jonathan Wakely + + * include/std/bit (bit_cast, byteswap, endian): Add doxygen + comments. + 2022-03-23 Jonathan Wakely PR libstdc++/105027 From f0fdd92e9dae17b543b089dac753211298b04c78 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 26 Mar 2022 11:28:35 +0100 Subject: [PATCH 024/157] Manually add entry for r12-7818-g3ab5c8cd03d92bf4ec41e351820349d92fbc40c4 Because update_version_git gave up on it. --- gcc/ChangeLog | 19 +++++++++++++++++++ gcc/testsuite/ChangeLog | 9 +++++++++ 2 files changed, 28 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6fc58ceb63f..4b1cdddde81 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -4,6 +4,25 @@ considering the intersection of register classes then tweaking the regclass for the current alternative or rejecting it. +2022-03-25 Christophe Lyon + + PR target/104882 + Revert + 2021-06-11 Christophe Lyon + + * config/arm/mve.md (mve_vec_unpack_lo_): Delete. + (mve_vec_unpack_hi_): Delete. + (@mve_vec_pack_trunc_lo_): Delete. + (mve_vmovntq_): Remove '@' prefix. + * config/arm/neon.md (vec_unpack_hi_): Move back + from vec-common.md. + (vec_unpack_lo_): Likewise. + (vec_pack_trunc_): Rename from + neon_quad_vec_pack_trunc_. + * config/arm/vec-common.md (vec_unpack_hi_): Delete. + (vec_unpack_lo_): Delete. + (vec_pack_trunc_): Delete. + 2022-03-25 Vladimir N. Makarov PR middle-end/104971 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 516c382f0c3..51880608576 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -29,6 +29,15 @@ PR testsuite/105055 * gcc.target/i386/pr95483-1.c: Replace -msse with -msse2. +2022-03-25 Christophe Lyon + + PR target/104882 + * gcc.target/arm/simd/mve-vclz.c: Update expected results. + * gcc.target/arm/simd/mve-vshl.c: Likewise. + * gcc.target/arm/simd/mve-vec-pack.c: Delete. + * gcc.target/arm/simd/mve-vec-unpack.c: Delete. + * gcc.target/arm/simd/pr104882.c: New test. + 2022-03-25 Richard Biener PR tree-optimization/105053 From 8c8993c75309901e03418eba1d6239b9a39a43b7 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 25 Mar 2022 16:50:51 -0400 Subject: [PATCH 025/157] analyzer: fix ICE on memset of untracked region [PR105057] In r12-7809-g5f6197d7c197f9d2b7fb2e1a19dac39a023755e8 I added an optimization to avoid tracking the state of certain memory regions in the store. Unfortunately, I didn't cover every way in which store::get_or_create_cluster can be called for a base region, leading to assertion failure ICEs in -fanalyzer on certain function calls with certain params. I've worked through all uses of store::get_or_create_cluster and found four places where the assertion could fire. This patch fixes them, and adds regression tests where possible. gcc/analyzer/ChangeLog: PR analyzer/105057 * store.cc (binding_cluster::make_unknown_relative_to): Reject attempts to create a cluster for untracked base regions. (store::set_value): Likewise. (store::fill_region): Likewise. (store::mark_region_as_unknown): Likewise. gcc/testsuite/ChangeLog: PR analyzer/105057 * gcc.dg/analyzer/fread-2.c: New test, as a regression test for ICE in store::set_value on untracked base region. * gcc.dg/analyzer/memset-2.c: Likewise, for ICE in store::fill_region. * gcc.dg/analyzer/strcpy-2.c: Likewise, for ICE in store::mark_region_as_unknown. Signed-off-by: David Malcolm --- gcc/analyzer/store.cc | 17 ++++++++++--- gcc/testsuite/gcc.dg/analyzer/fread-2.c | 31 ++++++++++++++++++++++++ gcc/testsuite/gcc.dg/analyzer/memset-2.c | 27 +++++++++++++++++++++ gcc/testsuite/gcc.dg/analyzer/strcpy-2.c | 27 +++++++++++++++++++++ 4 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/analyzer/fread-2.c create mode 100644 gcc/testsuite/gcc.dg/analyzer/memset-2.c create mode 100644 gcc/testsuite/gcc.dg/analyzer/strcpy-2.c diff --git a/gcc/analyzer/store.cc b/gcc/analyzer/store.cc index 62733b9777f..9aa7d690b04 100644 --- a/gcc/analyzer/store.cc +++ b/gcc/analyzer/store.cc @@ -1823,7 +1823,8 @@ binding_cluster::make_unknown_relative_to (const binding_cluster *other, { const region *base_reg = region_sval->get_pointee ()->get_base_region (); - if (!base_reg->symbolic_for_unknown_ptr_p ()) + if (base_reg->tracked_p () + && !base_reg->symbolic_for_unknown_ptr_p ()) { binding_cluster *c = out_store->get_or_create_cluster (base_reg); c->mark_as_escaped (); @@ -2384,11 +2385,17 @@ store::set_value (store_manager *mgr, const region *lhs_reg, mark_as_escaped (ptr_base_reg); } } - else + else if (lhs_base_reg->tracked_p ()) { lhs_cluster = get_or_create_cluster (lhs_base_reg); lhs_cluster->bind (mgr, lhs_reg, rhs_sval); } + else + { + /* Reject attempting to bind values into an untracked region; + merely invalidate values below. */ + lhs_cluster = NULL; + } /* Bindings to a cluster can affect other clusters if a symbolic base region is involved. @@ -2564,7 +2571,8 @@ void store::fill_region (store_manager *mgr, const region *reg, const svalue *sval) { const region *base_reg = reg->get_base_region (); - if (base_reg->symbolic_for_unknown_ptr_p ()) + if (base_reg->symbolic_for_unknown_ptr_p () + || !base_reg->tracked_p ()) return; binding_cluster *cluster = get_or_create_cluster (base_reg); cluster->fill_region (mgr, reg, sval); @@ -2587,7 +2595,8 @@ store::mark_region_as_unknown (store_manager *mgr, const region *reg, uncertainty_t *uncertainty) { const region *base_reg = reg->get_base_region (); - if (base_reg->symbolic_for_unknown_ptr_p ()) + if (base_reg->symbolic_for_unknown_ptr_p () + || !base_reg->tracked_p ()) return; binding_cluster *cluster = get_or_create_cluster (base_reg); cluster->mark_region_as_unknown (mgr, reg, uncertainty); diff --git a/gcc/testsuite/gcc.dg/analyzer/fread-2.c b/gcc/testsuite/gcc.dg/analyzer/fread-2.c new file mode 100644 index 00000000000..02a5e31cec6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/fread-2.c @@ -0,0 +1,31 @@ +/* { dg-additional-options "-fdump-analyzer-untracked" } */ + +#include "analyzer-decls.h" + +struct S +{ + int i; +}; + +typedef __SIZE_TYPE__ size_t; + +extern size_t fread (void *, size_t, size_t, void *); + +/* fread of a static struct that never gets used. */ + +void +test_1 (void *fp) +{ + static struct S s; /* { dg-warning "track 's': no" } */ + fread (&s, sizeof (s), 1, fp); +} + +/* fread of a static struct that later gets used. */ + +int +test_2 (void *fp) +{ + static struct S s; /* { dg-warning "track 's': yes" } */ + fread (&s, sizeof (s), 1, fp); + return s.i; +} diff --git a/gcc/testsuite/gcc.dg/analyzer/memset-2.c b/gcc/testsuite/gcc.dg/analyzer/memset-2.c new file mode 100644 index 00000000000..de7c973b1fd --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/memset-2.c @@ -0,0 +1,27 @@ +/* { dg-additional-options "-fdump-analyzer-untracked" } */ + +#include "analyzer-decls.h" + +struct S +{ + int i; +}; + +/* memset of a static struct that never gets used. */ + +void +test_1 (void) +{ + static struct S s; /* { dg-warning "track 's': no" } */ + __builtin_memset (&s, 0, sizeof (s)); +} + +/* memset of a static struct that later gets used. */ + +void +test_2 (void) +{ + static struct S s; /* { dg-warning "track 's': yes" } */ + __builtin_memset (&s, 0, sizeof (s)); + __analyzer_eval (s.i == 0); /* { dg-warning "TRUE" } */ +} diff --git a/gcc/testsuite/gcc.dg/analyzer/strcpy-2.c b/gcc/testsuite/gcc.dg/analyzer/strcpy-2.c new file mode 100644 index 00000000000..e4e6c975d14 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/strcpy-2.c @@ -0,0 +1,27 @@ +/* { dg-additional-options "-fdump-analyzer-untracked" } */ + +#include "analyzer-decls.h" + +struct S +{ + char buf[10]; +}; + +/* strcpy to a static struct that never gets used. */ + +void +test_1 (const char *src) +{ + static struct S s; /* { dg-warning "track 's': no" } */ + __builtin_strcpy (s.buf, src); +} + +/* strcpy to a static struct that later gets used. */ + +const char * +test_2 (const char *src) +{ + static struct S s; /* { dg-warning "track 's': yes" } */ + __builtin_strcpy (s.buf, src); + return s.buf; +} From 99591cf43fc1da0fb72b3da02ba937ba30bd2bf2 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 24 Mar 2022 21:41:12 -0700 Subject: [PATCH 026/157] x86: Use x constraint on SSSE3 patterns with MMX operands Since PHADDW/PHADDD/PHADDSW/PHSUBW/PHSUBD/PHSUBSW/PSIGNB/PSIGNW/PSIGND have no AVX512 version, replace the "Yv" register constraint with the "x" register constraint. PR target/105052 * config/i386/sse.md (ssse3_phwv4hi3): Replace "Yv" with "x". (ssse3_phdv2si3): Likewise. (ssse3_psign3): Likewise. --- gcc/config/i386/sse.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index a9e18d38323..29802d00ce6 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -20221,12 +20221,12 @@ (set_attr "mode" "TI")]) (define_insn_and_split "ssse3_phwv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yv") + [(set (match_operand:V4HI 0 "register_operand" "=y,x,x") (ssse3_plusminus:V4HI (vec_select:V4HI (vec_concat:V8HI - (match_operand:V4HI 1 "register_operand" "0,0,Yv") - (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yv")) + (match_operand:V4HI 1 "register_operand" "0,0,x") + (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,x")) (parallel [(const_int 0) (const_int 2) (const_int 4) (const_int 6)])) (vec_select:V4HI @@ -20308,12 +20308,12 @@ (set_attr "mode" "TI")]) (define_insn_and_split "ssse3_phdv2si3" - [(set (match_operand:V2SI 0 "register_operand" "=y,x,Yv") + [(set (match_operand:V2SI 0 "register_operand" "=y,x,x") (plusminus:V2SI (vec_select:V2SI (vec_concat:V4SI - (match_operand:V2SI 1 "register_operand" "0,0,Yv") - (match_operand:V2SI 2 "register_mmxmem_operand" "ym,x,Yv")) + (match_operand:V2SI 1 "register_operand" "0,0,x") + (match_operand:V2SI 2 "register_mmxmem_operand" "ym,x,x")) (parallel [(const_int 0) (const_int 2)])) (vec_select:V2SI (vec_concat:V4SI (match_dup 1) (match_dup 2)) @@ -20811,10 +20811,10 @@ (set_attr "mode" "")]) (define_insn "ssse3_psign3" - [(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,Yv") + [(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,x") (unspec:MMXMODEI - [(match_operand:MMXMODEI 1 "register_operand" "0,0,Yv") - (match_operand:MMXMODEI 2 "register_mmxmem_operand" "ym,x,Yv")] + [(match_operand:MMXMODEI 1 "register_operand" "0,0,x") + (match_operand:MMXMODEI 2 "register_mmxmem_operand" "ym,x,x")] UNSPEC_PSIGN))] "(TARGET_MMX || TARGET_MMX_WITH_SSE) && TARGET_SSSE3" "@ From ede5f5224d55b84b9f186b288164df9c06fd85e7 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 25 Mar 2022 10:48:16 -0700 Subject: [PATCH 027/157] x86: Use x constraint on KL patterns Since KL instructions have no AVX512 version, replace the "v" register constraint with the "x" register constraint. PR target/105058 * config/i386/sse.md (loadiwkey): Replace "v" with "x". (aesu8): Likewise. --- gcc/config/i386/sse.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 29802d00ce6..33bd2c4768a 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -28364,8 +28364,8 @@ ;; KEYLOCKER (define_insn "loadiwkey" - [(unspec_volatile:V2DI [(match_operand:V2DI 0 "register_operand" "v") - (match_operand:V2DI 1 "register_operand" "v") + [(unspec_volatile:V2DI [(match_operand:V2DI 0 "register_operand" "x") + (match_operand:V2DI 1 "register_operand" "x") (match_operand:V2DI 2 "register_operand" "Yz") (match_operand:SI 3 "register_operand" "a")] UNSPECV_LOADIWKEY) @@ -28498,7 +28498,7 @@ (UNSPECV_AESENC256KLU8 "enc256kl")]) (define_insn "aesu8" - [(set (match_operand:V2DI 0 "register_operand" "=v") + [(set (match_operand:V2DI 0 "register_operand" "=x") (unspec_volatile:V2DI [(match_operand:V2DI 1 "register_operand" "0") (match_operand:BLK 2 "memory_operand" "m")] AESDECENCKL)) From 04f19580e8dbdbc7366d0f5fd068aa0cecafdc9d Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Sat, 26 Mar 2022 10:20:16 -0400 Subject: [PATCH 028/157] c++: ICE when building builtin operator->* set [PR103455] Here when constructing the builtin operator->* candidate set according to the available conversion functions for the operand types, we end up considering a candidate with C1=T (through B's dependent conversion function) and C2=F, during which we crash from DERIVED_FROM_P because dependent_type_p sees a TEMPLATE_TYPE_PARM outside of a template context. Sidestepping the question of whether we should be considering such a dependent conversion function here in the first place, it seems futile to test DERIVED_FROM_P for anything other than an actual class type, so this patch fixes this ICE by simply guarding the DERIVED_FROM_P test with CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P. PR c++/103455 gcc/cp/ChangeLog: * call.cc (add_builtin_candidate) : Test CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P. gcc/testsuite/ChangeLog: * g++.dg/overload/builtin6.C: New test. --- gcc/cp/call.cc | 2 +- gcc/testsuite/g++.dg/overload/builtin6.C | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/overload/builtin6.C diff --git a/gcc/cp/call.cc b/gcc/cp/call.cc index ec6c5d5baa2..dfe370d685d 100644 --- a/gcc/cp/call.cc +++ b/gcc/cp/call.cc @@ -2821,7 +2821,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, tree c1 = TREE_TYPE (type1); tree c2 = TYPE_PTRMEM_CLASS_TYPE (type2); - if (MAYBE_CLASS_TYPE_P (c1) && DERIVED_FROM_P (c2, c1) + if (CLASS_TYPE_P (c1) && DERIVED_FROM_P (c2, c1) && (TYPE_PTRMEMFUNC_P (type2) || is_complete (TYPE_PTRMEM_POINTED_TO_TYPE (type2)))) break; diff --git a/gcc/testsuite/g++.dg/overload/builtin6.C b/gcc/testsuite/g++.dg/overload/builtin6.C new file mode 100644 index 00000000000..de192be67ec --- /dev/null +++ b/gcc/testsuite/g++.dg/overload/builtin6.C @@ -0,0 +1,14 @@ +// PR c++/103455 + +struct A { }; + +struct B { + operator A*() const; + template operator T*() const; +}; + +typedef void (A::*F)(); + +void f(B b, F pmf) { + (b->*pmf)(); +} From ff465bd8a0f0f96a00d3067018442917b194b7af Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Sat, 26 Mar 2022 10:20:18 -0400 Subject: [PATCH 029/157] c++: diagnosing if-stmt with non-constant branches [PR105050] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When an if-stmt is determined to be non-constant because both of its branches are non-constant, we issue a somewhat generic error which, since the error also points to the 'if' token, misleadingly suggests the condition is at fault: constexpr-105050.C:8:3: error: expression ‘’ is not a constant expression 8 | if (p != q && *p < 0) | ^~ This patch clarifies the error message to instead read: constexpr-105050.C:8:3: error: neither branch of ‘if’ is a constant expression 8 | if (p != q && *p < 0) | ^~ PR c++/105050 gcc/cp/ChangeLog: * constexpr.cc (potential_constant_expression_1) : Clarify error message when a if-stmt is non-constant because its branches are non-constant. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/constexpr-105050.C: New test. --- gcc/cp/constexpr.cc | 7 ++++++- gcc/testsuite/g++.dg/cpp1y/constexpr-105050.C | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/cpp1y/constexpr-105050.C diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc index 778680b8270..9c40b051574 100644 --- a/gcc/cp/constexpr.cc +++ b/gcc/cp/constexpr.cc @@ -9439,7 +9439,12 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, } } if (flags & tf_error) - error_at (loc, "expression %qE is not a constant expression", t); + { + if (TREE_CODE (t) == IF_STMT) + error_at (loc, "neither branch of % is a constant expression"); + else + error_at (loc, "expression %qE is not a constant expression", t); + } return false; case VEC_INIT_EXPR: diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-105050.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-105050.C new file mode 100644 index 00000000000..e0688fbd38e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-105050.C @@ -0,0 +1,12 @@ +// PR c++/105050 +// { dg-do compile { target c++14 } } + +void g(); +void h(); + +constexpr void f(int* p, int* q) { + if (p != q && *p < 0) // { dg-error "neither branch of 'if' is a constant expression" } + g(); + else + h(); +} From 6459e6537632bc06e04e6011ca7fb6488f0e8e7d Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 26 Mar 2022 16:21:36 +0100 Subject: [PATCH 030/157] ecog: Return 1 from insn_invalid_p if REG_INC reg overlaps some stored reg [PR103775] The following testcase ICEs on aarch64-linux with -g and assembles with a warning otherwise, because it emits ldrb w0,[x0,16]! instruction which sets the x0 register multiple times. Due to disabled DCE (from -Og) we end up before REE with: (insn 12 39 13 2 (set (reg:SI 1 x1 [orig:93 _2 ] [93]) (zero_extend:SI (mem/c:QI (pre_modify:DI (reg/f:DI 0 x0 [114]) (plus:DI (reg/f:DI 0 x0 [114]) (const_int 16 [0x10]))) [1 u128_1+0 S1 A128]))) "pr103775.c":5:35 117 {*zero_extendqisi2_aarch64} (expr_list:REG_INC (reg/f:DI 0 x0 [114]) (nil))) (insn 13 12 14 2 (set (reg:DI 0 x0 [orig:112 _2 ] [112]) (zero_extend:DI (reg:SI 1 x1 [orig:93 _2 ] [93]))) "pr103775.c":5:16 111 {*zero_extendsidi2_aarch64} (nil)) which is valid but not exactly efficient as x0 is dead after the insn that auto-increments it. REE turns it into: (insn 12 39 44 2 (set (reg:DI 0 x0) (zero_extend:DI (mem/c:QI (pre_modify:DI (reg/f:DI 0 x0 [114]) (plus:DI (reg/f:DI 0 x0 [114]) (const_int 16 [0x10]))) [1 u128_1+0 S1 A128]))) "pr103775.c":5:35 119 {*zero_extendqidi2_aarch64} (expr_list:REG_INC (reg/f:DI 0 x0 [114]) (nil))) (insn 44 12 14 2 (set (reg:DI 1 x1) (reg:DI 0 x0)) "pr103775.c":5:35 -1 (nil)) which is invalid because it sets x0 multiple times, one in SET_DEST of the PATTERN and once in PRE_MODIFY. As perhaps other passes than REE might suffer from it, IMHO it is better to reject this during change validation. 2022-03-26 Jakub Jelinek PR rtl-optimization/103775 * recog.cc (check_invalid_inc_dec): New function. (insn_invalid_p): Return 1 if REG_INC operand overlaps any stored REGs. * gcc.dg/pr103775.c: New test. --- gcc/recog.cc | 22 ++++++++++++++++++++++ gcc/testsuite/gcc.dg/pr103775.c | 12 ++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr103775.c diff --git a/gcc/recog.cc b/gcc/recog.cc index 1c9fe716322..cd2410ab2ae 100644 --- a/gcc/recog.cc +++ b/gcc/recog.cc @@ -329,6 +329,17 @@ canonicalize_change_group (rtx_insn *insn, rtx x) return false; } +/* Check if REG_INC argument in *data overlaps a stored REG. */ + +static void +check_invalid_inc_dec (rtx reg, const_rtx, void *data) +{ + rtx *pinc = (rtx *) data; + if (*pinc == NULL_RTX || MEM_P (reg)) + return; + if (reg_overlap_mentioned_p (reg, *pinc)) + *pinc = NULL_RTX; +} /* This subroutine of apply_change_group verifies whether the changes to INSN were valid; i.e. whether INSN can still be recognized. @@ -386,6 +397,17 @@ insn_invalid_p (rtx_insn *insn, bool in_group) return 1; } + /* Punt if REG_INC argument overlaps some stored REG. */ + for (rtx link = FIND_REG_INC_NOTE (insn, NULL_RTX); + link; link = XEXP (link, 1)) + if (REG_NOTE_KIND (link) == REG_INC) + { + rtx reg = XEXP (link, 0); + note_stores (insn, check_invalid_inc_dec, ®); + if (reg == NULL_RTX) + return 1; + } + INSN_CODE (insn) = icode; return 0; } diff --git a/gcc/testsuite/gcc.dg/pr103775.c b/gcc/testsuite/gcc.dg/pr103775.c new file mode 100644 index 00000000000..4a8c0d6d145 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr103775.c @@ -0,0 +1,12 @@ +/* PR rtl-optimization/103775 */ +/* { dg-do assemble { target int128 } } */ +/* { dg-options "-Og -fno-forward-propagate -free -g" } */ + +int +foo (char a, short b, int c, __int128 d, char e, short f, int g, __int128 h) +{ + long i = __builtin_clrsbll ((char) h); + __builtin_memset ((char *) &h + 4, d, 3); + c &= (char) h; + return c + i; +} From 41d1f11f5f693a2a06c65c9467a28dfeb02aed85 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Sat, 26 Mar 2022 08:10:27 -1000 Subject: [PATCH 031/157] PR middle-end/104885: Fix ICE with large stack frame on powerpc64. My recent testcase for PR c++/84964.C stress tests the middle-end by attempting to pass a UINT_MAX sized structure on the stack. Although my fix to PR84964 avoids the ICE after sorry on x86_64 and similar targets, a related issue still exists on powerpc64 (and similar ACCUMULATE_OUTGOING_ARGS/ARGS_GROW_DOWNWARD targets) which don't issue a "sorry, unimplemented" message, but instead ICE elsewhere. After attempting several alternate fixes, the simplest solution is to just defensively check in mark_stack_region_used that the upper bound of the region lies within the allocated stack_usage_map array, which is of size highest_outgoing_arg_in_use. When this isn't the case, the code now follows the same path as for variable sized regions, and uses stack_usage_watermark rather than a map. 2022-03-26 Roger Sayle gcc/ChangeLog PR middle-end/104885 * calls.cc (mark_stack_region_used): Check that the region is within the allocated size of stack_usage_map. --- gcc/calls.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/calls.cc b/gcc/calls.cc index e13469cfd43..4d0bc45be28 100644 --- a/gcc/calls.cc +++ b/gcc/calls.cc @@ -201,7 +201,8 @@ mark_stack_region_used (poly_uint64 lower_bound, poly_uint64 upper_bound) { unsigned HOST_WIDE_INT const_lower, const_upper; const_lower = constant_lower_bound (lower_bound); - if (upper_bound.is_constant (&const_upper)) + if (upper_bound.is_constant (&const_upper) + && const_upper <= highest_outgoing_arg_in_use) for (unsigned HOST_WIDE_INT i = const_lower; i < const_upper; ++i) stack_usage_map[i] = 1; else From 43911ddd18b97d8ebd17d2959f36efa539d359b7 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 24 Mar 2022 22:34:30 +0100 Subject: [PATCH 032/157] Remove mysterious '-# Defining these options here in addition to common.opt is necessary' command-line option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before: $ [...]/gcc '-# Defining these options here in addition to common.opt is necessary' -S -x c /dev/null && echo MYSTERIOUS MYSTERIOUS After: $ [...]/gcc '-# Defining these options here in addition to common.opt is necessary' -S -x c /dev/null && echo MYSTERIOUS gcc: error: unrecognized command-line option ‘-# Defining these options here in addition to common.opt is necessary’ This commit changes: --- [...]/build-gcc/gcc/optionlist 2022-03-24 22:12:07.936746648 +0100 +++ [...]/build-gcc/gcc/optionlist 2022-03-24 22:30:06.976737341 +0100 @@ -1,4 +1,3 @@ -# Defining these options here in addition to common.opt is necessary# in order for the default -Wall setting of -Wuse-after-free=2 to take# effect. ###Driver -all-warningsAda AdaWhy AdaSCIL Alias(Wall) -all-warningsC ObjC C++ ObjC++ Warning Alias(Wall) [...] --- [...]/build-gcc/gcc/options.cc 2022-03-24 22:12:09.548727738 +0100 +++ [...]/build-gcc/gcc/options.cc 2022-03-24 22:30:08.904727249 +0100 @@ -3222,15 +3222,6 @@ const struct cl_option cl_options[] = { /* [0] = */ { - "-# Defining these options here in addition to common.opt is necessary", - "# effect.", - NULL, - NULL, - NULL, NULL, N_OPTS, N_OPTS, 68, /* .neg_idx = */ -1, - 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - (unsigned short) -1, 0, CLVC_INTEGER, 0, -1, -1 }, - /* [1] = */ { "-###", NULL, NULL, [...] ..., and re-numbers all following options. --- [...]/build-gcc/gcc/options.h 2022-03-21 23:24:25.894226828 +0100 +++ [...]/build-gcc/gcc/options.h 2022-03-24 22:30:07.288735708 +0100 @@ -9753,2118 +9753,2117 @@ enum opt_code { - OPT___Defining_these_options_here_in_addition_to_common_opt_is_necessary = 0,/* -# Defining these options here in addition to common.opt is necessary */ [...] ..., and likewise re-numbers all following options. Clean-up for commit 671a283636de75f7ed638ee6b01ed2d44361b8b6 "Add -Wuse-after-free [PR80532]". gcc/c-family/ * c.opt: Properly quote comment. --- gcc/c-family/c.opt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 9a4828ebe37..790d47caf0a 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -1377,9 +1377,9 @@ Wunused-const-variable= C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_unused_const_variable) Warning LangEnabledBy(C ObjC,Wunused-variable, 1, 0) IntegerRange(0, 2) Warn when a const variable is unused. -# Defining these options here in addition to common.opt is necessary -# in order for the default -Wall setting of -Wuse-after-free=2 to take -# effect. +; Defining these options here in addition to common.opt is necessary +; in order for the default -Wall setting of -Wuse-after-free=2 to take +; effect. Wuse-after-free LangEnabledBy(C ObjC C++ LTO ObjC++) From d2906412ada87a4bdd6410060bc18a2c53c419b7 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Sun, 27 Mar 2022 00:16:33 +0000 Subject: [PATCH 033/157] Daily bump. --- gcc/ChangeLog | 27 +++++++++++++++++++++++++++ gcc/DATESTAMP | 2 +- gcc/analyzer/ChangeLog | 9 +++++++++ gcc/c-family/ChangeLog | 4 ++++ gcc/cp/ChangeLog | 13 +++++++++++++ gcc/testsuite/ChangeLog | 25 +++++++++++++++++++++++++ 6 files changed, 79 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4b1cdddde81..1f49cbdcd67 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,30 @@ +2022-03-26 Roger Sayle + + PR middle-end/104885 + * calls.cc (mark_stack_region_used): Check that the region + is within the allocated size of stack_usage_map. + +2022-03-26 Jakub Jelinek + + PR rtl-optimization/103775 + * recog.cc (check_invalid_inc_dec): New function. + (insn_invalid_p): Return 1 if REG_INC operand overlaps + any stored REGs. + +2022-03-26 H.J. Lu + + PR target/105058 + * config/i386/sse.md (loadiwkey): Replace "v" with "x". + (aesu8): Likewise. + +2022-03-26 H.J. Lu + + PR target/105052 + * config/i386/sse.md (ssse3_phwv4hi3): + Replace "Yv" with "x". + (ssse3_phdv2si3): Likewise. + (ssse3_psign3): Likewise. + 2022-03-26 Hans-Peter Nilsson * reload.cc (find_reloads): Align comment with code where diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 8b0bfd64c7b..70c092d6a80 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20220326 +20220327 diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index a76d61e3cbb..d0c74b48105 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,3 +1,12 @@ +2022-03-26 David Malcolm + + PR analyzer/105057 + * store.cc (binding_cluster::make_unknown_relative_to): Reject + attempts to create a cluster for untracked base regions. + (store::set_value): Likewise. + (store::fill_region): Likewise. + (store::mark_region_as_unknown): Likewise. + 2022-03-25 David Malcolm PR analyzer/104954 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index c28da277ec0..a85f82f490b 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2022-03-26 Thomas Schwinge + + * c.opt: Properly quote comment. + 2022-03-25 Eric Botcazou * c-ada-spec.cc (dump_ada_import): Deal with the "section" attribute diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f17a9c9a5ac..2c885b2394e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,16 @@ +2022-03-26 Patrick Palka + + PR c++/105050 + * constexpr.cc (potential_constant_expression_1) : + Clarify error message when a if-stmt is non-constant because its + branches are non-constant. + +2022-03-26 Patrick Palka + + PR c++/103455 + * call.cc (add_builtin_candidate) : Test + CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P. + 2022-03-26 Jakub Jelinek * parser.cc (cp_parser_postfix_expression) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 51880608576..260858893d2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,28 @@ +2022-03-26 Jakub Jelinek + + PR rtl-optimization/103775 + * gcc.dg/pr103775.c: New test. + +2022-03-26 Patrick Palka + + PR c++/105050 + * g++.dg/cpp1y/constexpr-105050.C: New test. + +2022-03-26 Patrick Palka + + PR c++/103455 + * g++.dg/overload/builtin6.C: New test. + +2022-03-26 David Malcolm + + PR analyzer/105057 + * gcc.dg/analyzer/fread-2.c: New test, as a regression test for + ICE in store::set_value on untracked base region. + * gcc.dg/analyzer/memset-2.c: Likewise, for ICE in + store::fill_region. + * gcc.dg/analyzer/strcpy-2.c: Likewise, for ICE in + store::mark_region_as_unknown. + 2022-03-26 Jakub Jelinek * c-c++-common/builtin-convertvector-3.c: New test. From b78e0ce28b32a1b89886219c557506aeae6caffc Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 24 Mar 2022 20:37:13 +0000 Subject: [PATCH 034/157] libstdc++: Define std::expected for C++23 (P0323R12) Because this adds a new class template called std::unexpected, we have to stop declaring the std::unexpected() function (which was deprecated in C++11 and removed in C++17). libstdc++-v3/ChangeLog: * doc/doxygen/user.cfg.in: Add new header. * include/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * include/precompiled/stdc++.h: Add new header. * include/std/version (__cpp_lib_expected): Define. * libsupc++/exception [__cplusplus > 202002] (unexpected) (unexpected_handler, set_unexpected): Do not declare for C++23. * include/std/expected: New file. * testsuite/20_util/expected/assign.cc: New test. * testsuite/20_util/expected/cons.cc: New test. * testsuite/20_util/expected/illformed_neg.cc: New test. * testsuite/20_util/expected/observers.cc: New test. * testsuite/20_util/expected/requirements.cc: New test. * testsuite/20_util/expected/swap.cc: New test. * testsuite/20_util/expected/synopsis.cc: New test. * testsuite/20_util/expected/unexpected.cc: New test. * testsuite/20_util/expected/version.cc: New test. --- libstdc++-v3/doc/doxygen/user.cfg.in | 1 + libstdc++-v3/include/Makefile.am | 1 + libstdc++-v3/include/Makefile.in | 1 + libstdc++-v3/include/precompiled/stdc++.h | 1 + libstdc++-v3/include/std/expected | 1240 +++++++++++++++++ libstdc++-v3/include/std/version | 1 + libstdc++-v3/libsupc++/exception | 2 +- .../testsuite/20_util/expected/assign.cc | 321 +++++ .../testsuite/20_util/expected/cons.cc | 175 +++ .../20_util/expected/illformed_neg.cc | 67 + .../testsuite/20_util/expected/observers.cc | 209 +++ .../20_util/expected/requirements.cc | 129 ++ .../testsuite/20_util/expected/swap.cc | 57 + .../testsuite/20_util/expected/synopsis.cc | 21 + .../testsuite/20_util/expected/unexpected.cc | 80 ++ .../testsuite/20_util/expected/version.cc | 10 + 16 files changed, 2315 insertions(+), 1 deletion(-) create mode 100644 libstdc++-v3/include/std/expected create mode 100644 libstdc++-v3/testsuite/20_util/expected/assign.cc create mode 100644 libstdc++-v3/testsuite/20_util/expected/cons.cc create mode 100644 libstdc++-v3/testsuite/20_util/expected/illformed_neg.cc create mode 100644 libstdc++-v3/testsuite/20_util/expected/observers.cc create mode 100644 libstdc++-v3/testsuite/20_util/expected/requirements.cc create mode 100644 libstdc++-v3/testsuite/20_util/expected/swap.cc create mode 100644 libstdc++-v3/testsuite/20_util/expected/synopsis.cc create mode 100644 libstdc++-v3/testsuite/20_util/expected/unexpected.cc create mode 100644 libstdc++-v3/testsuite/20_util/expected/version.cc diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in index 2f15f2c1b82..85955f88390 100644 --- a/libstdc++-v3/doc/doxygen/user.cfg.in +++ b/libstdc++-v3/doc/doxygen/user.cfg.in @@ -858,6 +858,7 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ include/concepts \ include/condition_variable \ include/deque \ + include/expected \ include/filesystem \ include/forward_list \ include/fstream \ diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 43f7f9f240d..77eea7d61e8 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -42,6 +42,7 @@ std_headers = \ ${std_srcdir}/coroutine \ ${std_srcdir}/deque \ ${std_srcdir}/execution \ + ${std_srcdir}/expected \ ${std_srcdir}/filesystem \ ${std_srcdir}/forward_list \ ${std_srcdir}/fstream \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 88391a44d33..01bf3e0eb32 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -400,6 +400,7 @@ std_headers = \ ${std_srcdir}/coroutine \ ${std_srcdir}/deque \ ${std_srcdir}/execution \ + ${std_srcdir}/expected \ ${std_srcdir}/filesystem \ ${std_srcdir}/forward_list \ ${std_srcdir}/fstream \ diff --git a/libstdc++-v3/include/precompiled/stdc++.h b/libstdc++-v3/include/precompiled/stdc++.h index dc94a9c471f..6d6d2ad7c4c 100644 --- a/libstdc++-v3/include/precompiled/stdc++.h +++ b/libstdc++-v3/include/precompiled/stdc++.h @@ -153,5 +153,6 @@ #endif #if __cplusplus > 202002L +#include #include #endif diff --git a/libstdc++-v3/include/std/expected b/libstdc++-v3/include/std/expected new file mode 100644 index 00000000000..39d07cda4a9 --- /dev/null +++ b/libstdc++-v3/include/std/expected @@ -0,0 +1,1240 @@ +// -*- C++ -*- + +// Copyright The GNU Toolchain Authors +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file include/expected + * This is a Standard C++ Library header. + */ + +#ifndef _GLIBCXX_EXPECTED +#define _GLIBCXX_EXPECTED + +#pragma GCC system_header + +#if __cplusplus > 202002L && __cpp_concepts >= 202002L + +#include +#include // exception +#include // construct_at +#include // in_place_t + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + /** + * @defgroup expected_values Expected values + * @addtogroup utilities + * @since C++23 + * @{ + */ + +#define __cpp_lib_expected 202202L + + /// Discriminated union that holds an expected value or an error value. + /** + * @since C++23 + */ + template + class expected; + + /// Wrapper type used to pass an error value to a `std::expected`. + /** + * @since C++23 + */ + template + class unexpected; + + /// Exception thrown by std::expected when the value() is not present. + /** + * @since C++23 + */ + template + class bad_expected_access; + + template<> + class bad_expected_access : public exception + { + protected: + bad_expected_access() noexcept { } + bad_expected_access(const bad_expected_access&) = default; + bad_expected_access(bad_expected_access&&) = default; + bad_expected_access& operator=(const bad_expected_access&) = default; + bad_expected_access& operator=(bad_expected_access&&) = default; + ~bad_expected_access() = default; + + public: + + [[nodiscard]] + const char* + what() const noexcept override + { return "bad access to std::expected without expected value"; } + }; + + template + class bad_expected_access : public bad_expected_access { + public: + explicit + bad_expected_access(_Er __e) : _M_val(__e) { } + + // XXX const char* what() const noexcept override; + + [[nodiscard]] + _Er& + error() & noexcept + { return _M_val; } + + [[nodiscard]] + const _Er& + error() const & noexcept + { return _M_val; } + + [[nodiscard]] + _Er&& + error() && noexcept + { return std::move(_M_val); } + + [[nodiscard]] + const _Er&& + error() const && noexcept + { return std::move(_M_val); } + + private: + _Er _M_val; + }; + + /// Tag type for constructing unexpected values in a std::expected + /** + * @since C++23 + */ + struct unexpect_t + { + explicit unexpect_t() = default; + }; + + /// Tag for constructing unexpected values in a std::expected + /** + * @since C++23 + */ + inline constexpr unexpect_t unexpect{}; + +/// @cond undoc +namespace __expected +{ + template + constexpr bool __is_expected = false; + template + constexpr bool __is_expected> = true; + + template + constexpr bool __is_unexpected = false; + template + constexpr bool __is_unexpected> = true; + + template + concept __can_be_unexpected + = is_object_v<_Er> && (!is_array_v<_Er>) + && (!__expected::__is_unexpected<_Er>) + && (!is_const_v<_Er>) && (!is_volatile_v<_Er>); +} +/// @endcond + + template + class unexpected + { + static_assert( __expected::__can_be_unexpected<_Er> ); + + public: + constexpr unexpected(const unexpected&) = default; + constexpr unexpected(unexpected&&) = default; + + template + requires (!is_same_v, unexpected>) + && (!is_same_v, in_place_t>) + && is_constructible_v<_Er, _Err> + constexpr explicit + unexpected(_Err&& __e) + noexcept(is_nothrow_constructible_v<_Er, _Err>) + : _M_val(std::forward<_Err>(__e)) + { } + + template + requires is_constructible_v<_Er, _Args...> + constexpr explicit + unexpected(in_place_t, _Args&&... __args) + noexcept(is_nothrow_constructible_v<_Er, _Args...>) + : _M_val(std::forward<_Args>(__args)...) + { } + + template + requires is_constructible_v<_Er, initializer_list<_Up>&, _Args...> + constexpr explicit + unexpected(in_place_t, initializer_list<_Up> __il, _Args&&... __args) + noexcept(is_nothrow_constructible_v<_Er, initializer_list<_Up>&, + _Args...>) + : _M_val(__il, std::forward<_Args>(__args)...) + { } + + constexpr unexpected& operator=(const unexpected&) = default; + constexpr unexpected& operator=(unexpected&&) = default; + + + [[nodiscard]] + constexpr const _Er& + error() const & noexcept { return _M_val; } + + [[nodiscard]] + constexpr _Er& + error() & noexcept { return _M_val; } + + [[nodiscard]] + constexpr const _Er&& + error() const && noexcept { return std::move(_M_val); } + + [[nodiscard]] + constexpr _Er&& + error() && noexcept { return std::move(_M_val); } + + constexpr void + swap(unexpected& __other) noexcept(is_nothrow_swappable_v<_Er>) + { + static_assert( is_swappable_v<_Er> ); + using std::swap; + swap(_M_val, __other._M_val); + } + + template + [[nodiscard]] + friend constexpr bool + operator==(const unexpected& __x, const unexpected<_Err>& __y) + { return __x._M_val == __y.error(); } + + friend constexpr void + swap(unexpected& __x, unexpected& __y) + noexcept(noexcept(__x.swap(__y))) + requires requires {__x.swap(__y);} + { __x.swap(__y); } + + private: + _Er _M_val; + }; + + template unexpected(_Er) -> unexpected<_Er>; + +/// @cond undoc +namespace __expected +{ + template + struct _Guard + { + static_assert( is_nothrow_move_constructible_v<_Tp> ); + + constexpr explicit + _Guard(_Tp& __x) + : _M_guarded(__builtin_addressof(__x)), _M_tmp(std::move(__x)) // nothrow + { std::destroy_at(_M_guarded); } + + constexpr + ~_Guard() + { + if (_M_guarded) [[unlikely]] + std::construct_at(_M_guarded, std::move(_M_tmp)); + } + + _Guard(const _Guard&) = delete; + _Guard& operator=(const _Guard&) = delete; + + constexpr _Tp&& + release() noexcept + { + _M_guarded = nullptr; + return std::move(_M_tmp); + } + + private: + _Tp* _M_guarded; + _Tp _M_tmp; + }; + + // reinit-expected helper from [expected.object.assign] + template + constexpr void + __reinit(_Tp* __newval, _Up* __oldval, _Vp&& __arg) + noexcept(is_nothrow_constructible_v<_Tp, _Vp>) + { + if constexpr (is_nothrow_constructible_v<_Tp, _Vp>) + { + std::destroy_at(__oldval); + std::construct_at(__newval, std::forward<_Vp>(__arg)); + } + else if constexpr (is_nothrow_move_constructible_v<_Tp>) + { + _Tp __tmp(std::forward<_Vp>(__arg)); // might throw + std::destroy_at(__oldval); + std::construct_at(__newval, std::move(__tmp)); + } + else + { + _Guard<_Up> __guard(*__oldval); + std::construct_at(__newval, std::forward<_Vp>(__arg)); // might throw + __guard.release(); + } + } +} +/// @endcond + + template + class expected + { + static_assert( ! is_reference_v<_Tp> ); + static_assert( ! is_function_v<_Tp> ); + static_assert( ! is_same_v, in_place_t> ); + static_assert( ! is_same_v, unexpect_t> ); + static_assert( ! __expected::__is_unexpected> ); + static_assert( __expected::__can_be_unexpected<_Er> ); + + template> + static constexpr bool __cons_from_expected + = __or_v&>, + is_constructible<_Tp, expected<_Up, _Err>>, + is_constructible<_Tp, const expected<_Up, _Err>&>, + is_constructible<_Tp, const expected<_Up, _Err>>, + is_convertible&, _Tp>, + is_convertible, _Tp>, + is_convertible&, _Tp>, + is_convertible, _Tp>, + is_constructible<_Unex, expected<_Up, _Err>&>, + is_constructible<_Unex, expected<_Up, _Err>>, + is_constructible<_Unex, const expected<_Up, _Err>&>, + is_constructible<_Unex, const expected<_Up, _Err>> + >; + + template + constexpr static bool __explicit_conv + = __or_v<__not_>, + __not_> + >; + + public: + using value_type = _Tp; + using error_type = _Er; + using unexpected_type = unexpected<_Er>; + + template + using rebind = expected<_Up, error_type>; + + constexpr + expected() + noexcept(is_nothrow_default_constructible_v<_Tp>) + requires is_default_constructible_v<_Tp> + : _M_val(), _M_has_value(true) + { } + + expected(const expected&) = default; + + constexpr + expected(const expected& __x) + noexcept(__and_v, + is_nothrow_copy_constructible<_Er>>) + requires is_copy_constructible_v<_Tp> && is_copy_constructible_v<_Er> + && (!is_trivially_copy_constructible_v<_Tp> + || !is_trivially_copy_constructible_v<_Er>) + : _M_invalid(), _M_has_value(__x._M_has_value) + { + if (_M_has_value) + std::construct_at(__builtin_addressof(_M_val), __x._M_val); + else + std::construct_at(__builtin_addressof(_M_unex), __x._M_unex); + } + + expected(expected&&) = default; + + constexpr + expected(expected&& __x) + noexcept(__and_v, + is_nothrow_move_constructible<_Er>>) + requires is_move_constructible_v<_Tp> && is_move_constructible_v<_Er> + && (!is_trivially_move_constructible_v<_Tp> + || !is_trivially_move_constructible_v<_Er>) + : _M_invalid(), _M_has_value(__x._M_has_value) + { + if (_M_has_value) + std::construct_at(__builtin_addressof(_M_val), + std::move(__x)._M_val); + else + std::construct_at(__builtin_addressof(_M_unex), + std::move(__x)._M_unex); + } + + template + requires is_constructible_v<_Tp, const _Up&> + && is_constructible_v<_Er, const _Gr&> + && (!__cons_from_expected<_Up, _Gr>) + constexpr explicit(__explicit_conv) + expected(const expected<_Up, _Gr>& __x) + noexcept(__and_v, + is_nothrow_constructible<_Er, const _Gr&>>) + : _M_invalid(), _M_has_value(__x._M_has_value) + { + if (_M_has_value) + std::construct_at(__builtin_addressof(_M_val), __x._M_val); + else + std::construct_at(__builtin_addressof(_M_unex), __x._M_unex); + } + + template + requires is_constructible_v<_Tp, _Up> + && is_constructible_v<_Er, _Gr> + && (!__cons_from_expected<_Up, _Gr>) + constexpr explicit(__explicit_conv<_Up, _Gr>) + expected(expected<_Up, _Gr>&& __x) + noexcept(__and_v, + is_nothrow_constructible<_Er, _Gr>>) + : _M_invalid(), _M_has_value(__x._M_has_value) + { + if (_M_has_value) + std::construct_at(__builtin_addressof(_M_val), + std::move(__x)._M_val); + else + std::construct_at(__builtin_addressof(_M_unex), + std::move(__x)._M_unex); + } + + template + requires (!is_same_v, expected>) + && (!is_same_v, in_place_t>) + && (!__expected::__is_unexpected>) + && is_constructible_v<_Tp, _Up> + constexpr explicit(!is_convertible_v<_Up, _Tp>) + expected(_Up&& __v) + noexcept(is_nothrow_constructible_v<_Tp, _Up>) + : _M_val(std::forward<_Up>(__v)), _M_has_value(true) + { } + + template + requires is_constructible_v<_Er, const _Gr&> + constexpr explicit(!is_convertible_v) + expected(const unexpected<_Gr>& __u) + noexcept(is_nothrow_constructible_v<_Er, const _Gr&>) + : _M_unex(__u.error()), _M_has_value(false) + { } + + template + requires is_constructible_v<_Er, _Gr> + constexpr explicit(!is_convertible_v<_Gr, _Er>) + expected(unexpected<_Gr>&& __u) + noexcept(is_nothrow_constructible_v<_Er, _Gr>) + : _M_unex(std::move(__u).error()), _M_has_value(false) + { } + + template + requires is_constructible_v<_Tp, _Args...> + constexpr explicit + expected(in_place_t, _Args&&... __args) + noexcept(is_nothrow_constructible_v<_Tp, _Args...>) + : _M_val(std::forward<_Args>(__args)...), _M_has_value(true) + { } + + template + requires is_constructible_v<_Tp, initializer_list<_Up>&, _Args...> + constexpr explicit + expected(in_place_t, initializer_list<_Up> __il, _Args&&... __args) + noexcept(is_nothrow_constructible_v<_Tp, initializer_list<_Up>&, + _Args...>) + : _M_val(__il, std::forward<_Args>(__args)...), _M_has_value(true) + { } + + template + requires is_constructible_v<_Er, _Args...> + constexpr explicit + expected(unexpect_t, _Args&&... __args) + noexcept(is_nothrow_constructible_v<_Er, _Args...>) + : _M_unex(std::forward<_Args>(__args)...), _M_has_value(false) + { } + + template + requires is_constructible_v<_Er, initializer_list<_Up>&, _Args...> + constexpr explicit + expected(unexpect_t, initializer_list<_Up> __il, _Args&&... __args) + noexcept(is_nothrow_constructible_v<_Er, initializer_list<_Up>&, + _Args...>) + : _M_unex(__il, std::forward<_Args>(__args)...), _M_has_value(false) + { } + + constexpr ~expected() = default; + + constexpr ~expected() + requires (!is_trivially_destructible_v<_Tp>) + || (!is_trivially_destructible_v<_Er>) + { + if (_M_has_value) + std::destroy_at(__builtin_addressof(_M_val)); + else + std::destroy_at(__builtin_addressof(_M_unex)); + } + + // assignment + + expected& operator=(const expected&) = delete; + + constexpr expected& + operator=(const expected& __x) + noexcept(__and_v, + is_nothrow_copy_constructible<_Er>, + is_nothrow_copy_assignable<_Tp>, + is_nothrow_copy_assignable<_Er>>) + requires is_copy_assignable_v<_Tp> && is_copy_constructible_v<_Tp> + && is_copy_assignable_v<_Er> && is_copy_constructible_v<_Er> + && (is_nothrow_move_constructible_v<_Tp> + || is_nothrow_move_constructible_v<_Er>) + { + if (__x._M_has_value) + this->_M_assign_val(__x._M_val); + else + this->_M_assign_unex(__x._M_unex); + return *this; + } + + constexpr expected& + operator=(expected&& __x) + noexcept(__and_v, + is_nothrow_move_constructible<_Er>, + is_nothrow_move_assignable<_Tp>, + is_nothrow_move_assignable<_Er>>) + requires is_move_assignable_v<_Tp> && is_move_constructible_v<_Tp> + && is_move_assignable_v<_Er> && is_move_constructible_v<_Er> + && (is_nothrow_move_constructible_v<_Tp> + || is_nothrow_move_constructible_v<_Er>) + { + if (__x._M_has_value) + _M_assign_val(std::move(__x._M_val)); + else + _M_assign_unex(std::move(__x._M_unex)); + return *this; + } + + template + requires (!is_same_v>) + && (!__expected::__is_unexpected>) + && is_constructible_v<_Tp, _Up> && is_assignable_v<_Tp&, _Up> + && (is_nothrow_constructible_v<_Tp, _Up> + || is_nothrow_move_constructible_v<_Tp> + || is_nothrow_move_constructible_v<_Er>) + constexpr expected& + operator=(_Up&& __v) + { + _M_assign_val(std::forward<_Up>(__v)); + return *this; + } + + template + requires is_constructible_v<_Er, const _Gr&> + && is_assignable_v<_Er&, const _Gr&> + && (is_nothrow_constructible_v<_Er, const _Gr&> + || is_nothrow_move_constructible_v<_Tp> + || is_nothrow_move_constructible_v<_Er>) + constexpr expected& + operator=(const unexpected<_Gr>& __e) + { + _M_assign_unex(__e.error()); + return *this; + } + + template + requires is_constructible_v<_Er, _Gr> + && is_assignable_v<_Er&, _Gr> + && (is_nothrow_constructible_v<_Er, _Gr> + || is_nothrow_move_constructible_v<_Tp> + || is_nothrow_move_constructible_v<_Er>) + constexpr expected& + operator=(unexpected<_Gr>&& __e) + { + _M_assign_unex(std::move(__e).error()); + return *this; + } + + // modifiers + + template + requires is_nothrow_constructible_v<_Tp, _Args...> + constexpr _Tp& + emplace(_Args&&... __args) noexcept + { + if (_M_has_value) + std::destroy_at(__builtin_addressof(_M_val)); + else + { + std::destroy_at(__builtin_addressof(_M_unex)); + _M_has_value = true; + } + std::construct_at(__builtin_addressof(_M_val), + std::forward<_Args>(__args)...); + return _M_val; + } + + template + requires is_nothrow_constructible_v<_Tp, initializer_list<_Up>&, + _Args...> + constexpr _Tp& + emplace(initializer_list<_Up> __il, _Args&&... __args) noexcept + { + if (_M_has_value) + std::destroy_at(__builtin_addressof(_M_val)); + else + { + std::destroy_at(__builtin_addressof(_M_unex)); + _M_has_value = true; + } + std::construct_at(__builtin_addressof(_M_val), + __il, std::forward<_Args>(__args)...); + return _M_val; + } + + // swap + constexpr void + swap(expected& __x) + noexcept(__and_v, + is_nothrow_move_constructible<_Er>, + is_nothrow_swappable<_Tp&>, + is_nothrow_swappable<_Er&>>) + requires is_swappable_v<_Tp> && is_swappable_v<_Er> + && is_move_constructible_v<_Tp> + && is_move_constructible_v<_Er> + && (is_nothrow_move_constructible_v<_Tp> + || is_nothrow_move_constructible_v<_Er>) + { + if (_M_has_value) + { + if (__x._M_has_value) + { + using std::swap; + swap(_M_val, __x._M_val); + } + else + this->_M_swap_val_unex(__x); + } + else + { + if (__x._M_has_value) + __x._M_swap_val_unex(*this); + else + { + using std::swap; + swap(_M_unex, __x._M_unex); + } + } + } + + // observers + + [[nodiscard]] + constexpr const _Tp* + operator->() const noexcept + { + __glibcxx_assert(_M_has_value); + return __builtin_addressof(_M_val); + } + + [[nodiscard]] + constexpr _Tp* + operator->() noexcept + { + __glibcxx_assert(_M_has_value); + return __builtin_addressof(_M_val); + } + + [[nodiscard]] + constexpr const _Tp& + operator*() const & noexcept + { + __glibcxx_assert(_M_has_value); + return _M_val; + } + + [[nodiscard]] + constexpr _Tp& + operator*() & noexcept + { + __glibcxx_assert(_M_has_value); + return _M_val; + } + + [[nodiscard]] + constexpr const _Tp&& + operator*() const && noexcept + { + __glibcxx_assert(_M_has_value); + return std::move(_M_val); + } + + [[nodiscard]] + constexpr _Tp&& + operator*() && noexcept + { + __glibcxx_assert(_M_has_value); + return std::move(_M_val); + } + + [[nodiscard]] + constexpr explicit + operator bool() const noexcept { return _M_has_value; } + + [[nodiscard]] + constexpr bool has_value() const noexcept { return _M_has_value; } + + constexpr const _Tp& + value() const & + { + if (_M_has_value) [[likely]] + return _M_val; + _GLIBCXX_THROW_OR_ABORT(bad_expected_access<_Er>(_M_unex)); + } + + constexpr _Tp& + value() & + { + if (_M_has_value) [[likely]] + return _M_val; + _GLIBCXX_THROW_OR_ABORT(bad_expected_access<_Er>(_M_unex)); + } + + constexpr const _Tp&& + value() const && + { + if (_M_has_value) [[likely]] + return std::move(_M_val); + _GLIBCXX_THROW_OR_ABORT(bad_expected_access<_Er>( + std::move(_M_unex))); + } + + constexpr _Tp&& + value() && + { + if (_M_has_value) [[likely]] + return std::move(_M_val); + _GLIBCXX_THROW_OR_ABORT(bad_expected_access<_Er>( + std::move(_M_unex))); + } + + constexpr const _Er& + error() const & noexcept + { + __glibcxx_assert(!_M_has_value); + return _M_unex; + } + + constexpr _Er& + error() & noexcept + { + __glibcxx_assert(!_M_has_value); + return _M_unex; + } + + constexpr const _Er&& + error() const && noexcept + { + __glibcxx_assert(!_M_has_value); + return std::move(_M_unex); + } + + constexpr _Er&& + error() && noexcept + { + __glibcxx_assert(!_M_has_value); + return std::move(_M_unex); + } + + template + constexpr _Tp + value_or(_Up&& __v) const & + noexcept(__and_v, + is_nothrow_convertible<_Up, _Tp>>) + { + static_assert( is_copy_constructible_v<_Tp> ); + static_assert( is_convertible_v<_Up, _Tp> ); + + if (_M_has_value) + return _M_val; + return static_cast<_Tp>(std::forward<_Up>(__v)); + } + + template + constexpr _Tp + value_or(_Up&& __v) && + noexcept(__and_v, + is_nothrow_convertible<_Up, _Tp>>) + { + static_assert( is_move_constructible_v<_Tp> ); + static_assert( is_convertible_v<_Up, _Tp> ); + + if (_M_has_value) + return std::move(_M_val); + return static_cast<_Tp>(std::forward<_Up>(__v)); + } + + // equality operators + + template + requires (!is_void_v<_Up>) + friend constexpr bool + operator==(const expected& __x, const expected<_Up, _Er2>& __y) + noexcept(noexcept(bool(*__x == *__y)) + && noexcept(bool(__x.error() == __y.error()))) + { + if (__x.has_value()) + return __y.has_value() && bool(*__x == *__y); + else + return !__y.has_value() && bool(__x.error() == __y.error()); + } + + template + friend constexpr bool + operator==(const expected& __x, const _Up& __v) + noexcept(noexcept(bool(*__x == __v))) + { return __x.has_value() && bool(*__x == __v); } + + template + friend constexpr bool + operator==(const expected& __x, const unexpected<_Er2>& __e) + noexcept(noexcept(bool(__x.error() == __e.error()))) + { return !__x.has_value() && bool(__x.error() == __e.error()); } + + friend constexpr void + swap(expected& __x, expected& __y) + noexcept(noexcept(__x.swap(__y))) + requires requires {__x.swap(__y);} + { __x.swap(__y); } + + private: + template friend class expected; + + template + constexpr void + _M_assign_val(_Vp&& __v) + { + if (_M_has_value) + _M_val = std::forward<_Vp>(__v); + else + { + __expected::__reinit(__builtin_addressof(_M_val), + __builtin_addressof(_M_unex), + std::forward<_Vp>(__v)); + _M_has_value = true; + } + } + + template + constexpr void + _M_assign_unex(_Vp&& __v) + { + if (_M_has_value) + { + __expected::__reinit(__builtin_addressof(_M_unex), + __builtin_addressof(_M_val), + std::forward<_Vp>(__v)); + _M_has_value = false; + } + else + _M_unex = std::forward<_Vp>(__v); + } + + // Swap two expected objects when only one has a value. + // Precondition: this->_M_has_value && !__rhs._M_has_value + constexpr void + _M_swap_val_unex(expected& __rhs) + noexcept(__and_v, + is_nothrow_move_constructible<_Tp>>) + { + if constexpr (is_nothrow_move_constructible_v<_Er>) + { + __expected::_Guard<_Er> __guard(__rhs._M_unex); + std::construct_at(__builtin_addressof(__rhs._M_val), + std::move(_M_val)); // might throw + __rhs._M_has_value = true; + std::destroy_at(__builtin_addressof(_M_val)); + std::construct_at(__builtin_addressof(_M_unex), + __guard.release()); + _M_has_value = false; + } + else + { + __expected::_Guard<_Tp> __guard(__rhs._M_val); + std::construct_at(__builtin_addressof(_M_unex), + std::move(__rhs._M_unex)); // might throw + _M_has_value = false; + std::destroy_at(__builtin_addressof(__rhs._M_unex)); + std::construct_at(__builtin_addressof(__rhs._M_val), + __guard.release()); + __rhs._M_has_value = true; + } + } + + union { + struct { } _M_invalid; + _Tp _M_val; + _Er _M_unex; + }; + + bool _M_has_value; + }; + + // Partial specialization for std::expected + template requires is_void_v<_Tp> + class expected<_Tp, _Er> + { + static_assert( __expected::__can_be_unexpected<_Er> ); + + template> + static constexpr bool __cons_from_expected + = __or_v&>, + is_constructible<_Unex, expected<_Up, _Err>>, + is_constructible<_Unex, const expected<_Up, _Err>&>, + is_constructible<_Unex, const expected<_Up, _Err>> + >; + + public: + using value_type = _Tp; + using error_type = _Er; + using unexpected_type = unexpected<_Er>; + + template + using rebind = expected<_Up, error_type>; + + constexpr + expected() noexcept + : _M_void(), _M_has_value(true) + { } + + expected(const expected&) = default; + + constexpr + expected(const expected& __x) + noexcept(is_nothrow_copy_constructible_v<_Er>) + requires is_copy_constructible_v<_Er> + && (!is_trivially_copy_constructible_v<_Er>) + : _M_void(), _M_has_value(__x._M_has_value) + { + if (!_M_has_value) + std::construct_at(__builtin_addressof(_M_unex), __x._M_unex); + } + + expected(expected&&) = default; + + constexpr + expected(expected&& __x) + noexcept(is_nothrow_move_constructible_v<_Er>) + requires is_move_constructible_v<_Er> + && (!is_trivially_move_constructible_v<_Er>) + : _M_void(), _M_has_value(__x._M_has_value) + { + if (!_M_has_value) + std::construct_at(__builtin_addressof(_M_unex), + std::move(__x)._M_unex); + } + + template + requires is_void_v<_Up> + && is_constructible_v<_Er, const _Gr&> + && (!__cons_from_expected<_Up, _Gr>) + constexpr explicit(!is_convertible_v) + expected(const expected<_Up, _Gr>& __x) + noexcept(is_nothrow_constructible_v<_Er, const _Gr&>) + : _M_void(), _M_has_value(__x._M_has_value) + { + if (!_M_has_value) + std::construct_at(__builtin_addressof(_M_unex), __x._M_unex); + } + + template + requires is_void_v<_Tp> + && is_constructible_v<_Er, const _Gr&> + && (!__cons_from_expected<_Up, _Gr>) + constexpr explicit(!is_convertible_v<_Gr, _Er>) + expected(expected<_Up, _Gr>&& __x) + noexcept(is_nothrow_constructible_v<_Er, _Gr>) + : _M_void(), _M_has_value(__x._M_has_value) + { + if (!_M_has_value) + std::construct_at(__builtin_addressof(_M_unex), + std::move(__x)._M_unex); + } + + template + requires is_constructible_v<_Er, const _Gr&> + constexpr explicit(!is_convertible_v) + expected(const unexpected<_Gr>& __u) + noexcept(is_nothrow_constructible_v<_Er, const _Gr&>) + : _M_unex(__u.error()), _M_has_value(false) + { } + + template + requires is_constructible_v<_Er, _Gr> + constexpr explicit(!is_convertible_v<_Gr, _Er>) + expected(unexpected<_Gr>&& __u) + noexcept(is_nothrow_constructible_v<_Er, _Gr>) + : _M_unex(std::move(__u).error()), _M_has_value(false) + { } + + template + constexpr explicit + expected(in_place_t) noexcept + : expected() + { } + + template + requires is_constructible_v<_Er, _Args...> + constexpr explicit + expected(unexpect_t, _Args&&... __args) + noexcept(is_nothrow_constructible_v<_Er, _Args...>) + : _M_unex(std::forward<_Args>(__args)...), _M_has_value(false) + { } + + template + requires is_constructible_v<_Er, initializer_list<_Up>&, _Args...> + constexpr explicit + expected(unexpect_t, initializer_list<_Up> __il, _Args&&... __args) + noexcept(is_nothrow_constructible_v<_Er, initializer_list<_Up>&, + _Args...>) + : _M_unex(__il, std::forward<_Args>(__args)...), _M_has_value(false) + { } + + constexpr ~expected() = default; + + constexpr ~expected() requires (!is_trivially_destructible_v<_Er>) + { + if (!_M_has_value) + std::destroy_at(__builtin_addressof(_M_unex)); + } + + // assignment + + expected& operator=(const expected&) = delete; + + constexpr expected& + operator=(const expected& __x) + noexcept(__and_v, + is_nothrow_copy_assignable<_Er>>) + requires is_copy_constructible_v<_Er> + && is_copy_assignable_v<_Er> + { + if (__x._M_has_value) + emplace(); + else + _M_assign_unex(__x._M_unex); + return *this; + } + + constexpr expected& + operator=(expected&& __x) + noexcept(__and_v, + is_nothrow_move_assignable<_Er>>) + requires is_move_constructible_v<_Er> + && is_move_assignable_v<_Er> + { + if (__x._M_has_value) + emplace(); + else + _M_assign_unex(std::move(__x._M_unex)); + return *this; + } + + template + requires is_constructible_v<_Er, const _Gr&> + && is_assignable_v<_Er&, const _Gr&> + constexpr expected& + operator=(const unexpected<_Gr>& __e) + { + _M_assign_unex(__e.error()); + return *this; + } + + template + requires is_constructible_v<_Er, _Gr> + && is_assignable_v<_Er&, _Gr> + constexpr expected& + operator=(unexpected<_Gr>&& __e) + { + _M_assign_unex(std::move(__e.error())); + return *this; + } + + // modifiers + + constexpr void + emplace() noexcept + { + if (!_M_has_value) + { + std::destroy_at(__builtin_addressof(_M_unex)); + _M_has_value = true; + } + } + + // swap + constexpr void + swap(expected& __x) + noexcept(__and_v, + is_nothrow_move_constructible<_Er>>) + requires is_swappable_v<_Er> && is_move_constructible_v<_Er> + { + if (_M_has_value) + { + if (!__x._M_has_value) + { + std::construct_at(__builtin_addressof(_M_unex), + std::move(__x._M_unex)); // might throw + std::destroy_at(__builtin_addressof(__x._M_unex)); + __x._M_has_value = true; + } + } + else + { + if (__x._M_has_value) + { + std::construct_at(__builtin_addressof(__x._M_unex), + std::move(_M_unex)); // might throw + std::destroy_at(__builtin_addressof(_M_unex)); + _M_has_value = true; + } + else + { + using std::swap; + swap(_M_unex, __x._M_unex); + } + } + } + + // observers + + [[nodiscard]] + constexpr explicit + operator bool() const noexcept { return _M_has_value; } + + [[nodiscard]] + constexpr bool has_value() const noexcept { return _M_has_value; } + + constexpr void + operator*() const noexcept { __glibcxx_assert(_M_has_value); } + + constexpr void + value() const& + { + if (_M_has_value) [[likely]] + return; + _GLIBCXX_THROW_OR_ABORT(bad_expected_access<_Er>(_M_unex)); + } + + constexpr void + value() && + { + if (_M_has_value) [[likely]] + return; + _GLIBCXX_THROW_OR_ABORT(bad_expected_access<_Er>(std::move(_M_unex))); + } + + constexpr const _Er& + error() const & noexcept + { + __glibcxx_assert(!_M_has_value); + return _M_unex; + } + + constexpr _Er& + error() & noexcept + { + __glibcxx_assert(!_M_has_value); + return _M_unex; + } + + constexpr const _Er&& + error() const && noexcept + { + __glibcxx_assert(!_M_has_value); + return std::move(_M_unex); + } + + constexpr _Er&& + error() && noexcept + { + __glibcxx_assert(!_M_has_value); + return std::move(_M_unex); + } + + // equality operators + + template + requires is_void_v<_Up> + friend constexpr bool + operator==(const expected& __x, const expected<_Up, _Er2>& __y) + noexcept(noexcept(bool(__x.error() == __y.error()))) + { + if (__x.has_value()) + return __y.has_value(); + else + return !__y.has_value() && bool(__x.error() == __y.error()); + } + + template + friend constexpr bool + operator==(const expected& __x, const unexpected<_Er2>& __e) + noexcept(noexcept(bool(__x.error() == __e.error()))) + { return !__x.has_value() && bool(__x.error() == __e.error()); } + + friend constexpr void + swap(expected& __x, expected& __y) + noexcept(noexcept(__x.swap(__y))) + requires requires { __x.swap(__y); } + { __x.swap(__y); } + + private: + template friend class expected; + + template + constexpr void + _M_assign_unex(_Vp&& __v) + { + if (_M_has_value) + { + std::construct_at(__builtin_addressof(_M_unex), + std::forward<_Vp>(__v)); + _M_has_value = false; + } + else + _M_unex = std::forward<_Vp>(__v); + } + + + union { + struct { } _M_void; + _Er _M_unex; + }; + + bool _M_has_value; + }; + /// @} + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace std + +#endif // C++23 +#endif // _GLIBCXX_EXPECTED diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index 535f095108a..7dbac23f22d 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -306,6 +306,7 @@ #if _GLIBCXX_HOSTED #define __cpp_lib_adaptor_iterator_pair_constructor 202106L +#define __cpp_lib_expected 202202L #define __cpp_lib_invoke_r 202106L #define __cpp_lib_ios_noreplace 202200L #if __cpp_lib_concepts diff --git a/libstdc++-v3/libsupc++/exception b/libstdc++-v3/libsupc++/exception index 43f1cf71262..ae2b0dd7f78 100644 --- a/libstdc++-v3/libsupc++/exception +++ b/libstdc++-v3/libsupc++/exception @@ -79,7 +79,7 @@ namespace std * abandoned for any reason. It can also be called by the user. */ void terminate() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__noreturn__)); -#if __cplusplus < 201703L || _GLIBCXX_USE_DEPRECATED +#if __cplusplus < 201703L || (__cplusplus <= 202002L && _GLIBCXX_USE_DEPRECATED) /// If you write a replacement %unexpected handler, it must be of this type. typedef void (*_GLIBCXX11_DEPRECATED unexpected_handler) (); diff --git a/libstdc++-v3/testsuite/20_util/expected/assign.cc b/libstdc++-v3/testsuite/20_util/expected/assign.cc new file mode 100644 index 00000000000..bbf5b900f4c --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/expected/assign.cc @@ -0,0 +1,321 @@ +// { dg-options "-std=gnu++23" } +// { dg-do run { target c++23 } } + +#include +#include +#include + +int dtor_count; +constexpr void reset_dtor_count() +{ + if (!std::is_constant_evaluated()) + dtor_count = 0; +} +constexpr void inc_dtor_count() +{ + if (!std::is_constant_evaluated()) + ++dtor_count; +} +constexpr bool check_dtor_count(int c) +{ + if (std::is_constant_evaluated()) + return true; + return dtor_count == c; +} + +struct X +{ + constexpr X(int i, int j = 0) noexcept : n(i+j) { } + constexpr X(std::initializer_list l, void*) noexcept : n(l.size()) { } + + constexpr X(const X&) = default; + constexpr X(X&& x) noexcept : n(x.n) { x.n = -1; } + + constexpr X& operator=(const X&) = default; + constexpr X& operator=(X&& x) noexcept { n = x.n; x.n = -1; return *this; } + + constexpr ~X() + { + inc_dtor_count(); + } + + constexpr bool operator==(const X&) const = default; + constexpr bool operator==(int i) const { return n == i; } + + int n; +}; + +constexpr bool +test_copy(bool = true) +{ + reset_dtor_count(); + + std::expected e1(1), e2(2), e3(std::unexpect, 3); + + e1 = e1; + e1 = e2; // T = T + VERIFY( e1.value() == e2.value() ); + e1 = e3; // T = E + VERIFY( ! e1.has_value() ); + VERIFY( e1.error() == e3.error() ); + e1 = e3; // E = E + VERIFY( ! e1.has_value() ); + VERIFY( e1.error() == e3.error() ); + e1 = e2; // E = T + VERIFY( e1.value() == e2.value() ); + + e1 = std::move(e1); + e1 = std::move(e2); // T = T + VERIFY( e1.value() == e2.value() ); + e1 = std::move(e3); // T = E + VERIFY( ! e1.has_value() ); + VERIFY( e1.error() == e3.error() ); + e1 = std::move(e3); // E = E + VERIFY( ! e1.has_value() ); + VERIFY( e1.error() == e3.error() ); + e1 = std::move(e2); // E = T + VERIFY( e1.value() == e2.value() ); + + std::expected x1(1), x2(2), x3(std::unexpect, 3); + + x1 = x1; + + x1 = x2; // T = T + VERIFY( check_dtor_count(0) ); + VERIFY( x1.value() == x2.value() ); + x1 = x3; // T = E + VERIFY( check_dtor_count(1) ); + VERIFY( ! x1.has_value() ); + x1 = x3; // E = E + VERIFY( check_dtor_count(1) ); + VERIFY( ! x1.has_value() ); + x1 = x2; // E = T + VERIFY( check_dtor_count(2) ); + VERIFY( x1.value() == x2.value() ); + + reset_dtor_count(); + + x1 = std::move(x1); + VERIFY( x1.value() == -1 ); + + x1 = std::move(x2); // T = T + VERIFY( check_dtor_count(0) ); + VERIFY( x1.value() == 2 ); + VERIFY( x2.value() == -1 ); + x1 = std::move(x3); // T = E + VERIFY( check_dtor_count(1) ); + VERIFY( ! x1.has_value() ); + VERIFY( x1.error() == 3 ); + VERIFY( x3.error() == -1 ); + x3.error().n = 33; + x1 = std::move(x3); // E = E + VERIFY( check_dtor_count(1) ); + VERIFY( ! x1.has_value() ); + VERIFY( x1.error() == 33 ); + VERIFY( x3.error() == -1 ); + x2.value().n = 22; + x1 = std::move(x2); // E = T + VERIFY( check_dtor_count(2) ); + VERIFY( x1.value() == 22 ); + VERIFY( x2.value() == -1 ); + + std::expected ev1, ev2, ev3(std::unexpect, 3); + + ev1 = ev2; // T = T + VERIFY( ev1.has_value() ); + ev1 = ev3; // T = E + VERIFY( ! ev1.has_value() ); + VERIFY( ev1.error() == ev3.error() ); + ev1 = ev3; // E = E + VERIFY( ! ev1.has_value() ); + VERIFY( ev1.error() == ev3.error() ); + ev1 = ev2; // E = T + VERIFY( ev1.has_value() ); + + reset_dtor_count(); + std::expected xv1, xv2, xv3(std::unexpect, 3); + + xv1 = std::move(xv2); // T = T + VERIFY( check_dtor_count(0) ); + VERIFY( xv1.has_value() ); + xv1 = std::move(xv3); // T = E + VERIFY( check_dtor_count(0) ); + VERIFY( ! xv1.has_value() ); + VERIFY( xv1.error() == 3 ); + VERIFY( xv3.error() == -1 ); + xv3.error().n = 33; + xv1 = std::move(xv3); // E = E + VERIFY( check_dtor_count(0) ); + VERIFY( xv1.error() == 33 ); + VERIFY( xv3.error() == -1 ); + xv1 = std::move(xv2); // E = T + VERIFY( check_dtor_count(1) ); + VERIFY( xv1.has_value() ); + + return true; +} + +constexpr bool +test_converting(bool = true) +{ + std::expected e1(1); + std::expected e2(2U), e3(std::unexpect, 3L); + e1 = e2; + VERIFY( e1.value() == e2.value() ); + e1 = e3; + VERIFY( ! e1.has_value() ); + VERIFY( e1.error() == e3.error() ); + e1 = e2; + VERIFY( e1.value() == e2.value() ); + + e1 = std::move(e3); + VERIFY( ! e1.has_value() ); + VERIFY( e1.error() == e3.error() ); + e1 = std::move(e2); + VERIFY( e1.value() == e2.value() ); + + std::expected ev4; + std::expected ev5(std::unexpect, 5); + ev4 = ev5; + VERIFY( ! ev4.has_value() ); + VERIFY( ev4.error() == 5 ); + ev4 = std::expected(); + VERIFY( ev4.has_value() ); + ev4 = std::move(ev5); + VERIFY( ! ev4.has_value() ); + VERIFY( ev4.error() == 5 ); + + return true; +} + +constexpr bool +test_unexpected(bool = true) +{ + reset_dtor_count(); + + std::expected e1(0); + + e1 = std::unexpected(5); + VERIFY( ! e1.has_value() ); + VERIFY( e1.error() == 5 ); + VERIFY( check_dtor_count(1) ); + + e1 = std::unexpected(6); + VERIFY( check_dtor_count(1) ); + + std::expected e2; + + std::unexpected x(std::in_place, 1, 2); + e2 = x; + VERIFY( check_dtor_count(1) ); + + e2 = 1; + VERIFY( e2.value() == 1 ); + VERIFY( check_dtor_count(2) ); + + return true; +} + +constexpr bool +test_emplace(bool = true) +{ + reset_dtor_count(); + + std::expected e1(1); + e1.emplace(2); + VERIFY( e1.value() == 2 ); + + std::expected ev2; + ev2.emplace(); + VERIFY( ev2.has_value() ); + + std::expected e3(std::in_place, 0, 0); + + e3.emplace({1,2,3}, nullptr); + VERIFY( e3.value() == 3 ); + VERIFY( check_dtor_count(1) ); + + e3.emplace(2, 2); + VERIFY( e3.value() == 4 ); + VERIFY( check_dtor_count(2) ); + + std::expected ev4(std::unexpect, 4); + + ev4.emplace(5); + VERIFY( ev4.value() == 5 ); + VERIFY( check_dtor_count(3) ); + + ev4.emplace(6); + VERIFY( ev4.value() == 6 ); + VERIFY( check_dtor_count(3) ); + + return true; +} + +void +test_exception_safety() +{ + struct CopyThrows + { + CopyThrows(int i) noexcept : x(i) { } + CopyThrows(const CopyThrows&) { throw 1; } + CopyThrows(CopyThrows&&) = default; + CopyThrows& operator=(const CopyThrows&) = default; + CopyThrows& operator=(CopyThrows&&) = default; + int x; + + bool operator==(int i) const { return x == i; } + }; + + struct MoveThrows + { + MoveThrows(int i) noexcept : x(i) { } + MoveThrows(const MoveThrows&) = default; + MoveThrows(MoveThrows&&) { throw 1L; } + MoveThrows& operator=(const MoveThrows&) = default; + MoveThrows& operator=(MoveThrows&&) = default; + int x; + + bool operator==(int i) const { return x == i; } + }; + + std::expected c(std::unexpect, 1); + + // operator=(U&&) + try { + CopyThrows x(2); + c = x; + VERIFY( false ); + } catch (int) { + VERIFY( ! c.has_value() ); + VERIFY( c.error() == 1 ); + } + + c = CopyThrows(2); + + try { + c = std::unexpected(3); + VERIFY( false ); + } catch (long) { + VERIFY( c.value() == 2 ); + } +} + +int main(int argc, char**) +{ + bool non_constant = argc == 1; // force non-constant evaluation + + static_assert( test_copy() ); + test_copy(non_constant); + static_assert( test_converting() ); + test_converting(non_constant); + static_assert( test_unexpected() ); + test_unexpected(non_constant); + static_assert( test_emplace() ); + test_emplace(non_constant); + + test_exception_safety(); + + // Ensure the non-constexpr tests actually ran: + VERIFY( dtor_count != 0 ); +} diff --git a/libstdc++-v3/testsuite/20_util/expected/cons.cc b/libstdc++-v3/testsuite/20_util/expected/cons.cc new file mode 100644 index 00000000000..1fe5b7bf4d1 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/expected/cons.cc @@ -0,0 +1,175 @@ +// { dg-options "-std=gnu++23" } +// { dg-do run { target c++23 } } + +#include +#include + +constexpr bool +test_default() +{ + std::expected e; + VERIFY( e.has_value() ); + VERIFY( *e == 0 ); + + std::expected ev; + VERIFY( ev.has_value() ); + VERIFY( (ev.value(), true) ); + + return true; +} + +constexpr bool +test_val() +{ + std::expected e1(1); + VERIFY( e1.has_value() ); + VERIFY( *e1 == 1 ); + + std::expected e2(std::in_place, 2); + VERIFY( e2.has_value() ); + VERIFY( *e2 == 2 ); + + struct X + { + constexpr X(std::initializer_list l, void*) : n(l.size()) { } + int n; + }; + + std::expected e3(X{{1, 2, 3}, nullptr}); + VERIFY( e3.has_value() ); + VERIFY( e3->n == 3 ); + + std::expected e4(std::in_place, {1, 2, 3, 4}, nullptr); + VERIFY( e4.has_value() ); + VERIFY( e4->n == 4 ); + + std::expected ev(std::in_place); + VERIFY( ev.has_value() ); + VERIFY( (ev.value(), true) ); + + return true; +} + +constexpr bool +test_err() +{ + std::expected e1(std::unexpected(1)); + VERIFY( ! e1.has_value() ); + VERIFY( e1.error() == 1 ); + + const std::unexpected u2(2); + std::expected e2(u2); + VERIFY( ! e2.has_value() ); + VERIFY( e2.error() == 2 ); + + std::expected e3(std::unexpect, 3); + VERIFY( ! e3.has_value() ); + VERIFY( e3.error() == 3 ); + + struct X + { + constexpr X(int i, int j) : n(i+j) { } + constexpr X(std::initializer_list l, void*) : n(l.size()) { } + int n; + }; + + std::expected e4(std::unexpect, 1, 3); + VERIFY( ! e4.has_value() ); + VERIFY( e4.error().n == 4 ); + + std::expected e5(std::unexpect, {1, 2, 3, 4, 5}, nullptr); + VERIFY( ! e5.has_value() ); + VERIFY( e5.error().n == 5 ); + + std::expected ev1(std::unexpected(1)); + VERIFY( ! ev1.has_value() ); + VERIFY( ev1.error() == 1 ); + + std::expected ev2(u2); + VERIFY( ! ev2.has_value() ); + VERIFY( ev2.error() == 2 ); + + std::expected ev3(std::unexpect, 3); + VERIFY( ! ev3.has_value() ); + VERIFY( ev3.error() == 3 ); + + std::expected ev4(std::unexpect, 1, 3); + VERIFY( ! ev4.has_value() ); + VERIFY( ev4.error().n == 4 ); + + std::expected ev5(std::unexpect, {1, 2, 3, 4, 5}, nullptr); + VERIFY( ! ev5.has_value() ); + VERIFY( ev5.error().n == 5 ); + + return true; +} + +constexpr bool +test_copy() +{ + std::expected e1(1); + std::expected e2(e1); + VERIFY( e2.value() == 1 ); + std::expected e3(std::move(e2)); + VERIFY( e2.value() == 1 ); + VERIFY( e3.value() == 1 ); + std::expected e4(e1); + VERIFY( e4.value() == 1 ); + std::expected e5(std::move(e4)); + VERIFY( e4.value() == 1 ); + VERIFY( e5.value() == 1 ); + + std::expected u1(std::unexpect, 2); + std::expected u2(u1); + VERIFY( ! u2.has_value() ); + VERIFY( u2.error() == 2 ); + std::expected u3(std::move(u2)); + VERIFY( ! u3.has_value() ); + VERIFY( u3.error() == 2 ); + std::expected u4(u1); + VERIFY( ! u4.has_value() ); + VERIFY( u4.error() == 2 ); + std::expected u5(std::move(u4)); + VERIFY( ! u5.has_value() ); + VERIFY( u5.error() == 2 ); + + std::expected ev1; + std::expected ev2(ev1); + VERIFY( ev2.has_value() ); + std::expected ev3(std::move(ev2)); + VERIFY( ev2.has_value() ); + VERIFY( ev3.has_value() ); + std::expected ev4(ev1); + VERIFY( ev4.has_value() ); + std::expected ev5(std::move(ev4)); + VERIFY( ev4.has_value() ); + VERIFY( ev5.has_value() ); + + std::expected uv1(std::unexpect, 2); + std::expected uv2(uv1); + VERIFY( ! uv2.has_value() ); + VERIFY( uv2.error() == 2 ); + std::expected uv3(std::move(uv2)); + VERIFY( ! uv3.has_value() ); + VERIFY( uv3.error() == 2 ); + std::expected uv4(uv1); + VERIFY( ! uv4.has_value() ); + VERIFY( uv4.error() == 2 ); + std::expected uv5(std::move(uv4)); + VERIFY( ! uv5.has_value() ); + VERIFY( uv5.error() == 2 ); + + return true; +} + +int main() +{ + test_default(); + static_assert( test_default() ); + test_val(); + static_assert( test_val() ); + test_err(); + static_assert( test_err() ); + test_copy(); + static_assert( test_copy() ); +} diff --git a/libstdc++-v3/testsuite/20_util/expected/illformed_neg.cc b/libstdc++-v3/testsuite/20_util/expected/illformed_neg.cc new file mode 100644 index 00000000000..921306bc667 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/expected/illformed_neg.cc @@ -0,0 +1,67 @@ +// { dg-options "-std=gnu++23" } +// { dg-do compile { target c++23 } } + +#include + +void +test_unexpected() +{ + int i[2]{}; + + // std::unexpected is ill-formed if E is a non-object type, + + std::unexpected ref(i[0]); // { dg-error "here" } + std::unexpected func(test_unexpected); // { dg-error "here" } + // { dg-error "no matching function for call to" "" { target *-*-* } 0 } + // { dg-error "invalidly declared function type" "" { target *-*-* } 0 } + + // an array type, + std::unexpected array(i); // { dg-error "here" } + + // a specialization of std::unexpected, + std::unexpected u(1); + std::unexpected> nested(u); // { dg-error "here" } + // + // or a cv-qualified type. + std::unexpected c_int(1); // { dg-error "here" } + std::unexpected v_int(1); // { dg-error "here" } +} + +void +test_expected_value() +{ + // std::expected is ill-formed if T is a reference type, + std::expected ref(std::unexpect); // { dg-error "here" } + // { dg-error "reference type" "" { target *-*-* } 0 } + + // a function type, + std::expected func(std::unexpect); // { dg-error "here" } + // { dg-error "returning a function" "" { target *-*-* } 0 } + // + // possibly cv-qualified types in_place_t, + std::expected tag(std::unexpect); // { dg-error "here" } + std::expected ctag(std::unexpect); // { dg-error "here" } + // unexpect_t, + std::expected utag(std::unexpect); // { dg-error "here" } + std::expected cutag(std::unexpect); // { dg-error "here" } + // or a specialization of unexpected. + std::expected, int> unex(std::in_place, 1); // { dg-error "here" } + std::expected, int> cunex(std::in_place, 1); // { dg-error "here" } +} + +void +test_expected_error() +{ + + // std::expected is ill-formed if std::unexpected would be + // ill-formed. Test the same types as in test_unexpected(). + + std::expected ref; // { dg-error "here" } + std::expected func; // { dg-error "here" } + std::expected array; // { dg-error "here" } + std::expected> nested; // { dg-error "here" } + std::expected c_int; // { dg-error "here" } + std::expected v_int; // { dg-error "here" } +} + +// { dg-prune-output "static assertion failed" } diff --git a/libstdc++-v3/testsuite/20_util/expected/observers.cc b/libstdc++-v3/testsuite/20_util/expected/observers.cc new file mode 100644 index 00000000000..e76ca378026 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/expected/observers.cc @@ -0,0 +1,209 @@ +// { dg-options "-std=gnu++23" } +// { dg-do run { target c++23 } } + +#include +#include +#include + +struct X +{ + constexpr int f() & { return 1; } + constexpr int f() const & { return 2; } + constexpr int f() && { return 3; } + constexpr int f() const && { return 4; } +}; + +constexpr bool +test_arrow() +{ + std::expected e1; + VERIFY( e1->f() == 1 ); + const auto& e2 = e1; + VERIFY( e2->f() == 2 ); + + return true; +} + +constexpr bool +test_star() +{ + std::expected e1; + VERIFY( (*e1).f() == 1 ); + VERIFY( std::move(*e1).f() == 3 ); + const auto& e2 = e1; + VERIFY( (*e2).f() == 2 ); + VERIFY( std::move(*e2).f() == 4 ); + + std::expected v; + *v; + + return true; +} + +constexpr bool +test_has_value() +{ + std::expected e; + VERIFY( e.has_value() ); + VERIFY( e ); + e = std::unexpected(1); + VERIFY( ! e.has_value() ); + VERIFY( ! e ); + + std::expected v; + VERIFY( v.has_value() ); + VERIFY( v ); + v = std::unexpected(1); + VERIFY( ! v.has_value() ); + VERIFY( ! v ); + + return true; +} + +constexpr bool +test_value() +{ + std::expected e1; + + VERIFY( e1.value().f() == 1 ); + VERIFY( std::move(e1).value().f() == 3 ); + const auto& e2 = e1; + VERIFY( e2.value().f() == 2 ); + VERIFY( std::move(e2).value().f() == 4 ); + + std::expected v1; + v1.value(); + std::move(v1).value(); + + return true; +} + +void +test_value_throw() +{ + std::expected e1 = std::unexpected(9); + + try { + e1.value(); + VERIFY( false ); + } catch (const std::bad_expected_access& e) { + VERIFY( e.error() == 9 ); + } + try { + std::move(e1).value(); + VERIFY( false ); + } catch (const std::bad_expected_access& e) { + VERIFY( e.error() == 9 ); + } + + const auto& e2 = e1; + try { + e2.value(); + VERIFY( false ); + } catch (const std::bad_expected_access& e) { + VERIFY( e.error() == 9 ); + } + try { + std::move(e2).value(); + VERIFY( false ); + } catch (const std::bad_expected_access& e) { + VERIFY( e.error() == 9 ); + } + + std::expected v1 = std::unexpected(8); + try { + v1.value(); + VERIFY( false ); + } catch (const std::bad_expected_access& e) { + VERIFY( e.error() == 8 ); + } + try { + std::move(v1).value(); + VERIFY( false ); + } catch (const std::bad_expected_access& e) { + VERIFY( e.error() == 8 ); + } +} + +constexpr bool +test_error() +{ + std::expected e1(std::unexpect); + + VERIFY( e1.error().f() == 1 ); + VERIFY( std::move(e1).error().f() == 3 ); + const auto& e2 = e1; + VERIFY( e2.error().f() == 2 ); + VERIFY( std::move(e2).error().f() == 4 ); + + std::expected v1(std::unexpect); + + VERIFY( v1.error().f() == 1 ); + VERIFY( std::move(v1).error().f() == 3 ); + const auto& v2 = v1; + VERIFY( v2.error().f() == 2 ); + VERIFY( std::move(v2).error().f() == 4 ); + + return true; +} + +constexpr bool +test_value_or() +{ + struct Movable + { + constexpr Movable(int i) : x(i) { } + constexpr Movable(const Movable&) = default; + constexpr Movable(Movable&& m) : x(m.x) { m.x = -1; } + int x; + + constexpr bool operator==(int i) const { return x == i; } + }; + + std::expected e1(1); + + Movable m2(2); + VERIFY( e1.value_or(2) == 1 ); + VERIFY( e1.value_or(m2) == 1 ); + VERIFY( e1.value_or(std::move(m2)) == 1 ); + VERIFY( m2 == 2 ); + + VERIFY( std::move(e1).value_or(m2) == 1 ); + VERIFY( *e1 == -1 ); // moved + VERIFY( m2 == 2 ); + + e1 = std::unexpected(3); + VERIFY( e1.value_or(m2) == 2 ); + VERIFY( m2 == 2 ); + VERIFY( std::move(e1).value_or(m2) == 2 ); + VERIFY( m2 == 2 ); + + VERIFY( e1.value_or(std::move(m2)) == 2 ); + VERIFY( m2 == -1 ); + + m2.x = 4; + VERIFY( std::move(e1).value_or(std::move(m2)) == 4 ); + VERIFY( m2 == -1 ); + + VERIFY( e1.value_or(5) == 5 ); + VERIFY( std::move(e1).value_or(6) == 6 ); + + return true; +} + +int main() +{ + static_assert( test_arrow() ); + test_arrow(); + static_assert( test_star() ); + test_star(); + static_assert( test_has_value() ); + test_has_value(); + static_assert( test_value() ); + test_value(); + test_value_throw(); + static_assert( test_error() ); + test_error(); + static_assert( test_value_or() ); + test_value_or(); +} diff --git a/libstdc++-v3/testsuite/20_util/expected/requirements.cc b/libstdc++-v3/testsuite/20_util/expected/requirements.cc new file mode 100644 index 00000000000..485aa338679 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/expected/requirements.cc @@ -0,0 +1,129 @@ +// { dg-options "-std=gnu++23" } +// { dg-do compile { target c++23 } } + +#include +#include + +// Default construction + +template + constexpr bool default_constructible + = std::is_default_constructible_v>; + +struct A { A(int); }; + +static_assert( default_constructible< int, int > ); +static_assert( default_constructible< A, int > == false ); +static_assert( default_constructible< int, A > ); +static_assert( default_constructible< A, A > == false ); +static_assert( default_constructible< int, A > ); +static_assert( default_constructible< void, int > ); + +// Destruction + +template + constexpr bool trivially_destructible + = std::is_trivially_destructible_v>; + +struct B { ~B(); }; + +static_assert( trivially_destructible< int, int > ); +static_assert( trivially_destructible< B, int > == false ); +static_assert( trivially_destructible< int, B > == false ); +static_assert( trivially_destructible< B, B > == false ); +static_assert( trivially_destructible< void, int > ); +static_assert( trivially_destructible< void, B > == false ); + +enum Result { No, Yes, NoThrow, Trivial }; + +// Copy construction + +template + constexpr Result copy_constructible + = std::is_trivially_copy_constructible_v> ? Trivial + : std::is_copy_constructible_v> ? Yes + : No; + +struct C { C(const C&); }; +struct D { D(D&&); }; + +static_assert( copy_constructible< int, int > == Trivial ); +static_assert( copy_constructible< C, C > == Yes ); +static_assert( copy_constructible< C, int > == Yes ); +static_assert( copy_constructible< int, C > == Yes ); +static_assert( copy_constructible< int, D > == No ); +static_assert( copy_constructible< D, int > == No ); +static_assert( copy_constructible< D, D > == No ); +static_assert( copy_constructible< void, int > == Trivial ); +static_assert( copy_constructible< void, C > == Yes ); +static_assert( copy_constructible< void, D > == No ); + +// Move construction + +template + constexpr Result move_constructible + = std::is_trivially_move_constructible_v> ? Trivial + : std::is_nothrow_move_constructible_v> ? NoThrow + : std::is_move_constructible_v> ? Yes + : No; + +struct E { E(E&&) noexcept; }; + +static_assert( move_constructible< int, int > == Trivial ); +static_assert( move_constructible< C, C > == Yes ); +static_assert( move_constructible< C, int > == Yes ); +static_assert( move_constructible< int, C > == Yes ); +static_assert( move_constructible< D, D > == Yes ); +static_assert( move_constructible< D, int > == Yes ); +static_assert( move_constructible< int, D > == Yes ); +static_assert( move_constructible< E, E > == NoThrow ); +static_assert( move_constructible< E, int > == NoThrow ); +static_assert( move_constructible< int, E > == NoThrow ); +static_assert( move_constructible< void, int > == Trivial ); +static_assert( move_constructible< void, C > == Yes ); +static_assert( move_constructible< void, D > == Yes ); +static_assert( move_constructible< void, E > == NoThrow ); + +// Copy assignment + +template + constexpr bool copy_assignable + = std::is_copy_assignable_v>; + +struct F { F(F&&); F& operator=(const F&); }; // not copy-constructible +struct G { G(const G&); G(G&&); G& operator=(const G&); }; // throwing move + +static_assert( copy_assignable< int, int > ); +static_assert( copy_assignable< F, int > == false ); +static_assert( copy_assignable< int, F > == false ); +static_assert( copy_assignable< F, F > == false ); +static_assert( copy_assignable< G, int > ); +static_assert( copy_assignable< int, G > ); +static_assert( copy_assignable< G, G > == false ); +static_assert( copy_assignable< void, int > ); +static_assert( copy_assignable< void, F > == false ); +static_assert( copy_assignable< void, G > ); + +// Move assignment + +template + constexpr bool move_assignable + = std::is_move_assignable_v>; + +static_assert( move_assignable< int, int > ); +static_assert( move_assignable< F, int > ); +static_assert( move_assignable< int, F > ); +static_assert( move_assignable< F, F > == false ); +static_assert( move_assignable< G, int > ); +static_assert( move_assignable< int, G > ); +static_assert( move_assignable< G, G > == false ); +static_assert( move_assignable< void, int > ); +static_assert( move_assignable< void, F > ); +static_assert( move_assignable< void, G > ); + +// QoI properties +static_assert( sizeof(std::expected) == 2 ); +static_assert( sizeof(std::expected) == 2 ); +static_assert( sizeof(std::expected) == 2 * __alignof(void*) ); +static_assert( alignof(std::expected) == 1 ); +static_assert( alignof(std::expected) == alignof(void*) ); diff --git a/libstdc++-v3/testsuite/20_util/expected/swap.cc b/libstdc++-v3/testsuite/20_util/expected/swap.cc new file mode 100644 index 00000000000..1b3b8c5f4e8 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/expected/swap.cc @@ -0,0 +1,57 @@ +// { dg-options "-std=gnu++23" } +// { dg-do run { target c++23 } } + +#include +#include + +constexpr bool +test_swap() +{ + std::expected e1(1), e2(2); + std::expected e3(std::unexpect, 3), e4(std::unexpect, 4); + + swap(e1, e2); + VERIFY( e1.value() == 2 ); + VERIFY( e2.value() == 1 ); + swap(e1, e3); + VERIFY( ! e1.has_value() ); + VERIFY( e1.error() == 3 ); + VERIFY( e3.value() == 2 ); + swap(e1, e3); + VERIFY( ! e3.has_value() ); + VERIFY( e1.value() == 2 ); + VERIFY( e3.error() == 3 ); + swap(e3, e4); + VERIFY( ! e3.has_value() ); + VERIFY( ! e4.has_value() ); + VERIFY( e3.error() == 4 ); + VERIFY( e4.error() == 3 ); + + std::expected v1(1), v2(2); + std::expected v3(std::unexpect, 3), v4(std::unexpect, 4); + + swap(v1, v2); + VERIFY( v1.value() == 2 ); + VERIFY( v2.value() == 1 ); + swap(v1, v3); + VERIFY( ! v1.has_value() ); + VERIFY( v1.error() == 3 ); + VERIFY( v3.value() == 2 ); + swap(v1, v3); + VERIFY( ! v3.has_value() ); + VERIFY( v1.value() == 2 ); + VERIFY( v3.error() == 3 ); + swap(v3, v4); + VERIFY( ! v3.has_value() ); + VERIFY( ! v4.has_value() ); + VERIFY( v3.error() == 4 ); + VERIFY( v4.error() == 3 ); + + return true; +} + +int main() +{ + static_assert( test_swap() ); + test_swap(); +} diff --git a/libstdc++-v3/testsuite/20_util/expected/synopsis.cc b/libstdc++-v3/testsuite/20_util/expected/synopsis.cc new file mode 100644 index 00000000000..304bae93ebd --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/expected/synopsis.cc @@ -0,0 +1,21 @@ +// { dg-options "-std=gnu++23" } +// { dg-do compile { target c++23 } } + +#include + +#ifndef __cpp_lib_expected +# error "Feature-test macro for expected missing in " +#elif __cpp_lib_expected != 202202L +# error "Feature-test macro for expected has wrong value in " +#endif + +namespace std +{ + template class unexpected; + template class bad_expected_access; + template<> class bad_expected_access; + struct unexpect_t; + extern inline const unexpect_t unexpect; + template class expected; + template requires is_void_v class expected; +} diff --git a/libstdc++-v3/testsuite/20_util/expected/unexpected.cc b/libstdc++-v3/testsuite/20_util/expected/unexpected.cc new file mode 100644 index 00000000000..d4cbeadf674 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/expected/unexpected.cc @@ -0,0 +1,80 @@ +// { dg-options "-std=gnu++23" } +// { dg-do run { target c++23 } } + +#include +#include + +static_assert( sizeof(std::unexpected) == 1 ); + +constexpr bool +test() +{ + std::unexpected u1(1); + VERIFY( u1.error() == 1 ); + + std::unexpected u2(std::in_place, 2); + VERIFY( u2.error() == 2 ); + + struct X + { + constexpr X(int i, int j) : n(i+j) { } + constexpr X(std::initializer_list l, void*) : n(l.size()) { } + + constexpr X(const X&) = default; + constexpr X(X&& x) :n(x.n) { x.n = -1; } + + constexpr X& operator=(const X&) = default; + constexpr X& operator=(X&& x) { n = x.n; x.n = -1; return *this; } + + constexpr bool operator==(const X&) const = default; + constexpr bool operator==(int i) const { return n == i; } + + int n; + }; + + std::unexpected u3(std::in_place, 2, 1); + VERIFY( u3.error() == 3 ); + + std::unexpected u4(std::in_place, {1,2,3,4}, nullptr); + VERIFY( u4.error() == 4 ); + + std::unexpected u5(u4); + VERIFY( u5.error() == 4 ); + VERIFY( u4.error() == 4 ); + + std::unexpected u6(std::move(u4)); + VERIFY( u6.error() == 4 ); + VERIFY( u4.error() == -1 ); + + u6 = u3; + VERIFY( u6.error() == 3 ); + VERIFY( u3.error() == 3 ); + + u5 = std::move(u3); + VERIFY( u5.error() == 3 ); + VERIFY( u3.error() == -1 ); + + u5.swap(u3); + VERIFY( u3.error() == 3 ); + VERIFY( u5.error() == -1 ); + + swap(u5, u3); + VERIFY( u5.error() == 3 ); + VERIFY( u3.error() == -1 ); + + VERIFY( u1 == u1 ); + VERIFY( u1 != u2 ); + VERIFY( u3 == u4 ); + + // CTAD + std::unexpected u7(1L); + static_assert( std::is_same_v> ); + + return true; +} + +int main() +{ + static_assert( test() ); + test(); +} diff --git a/libstdc++-v3/testsuite/20_util/expected/version.cc b/libstdc++-v3/testsuite/20_util/expected/version.cc new file mode 100644 index 00000000000..78dc61ef55d --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/expected/version.cc @@ -0,0 +1,10 @@ +// { dg-options "-std=gnu++23" } +// { dg-do preprocess { target c++23 } } + +#include + +#ifndef __cpp_lib_expected +# error "Feature-test macro for expected missing in " +#elif __cpp_lib_expected != 202202L +# error "Feature-test macro for expected has wrong value in " +#endif From 08e69332881f8d28ce8b559ffba1900ae5c0d5ee Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 27 Mar 2022 11:07:39 -0700 Subject: [PATCH 035/157] x86: Use Yw constraint on *ssse3_pshufbv8qi3 Since AVX512VL and AVX512BW are required for AVX512 VPSHUFB, replace the "Yv" register constraint with the "Yw" register constraint. gcc/ PR target/105068 * config/i386/sse.md (*ssse3_pshufbv8qi3): Replace "Yv" with "Yw". gcc/testsuite/ PR target/105068 * gcc.target/i386/pr105068.c: New test. --- gcc/config/i386/sse.md | 6 +-- gcc/testsuite/gcc.target/i386/pr105068.c | 47 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr105068.c diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 33bd2c4768a..58d2bd972ed 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -20758,9 +20758,9 @@ }) (define_insn_and_split "*ssse3_pshufbv8qi3" - [(set (match_operand:V8QI 0 "register_operand" "=y,x,Yv") - (unspec:V8QI [(match_operand:V8QI 1 "register_operand" "0,0,Yv") - (match_operand:V8QI 2 "register_mmxmem_operand" "ym,x,Yv") + [(set (match_operand:V8QI 0 "register_operand" "=y,x,Yw") + (unspec:V8QI [(match_operand:V8QI 1 "register_operand" "0,0,Yw") + (match_operand:V8QI 2 "register_mmxmem_operand" "ym,x,Yw") (match_operand:V4SI 4 "reg_or_const_vector_operand" "i,3,3")] UNSPEC_PSHUFB)) diff --git a/gcc/testsuite/gcc.target/i386/pr105068.c b/gcc/testsuite/gcc.target/i386/pr105068.c new file mode 100644 index 00000000000..e5fb0338e3b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr105068.c @@ -0,0 +1,47 @@ +/* { dg-do compile } */ +/* { dg-options "-Og -march=x86-64 -mavx512vl -fsanitize=thread -fstack-protector-all" } */ + +typedef char __attribute__((__vector_size__(8))) C; +typedef int __attribute__((__vector_size__(8))) U; +typedef int __attribute__((__vector_size__(16))) V; +typedef int __attribute__((__vector_size__(32))) W; +typedef long long __attribute__((__vector_size__(64))) L; +typedef _Float64 __attribute__((__vector_size__(16))) F; +typedef _Float64 __attribute__((__vector_size__(64))) G; +C c; +int i; + +U foo0( W v256u32_0, + W v256s32_0, + V v128u64_0, + V v128s64_0, + W v256u64_0, + W v256s64_0, + L v512s64_0, + W v256u128_0, + W v256s128_0, + V v128f32_0, + W v256f32_0, + F F_0, + W v256f64_0, + G G_0) { + C U_1 = __builtin_ia32_pshufb(c, c); + G_0 += __builtin_convertvector(v512s64_0, G); + F F_1 = __builtin_shufflevector(F_0, G_0, 2, 2); + W W_r = v256u32_0 + v256s32_0 + v256u64_0 + v256s64_0 + v256u128_0 + + v256s128_0 + v256f32_0 + v256f64_0; + V V_r = ((union { + W a; + V b; + })W_r) + .b + + i + v128u64_0 + v128s64_0 + v128f32_0 + + (V)F_1; + U U_r = ((union { + V a; + U b; + })V_r) + .b + + (U)U_1; + return U_r; +} From 2c1c55d701cfcac29a7ec5af171cf670418cf83d Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Mon, 28 Mar 2022 00:16:40 +0000 Subject: [PATCH 036/157] Daily bump. --- gcc/ChangeLog | 6 ++++++ gcc/DATESTAMP | 2 +- gcc/testsuite/ChangeLog | 5 +++++ libstdc++-v3/ChangeLog | 20 ++++++++++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1f49cbdcd67..d11799e7f7f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2022-03-27 H.J. Lu + + PR target/105068 + * config/i386/sse.md (*ssse3_pshufbv8qi3): Replace "Yv" with + "Yw". + 2022-03-26 Roger Sayle PR middle-end/104885 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 70c092d6a80..0f81793ddaf 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20220327 +20220328 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 260858893d2..b4168acc6fa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2022-03-27 H.J. Lu + + PR target/105068 + * gcc.target/i386/pr105068.c: New test. + 2022-03-26 Jakub Jelinek PR rtl-optimization/103775 diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 50eee8017ab..b06414764b8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,23 @@ +2022-03-27 Jonathan Wakely + + * doc/doxygen/user.cfg.in: Add new header. + * include/Makefile.am: Likewise. + * include/Makefile.in: Regenerate. + * include/precompiled/stdc++.h: Add new header. + * include/std/version (__cpp_lib_expected): Define. + * libsupc++/exception [__cplusplus > 202002] (unexpected) + (unexpected_handler, set_unexpected): Do not declare for C++23. + * include/std/expected: New file. + * testsuite/20_util/expected/assign.cc: New test. + * testsuite/20_util/expected/cons.cc: New test. + * testsuite/20_util/expected/illformed_neg.cc: New test. + * testsuite/20_util/expected/observers.cc: New test. + * testsuite/20_util/expected/requirements.cc: New test. + * testsuite/20_util/expected/swap.cc: New test. + * testsuite/20_util/expected/synopsis.cc: New test. + * testsuite/20_util/expected/unexpected.cc: New test. + * testsuite/20_util/expected/version.cc: New test. + 2022-03-25 Jonathan Wakely * include/std/bit (bit_cast, byteswap, endian): Add doxygen From f6819b7fea38f2e5482c71aabab3d44a8bd7d904 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 28 Mar 2022 09:48:08 +0200 Subject: [PATCH 037/157] add missing dg-require alias to gcc.dg/torture/pr100786.c 2022-03-28 Richard Biener * gcc.dg/torture/pr100786.c: Add dg-require alias. --- gcc/testsuite/gcc.dg/torture/pr100786.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/testsuite/gcc.dg/torture/pr100786.c b/gcc/testsuite/gcc.dg/torture/pr100786.c index 42f4e485593..7c03b08d8cb 100644 --- a/gcc/testsuite/gcc.dg/torture/pr100786.c +++ b/gcc/testsuite/gcc.dg/torture/pr100786.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-alias "" } */ const double a = 0; extern int b __attribute__((alias("a"))); From 50f9148f7a8daf1fa1608cb23595c3cca191da0f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 28 Mar 2022 09:51:28 +0200 Subject: [PATCH 038/157] predcom: Fix up component::component [PR105056] The recent change didn't initialize comp_step while previously we used XCNEW to allocate it. I think RS_ANY is better than RS_INTERNAL (== 0) as the default. 2022-03-28 Jakub Jelinek PR tree-optimization/105056 * tree-predcom.cc (component::component): Initialize also comp_step. --- gcc/tree-predcom.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/tree-predcom.cc b/gcc/tree-predcom.cc index e4aea7cdcb4..bb3a1cb68fc 100644 --- a/gcc/tree-predcom.cc +++ b/gcc/tree-predcom.cc @@ -367,7 +367,8 @@ enum ref_step_type struct component { - component (bool es) : eliminate_store_p (es), next (NULL) {} + component (bool es) : comp_step (RS_ANY), eliminate_store_p (es), + next (NULL) {} /* The references in the component. */ auto_vec refs; From e4352a0fee49441a32d12e8d8b98c425cfed4a86 Mon Sep 17 00:00:00 2001 From: liuhongt Date: Mon, 28 Mar 2022 11:12:37 +0800 Subject: [PATCH 039/157] Fix typo in vec_setv8hi_0. pinsrw is available for both reg and mem operand under sse2. pextrw requires sse4.1 for mem operands. The patch change attr "isa" for pinsrw mem alternative from sse4_noavx to noavx, will enable below optimization. - movzwl (%rdi), %eax pxor %xmm1, %xmm1 - pinsrw $0, %eax, %xmm1 + pinsrw $0, (%rdi), %xmm1 movdqa %xmm1, %xmm0 gcc/ChangeLog: PR target/105066 * config/i386/sse.md (vec_set_0): Change attr "isa" of alternative 4 from sse4_noavx to noavx. gcc/testsuite/ChangeLog: * gcc.target/i386/pr105066.c: New test. --- gcc/config/i386/sse.md | 4 ++-- gcc/testsuite/gcc.target/i386/pr105066.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr105066.c diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 58d2bd972ed..01543afd111 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -10617,9 +10617,9 @@ [(set (attr "isa") (cond [(eq_attr "alternative" "0,1,2") (const_string "avx512fp16") - (eq_attr "alternative" "3") + (eq_attr "alternative" "3,4") (const_string "noavx") - (eq_attr "alternative" "4,5,6") + (eq_attr "alternative" "5,6") (const_string "sse4_noavx") (eq_attr "alternative" "7,8,9") (const_string "avx") diff --git a/gcc/testsuite/gcc.target/i386/pr105066.c b/gcc/testsuite/gcc.target/i386/pr105066.c new file mode 100644 index 00000000000..c5c5b9e12de --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr105066.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2 -mno-sse4.1" } */ +/* { dg-final { scan-assembler-not "movzwl" } } */ +/* { dg-final { scan-assembler {(?n)pinsrw[ \t]+\$0.*\(%} } } */ + +#include + +__m128i load16(void *p){ + return _mm_loadu_si16(p); +} From 9f37d31324f89d0b7b2abac988a976d121ae29c6 Mon Sep 17 00:00:00 2001 From: Andre Vieira Date: Mon, 28 Mar 2022 09:24:04 +0100 Subject: [PATCH 040/157] aarch64: Update Neoverse N2 core definition gcc/ChangeLog: * config/aarch64/aarch64-cores.def: Update Neoverse N2 core entry. --- gcc/config/aarch64/aarch64-cores.def | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/config/aarch64/aarch64-cores.def b/gcc/config/aarch64/aarch64-cores.def index 9e6ca84bd4b..41d95354b6a 100644 --- a/gcc/config/aarch64/aarch64-cores.def +++ b/gcc/config/aarch64/aarch64-cores.def @@ -145,9 +145,6 @@ AARCH64_CORE("neoverse-512tvb", neoverse512tvb, cortexa57, 8_4A, AARCH64_FL_FOR /* Qualcomm ('Q') cores. */ AARCH64_CORE("saphira", saphira, saphira, 8_4A, AARCH64_FL_FOR_ARCH8_4 | AARCH64_FL_CRYPTO | AARCH64_FL_RCPC, saphira, 0x51, 0xC01, -1) -/* Armv8.5-A Architecture Processors. */ -AARCH64_CORE("neoverse-n2", neoversen2, cortexa57, 8_5A, AARCH64_FL_FOR_ARCH8_5 | AARCH64_FL_I8MM | AARCH64_FL_BF16 | AARCH64_FL_F16 | AARCH64_FL_SVE | AARCH64_FL_SVE2 | AARCH64_FL_SVE2_BITPERM | AARCH64_FL_RNG | AARCH64_FL_MEMTAG, neoversen2, 0x41, 0xd49, -1) - /* ARMv8-A big.LITTLE implementations. */ AARCH64_CORE("cortex-a57.cortex-a53", cortexa57cortexa53, cortexa53, 8A, AARCH64_FL_FOR_ARCH8 | AARCH64_FL_CRC, cortexa57, 0x41, AARCH64_BIG_LITTLE (0xd07, 0xd03), -1) @@ -172,6 +169,8 @@ AARCH64_CORE("cortex-a710", cortexa710, cortexa57, 9A, AARCH64_FL_FOR_ARCH9 | AARCH64_CORE("cortex-x2", cortexx2, cortexa57, 9A, AARCH64_FL_FOR_ARCH9 | AARCH64_FL_SVE2_BITPERM | AARCH64_FL_MEMTAG | AARCH64_FL_I8MM | AARCH64_FL_BF16, neoversen2, 0x41, 0xd48, -1) +AARCH64_CORE("neoverse-n2", neoversen2, cortexa57, 9A, AARCH64_FL_FOR_ARCH9 | AARCH64_FL_I8MM | AARCH64_FL_BF16 | AARCH64_FL_SVE2_BITPERM | AARCH64_FL_RNG | AARCH64_FL_MEMTAG | AARCH64_FL_PROFILE, neoversen2, 0x41, 0xd49, -1) + AARCH64_CORE("demeter", demeter, cortexa57, 9A, AARCH64_FL_FOR_ARCH9 | AARCH64_FL_I8MM | AARCH64_FL_BF16 | AARCH64_FL_SVE2_BITPERM | AARCH64_FL_RNG | AARCH64_FL_MEMTAG | AARCH64_FL_PROFILE, demeter, 0x41, 0xd4f, -1) #undef AARCH64_CORE From bc86a86a4f2c057bc0e0be94dcbb8c128ae7f717 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 28 Mar 2022 10:07:53 +0200 Subject: [PATCH 041/157] tree-optimization/105070 - annotate bit cluster tests with locations The following makes sure to annotate the tests generated by switch lowering bit-clustering with locations which otherwise can be completely lost even at -O0. 2022-03-28 Richard Biener PR tree-optimization/105070 * tree-switch-conversion.h (bit_test_cluster::hoist_edge_and_branch_if_true): Add location argument. * tree-switch-conversion.cc (bit_test_cluster::hoist_edge_and_branch_if_true): Annotate cond with location. (bit_test_cluster::emit): Annotate all generated expressions with location. --- gcc/tree-switch-conversion.cc | 28 ++++++++++++++++------------ gcc/tree-switch-conversion.h | 3 ++- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/gcc/tree-switch-conversion.cc b/gcc/tree-switch-conversion.cc index 670397c87e4..e14b4e6c94a 100644 --- a/gcc/tree-switch-conversion.cc +++ b/gcc/tree-switch-conversion.cc @@ -1498,7 +1498,7 @@ case_bit_test::cmp (const void *p1, const void *p2) void bit_test_cluster::emit (tree index_expr, tree index_type, - tree, basic_block default_bb, location_t) + tree, basic_block default_bb, location_t loc) { case_bit_test test[m_max_case_bit_tests] = { {} }; unsigned int i, j, k; @@ -1622,9 +1622,9 @@ bit_test_cluster::emit (tree index_expr, tree index_type, gsi = gsi_last_bb (m_case_bb); /* idx = (unsigned)x - minval. */ - idx = fold_convert (unsigned_index_type, index_expr); - idx = fold_build2 (MINUS_EXPR, unsigned_index_type, idx, - fold_convert (unsigned_index_type, minval)); + idx = fold_convert_loc (loc, unsigned_index_type, index_expr); + idx = fold_build2_loc (loc, MINUS_EXPR, unsigned_index_type, idx, + fold_convert_loc (loc, unsigned_index_type, minval)); idx = force_gimple_operand_gsi (&gsi, idx, /*simple=*/true, NULL_TREE, /*before=*/true, GSI_SAME_STMT); @@ -1638,15 +1638,15 @@ bit_test_cluster::emit (tree index_expr, tree index_type, fold_convert (unsigned_index_type, range), /*simple=*/true, NULL_TREE, /*before=*/true, GSI_SAME_STMT); - tmp = fold_build2 (GT_EXPR, boolean_type_node, idx, range); + tmp = fold_build2_loc (loc, GT_EXPR, boolean_type_node, idx, range); basic_block new_bb = hoist_edge_and_branch_if_true (&gsi, tmp, default_bb, - profile_probability::unlikely ()); + profile_probability::unlikely (), loc); gsi = gsi_last_bb (new_bb); } - tmp = fold_build2 (LSHIFT_EXPR, word_type_node, word_mode_one, - fold_convert (word_type_node, idx)); + tmp = fold_build2_loc (loc, LSHIFT_EXPR, word_type_node, word_mode_one, + fold_convert_loc (loc, word_type_node, idx)); /* csui = (1 << (word_mode) idx) */ if (count > 1) @@ -1672,13 +1672,15 @@ bit_test_cluster::emit (tree index_expr, tree index_type, bt_range); bt_range -= test[k].bits; tmp = wide_int_to_tree (word_type_node, test[k].mask); - tmp = fold_build2 (BIT_AND_EXPR, word_type_node, csui, tmp); - tmp = fold_build2 (NE_EXPR, boolean_type_node, tmp, word_mode_zero); + tmp = fold_build2_loc (loc, BIT_AND_EXPR, word_type_node, csui, tmp); + tmp = fold_build2_loc (loc, NE_EXPR, boolean_type_node, + tmp, word_mode_zero); tmp = force_gimple_operand_gsi (&gsi, tmp, /*simple=*/true, NULL_TREE, /*before=*/true, GSI_SAME_STMT); basic_block new_bb - = hoist_edge_and_branch_if_true (&gsi, tmp, test[k].target_bb, prob); + = hoist_edge_and_branch_if_true (&gsi, tmp, test[k].target_bb, + prob, loc); gsi = gsi_last_bb (new_bb); } @@ -1708,7 +1710,8 @@ bit_test_cluster::emit (tree index_expr, tree index_type, basic_block bit_test_cluster::hoist_edge_and_branch_if_true (gimple_stmt_iterator *gsip, tree cond, basic_block case_bb, - profile_probability prob) + profile_probability prob, + location_t loc) { tree tmp; gcond *cond_stmt; @@ -1722,6 +1725,7 @@ bit_test_cluster::hoist_edge_and_branch_if_true (gimple_stmt_iterator *gsip, tmp = force_gimple_operand_gsi (gsip, cond, /*simple=*/true, NULL, /*before=*/true, GSI_SAME_STMT); cond_stmt = gimple_build_cond_from_tree (tmp, NULL_TREE, NULL_TREE); + gimple_set_location (cond_stmt, loc); gsi_insert_before (gsip, cond_stmt, GSI_SAME_STMT); e_false = split_block (split_bb, cond_stmt); diff --git a/gcc/tree-switch-conversion.h b/gcc/tree-switch-conversion.h index e969c051a05..2b677d9f7e9 100644 --- a/gcc/tree-switch-conversion.h +++ b/gcc/tree-switch-conversion.h @@ -429,7 +429,8 @@ public: static basic_block hoist_edge_and_branch_if_true (gimple_stmt_iterator *gsip, tree cond, basic_block case_bb, - profile_probability prob); + profile_probability prob, + location_t); /* Return whether bit test expansion is allowed. */ static inline bool is_enabled (void) From c8464cf444e8f41f6c10cb75cfa899c838f8d506 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 28 Mar 2022 12:29:29 +0200 Subject: [PATCH 042/157] gcc-changelog: Make This reverts stricter. contrib/ChangeLog: * gcc-changelog/git_commit.py: Make the parsing stricter. --- contrib/gcc-changelog/git_commit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index 95dc49e5d48..7e29934b4ad 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -165,7 +165,7 @@ star_prefix_regex = re.compile(r'\t\*(?P\ *)(?P.*)') end_of_location_regex = re.compile(r'[\[<(:]') item_empty_regex = re.compile(r'\t(\* \S+ )?\(\S+\):\s*$') item_parenthesis_regex = re.compile(r'\t(\*|\(\S+\):)') -revert_regex = re.compile(r'This reverts commit (?P\w+).$') +revert_regex = re.compile(r'This reverts commit (?P[0-9a-f]+).$') cherry_pick_regex = re.compile(r'cherry picked from commit (?P\w+)') LINE_LIMIT = 100 @@ -317,7 +317,7 @@ class GitCommit: # Identify first if the commit is a Revert commit for line in self.info.lines: - m = revert_regex.match(line) + m = revert_regex.fullmatch(line) if m: self.revert_commit = m.group('hash') break From a74ccc8cb02220ca45a1d0222ba5ba986abae570 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 28 Mar 2022 12:42:46 +0200 Subject: [PATCH 043/157] gcc-changelog: Update revert_regex. contrib/ChangeLog: * gcc-changelog/git_commit.py: Match trailing dot literally. --- contrib/gcc-changelog/git_commit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index 7e29934b4ad..a6b5ff04f22 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -165,7 +165,7 @@ star_prefix_regex = re.compile(r'\t\*(?P\ *)(?P.*)') end_of_location_regex = re.compile(r'[\[<(:]') item_empty_regex = re.compile(r'\t(\* \S+ )?\(\S+\):\s*$') item_parenthesis_regex = re.compile(r'\t(\*|\(\S+\):)') -revert_regex = re.compile(r'This reverts commit (?P[0-9a-f]+).$') +revert_regex = re.compile(r'This reverts commit (?P[0-9a-f]+)\.$') cherry_pick_regex = re.compile(r'cherry picked from commit (?P\w+)') LINE_LIMIT = 100 From 567eb37c76e19f82a44db53edbd54c361ab7aa18 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 28 Mar 2022 11:38:11 +0100 Subject: [PATCH 044/157] libstdc++: Fix typos in comments in tests libstdc++-v3/ChangeLog: * testsuite/20_util/optional/monadic/and_then.cc: Fix typo. * testsuite/20_util/optional/monadic/transform.cc: Likewise. * testsuite/22_locale/codecvt/always_noconv/char/1.cc: Likewise. * testsuite/22_locale/codecvt/encoding/char/1.cc: Likewise. * testsuite/22_locale/codecvt/in/char/1.cc: Likewise. * testsuite/22_locale/codecvt/max_length/char/1.cc: Likewise. * testsuite/22_locale/codecvt/out/char/1.cc: Likewise. * testsuite/22_locale/codecvt/unshift/char/1.cc: Likewise. --- .../testsuite/20_util/optional/monadic/and_then.cc | 2 +- .../testsuite/20_util/optional/monadic/transform.cc | 2 +- .../22_locale/codecvt/always_noconv/char/1.cc | 4 ++-- .../testsuite/22_locale/codecvt/encoding/char/1.cc | 4 ++-- .../testsuite/22_locale/codecvt/in/char/1.cc | 8 ++++---- .../testsuite/22_locale/codecvt/max_length/char/1.cc | 4 ++-- .../testsuite/22_locale/codecvt/out/char/1.cc | 8 ++++---- .../testsuite/22_locale/codecvt/unshift/char/1.cc | 12 ++++++------ 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/libstdc++-v3/testsuite/20_util/optional/monadic/and_then.cc b/libstdc++-v3/testsuite/20_util/optional/monadic/and_then.cc index f69ab952643..7cbec330ea0 100644 --- a/libstdc++-v3/testsuite/20_util/optional/monadic/and_then.cc +++ b/libstdc++-v3/testsuite/20_util/optional/monadic/and_then.cc @@ -118,7 +118,7 @@ void f(int&) { } void test_unconstrained() { - // PR libstc++/102863 - Optional monadic ops should not be constrained + // PR libstdc++/102863 - Optional monadic ops should not be constrained std::optional x; auto answer = x.and_then([](auto& y) { f(y); return std::optional{42}; }); VERIFY( !answer ); diff --git a/libstdc++-v3/testsuite/20_util/optional/monadic/transform.cc b/libstdc++-v3/testsuite/20_util/optional/monadic/transform.cc index 356c94de6d0..b08837ee03b 100644 --- a/libstdc++-v3/testsuite/20_util/optional/monadic/transform.cc +++ b/libstdc++-v3/testsuite/20_util/optional/monadic/transform.cc @@ -137,7 +137,7 @@ void f(int&) { } void test_unconstrained() { - // PR libstc++/102863 - Optional monadic ops should not be constrained + // PR libstdc++/102863 - Optional monadic ops should not be constrained std::optional x; auto answer = x.transform([](auto& y) { f(y); return 42; }); VERIFY( !answer ); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/1.cc index 9431c90b10e..c169073fb46 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/1.cc @@ -36,9 +36,9 @@ void test01() char* c_ref = new char[size]; locale loc = locale::classic(); - const c_codecvt* cvt = &use_facet(loc); + const c_codecvt* cvt = &use_facet(loc); - // According to the resolution of DR19 (see also libstd++/9168), in + // According to the resolution of DR19 (see also libstdc++/9168), in // case of degenerate conversion ('noconv'), "there are no changes to // the values in [to, to_limit)." memset(c_ref, 'X', size); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/1.cc index a8e86524e06..f5e0541a879 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/1.cc @@ -36,9 +36,9 @@ void test01() char* c_ref = new char[size]; locale loc = locale::classic(); - const c_codecvt* cvt = &use_facet(loc); + const c_codecvt* cvt = &use_facet(loc); - // According to the resolution of DR19 (see also libstd++/9168), in + // According to the resolution of DR19 (see also libstdc++/9168), in // case of degenerate conversion ('noconv'), "there are no changes to // the values in [to, to_limit)." memset(c_ref, 'X', size); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/in/char/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/in/char/1.cc index 42bb7bc8578..299c62a8cc6 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/in/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/in/char/1.cc @@ -40,19 +40,19 @@ void test01() locale loc = locale::classic(); c_codecvt::state_type state; - const c_codecvt* cvt = &use_facet(loc); + const c_codecvt* cvt = &use_facet(loc); - // According to the resolution of DR19 (see also libstd++/9168), in + // According to the resolution of DR19 (see also libstdc++/9168), in // case of degenerate conversion ('noconv'), "there are no changes to // the values in [to, to_limit)." memset(c_ref, 'X', size); // in memset(c_arr, 'X', size); - result r1 = cvt->in(state, c_lit, c_lit + size, from_next, + result r1 = cvt->in(state, c_lit, c_lit + size, from_next, c_arr, c_arr + size, to_next); VERIFY( r1 == codecvt_base::noconv ); - VERIFY( !memcmp(c_arr, c_ref, size) ); + VERIFY( !memcmp(c_arr, c_ref, size) ); VERIFY( from_next == c_lit ); VERIFY( to_next == c_arr ); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/1.cc index 0236ac35293..5aec13726da 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/1.cc @@ -35,9 +35,9 @@ void test01() char* c_arr = new char[size]; char* c_ref = new char[size]; locale loc = locale::classic(); - const c_codecvt* cvt = &use_facet(loc); + const c_codecvt* cvt = &use_facet(loc); - // According to the resolution of DR19 (see also libstd++/9168), in + // According to the resolution of DR19 (see also libstdc++/9168), in // case of degenerate conversion ('noconv'), "there are no changes to // the values in [to, to_limit)." memset(c_ref, 'X', size); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/out/char/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/out/char/1.cc index 5733df674aa..a2224c71e54 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/out/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/out/char/1.cc @@ -40,19 +40,19 @@ void test01() locale loc = locale::classic(); c_codecvt::state_type state; - const c_codecvt* cvt = &use_facet(loc); + const c_codecvt* cvt = &use_facet(loc); - // According to the resolution of DR19 (see also libstd++/9168), in + // According to the resolution of DR19 (see also libstdc++/9168), in // case of degenerate conversion ('noconv'), "there are no changes to // the values in [to, to_limit)." memset(c_ref, 'X', size); // out memset(c_arr, 'X', size); - result r2 = cvt->out(state, c_lit, c_lit + size, from_next, + result r2 = cvt->out(state, c_lit, c_lit + size, from_next, c_arr, c_arr + size, to_next); VERIFY( r2 == codecvt_base::noconv ); - VERIFY( !memcmp(c_arr, c_ref, size) ); + VERIFY( !memcmp(c_arr, c_ref, size) ); VERIFY( from_next == c_lit ); VERIFY( to_next == c_arr ); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/1.cc index 828fcec46d3..28745ce9eed 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/1.cc @@ -40,28 +40,28 @@ void test01() locale loc = locale::classic(); c_codecvt::state_type state; - const c_codecvt* cvt = &use_facet(loc); + const c_codecvt* cvt = &use_facet(loc); - // According to the resolution of DR19 (see also libstd++/9168), in + // According to the resolution of DR19 (see also libstdc++/9168), in // case of degenerate conversion ('noconv'), "there are no changes to // the values in [to, to_limit)." memset(c_ref, 'X', size); // in memset(c_arr, 'X', size); - result r1 = cvt->in(state, c_lit, c_lit + size, from_next, + result r1 = cvt->in(state, c_lit, c_lit + size, from_next, c_arr, c_arr + size, to_next); VERIFY( r1 == codecvt_base::noconv ); - VERIFY( !memcmp(c_arr, c_ref, size) ); + VERIFY( !memcmp(c_arr, c_ref, size) ); VERIFY( from_next == c_lit ); VERIFY( to_next == c_arr ); // out memset(c_arr, 'X', size); - result r2 = cvt->out(state, c_lit, c_lit + size, from_next, + result r2 = cvt->out(state, c_lit, c_lit + size, from_next, c_arr, c_arr + size, to_next); VERIFY( r2 == codecvt_base::noconv ); - VERIFY( !memcmp(c_arr, c_ref, size) ); + VERIFY( !memcmp(c_arr, c_ref, size) ); VERIFY( from_next == c_lit ); VERIFY( to_next == c_arr ); From 52f42dce15f036a140154aa339fa1709c5cc858b Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 28 Mar 2022 10:45:45 +0200 Subject: [PATCH 045/157] [libgomp, testsuite] Fix hardcoded libexec in plugin/configfrag.ac When building an nvptx offloading configuration on openSUSE Leap 15.3, the site script /usr/share/site/x86_64-unknown-linux-gnu is activated, setting libexecdir to ${exec_prefix}/lib rather than ${exec_prefix}/libexec: ... | # If user did not specify libexecdir, set the correct target: | # Nor FHS nor openSUSE allow prefix/libexec. Let's default to prefix/lib. | | if test "$libexecdir" = '${exec_prefix}/libexec' ; then | libexecdir='${exec_prefix}/lib' | fi ... However, in libgomp libgomp/plugin/configfrag.ac we hardcode libexec: ... # Configure additional search paths. if test x"$tgt_dir" != x; then offload_additional_options="$offload_additional_options \ -B$tgt_dir/libexec/gcc/\$(target_alias)/\$(gcc_version) \ -B$tgt_dir/bin" ... Fix this by using /$(libexecdir:\$(exec_prefix)/%=%)/ instead of /libexec/. Tested on x86_64-linux with nvptx accelerator. libgomp/ChangeLog: 2022-03-28 Tom de Vries * plugin/configfrag.ac: Use /$(libexecdir:\$(exec_prefix)/%=%)/ instead of /libexec/. * configure: Regenerate. --- libgomp/configure | 2 +- libgomp/plugin/configfrag.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libgomp/configure b/libgomp/configure index a73a6d44003..bdbe3d142d1 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -15419,7 +15419,7 @@ rm -f core conftest.err conftest.$ac_objext \ fi # Configure additional search paths. if test x"$tgt_dir" != x; then - offload_additional_options="$offload_additional_options -B$tgt_dir/libexec/gcc/\$(target_alias)/\$(gcc_version) -B$tgt_dir/bin" + offload_additional_options="$offload_additional_options -B$tgt_dir/\$(libexecdir:\$(exec_prefix)/%=%)/gcc/\$(target_alias)/\$(gcc_version) -B$tgt_dir/bin" offload_additional_lib_paths="$offload_additional_lib_paths:$tgt_dir/lib64:$tgt_dir/lib:$tgt_dir/lib32" else offload_additional_options="$offload_additional_options -B\$(libexecdir)/gcc/\$(target_alias)/\$(gcc_version) -B\$(bindir)" diff --git a/libgomp/plugin/configfrag.ac b/libgomp/plugin/configfrag.ac index da573bd8387..9f9d0a7f08c 100644 --- a/libgomp/plugin/configfrag.ac +++ b/libgomp/plugin/configfrag.ac @@ -254,7 +254,7 @@ if test x"$enable_offload_targets" != x; then fi # Configure additional search paths. if test x"$tgt_dir" != x; then - offload_additional_options="$offload_additional_options -B$tgt_dir/libexec/gcc/\$(target_alias)/\$(gcc_version) -B$tgt_dir/bin" + offload_additional_options="$offload_additional_options -B$tgt_dir/\$(libexecdir:\$(exec_prefix)/%=%)/gcc/\$(target_alias)/\$(gcc_version) -B$tgt_dir/bin" offload_additional_lib_paths="$offload_additional_lib_paths:$tgt_dir/lib64:$tgt_dir/lib:$tgt_dir/lib32" else offload_additional_options="$offload_additional_options -B\$(libexecdir)/gcc/\$(target_alias)/\$(gcc_version) -B\$(bindir)" From 07be8f8da4c6840a1fd6b2229b147e50cc6f03dc Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 25 Mar 2022 11:26:06 -0400 Subject: [PATCH 046/157] c++: ICE with alias in pack expansion [PR103769] This was breaking because when we stripped the 't' typedef in s...> to be s, the TYPE_MAIN_VARIANT of "Args..." was still "t...", because type pack expansions are treated as types. Fixed by using the right function to copy a "type". PR c++/99445 PR c++/103769 gcc/cp/ChangeLog: * tree.cc (strip_typedefs): Use build_distinct_type_copy. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/variadic-alias5.C: New test. --- gcc/cp/tree.cc | 2 +- gcc/testsuite/g++.dg/cpp0x/variadic-alias5.C | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/variadic-alias5.C diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc index eb59e56610b..492921721f2 100644 --- a/gcc/cp/tree.cc +++ b/gcc/cp/tree.cc @@ -1791,7 +1791,7 @@ strip_typedefs (tree t, bool *remove_attributes, unsigned int flags) Ts pack, resulting in an error. */ if (type != pat && uses_parameter_packs (type)) { - result = copy_node (t); + result = build_distinct_type_copy (t); PACK_EXPANSION_PATTERN (result) = type; } } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-alias5.C b/gcc/testsuite/g++.dg/cpp0x/variadic-alias5.C new file mode 100644 index 00000000000..70956c91838 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-alias5.C @@ -0,0 +1,9 @@ +// PR c++/103769 +// { dg-do compile { target c++11 } } +// { dg-additional-options "--param=hash-table-verification-limit=1000" } + +template using t = T; +template struct s {}; +template s...> f() { return {};} + +int main() { f(); } From 71e1db540c01a13b01fae054c92878a79252b471 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 26 Mar 2022 20:10:19 -0400 Subject: [PATCH 047/157] c++: mangling union{1} in template [PR104847] My implementation of union non-type template arguments in r11-2016 broke braced casts of union type, because they are still in syntactic (undigested) form. PR c++/104847 gcc/cp/ChangeLog: * mangle.cc (write_expression): Don't write a union designator when undigested. gcc/testsuite/ChangeLog: * g++.dg/abi/mangle-union1.C: New test. --- gcc/cp/mangle.cc | 2 +- gcc/testsuite/g++.dg/abi/mangle-union1.C | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/abi/mangle-union1.C diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc index dbcec0a55bc..eb53e0ebeb4 100644 --- a/gcc/cp/mangle.cc +++ b/gcc/cp/mangle.cc @@ -3363,7 +3363,7 @@ write_expression (tree expr) { if (i > last_nonzero) break; - if (TREE_CODE (etype) == UNION_TYPE) + if (!undigested && TREE_CODE (etype) == UNION_TYPE) { /* Express the active member as a designator. */ write_string ("di"); diff --git a/gcc/testsuite/g++.dg/abi/mangle-union1.C b/gcc/testsuite/g++.dg/abi/mangle-union1.C new file mode 100644 index 00000000000..f2ee4576adf --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/mangle-union1.C @@ -0,0 +1,10 @@ +// PR c++/104847 +// { dg-do compile { target c++11 } } + +struct S { int i; }; +union U { S k; }; +template T sink(T&&, Ts&&...); +template +decltype(sink(U{1},T())) f(T) { return U{1}; } +int main() { f(3); } +// { dg-final { scan-assembler "_Z1fIiEDTcl4sinktl1ULi1EEcvT__EEES1_" } } From 72bdfcb848327020f62f72405d72cf85650666e1 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 26 Mar 2022 20:38:54 -0400 Subject: [PATCH 048/157] c++: missing aggregate base ctor [PR102045] When make_base_init_ok changes a call to a complete constructor into a call to a base constructor, we were never marking the base ctor as used, so it didn't get emitted. PR c++/102045 gcc/cp/ChangeLog: * call.cc (make_base_init_ok): Call make_used. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/aggr-base12.C: New test. --- gcc/cp/call.cc | 1 + gcc/testsuite/g++.dg/cpp1z/aggr-base12.C | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1z/aggr-base12.C diff --git a/gcc/cp/call.cc b/gcc/cp/call.cc index dfe370d685d..73fede5a3df 100644 --- a/gcc/cp/call.cc +++ b/gcc/cp/call.cc @@ -8958,6 +8958,7 @@ make_base_init_ok (tree exp) call target. It would be possible to splice in the appropriate arguments, but probably not worth the complexity. */ return false; + mark_used (fn); AGGR_INIT_EXPR_FN (exp) = build_address (fn); return true; } diff --git a/gcc/testsuite/g++.dg/cpp1z/aggr-base12.C b/gcc/testsuite/g++.dg/cpp1z/aggr-base12.C new file mode 100644 index 00000000000..6f5a6b2056a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/aggr-base12.C @@ -0,0 +1,24 @@ +// PR c++/102045 +// { dg-do link { target c++17 } } + +template +struct span +{ + template + constexpr span(T (&a)[N]) : data(a), len(N) { } + constexpr bool empty() const { return len == 0; } + T* data; + unsigned long len; +}; + +struct byte_writer: span { + constexpr void do_something() noexcept { + (void)this->empty(); + } +}; + +int main() { + char array[1]; + auto writer = byte_writer{array}; + writer.do_something(); +} From 8bc5cdaafa2e729f9209684dc30aa0acb72d2580 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 26 Mar 2022 22:05:53 -0400 Subject: [PATCH 049/157] c++: CTAD and member function references [PR103943] More quirks of rewriting member references to dependent references for CTAD. A reference to a member of dependent scope is definitely dependent. And since r11-7044, tsubst_baselink builds a SCOPE_REF, so tsubst_qualified_id should just use it. PR c++/103943 gcc/cp/ChangeLog: * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from tsubst_baselink. (instantiation_dependent_scope_ref_p): Check dependent_scope_p. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/class-deduction109.C: New test. --- gcc/cp/pt.cc | 21 ++++-- .../g++.dg/cpp1z/class-deduction109.C | 64 +++++++++++++++++++ 2 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp1z/class-deduction109.C diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 173bc3a8c7f..b229c9fc739 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -16590,12 +16590,20 @@ tsubst_qualified_id (tree qualified_id, tree args, if (dependent_scope_p (scope)) { - if (is_template) - expr = build_min_nt_loc (loc, TEMPLATE_ID_EXPR, expr, template_args); - tree r = build_qualified_name (NULL_TREE, scope, expr, - QUALIFIED_NAME_IS_TEMPLATE (qualified_id)); - REF_PARENTHESIZED_P (r) = REF_PARENTHESIZED_P (qualified_id); - return r; + if (TREE_CODE (expr) == SCOPE_REF) + /* We built one in tsubst_baselink. */ + gcc_checking_assert (same_type_p (scope, TREE_OPERAND (expr, 0))); + else + { + if (is_template) + expr = build_min_nt_loc (loc, TEMPLATE_ID_EXPR, expr, + template_args); + expr = build_qualified_name (NULL_TREE, scope, expr, + QUALIFIED_NAME_IS_TEMPLATE + (qualified_id)); + } + REF_PARENTHESIZED_P (expr) = REF_PARENTHESIZED_P (qualified_id); + return expr; } if (!BASELINK_P (name) && !DECL_P (expr)) @@ -27334,6 +27342,7 @@ instantiation_dependent_scope_ref_p (tree t) { if (DECL_P (TREE_OPERAND (t, 1)) && CLASS_TYPE_P (TREE_OPERAND (t, 0)) + && !dependent_scope_p (TREE_OPERAND (t, 0)) && !unknown_base_ref_p (t) && accessible_in_template_p (TREE_OPERAND (t, 0), TREE_OPERAND (t, 1))) diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction109.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction109.C new file mode 100644 index 00000000000..e621ebad28a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction109.C @@ -0,0 +1,64 @@ +// PR c++/103943 +// { dg-do compile { target c++17 } } + +template struct F0 { //OK + R(*fun_ptr)(AA...); +}; +template struct F1 { //OK + R(*fun_ptr)(AA...); + F1(R(*fun_ptr)(AA...)) : fun_ptr(fun_ptr) {} +}; +template struct F2 { //OK + R(*fun_ptr)(AA...); + using fun_ptr_t = decltype(fun_ptr); + F2(fun_ptr_t fun_ptr) : fun_ptr(fun_ptr) {} +}; +template struct F3 { + R(*fun_ptr)(AA...); +// using fun_ptr_t = decltype(fun_ptr); //OK as in F2 + using fun_ptr_t = decltype(F3::fun_ptr); //ICE: Segmentation fault +// using fun_ptr_t = decltype(F3::fun_ptr); //ICE: Segmentation fault + F3(fun_ptr_t fun_ptr) : fun_ptr(fun_ptr) {} +}; +template struct F4 { + static R fun_not_implemented(AA...); +// using fun_ptr_t = decltype(&fun_not_implemented); //OK + using fun_ptr_t = decltype(&F4::fun_not_implemented); //OK with aggregate initialization (no ctor) +// using fun_ptr_t = decltype(&F4::fun_not_implemented); //OK with aggregate initialization (no ctor) + fun_ptr_t fun_ptr; +}; +template struct F5 { //OK + static R fun_not_implemented(AA...); + using fun_ptr_t = decltype(&fun_not_implemented); + fun_ptr_t fun_ptr; + F5(fun_ptr_t fun_ptr) : fun_ptr(fun_ptr) {} +}; +template struct F6 { + static R fun_not_implemented(AA...); +// using fun_ptr_t = decltype(&fun_not_implemented); //OK as in F5 + using fun_ptr_t = decltype(&F6::fun_not_implemented); //ICE: in build_qualified_name, at cp/tree.c:2238 +// using fun_ptr_t = decltype(&F6::fun_not_implemented); //ICE: in build_qualified_name, at cp/tree.c:2238 + fun_ptr_t fun_ptr; + F6(fun_ptr_t fun_ptr) : fun_ptr(fun_ptr) {} +}; +template F0(R(*fun_ptr)(AA...)) -> F0; +template F1(R(*fun_ptr)(AA...)) -> F1; +template F2(R(*fun_ptr)(AA...)) -> F2; +template F3(R(*fun_ptr)(AA...)) -> F3; +template F4(R(*fun_ptr)(AA...)) -> F4; +template F5(R(*fun_ptr)(AA...)) -> F5; +template F6(R(*fun_ptr)(AA...)) -> F6; + +int fun(int a) { + return a + 1; +} +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +void test() { + auto f0 = F0{&fun}; //OK + auto f1 = F1{&fun}; //OK + auto f2 = F2{&fun}; //OK + auto f3 = F3{&fun}; //ICE: Segmentation fault + auto f4 = F4{&fun}; //OK + auto f5 = F5{&fun}; //OK + auto f6 = F6{&fun}; //ICE: in build_qualified_name, at cp/tree.c:2238 +} From c7361eb36fa50307c9f7cfca36c9f58ce24f8f54 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sun, 27 Mar 2022 00:28:30 -0400 Subject: [PATCH 050/157] c++: member alias declaration [PR103968] Here, we were wrongly thinking that (const Options&)Widget::c_options is not value-dependent because neither the type nor the (value of) c_options are dependent, but since we're binding it to a reference we also need to consider that it has a value-dependent address. PR c++/103968 gcc/cp/ChangeLog: * pt.cc (value_dependent_expression_p): Check has_value_dependent_address for conversion to reference. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/alias-decl-mem1.C: New test. --- gcc/cp/pt.cc | 4 ++++ gcc/testsuite/g++.dg/cpp0x/alias-decl-mem1.C | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-mem1.C diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index b229c9fc739..41f1ef1f64d 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -27449,6 +27449,10 @@ value_dependent_expression_p (tree expression) if (TREE_CODE (expression) == TREE_LIST) return any_value_dependent_elements_p (expression); + if (TREE_CODE (type) == REFERENCE_TYPE + && has_value_dependent_address (expression)) + return true; + return value_dependent_expression_p (expression); } diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-mem1.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-mem1.C new file mode 100644 index 00000000000..3e422de4054 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-mem1.C @@ -0,0 +1,20 @@ +// PR c++/103968 +// { dg-do compile { target c++11 } } + +template +struct trait +{ + template + struct NonInstantiated{}; +}; + +struct Options {}; + +template +struct Widget +{ + static constexpr auto c_options = Options{}; + using Trait = trait; +}; + +Widget::Trait b{}; // Crashes GCC > 10.3 From b854ce130ebbfdf2f882ef08538746030513b44b Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 26 Mar 2022 23:54:22 -0400 Subject: [PATCH 051/157] c++: CTAD and member alias template [PR102123] When building a deduction guide from the Test constructor, we need to rewrite the use of _dummy into a dependent reference, i.e. Test::template _dummy. We were using SCOPE_REF for both type and non-type templates; we need to use UNBOUND_CLASS_TEMPLATE for type templates. PR c++/102123 gcc/cp/ChangeLog: * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting a type template reference. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/class-deduction110.C: New test. --- gcc/cp/pt.cc | 3 ++ .../g++.dg/cpp1z/class-deduction110.C | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1z/class-deduction110.C diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 41f1ef1f64d..678063f6e4c 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -17021,6 +17021,9 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) /* When rewriting a constructor into a deduction guide, a non-dependent name can become dependent, so memtmpl becomes context::template memtmpl. */ + if (DECL_TYPE_TEMPLATE_P (t)) + return make_unbound_class_template (context, DECL_NAME (t), + NULL_TREE, complain); tree type = tsubst (TREE_TYPE (t), args, complain, in_decl); return build_qualified_name (type, context, DECL_NAME (t), /*template*/true); diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction110.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction110.C new file mode 100644 index 00000000000..8eb56478fe9 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction110.C @@ -0,0 +1,28 @@ +// PR c++/102123 +// { dg-do compile { target c++17 } } + +template typename Template, typename... Args> +struct _dummy_forwarder { + using type = Template; +}; + +template typename Template, typename... Args> +using dummy_forwarder = typename _dummy_forwarder::type; + +template +struct Test { + template using _dummy = U; + + using Element = dummy_forwarder<_dummy, T>; + + Element _elem; + + constexpr Test(const Element elem) : _elem(elem) { } +}; + +template +Test(T) -> Test; + +void test() { + const auto t = Test(1); +} From 8796eb27e24bd3340ebd393e96a94b91d09407e9 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sun, 27 Mar 2022 09:44:59 -0400 Subject: [PATCH 052/157] c++: visibility of local extern [PR103291] When setting up the hidden namespace-scope decl for a local extern, we also need to set its visibility. PR c++/103291 gcc/cp/ChangeLog: * name-lookup.cc (push_local_extern_decl_alias): Call determine_visibility. gcc/testsuite/ChangeLog: * g++.dg/ext/visibility/visibility-local-extern1.C: New test. --- gcc/cp/name-lookup.cc | 3 +++ .../g++.dg/ext/visibility/visibility-local-extern1.C | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 gcc/testsuite/g++.dg/ext/visibility/visibility-local-extern1.C diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc index 3c7b626350f..c833b84ca8a 100644 --- a/gcc/cp/name-lookup.cc +++ b/gcc/cp/name-lookup.cc @@ -3476,6 +3476,9 @@ push_local_extern_decl_alias (tree decl) && CP_DECL_THREAD_LOCAL_P (decl) && alias != error_mark_node) set_decl_tls_model (alias, DECL_TLS_MODEL (decl)); + + /* Adjust visibility. */ + determine_visibility (alias); } } diff --git a/gcc/testsuite/g++.dg/ext/visibility/visibility-local-extern1.C b/gcc/testsuite/g++.dg/ext/visibility/visibility-local-extern1.C new file mode 100644 index 00000000000..40c20199d0c --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/visibility/visibility-local-extern1.C @@ -0,0 +1,10 @@ +// PR c++/103291 +// { dg-additional-options -fpic } +// { dg-final { scan-assembler-not "@GOTPCREL" } } + +#pragma GCC visibility push(hidden) + +int hidden_fetch(void) { + extern const int hidden_global; + return hidden_global; +} From 19b87a06482756739087283cd8b884cb3de693f9 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sun, 27 Mar 2022 12:36:13 -0400 Subject: [PATCH 053/157] c++: low -faligned-new [PR102071] This test ICEd after the constexpr new patch (r10-3661) because alloc_call had a NOP_EXPR around it; fixed by moving the NOP_EXPR to alloc_expr. And the PR pointed out that the size_t cookie might need more alignment, so I fix that as well. PR c++/102071 gcc/cp/ChangeLog: * init.cc (build_new_1): Include cookie in alignment. Omit constexpr wrapper from alloc_call. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/aligned-new9.C: New test. --- gcc/cp/init.cc | 15 +++++++++---- gcc/testsuite/g++.dg/cpp1z/aligned-new9.C | 26 +++++++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp1z/aligned-new9.C diff --git a/gcc/cp/init.cc b/gcc/cp/init.cc index 08767679dd4..91b5c2c0f69 100644 --- a/gcc/cp/init.cc +++ b/gcc/cp/init.cc @@ -3284,7 +3284,13 @@ build_new_1 (vec **placement, tree type, tree nelts, tree align_arg = NULL_TREE; if (type_has_new_extended_alignment (elt_type)) - align_arg = build_int_cst (align_type_node, TYPE_ALIGN_UNIT (elt_type)); + { + unsigned align = TYPE_ALIGN_UNIT (elt_type); + /* Also consider the alignment of the cookie, if any. */ + if (TYPE_VEC_NEW_USES_COOKIE (elt_type)) + align = MAX (align, TYPE_ALIGN_UNIT (size_type_node)); + align_arg = build_int_cst (align_type_node, align); + } alloc_fn = NULL_TREE; @@ -3473,18 +3479,19 @@ build_new_1 (vec **placement, tree type, tree nelts, } } + alloc_expr = alloc_call; if (cookie_size) - alloc_call = maybe_wrap_new_for_constexpr (alloc_call, type, + alloc_expr = maybe_wrap_new_for_constexpr (alloc_expr, type, cookie_size); /* In the simple case, we can stop now. */ pointer_type = build_pointer_type (type); if (!cookie_size && !is_initialized && !member_delete_p) - return build_nop (pointer_type, alloc_call); + return build_nop (pointer_type, alloc_expr); /* Store the result of the allocation call in a variable so that we can use it more than once. */ - alloc_expr = get_target_expr (alloc_call); + alloc_expr = get_target_expr (alloc_expr); alloc_node = TARGET_EXPR_SLOT (alloc_expr); /* Strip any COMPOUND_EXPRs from ALLOC_CALL. */ diff --git a/gcc/testsuite/g++.dg/cpp1z/aligned-new9.C b/gcc/testsuite/g++.dg/cpp1z/aligned-new9.C new file mode 100644 index 00000000000..7854299419a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/aligned-new9.C @@ -0,0 +1,26 @@ +// PR c++/102071 +// { dg-do run { target c++17 } } +// { dg-additional-options -faligned-new=2 } + +#include + +int nalign; +void *operator new (std::size_t s, std::align_val_t a) +{ + nalign = (int)a; + return operator new (s); +} + +struct X { ~X(); int c; }; + +int align = (alignof (X) > alignof (std::size_t) + ? alignof (X) : alignof (std::size_t)); + +int n = 4; + +int main() +{ + X *p = new X[n]; + if (nalign != align) + __builtin_abort (); +} From 875342766d42988fa2f8eb7d34ef562ba69e340a Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 28 Mar 2022 09:43:07 -0400 Subject: [PATCH 054/157] gimple-fold: fix location of loads for memory ops [PR104308] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR analyzer/104308 reports that when -Wanalyzer-use-of-uninitialized-value complains about certain memmove operations where the source is uninitialized, the diagnostic uses UNKNOWN_LOCATION: In function 'main': cc1: warning: use of uninitialized value '*(short unsigned int *)&s + 1' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 'main': event 1 | |pr104308.c:5:8: | 5 | char s[5]; /* { dg-message "region created on stack here" } */ | | ^ | | | | | (1) region created on stack here | 'main': event 2 | |cc1: | (2): use of uninitialized value '*(short unsigned int *)&s + 1' here | The issue is that gimple_fold_builtin_memory_op converts a memmove to: _3 = MEM [(char * {ref-all})_1]; MEM [(char * {ref-all})&s] = _3; but only sets the location of the 2nd stmt, not the 1st. Fixed thusly, giving: pr104308.c: In function 'main': pr104308.c:6:3: warning: use of uninitialized value '*(short unsigned int *)&s + 1' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 6 | memmove(s, s + 1, 2); /* { dg-warning "use of uninitialized value" } */ | ^~~~~~~~~~~~~~~~~~~~ 'main': events 1-2 | | 5 | char s[5]; /* { dg-message "region created on stack here" } */ | | ^ | | | | | (1) region created on stack here | 6 | memmove(s, s + 1, 2); /* { dg-warning "use of uninitialized value" } */ | | ~~~~~~~~~~~~~~~~~~~~ | | | | | (2) use of uninitialized value '*(short unsigned int *)&s + 1' here | One side-effect of this change is a change in part of the output of gcc.dg/uninit-40.c from: uninit-40.c:47:3: warning: ‘*(long unsigned int *)(&u[1][0][0])’ is used uninitialized [-Wuninitialized] 47 | __builtin_memcpy (&v[1], &u[1], sizeof (V)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ uninit-40.c:45:5: note: ‘*(long unsigned int *)(&u[1][0][0])’ was declared here 45 | V u[2], v[2]; | ^ to: uninit-40.c:47:3: warning: ‘u’ is used uninitialized [-Wuninitialized] 47 | __builtin_memcpy (&v[1], &u[1], sizeof (V)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ uninit-40.c:45:5: note: ‘u’ declared here 45 | V u[2], v[2]; | ^ What's happening is that pass "early_uninit"(29)'s call to maybe_warn_operand is guarded by this condition: 1051 else if (gimple_assign_load_p (stmt) 1052 && gimple_has_location (stmt)) Before the patch, the stmt: _3 = MEM [(char * {ref-all})&u + 8B]; has no location, and so early_uninit skips this operand at line 1052 above. Later, pass "uninit"(217) tests the var_decl "u$8", and emits a warning for it. With the patch, the stmt has a location, and so early_uninit emits a warning for "u" and sets a NW_UNINIT warning suppression at that location. Later, pass "uninit"(217)'s test of "u$8" is rejected due to that per-location suppression of uninit warnings, from the earlier warning. gcc/ChangeLog: PR analyzer/104308 * gimple-fold.cc (gimple_fold_builtin_memory_op): When optimizing to loads then stores, set the location of the new load stmt. gcc/testsuite/ChangeLog: PR analyzer/104308 * gcc.dg/analyzer/pr104308.c: New test. * gcc.dg/uninit-40.c (foo): Update expression in expected message. Signed-off-by: David Malcolm --- gcc/gimple-fold.cc | 1 + gcc/testsuite/gcc.dg/analyzer/pr104308.c | 8 ++++++++ gcc/testsuite/gcc.dg/uninit-40.c | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/analyzer/pr104308.c diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc index 5eff7d68ac1..e73bc6a7137 100644 --- a/gcc/gimple-fold.cc +++ b/gcc/gimple-fold.cc @@ -1039,6 +1039,7 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi, new_stmt); gimple_assign_set_lhs (new_stmt, srcmem); gimple_set_vuse (new_stmt, gimple_vuse (stmt)); + gimple_set_location (new_stmt, loc); gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT); } if (dest_align < GET_MODE_ALIGNMENT (mode)) diff --git a/gcc/testsuite/gcc.dg/analyzer/pr104308.c b/gcc/testsuite/gcc.dg/analyzer/pr104308.c new file mode 100644 index 00000000000..9cd5ee6feee --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr104308.c @@ -0,0 +1,8 @@ +#include + +int main() +{ + char s[5]; /* { dg-message "region created on stack here" } */ + memmove(s, s + 1, 2); /* { dg-warning "use of uninitialized value" } */ + return 0; +} diff --git a/gcc/testsuite/gcc.dg/uninit-40.c b/gcc/testsuite/gcc.dg/uninit-40.c index 8708079d397..567707a885e 100644 --- a/gcc/testsuite/gcc.dg/uninit-40.c +++ b/gcc/testsuite/gcc.dg/uninit-40.c @@ -44,7 +44,7 @@ foo (int *q) /* memcpy folding is too target dependent to test it everywhere. */ V u[2], v[2]; u[0][0][0] = 1; - __builtin_memcpy (&v[1], &u[1], sizeof (V)); /* { dg-warning "'\\*\\(\(long \)?long unsigned int \\*\\)\\(&u\\\[1\\\]\\\[0\\\]\\\[0\\\]\\)' is used uninitialized" "" { target i?86-*-* x86_64-*-* } } */ + __builtin_memcpy (&v[1], &u[1], sizeof (V)); /* { dg-warning "'u' is used uninitialized" "" { target i?86-*-* x86_64-*-* } } */ baz (&v[1]); #endif } From fc50d9a252c89c1bac78192bd0884ff23f2bf48b Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 25 Mar 2022 13:13:35 -0400 Subject: [PATCH 055/157] c++: hash table ICE with variadic alias [PR105003] For PR104008 we thought it might be enough to keep strip_typedefs from removing this alias template specialization, but this PR demonstrates that other parts of the compiler also need to know to consider it dependent. So, this patch changes complex_alias_template_p to no longer consider template parameters used when their only use appears in a pack expansion, unless they are the parameter packs being expanded. To do that I also needed to change it to use cp_walk_tree instead of for_each_template_parm. It occurs to me that find_template_parameters should probably also use cp_walk_tree, but I'm not messing with that now. PR c++/105003 PR c++/104008 PR c++/102869 gcc/cp/ChangeLog: * pt.cc (complex_alias_template_r): walk_tree callback, replacing uses_all_template_parms_r, complex_pack_expansion_r. (complex_alias_template_p): Adjust. * tree.cc (strip_typedefs): Revert r12-7710 change. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/variadic-alias6.C: New test. * g++.dg/cpp0x/variadic-alias7.C: New test. --- gcc/cp/pt.cc | 72 +++++++++++++------- gcc/cp/tree.cc | 13 +--- gcc/testsuite/g++.dg/cpp0x/variadic-alias6.C | 20 ++++++ gcc/testsuite/g++.dg/cpp0x/variadic-alias7.C | 16 +++++ 4 files changed, 85 insertions(+), 36 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/variadic-alias6.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/variadic-alias7.C diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 678063f6e4c..3df509bbed0 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -6460,10 +6460,7 @@ alias_template_specialization_p (const_tree t, return NULL_TREE; } -/* An alias template is complex from a SFINAE perspective if a template-id - using that alias can be ill-formed when the expansion is not, as with - the void_t template. We determine this by checking whether the - expansion for the alias template uses all its template parameters. */ +/* Data structure for complex_alias_template_*. */ struct uses_all_template_parms_data { @@ -6471,31 +6468,36 @@ struct uses_all_template_parms_data bool *seen; }; -static int -uses_all_template_parms_r (tree t, void *data_) +/* walk_tree callback for complex_alias_template_p. */ + +static tree +complex_alias_template_r (tree *tp, int *walk_subtrees, void *data_) { - struct uses_all_template_parms_data &data - = *(struct uses_all_template_parms_data*)data_; - tree idx = get_template_parm_index (t); + tree t = *tp; + auto &data = *(struct uses_all_template_parms_data*)data_; - if (TEMPLATE_PARM_LEVEL (idx) == data.level) - data.seen[TEMPLATE_PARM_IDX (idx)] = true; - return 0; -} + switch (TREE_CODE (t)) + { + case TEMPLATE_TYPE_PARM: + case TEMPLATE_PARM_INDEX: + case TEMPLATE_TEMPLATE_PARM: + case BOUND_TEMPLATE_TEMPLATE_PARM: + { + tree idx = get_template_parm_index (t); + if (TEMPLATE_PARM_LEVEL (idx) == data.level) + data.seen[TEMPLATE_PARM_IDX (idx)] = true; + } -/* for_each_template_parm any_fn callback for complex_alias_template_p. */ + default:; + } + + if (!PACK_EXPANSION_P (t)) + return 0; -static int -complex_pack_expansion_r (tree t, void *data_) -{ /* An alias template with a pack expansion that expands a pack from the enclosing class needs to be considered complex, to avoid confusion with the same pack being used as an argument to the alias's own template parameter (91966). */ - if (!PACK_EXPANSION_P (t)) - return 0; - struct uses_all_template_parms_data &data - = *(struct uses_all_template_parms_data*)data_; for (tree pack = PACK_EXPANSION_PARAMETER_PACKS (t); pack; pack = TREE_CHAIN (pack)) { @@ -6505,11 +6507,34 @@ complex_pack_expansion_r (tree t, void *data_) int idx, level; template_parm_level_and_index (parm_pack, &level, &idx); if (level < data.level) - return 1; + return t; + + /* Consider the expanded packs to be used outside the expansion... */ + data.seen[idx] = true; } + + /* ...but don't walk into the pattern. Consider PR104008: + + template + using IsOneOf = disjunction...>; + + where IsOneOf seemingly uses all of its template parameters in its + expansion (and does not expand a pack from the enclosing class), so the + alias was not marked as complex. However, if it is used like + "IsOneOf", the empty pack for Ts means that T no longer appears in the + expansion. So only Ts is considered used by the pack expansion. */ + *walk_subtrees = false; + return 0; } +/* An alias template is complex from a SFINAE perspective if a template-id + using that alias can be ill-formed when the expansion is not, as with + the void_t template. + + Returns 1 if always complex, 0 if not complex, -1 if complex iff any of the + template arguments are empty packs. */ + static bool complex_alias_template_p (const_tree tmpl) { @@ -6530,8 +6555,7 @@ complex_alias_template_p (const_tree tmpl) for (int i = 0; i < len; ++i) data.seen[i] = false; - if (for_each_template_parm (pat, uses_all_template_parms_r, &data, - NULL, true, complex_pack_expansion_r)) + if (cp_walk_tree_without_duplicates (&pat, complex_alias_template_r, &data)) return true; for (int i = 0; i < len; ++i) if (!data.seen[i]) diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc index 492921721f2..780a8d89165 100644 --- a/gcc/cp/tree.cc +++ b/gcc/cp/tree.cc @@ -1778,18 +1778,7 @@ strip_typedefs (tree t, bool *remove_attributes, unsigned int flags) if (TYPE_P (pat)) { type = strip_typedefs (pat, remove_attributes, flags); - /* Empty packs can thwart our efforts here. Consider - - template - using IsOneOf = disjunction...>; - - where IsOneOf seemingly uses all of its template parameters in - its expansion (and does not expand a pack from the enclosing - class), so the alias is not marked as complex. However, it may - be used as in "IsOneOf", where Ts is an empty parameter pack, - and stripping it down into "disjunction<>" here would exclude the - Ts pack, resulting in an error. */ - if (type != pat && uses_parameter_packs (type)) + if (type != pat) { result = build_distinct_type_copy (t); PACK_EXPANSION_PATTERN (result) = type; diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-alias6.C b/gcc/testsuite/g++.dg/cpp0x/variadic-alias6.C new file mode 100644 index 00000000000..c095bc537d7 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-alias6.C @@ -0,0 +1,20 @@ +// PR c++/105003 +// { dg-do compile { target c++11 } } + +template struct A; +template struct B { }; +template struct C { }; + +// Fn is not complex, since T is used outside the pack expansion, so the two +// partial specializations are equivalent. +template using Fn = T(Ts...); +template struct A*> { }; +template struct A { }; // { dg-error "redefinition" } + +// CB is complex, since T is only used in the pack expansion, so the two +// partial specializations are functionally equivalent but not equivalent. +template using CB = C...>; +template struct A*> { }; +template struct A...>*> { }; // IFNDR +A>*> a; // { dg-error "ambiguous" } +// { dg-prune-output "incomplete" } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-alias7.C b/gcc/testsuite/g++.dg/cpp0x/variadic-alias7.C new file mode 100644 index 00000000000..41a432a8e41 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-alias7.C @@ -0,0 +1,16 @@ +// PR c++/102869 +// { dg-do compile { target c++11 } } + +template struct integer_sequence; + +template +using make_index_sequence = integer_sequence<__integer_pack(_Num)...>; + +template struct Tuple; + +template using tuple_t = Tuple...>; + +template +void f() { + tuple_t t; +} From 0127fb1b78a36a7b228d4b3fe32eedfc8d273363 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 28 Mar 2022 17:55:49 +0200 Subject: [PATCH 056/157] [nvptx] Improve help description of misa and mptx Currently we have: ... $ gcc --target-help 2>&1 | egrep "misa|mptx" -misa= Specify the version of the ptx ISA to use. -mptx= Specify the version of the ptx version to use. Known PTX ISA versions (for use with the -misa= option): Known PTX versions (for use with the -mptx= option): ... As reported in PR104818, the "version of the ptx version" doesn't make much sense. Furthermore, the description of misa (and 'Known ISA versions') is misleading because it does not specify the version of the PTX ISA, but rather the PTX ISA target architecture. Fix this by printing instead: ... $ gcc --target-help 2>&1 | egrep "misa|mptx" -misa= Specify the PTX ISA target architecture to use. -mptx= Specify the PTX ISA version to use. Known PTX ISA target architectures (for use with the -misa= option): Known PTX ISA versions (for use with the -mptx= option): ... Tested on nvptx. gcc/ChangeLog: 2022-03-28 Tom de Vries PR target/104818 * config/nvptx/gen-opt.sh (ptx_isa): Improve help text. * config/nvptx/nvptx-gen.opt: Regenerate. * config/nvptx/nvptx.opt (misa, mptx, ptx_version): Improve help text. * config/nvptx/t-nvptx (s-nvptx-gen-opt): Add missing dependency on gen-opt.sh. --- gcc/config/nvptx/gen-opt.sh | 2 +- gcc/config/nvptx/nvptx-gen.opt | 2 +- gcc/config/nvptx/nvptx.opt | 6 +++--- gcc/config/nvptx/t-nvptx | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gcc/config/nvptx/gen-opt.sh b/gcc/config/nvptx/gen-opt.sh index 5248ed25090..ba048891a49 100644 --- a/gcc/config/nvptx/gen-opt.sh +++ b/gcc/config/nvptx/gen-opt.sh @@ -44,7 +44,7 @@ echo cat < tmp-nvptx-gen.opt $(SHELL) $(srcdir)/../move-if-change \ From cccbb776589c1825de1bd2eefabb11d72ef28de8 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 28 Mar 2022 09:32:53 -0700 Subject: [PATCH 057/157] x86: Also use Yw in *ssse3_pshufbv8qi3 clobber PR target/105068 * config/i386/sse.md (*ssse3_pshufbv8qi3): Also replace "Yv" with "Yw" in clobber. --- gcc/config/i386/sse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 01543afd111..1f9c496e7c0 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -20764,7 +20764,7 @@ (match_operand:V4SI 4 "reg_or_const_vector_operand" "i,3,3")] UNSPEC_PSHUFB)) - (clobber (match_scratch:V4SI 3 "=X,&x,&Yv"))] + (clobber (match_scratch:V4SI 3 "=X,&x,&Yw"))] "(TARGET_MMX || TARGET_MMX_WITH_SSE) && TARGET_SSSE3" "@ pshufb\t{%2, %0|%0, %2} From ecb4882e362e80a1bf172453ac9b366edbb4e89c Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Mon, 28 Mar 2022 14:15:16 -0400 Subject: [PATCH 058/157] c++: constrained template friend matching ICE [PR105064] Here during declaration matching for the two constrained template friends, we crash from maybe_substitute_reqs_for because the second friend doesn't yet have DECL_TEMPLATE_INFO set (we're being called indirectly from push_template_decl). As far as I can tell, this situation happens only when declaring a constrained template friend within a non-template class (as in the testcase), in which case the substitution would be a no-op anyway. So this patch rearranges maybe_substitute_reqs_for to gracefully handle missing DECL_TEMPLATE_INFO by just skipping the substitution. PR c++/105064 gcc/cp/ChangeLog: * constraint.cc (maybe_substitute_reqs_for): Don't assume DECL_TEMPLATE_INFO is available. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-friend9.C: New test. --- gcc/cp/constraint.cc | 13 ++++--------- gcc/testsuite/g++.dg/cpp2a/concepts-friend9.C | 12 ++++++++++++ 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp2a/concepts-friend9.C diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc index e14578b1721..c5a991b9e71 100644 --- a/gcc/cp/constraint.cc +++ b/gcc/cp/constraint.cc @@ -1268,20 +1268,15 @@ remove_constraints (tree t) for declaration matching. */ tree -maybe_substitute_reqs_for (tree reqs, const_tree decl_) +maybe_substitute_reqs_for (tree reqs, const_tree decl) { if (reqs == NULL_TREE) return NULL_TREE; - tree decl = CONST_CAST_TREE (decl_); - tree result = STRIP_TEMPLATE (decl); - - if (DECL_UNIQUE_FRIEND_P (result)) + decl = STRIP_TEMPLATE (decl); + if (DECL_UNIQUE_FRIEND_P (decl) && DECL_TEMPLATE_INFO (decl)) { - tree tmpl = decl; - if (TREE_CODE (decl) != TEMPLATE_DECL) - tmpl = DECL_TI_TEMPLATE (result); - + tree tmpl = DECL_TI_TEMPLATE (decl); tree gargs = generic_targs_for (tmpl); processing_template_decl_sentinel s; if (uses_template_parms (gargs)) diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-friend9.C b/gcc/testsuite/g++.dg/cpp2a/concepts-friend9.C new file mode 100644 index 00000000000..09054d23d5d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-friend9.C @@ -0,0 +1,12 @@ +// PR c++/105064 +// { dg-do compile { target c++20 } } + +struct A { + template + friend void f(T) requires true; +}; + +struct B { + template + friend void f(T) requires true; +}; From 23e57329c6516a81a8d3eb21b365ca8a0ec0c41b Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Mon, 28 Mar 2022 14:15:39 -0400 Subject: [PATCH 059/157] c++: reject concept w/ multiple tparm lists [PR105067] We weren't rejecting a concept declared with multiple template parameter lists. PR c++/105067 gcc/cp/ChangeLog: * pt.cc (finish_concept_definition): Check that a concept is declared with exactly one template parameter list. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-err4.C: New test. --- gcc/cp/pt.cc | 6 ++++++ gcc/testsuite/g++.dg/cpp2a/concepts-err4.C | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp2a/concepts-err4.C diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 3df509bbed0..cd07e48cb5a 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -28815,6 +28815,12 @@ finish_concept_definition (cp_expr id, tree init) return error_mark_node; } + if (current_template_depth > 1) + { + error_at (loc, "concept %qE has multiple template parameter lists", *id); + return error_mark_node; + } + /* Initially build the concept declaration; its type is bool. */ tree decl = build_lang_decl_loc (loc, CONCEPT_DECL, *id, boolean_type_node); DECL_CONTEXT (decl) = current_scope (); diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-err4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-err4.C new file mode 100644 index 00000000000..57a96a095c7 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-err4.C @@ -0,0 +1,6 @@ +// PR c++/105067 +// { dg-do compile { target c++20 } } + +template +template +concept C = true; // { dg-error "parameter list" } From f8093854c78f820a4f0202fd4db7bba0ee0573c8 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 15 Mar 2022 16:23:47 -0400 Subject: [PATCH 060/157] c++: add comment gcc/cp/ChangeLog: * pt.cc (determine_specialization): Add comment. --- gcc/cp/pt.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index cd07e48cb5a..ece839c22e3 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -2325,6 +2325,8 @@ determine_specialization (tree template_id, continue; if (freq) { + /* C++20 CA104: Substitute directly into the + constraint-expression. */ tree fargs = DECL_TI_ARGS (fn); tsubst_flags_t complain = tf_none; freq = tsubst_constraint (freq, fargs, complain, fn); From 83a21c993449a32b98916814ed8ca237b3276912 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 28 Mar 2022 15:32:30 -0400 Subject: [PATCH 061/157] c++: Fix __has_trivial_* docs [PR59426] These have been misdocumented since C++98 POD was split into C++11 trivial and standard-layout in r149721. PR c++/59426 gcc/ChangeLog: * doc/extend.texi: Refer to __is_trivial instead of __is_pod. --- gcc/doc/extend.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index a4a25e86928..8381eb620ea 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -25144,7 +25144,7 @@ Requires: @code{type} shall be a complete type, (possibly cv-qualified) @item __has_trivial_assign (type) If @code{type} is @code{const}- qualified or is a reference type then -the trait is @code{false}. Otherwise if @code{__is_pod (type)} is +the trait is @code{false}. Otherwise if @code{__is_trivial (type)} is @code{true} then the trait is @code{true}, else if @code{type} is a cv-qualified class or union type with a trivial copy assignment ([class.copy]) then the trait is @code{true}, else it is @code{false}. @@ -25152,7 +25152,7 @@ Requires: @code{type} shall be a complete type, (possibly cv-qualified) @code{void}, or an array of unknown bound. @item __has_trivial_copy (type) -If @code{__is_pod (type)} is @code{true} or @code{type} is a reference +If @code{__is_trivial (type)} is @code{true} or @code{type} is a reference type then the trait is @code{true}, else if @code{type} is a cv class or union type with a trivial copy constructor ([class.copy]) then the trait is @code{true}, else it is @code{false}. Requires: @code{type} shall be @@ -25160,7 +25160,7 @@ a complete type, (possibly cv-qualified) @code{void}, or an array of unknown bound. @item __has_trivial_constructor (type) -If @code{__is_pod (type)} is @code{true} then the trait is @code{true}, +If @code{__is_trivial (type)} is @code{true} then the trait is @code{true}, else if @code{type} is a cv-qualified class or union type (or array thereof) with a trivial default constructor ([class.ctor]) then the trait is @code{true}, else it is @code{false}. @@ -25168,7 +25168,7 @@ Requires: @code{type} shall be a complete type, (possibly cv-qualified) @code{void}, or an array of unknown bound. @item __has_trivial_destructor (type) -If @code{__is_pod (type)} is @code{true} or @code{type} is a reference type +If @code{__is_trivial (type)} is @code{true} or @code{type} is a reference type then the trait is @code{true}, else if @code{type} is a cv class or union type (or array thereof) with a trivial destructor ([class.dtor]) then the trait is @code{true}, else it is @code{false}. From 00635b6cf3a6854323d8a868dc203a41205e1dcc Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 28 Mar 2022 20:04:59 +0000 Subject: [PATCH 062/157] Update gcc sv.po * sv.po: Update. --- gcc/po/sv.po | 502 ++++++++++++++++++++------------------------------- 1 file changed, 200 insertions(+), 302 deletions(-) diff --git a/gcc/po/sv.po b/gcc/po/sv.po index 3727d4b575a..10ac5786fce 100644 --- a/gcc/po/sv.po +++ b/gcc/po/sv.po @@ -29,7 +29,7 @@ msgstr "" "Project-Id-Version: gcc 12.1-b20220213\n" "Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n" "POT-Creation-Date: 2022-02-11 23:10+0000\n" -"PO-Revision-Date: 2022-03-20 13:14+0100\n" +"PO-Revision-Date: 2022-03-28 16:28+0200\n" "Last-Translator: Göran Uddeborg \n" "Language-Team: Swedish \n" "Language: sv\n" @@ -30357,88 +30357,72 @@ msgstr[0] "%qD skriver %wu byte till en region med storlek mellan %wu och %wu" msgstr[1] "%qD skriver %wu byte till en region av storlek mellan %wu och %wu" #: tree-ssa-strlen.cc:2183 -#, fuzzy, gcc-internal-format -#| msgid "%Gwriting %wu byte into a region of size between %wu and %wu" -#| msgid_plural "%Gwriting %wu bytes into a region of size between %wu and %wu" +#, gcc-internal-format msgid "writing %wu byte into a region of size between %wu and %wu" msgid_plural "writing %wu bytes into a region of size between %wu and %wu" -msgstr[0] "%Gskriver %wu byte till en region med storlek mellan %wu och %wu" -msgstr[1] "%Gskriver %wu byte till en region med storlek mellan %wu och %wu" +msgstr[0] "skriver %wu byte till en region med storlek mellan %wu och %wu" +msgstr[1] "skriver %wu byte till en region med storlek mellan %wu och %wu" #: tree-ssa-strlen.cc:2193 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD writing between %wu and %wu bytes into a region of size %wu" +#, gcc-internal-format msgid "%qD writing between %wu and %wu bytes into a region of size %wu" -msgstr "%G%qD skriver mellan %wu och %wu byte till en region med storlek %wu" +msgstr "%qD skriver mellan %wu och %wu byte till en region med storlek %wu" #: tree-ssa-strlen.cc:2199 -#, fuzzy, gcc-internal-format -#| msgid "%Gwriting between %wu and %wu bytes into a region of size %wu" +#, gcc-internal-format msgid "writing between %wu and %wu bytes into a region of size %wu" -msgstr "%Gskriver mellan %wu och %wu byte till en region med storlek %wu" +msgstr "skriver mellan %wu och %wu byte till en region med storlek %wu" #: tree-ssa-strlen.cc:2207 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD writing between %wu and %wu bytes into a region of size between %wu and %wu" +#, gcc-internal-format msgid "%qD writing between %wu and %wu bytes into a region of size between %wu and %wu" -msgstr "%G%qD skriver mellan %wu och %wu byte till en region med storlek mellan %wu och %wu" +msgstr "%qD skriver mellan %wu och %wu byte till en region med storlek mellan %wu och %wu" #: tree-ssa-strlen.cc:2213 -#, fuzzy, gcc-internal-format -#| msgid "%Gwriting between %wu and %wu bytes into a region of size between %wu and %wu" +#, gcc-internal-format msgid "writing between %wu and %wu bytes into a region of size between %wu and %wu" -msgstr "%Gskriver mellan %wu och %wu byte till en region med storlek mellan %wu och %wu" +msgstr "skriver mellan %wu och %wu byte till en region med storlek mellan %wu och %wu" #: tree-ssa-strlen.cc:3105 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD output truncated before terminating nul copying %E byte from a string of the same length" -#| msgid_plural "%G%qD output truncated before terminating nul copying %E bytes from a string of the same length" +#, gcc-internal-format msgid "%qD output truncated before terminating nul copying %E byte from a string of the same length" msgid_plural "%qD output truncated before terminating nul copying %E bytes from a string of the same length" -msgstr[0] "Utdata för %G%qD avhuggen före avslutande null vid kopiering av %E byte från en sträng av samma längd" -msgstr[1] "Utdata för %G%qD avhuggen före avslutande null vid kopiering av %E byte från en sträng av samma längd" +msgstr[0] "Utdata för %qD avhuggen före avslutande null vid kopiering av %E byte från en sträng av samma längd" +msgstr[1] "Utdata för %qD avhuggen före avslutande null vid kopiering av %E byte från en sträng av samma längd" #: tree-ssa-strlen.cc:3121 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD output truncated copying %E byte from a string of length %wu" -#| msgid_plural "%G%qD output truncated copying %E bytes from a string of length %wu" +#, gcc-internal-format msgid "%qD output truncated copying %E byte from a string of length %wu" msgid_plural "%qD output truncated copying %E bytes from a string of length %wu" -msgstr[0] "utdata från %G%qD avhuggen vid kopiering av %E byte från en sträng med längden %wu" -msgstr[1] "utdata från %G%qD avhuggen vid kopiering av %E byte från en sträng med längden %wu" +msgstr[0] "utdata från %qD avhuggen vid kopiering av %E byte från en sträng med längden %wu" +msgstr[1] "utdata från %qD avhuggen vid kopiering av %E byte från en sträng med längden %wu" #: tree-ssa-strlen.cc:3128 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD output truncated copying between %wu and %wu bytes from a string of length %wu" +#, gcc-internal-format msgid "%qD output truncated copying between %wu and %wu bytes from a string of length %wu" -msgstr "utdata från %G%qD avhuggen vid kopiering mellan %wu och %wu byte från en sträng med längden %wu" +msgstr "utdata från %qD avhuggen vid kopiering mellan %wu och %wu byte från en sträng med längden %wu" #: tree-ssa-strlen.cc:3140 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD output may be truncated copying %E byte from a string of length %wu" -#| msgid_plural "%G%qD output may be truncated copying %E bytes from a string of length %wu" +#, gcc-internal-format msgid "%qD output may be truncated copying %E byte from a string of length %wu" msgid_plural "%qD output may be truncated copying %E bytes from a string of length %wu" -msgstr[0] "utdata från %G%qD kan ha huggits av vid kopiering av %E byte från en sträng med längden %wu" -msgstr[1] "utdata från %G%qD kan ha huggits av vid kopiering av %E byte från en sträng med längden %wu" +msgstr[0] "utdata från %qD kan ha huggits av vid kopiering av %E byte från en sträng med längden %wu" +msgstr[1] "utdata från %qD kan ha huggits av vid kopiering av %E byte från en sträng med längden %wu" #: tree-ssa-strlen.cc:3147 tree-ssa-strlen.cc:3163 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD output may be truncated copying between %wu and %wu bytes from a string of length %wu" +#, gcc-internal-format msgid "%qD output may be truncated copying between %wu and %wu bytes from a string of length %wu" -msgstr "utdata från %G%qD kan ha huggits av vid kopiering mellan %wu och %wu byte från en sträng med längden %wu" +msgstr "utdata från %qD kan ha huggits av vid kopiering mellan %wu och %wu byte från en sträng med längden %wu" #: tree-ssa-strlen.cc:3317 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD output truncated before terminating nul copying as many bytes from a string as its length" +#, gcc-internal-format msgid "%qD output truncated before terminating nul copying as many bytes from a string as its length" -msgstr "utdata från %G%qD höggs av före avslutande nolla vid kopiering av så många byte från en sträng som dess längd" +msgstr "utdata från %qD höggs av före avslutande nolla vid kopiering av så många byte från en sträng som dess längd" #: tree-ssa-strlen.cc:3330 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD specified bound depends on the length of the source argument" +#, gcc-internal-format msgid "%qD specified bound depends on the length of the source argument" -msgstr "%G%qD den angivna gränsen beror på längden av källargumentet" +msgstr "%qD den angivna gränsen beror på längden av källargumentet" #: tree-ssa-strlen.cc:3338 #, gcc-internal-format @@ -30446,28 +30430,24 @@ msgid "length computed here" msgstr "längden beräknad här" #: tree-ssa-strlen.cc:4259 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD of a string of length %wu or more and an array of size %wu evaluates to nonzero" +#, gcc-internal-format msgid "%qD of a string of length %wu or more and an array of size %wu evaluates to nonzero" -msgstr "%G%qD av en sträng med längden %wu eller mer och en vektor av storlek %wu evalueras till nollskilt" +msgstr "%qD av en sträng med längden %wu eller mer och en vektor av storlek %wu evalueras till nollskilt" #: tree-ssa-strlen.cc:4261 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD of a string of length %wu and an array of size %wu evaluates to nonzero" +#, gcc-internal-format msgid "%qD of a string of length %wu and an array of size %wu evaluates to nonzero" -msgstr "%G%qD av en sträng med längden %wu och en vektor av storlek %wu evalueras till nollskilt" +msgstr "%qD av en sträng med längden %wu och en vektor av storlek %wu evalueras till nollskilt" #: tree-ssa-strlen.cc:4268 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD of strings of length %wu and %wu and bound of %wu evaluates to nonzero" +#, gcc-internal-format msgid "%qD of strings of length %wu and %wu and bound of %wu evaluates to nonzero" -msgstr "%G%qD av en sträng med längden %wu och %wu och gräns på %wu evalueras till nollskilt" +msgstr "%qD av en sträng med längden %wu och %wu och gräns på %wu evalueras till nollskilt" #: tree-ssa-strlen.cc:4273 -#, fuzzy, gcc-internal-format -#| msgid "%G%qD of a string of length %wu, an array of size %wu and bound of %wu evaluates to nonzero" +#, gcc-internal-format msgid "%qD of a string of length %wu, an array of size %wu and bound of %wu evaluates to nonzero" -msgstr "%G%qD av en sträng med längden %wu och en vektor av storlek %wu och gräns på %wu evalueras till nollskilt" +msgstr "%qD av en sträng med längden %wu och en vektor av storlek %wu och gräns på %wu evalueras till nollskilt" #: tree-ssa-strlen.cc:4284 #, gcc-internal-format @@ -30485,16 +30465,14 @@ msgid "%qD may be used uninitialized" msgstr "%qD kan användas oinitierad" #: tree-ssa-uninit.cc:292 -#, fuzzy, gcc-internal-format -#| msgid "%qD is used uninitialized" +#, gcc-internal-format msgid "%qs is used uninitialized" -msgstr "%qD används oinitierad" +msgstr "%qs används oinitierad" #: tree-ssa-uninit.cc:295 -#, fuzzy, gcc-internal-format -#| msgid "%qD may be used uninitialized" +#, gcc-internal-format msgid "%qs may be used uninitialized" -msgstr "%qD kan användas oinitierad" +msgstr "%qs kan användas oinitierad" #: tree-ssa-uninit.cc:314 varasm.cc:366 varasm.cc:7825 #, gcc-internal-format @@ -30502,28 +30480,24 @@ msgid "%qD was declared here" msgstr "%qD deklarerades här" #: tree-ssa-uninit.cc:316 -#, fuzzy, gcc-internal-format -#| msgid "%qD was declared here" +#, gcc-internal-format msgid "%qs was declared here" -msgstr "%qD deklarerades här" +msgstr "%qs deklarerades här" #: tree-ssa-uninit.cc:430 tree-ssa-uninit.cc:742 -#, fuzzy, gcc-internal-format -#| msgid "%G%qE may be used uninitialized" +#, gcc-internal-format msgid "%qE may be used uninitialized" -msgstr "%G%qE kan användas oinitierad" +msgstr "%qE kan användas oinitierad" #: tree-ssa-uninit.cc:439 -#, fuzzy, gcc-internal-format -#| msgid "in a call to function %qD declared with attribute %qs" +#, gcc-internal-format msgid "accessing argument %u of a function declared with attribute %<%s%>" -msgstr "i ett anrop till funktionen %qD deklarerad med attributet %qs" +msgstr "kommer åt argument %u till en funktion deklarerad med attributet %<%s%>" #: tree-ssa-uninit.cc:729 -#, fuzzy, gcc-internal-format -#| msgid "%G%qE is used uninitialized" +#, gcc-internal-format msgid "%qE is used uninitialized" -msgstr "%G%qE används oinitierad" +msgstr "%qE används oinitierad" #: tree-ssa-uninit.cc:861 #, gcc-internal-format @@ -30836,40 +30810,34 @@ msgid "type is deprecated" msgstr "typen bör undvikas" #: tree.cc:12149 -#, fuzzy, gcc-internal-format -#| msgid "%qD is not a variable" +#, gcc-internal-format msgid "%qD is unavailable: %s" -msgstr "%qD är inte en variabel" +msgstr "%qD är otillgänglig: %s" #: tree.cc:12151 -#, fuzzy, gcc-internal-format -#| msgid "%qD is not a variable" +#, gcc-internal-format msgid "%qD is unavailable" -msgstr "%qD är inte en variabel" +msgstr "%qD är otillgänglig" #: tree.cc:12172 -#, fuzzy, gcc-internal-format -#| msgid "%qD is not a variable" +#, gcc-internal-format msgid "%qE is unavailable: %s" -msgstr "%qD är inte en variabel" +msgstr "%qE är otillgänglig: %s" #: tree.cc:12174 -#, fuzzy, gcc-internal-format -#| msgid "%qD is not a variable" +#, gcc-internal-format msgid "%qE is unavailable" -msgstr "%qD är inte en variabel" +msgstr "%qE är otillgänglig" #: tree.cc:12179 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "open %s failed: %s" +#, gcc-internal-format, gfc-internal-format msgid "type is unavailable: %s" -msgstr "öppning av %s misslyckades: %s" +msgstr "typen är otillgänglig: %s" #: tree.cc:12181 -#, fuzzy, gcc-internal-format -#| msgid "%qD is not a variable" +#, gcc-internal-format msgid "type is unavailable" -msgstr "%qD är inte en variabel" +msgstr "typen är otillgänglig" #. Type variant can differ by: #. @@ -31152,10 +31120,9 @@ msgid "variable tracking size limit exceeded" msgstr "storleksgräns på variabelspårning överskriden" #: varasm.cc:315 -#, fuzzy, gcc-internal-format -#| msgid "Section already exists: %qs" +#, gcc-internal-format msgid "section already exists: %qs" -msgstr "Sektionen finns redan: %qs" +msgstr "sektionen finns redan: %qs" #: varasm.cc:361 #, gcc-internal-format @@ -31268,10 +31235,9 @@ msgid "invalid initial value for member %qE" msgstr "ogiltigt startvärde för medlem %qE" #: varasm.cc:5872 -#, fuzzy, gcc-internal-format -#| msgid "%+qD declared weak after being used" +#, gcc-internal-format msgid "%qD declared weak after being used" -msgstr "%+qD deklarerad svag efter att ha använts" +msgstr "%qD deklarerad svag efter att ha använts" #: varasm.cc:5924 #, gcc-internal-format @@ -31395,10 +31361,9 @@ msgid "no sclass for %s stab (0x%x)" msgstr "ingen klass för %s-stab (0x%x)" #: c-family/c-ada-spec.cc:2858 -#, fuzzy, gcc-internal-format -#| msgid "Use packed stack layout." +#, gcc-internal-format msgid "packed layout" -msgstr "Använd packad stacklayout." +msgstr "packad layout" #: c-family/c-attribs.cc:619 d/d-attribs.cc:1169 #, gcc-internal-format @@ -31541,10 +31506,9 @@ msgid "%qE attribute ignored because %qD is not a variable" msgstr "attributet %qE ignorerat för att %qD inte är en variabel" #: c-family/c-attribs.cc:1649 -#, fuzzy, gcc-internal-format -#| msgid "%qE attribute ignored because %qD is not a variable" +#, gcc-internal-format msgid "%qE attribute ignored because %qD is not a local variable" -msgstr "attributet %qE ignorerat för att %qD inte är en variabel" +msgstr "attributet %qE ignorerat för att %qD inte är en lokal variabel" #: c-family/c-attribs.cc:1674 config/i386/i386-options.cc:3795 #, gcc-internal-format @@ -32057,10 +32021,9 @@ msgid "zero vector size" msgstr "vektorstorlek noll" #: c-family/c-attribs.cc:4371 c-family/c-attribs.cc:4374 -#, fuzzy, gcc-internal-format -#| msgid "number of components of vector not a power of two" +#, gcc-internal-format msgid "number of vector components %wu not a power of two" -msgstr "antal komponenter i vektorn inte en tvåpotens" +msgstr "antal vektorkomponenter %wu är inte en tvåpotens" #: c-family/c-attribs.cc:4381 c-family/c-attribs.cc:4385 #, gcc-internal-format @@ -32068,10 +32031,9 @@ msgid "number of vector components %wu exceeds %d" msgstr "antalet vektorkomponenter %wu överskrider %d" #: c-family/c-attribs.cc:4445 -#, fuzzy, gcc-internal-format -#| msgid "%qE attribute only supported on boolean types" +#, gcc-internal-format msgid "%qE attribute only supported on non-mask vector types" -msgstr "attributet %qE stödjs endast på booleska typer" +msgstr "attributet %qE stödjs endast på ej maskade vektortyper" #: c-family/c-attribs.cc:4478 #, gcc-internal-format @@ -32296,16 +32258,14 @@ msgid "%qE attribute argument %qE is not recognised" msgstr "argumentet %2$qE till attributet %1$qE är inte känt" #: c-family/c-attribs.cc:5826 -#, fuzzy, gcc-internal-format -#| msgid "%qE attribute ignored; valid only for functions" +#, gcc-internal-format msgid "%qE attribute ignored; valid only for functions and function pointer fields" -msgstr "attributet %qE ignorerat; det är bara tillämpligt på funktioner" +msgstr "attributet %qE ignorerat; det är bara tillämpligt på funktioner och funktionspekarfält" #: c-family/c-attribs.cc:5837 -#, fuzzy, gcc-internal-format -#| msgid "%qE attribute only applies to base type of a function pointer" +#, gcc-internal-format msgid "%qE attribute ignored; field must be a function pointer" -msgstr "attributet %qE är bara tillämpligt på bastypen av en funktionspekare" +msgstr "attributet %qE ignorerat; fältet måste vara en funktionspekare" #: c-family/c-attribs.cc:5861 #, gcc-internal-format @@ -32378,22 +32338,19 @@ msgid "%<__builtin_shuffle%> argument vector(s) inner type must have the same si msgstr "%<__builtin_shuffle%> argumentvektorns inre typ måste ha samma storlek som den inre typen för masken" #: c-family/c-common.cc:1136 -#, fuzzy, gcc-internal-format -#| msgid "%<__builtin_shuffle%> arguments must be vectors" +#, gcc-internal-format msgid "%<__builtin_shufflevector%> arguments must be vectors" -msgstr "argumenten till %<__builtin_shuffle%> måste vara vektorer" +msgstr "argumenten till %<__builtin_shufflevector%> måste vara vektorer" #: c-family/c-common.cc:1147 -#, fuzzy, gcc-internal-format -#| msgid "%<__builtin_shuffle%> arguments must be vectors" +#, gcc-internal-format msgid "%<__builtin_shufflevector%> arguments must be constant size vectors" -msgstr "argumenten till %<__builtin_shuffle%> måste vara vektorer" +msgstr "argumenten till %<__builtin_shufflevector%> måste vara vektorer med konstant storlek" #: c-family/c-common.cc:1156 -#, fuzzy, gcc-internal-format -#| msgid "%<__builtin_shuffle%> argument vectors must be of the same type" +#, gcc-internal-format msgid "%<__builtin_shufflevector%> argument vectors must have the same element type" -msgstr "argumentvektorerna till %<__builtin_shuffle%> måste ha samma typ" +msgstr "argumentvektorerna till %<__builtin_shufflevector%> måste ha samma elementtyp" #: c-family/c-common.cc:1164 #, gcc-internal-format @@ -32401,10 +32358,9 @@ msgid "%<__builtin_shufflevector%> must specify a result with a power of two num msgstr "%<__builtin_shufflevector%> måste ange ett resultat med en potens av två antal element" #: c-family/c-common.cc:1189 c-family/c-common.cc:1199 -#, fuzzy, gcc-internal-format -#| msgid "invalid alignment value for %<__builtin_arc_aligned%>" +#, gcc-internal-format msgid "invalid element index %qE to %<__builtin_shufflevector%>" -msgstr "ogiltigt argument till %<__builtin_arc_aligned%>" +msgstr "ogiltigt elementindex %qE till %<__builtin_shufflevector%>" #: c-family/c-common.cc:1277 #, gcc-internal-format @@ -33626,10 +33582,9 @@ msgid "%<_Atomic%> expression in %<#pragma omp atomic%>" msgstr "%<_Atomic%>-uttryck i %<#pragma omp atomic%>" #: c-family/c-omp.cc:251 -#, fuzzy, gcc-internal-format -#| msgid "%<#pragma omp atomic capture%> uses two different expressions for memory" +#, gcc-internal-format msgid "%<#pragma omp atomic compare capture%> with non-integral comparison result" -msgstr "%<#pragma omp atomic capture%> använder två olika uttryck till minne" +msgstr "%<#pragma omp atomic compare capture%> med jämförelseresultat som inte är ett heltal" #: c-family/c-omp.cc:535 #, gcc-internal-format @@ -33872,10 +33827,9 @@ msgid "opening output file %s: %m" msgstr "vid öppnandet av utdatafil %s: %m" #: c-family/c-opts.cc:1130 -#, fuzzy, gcc-internal-format -#| msgid "the %qs debug format cannot be used with pre-compiled headers" +#, gcc-internal-format msgid "the %qs debug info cannot be used with pre-compiled headers" -msgstr "felsökningsformatet %qs kan inte användas med förkompilerade huvuden" +msgstr "felsökningsinformationen %qs kan inte användas med förkompilerade huvuden" #: c-family/c-opts.cc:1296 d/d-lang.cc:1292 #, gcc-internal-format @@ -34043,16 +33997,14 @@ msgid "%<#pragma scalar_storage_order%> is not supported for C++" msgstr "%<#pragma scalar_storage_order%> stödjs inte för C++" #: c-family/c-pragma.cc:444 -#, fuzzy, gcc-internal-format -#| msgid "missing [big-endian|little-endian|default] after %<#pragma scalar_storage_order%>" +#, gcc-internal-format msgid "missing %, %, or % after %<#pragma scalar_storage_order%>" -msgstr "[big-endian|little-endian|default] saknas efter %<#pragma scalar_storage_order%>" +msgstr "%, % eller % saknas efter %<#pragma scalar_storage_order%>" #: c-family/c-pragma.cc:454 -#, fuzzy, gcc-internal-format -#| msgid "expected [big-endian|little-endian|default] after %<#pragma scalar_storage_order%>" +#, gcc-internal-format msgid "expected %, %, or % after %<#pragma scalar_storage_order%>" -msgstr "[big-endian|little-endian|default] förväntades efter %<#pragma scalar_storage_order%>" +msgstr "%, % eller % förväntades efter %<#pragma scalar_storage_order%>" #: c-family/c-pragma.cc:509 c-family/c-pragma.cc:511 #, gcc-internal-format @@ -34115,34 +34067,29 @@ msgid "junk at end of %<#pragma GCC visibility%>" msgstr "skräp vid slutet av %<#pragma GCC visibility%>" #: c-family/c-pragma.cc:776 -#, fuzzy, gcc-internal-format -#| msgid "missing [error|warning|ignored|push|pop] after %<#pragma GCC diagnostic%>" +#, gcc-internal-format msgid "missing %, %, %, %, %, or % after %<#pragma GCC diagnostic%>" -msgstr "[error|warning|ignored|push|pop] saknas efter %<#pragma GCC diagnostic%>" +msgstr "%, %, %, %, % eller % saknas efter %<#pragma GCC diagnostic%>" #: c-family/c-pragma.cc:806 -#, fuzzy, gcc-internal-format -#| msgid "missing option after %<#pragma GCC diagnostic%> kind" +#, gcc-internal-format msgid "missing attribute name after %<#pragma GCC diagnostic ignored_attributes%>" -msgstr "alternativ saknas efter %<#pragma GCC diagnostics%> sort" +msgstr "attributnamn saknas efter %<#pragma GCC diagnostic ignored_attributes%>" #: c-family/c-pragma.cc:814 -#, fuzzy, gcc-internal-format -#| msgid "missing option after %<#pragma GCC diagnostic%> kind" +#, gcc-internal-format msgid "missing argument to %<#pragma GCC diagnostic ignored_attributes%>" -msgstr "alternativ saknas efter %<#pragma GCC diagnostics%> sort" +msgstr "argument saknas till %<#pragma GCC diagnostic ignored_attributes%>" #: c-family/c-pragma.cc:821 -#, fuzzy, gcc-internal-format -#| msgid "missing option after %<#pragma GCC diagnostic%> kind" +#, gcc-internal-format msgid "trailing %<,%> in arguments for %<#pragma GCC diagnostic ignored_attributes%>" -msgstr "alternativ saknas efter %<#pragma GCC diagnostics%> sort" +msgstr "avslutande %<,%> i argument till %<#pragma GCC diagnostic ignored_attributes%>" #: c-family/c-pragma.cc:836 -#, fuzzy, gcc-internal-format -#| msgid "expected [error|warning|ignored|push|pop] after %<#pragma GCC diagnostic%>" +#, gcc-internal-format msgid "expected %, %, %, %, %, % after %<#pragma GCC diagnostic%>" -msgstr "[error|warning|ignored|push|pop] förväntades efter %<#pragma GCC diagnostic%>" +msgstr "%, %, %, %, %, % förväntades efter %<#pragma GCC diagnostic%>" #: c-family/c-pragma.cc:846 #, gcc-internal-format @@ -35228,16 +35175,14 @@ msgid "add parentheses around the second % to silence this warning" msgstr "lägg till parenteser runt den andra % för att tysta denna varning" #: c-family/c-warn.cc:3776 -#, fuzzy, gcc-internal-format -#| msgid "comparison between pointer and integer" +#, gcc-internal-format msgid "comparison between two arrays is deprecated in C++20" -msgstr "jämförelse mellan pekare och heltal" +msgstr "jämförelse mellan två vektorer bör undvikas enligt C++20" #: c-family/c-warn.cc:3777 -#, fuzzy, gcc-internal-format -#| msgid "comparison between %qT and %qT" +#, gcc-internal-format msgid "comparison between two arrays" -msgstr "jämförelse mellan %qT och %qT" +msgstr "jämförelse mellan två vektorer" #: c-family/c-warn.cc:3781 #, gcc-internal-format @@ -35260,10 +35205,9 @@ msgid "too many input files" msgstr "för många indatafiler" #: c-family/known-headers.cc:309 -#, fuzzy, gcc-internal-format -#| msgid "% is defined in header %qs; did you forget to %<#include %s%>?" +#, gcc-internal-format msgid "%qs is defined in header %qs; did you forget to %<#include %s%>?" -msgstr "% är definierad i huvudet %qs; glömde du %<#include %s%>?" +msgstr "%qs är definierad i huvudet %qs; glömde du %<#include %s%>?" #: common/config/aarch64/aarch64-common.cc:519 config/aarch64/aarch64.cc:16853 #, gcc-internal-format @@ -35276,10 +35220,9 @@ msgid "bad value %qs for %<-mtls-size%> switch" msgstr "felaktigt värde %qs till flaggan %<-mtls-size%>" #: common/config/arc/arc-common.cc:84 -#, fuzzy, gcc-internal-format -#| msgid "multiple %<-mcpu=%> options specified." +#, gcc-internal-format msgid "multiple %<-mcpu=%> options specified" -msgstr "flera %<-mcpu=%>-flaggor angivna." +msgstr "flera %<-mcpu=%>-flaggor angivna" #: common/config/arc/arc-common.cc:90 #, gcc-internal-format @@ -35287,16 +35230,14 @@ msgid "Unsupported value for mmpy-option" msgstr "Ej stött värde till mmpy-option" #: common/config/arm/arm-common.cc:289 -#, fuzzy, gcc-internal-format -#| msgid "%%:target_mode_check takes an even number of parameters" +#, gcc-internal-format msgid "%%:% takes an even number of parameters" -msgstr "%%:target_mode_check tar ett jämnt antal parametrar" +msgstr "%%:% tar ett jämnt antal parametrar" #: common/config/arm/arm-common.cc:298 -#, fuzzy, gcc-internal-format -#| msgid "unrecognized option passed to %%:target_mode_check" +#, gcc-internal-format msgid "unrecognized option passed to %%:%" -msgstr "okänd flagga skickad till %%:target_mode_check" +msgstr "okänd flagga skickad till %%:%" #: common/config/arm/arm-common.cc:378 common/config/arm/arm-common.cc:442 #: common/config/arm/arm-common.cc:489 config/aarch64/aarch64.cc:16785 @@ -35343,22 +35284,19 @@ msgid "%s does not take any feature options" msgstr "%s tar inte några funktionsflaggor" #: common/config/arm/arm-common.cc:665 -#, fuzzy, gcc-internal-format -#| msgid "%%:canon_for_mlib takes 1 or more pairs of parameters" +#, gcc-internal-format msgid "%%:% takes 1 or more pairs of parameters" -msgstr "%%:canon_for_mlib tar 1 eller fler par med parametrar" +msgstr "%%:% tar 1 eller fler par med parametrar" #: common/config/arm/arm-common.cc:679 -#, fuzzy, gcc-internal-format -#| msgid "unrecognized operand to %%:canon_for_mlib" +#, gcc-internal-format msgid "unrecognized operand to %%:%" -msgstr "okänd operand till %%:canon_for_mlib" +msgstr "okänd operand till %%:%" #: common/config/arm/arm-common.cc:1035 -#, fuzzy, gcc-internal-format -#| msgid "unrecognized operand to %%:asm_auto_mfpu" +#, gcc-internal-format msgid "unrecognized operand to %%:%" -msgstr "okänd operand till %%:asm_auto_mfpu" +msgstr "okänd operand till %%:%" #: common/config/avr/avr-common.cc:91 #, gcc-internal-format @@ -35462,14 +35400,12 @@ msgid "for the option %<-mcache-block-size=X%>, the valid X must be: 4, 8, 16, 3 msgstr "för flaggan %<-mcache-block-size=X%> måste ett giltigt X vara: 4, 8, 16, 32, 64, 128, 256 eller 512" #: common/config/riscv/riscv-common.cc:378 -#, fuzzy, gcc-internal-format -#| msgid "%<-march=%s%>: Extension `%s' appear more than one time." +#, gcc-internal-format msgid "%<-march=%s%>: extension %qs appear more than one time" -msgstr "%<-march=%s%>: Utökningen ”%s” förekommer mer än en gång." +msgstr "%<-march=%s%>: utökningen %qs förekommer mer än en gång." #: common/config/riscv/riscv-common.cc:626 -#, fuzzy, gcc-internal-format -#| msgid "%<-march=%s%>: Expect number after %<%dp%>." +#, gcc-internal-format msgid "%<-march=%s%>: expect number after %<%dp%>" msgstr "%<-march=%s%>: ett tal förväntades efter %<%dp%>." @@ -35484,10 +35420,9 @@ msgid "%<-march=%s%>: rv%de is not a valid base ISA" msgstr "%<-march%s%>: rv%de är inte en giltig bas-ISA" #: common/config/riscv/riscv-common.cc:714 -#, fuzzy, gcc-internal-format -#| msgid "version of `g` will be omitted, please specify version for individual extension." +#, gcc-internal-format msgid "version of % will be omitted, please specify version for individual extension" -msgstr "versionen av ”g” kommer utelämnas, ange en version för individuell utökning." +msgstr "versionen av % kommer utelämnas, ange en version för individuell utökning." #: common/config/riscv/riscv-common.cc:733 #, gcc-internal-format @@ -35510,10 +35445,9 @@ msgid "%<-march=%s%>: name of %s must be more than 1 letter" msgstr "%<-march=%s%>: namnet på %s måste vara mer än 1 bokstav" #: common/config/riscv/riscv-common.cc:919 -#, fuzzy, gcc-internal-format -#| msgid "%<-march=%s%>: %s must separate with _" +#, gcc-internal-format msgid "%<-march=%s%>: %s must separate with %<_%>" -msgstr "%<-march=%s%>: %s måste separeras med _" +msgstr "%<-march=%s%>: %s måste separeras med %<_%>" #: common/config/riscv/riscv-common.cc:948 #, gcc-internal-format @@ -35632,28 +35566,24 @@ msgid "unknown value %qs of %<-mmacosx-version-min%>" msgstr "okänt värde %qs till %<-mmacosx-version-min%>" #: config/darwin-driver.cc:147 -#, fuzzy, gcc-internal-format -#| msgid "sysctl for kern.osversion failed: %m" +#, gcc-internal-format msgid "% for % failed: %m" -msgstr "sysctl för kern.osversion misslyckades: %m" +msgstr "% för % misslyckades: %m" #: config/darwin-driver.cc:192 -#, fuzzy, gcc-internal-format -#| msgid "couldn%'t understand kern.osversion %q.*s" +#, gcc-internal-format msgid "could not understand % %q.*s" -msgstr "kunde inte förstå kern.osversion %q.*s" +msgstr "kunde inte förstå % %q.*s" #: config/darwin-driver.cc:232 -#, fuzzy, gcc-internal-format -#| msgid "could not understand version %s" +#, gcc-internal-format msgid "could not understand version %qs" -msgstr "kunde inte förstå version %s" +msgstr "kunde inte förstå versionen %qs" #: config/darwin-driver.cc:306 -#, fuzzy, gcc-internal-format -#| msgid "this compiler does not support %s" +#, gcc-internal-format msgid "this compiler does not support %qs" -msgstr "denna målarkitektur stödjer inte %s" +msgstr "denna kompilator stödjer inte %qs" #: config/darwin-driver.cc:332 #, gcc-internal-format @@ -35661,40 +35591,34 @@ msgid "%qs is not valid for %<-mmacosx-version-min%>" msgstr "%qs är inte ett giltigt värde till %<-mmacosx-version-min%>" #: config/darwin-driver.cc:373 -#, fuzzy, gcc-internal-format -#| msgid "this compiler does not support PowerPC (arch flags ignored)" +#, gcc-internal-format msgid "this compiler does not support PowerPC (%<-arch%> option ignored)" -msgstr "denna kompilator stödjer inte PowerPC (arch-flaggor ignoreras)" +msgstr "denna kompilator stödjer inte PowerPC (flaggan %<-arch%> ignoreras)" #: config/darwin-driver.cc:380 -#, fuzzy, gcc-internal-format -#| msgid "%s conflicts with i386 (arch flags ignored)" +#, gcc-internal-format msgid "%qs conflicts with %<-arch i386%> (%qs ignored)" -msgstr "%s står i konflikt med i386 (arch-flaggor ignoreras)" +msgstr "%qs står i konflikt med %<-arch i386%> (%qs ignoreras)" #: config/darwin-driver.cc:389 -#, fuzzy, gcc-internal-format -#| msgid "%s conflicts with x86_64 (arch flags ignored)" +#, gcc-internal-format msgid "%<-m32%> conflicts with %<-arch x86_64%> (%<-m32%> ignored)" -msgstr "%s står i konflikt med x86_64 (arch-flaggor ignoreras)" +msgstr "%<-m32%> står i konflikt med %<-arch x86_64%> (%<-m32%> ignoreras)" #: config/darwin-driver.cc:396 -#, fuzzy, gcc-internal-format -#| msgid "this compiler does not support X86 (arch flags ignored)" +#, gcc-internal-format msgid "this compiler does not support x86 (%<-arch%> option ignored)" -msgstr "denna kompilator stödjer inte X86 (arch-flaggor ignoreras)" +msgstr "denna kompilator stödjer inte x86 (flaggan %<-arch%> ignoreras)" #: config/darwin-driver.cc:403 -#, fuzzy, gcc-internal-format -#| msgid "%s conflicts with ppc (arch flags ignored)" +#, gcc-internal-format msgid "%qs conflicts with %<-arch ppc%> (%qs ignored)" -msgstr "%s står i konflikt med ppc (arch-flaggor ignoreras)" +msgstr "%qs står i konflikt med %<-arch ppc%> (%qs ignoreras)" #: config/darwin-driver.cc:412 -#, fuzzy, gcc-internal-format -#| msgid "%s conflicts with ppc64 (arch flags ignored)" +#, gcc-internal-format msgid "%<-m32%> conflicts with %<-arch ppc64%> (%<-m32%> ignored)" -msgstr "%s står i konflikt med ppc64 (arch-flaggor ignoreras)" +msgstr "%<-m32%> står i konflikt med %<-arch ppc64%> (%<-m32%> ignoreras)" #: config/darwin.cc:2022 #, gcc-internal-format, gfc-internal-format @@ -35782,10 +35706,9 @@ msgid "embedded NUL in CFString literal" msgstr "inbäddad NUL i CFString-litteral" #: config/host-darwin.cc:107 -#, fuzzy, gcc-internal-format -#| msgid "function body not available" +#, gcc-internal-format msgid "PCH memory not available %m" -msgstr "funktionskroppen inte tillgänglig" +msgstr "PCH-minne är inte tillgängligt %m" #: config/sol2-c.cc:91 config/sol2-c.cc:107 #, gcc-internal-format @@ -35854,28 +35777,24 @@ msgstr "PIC stödjs endast för RTP:er" #: config/aarch64/aarch64-builtins.cc:1870 #: config/aarch64/aarch64-builtins.cc:2104 config/arm/arm-builtins.cc:3032 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "%Kargument %d must be a constant immediate" +#, gcc-internal-format, gfc-internal-format msgid "argument %d must be a constant immediate" -msgstr "%Kargument %d måste vara en konstant omedelbar" +msgstr "argument %d måste vara en konstant omedelbar" #: config/aarch64/aarch64-builtins.cc:1942 config/arm/arm-builtins.cc:3380 -#, fuzzy, gcc-internal-format -#| msgid "%Klane index must be a constant immediate" +#, gcc-internal-format msgid "lane index must be a constant immediate" -msgstr "%Kbanindex måste vara en konstant omedelbar" +msgstr "banindex måste vara en konstant omedelbar" #: config/aarch64/aarch64-builtins.cc:1946 -#, fuzzy, gcc-internal-format -#| msgid "%Ktotal size and element size must be a non-zero constant immediate" +#, gcc-internal-format msgid "total size and element size must be a nonzero constant immediate" -msgstr "%Ktotal storlek och elementstorlek måste vara en konstant omedelbar skild från noll" +msgstr "total storlek och elementstorlek måste vara en konstant omedelbar skild från noll" #: config/aarch64/aarch64-builtins.cc:2194 -#, fuzzy, gcc-internal-format -#| msgid "%Kargument must be a 16-bit constant immediate" +#, gcc-internal-format msgid "argument must be a 16-bit constant immediate" -msgstr "%Kargument måste vara en 16-bitars konstant omedelbar" +msgstr "argument måste vara en 16-bitars konstant omedelbar" #: config/aarch64/aarch64-builtins.cc:2300 #, gcc-internal-format @@ -35883,10 +35802,9 @@ msgid "Memory Tagging Extension does not support %<-mabi=ilp32%>" msgstr "Memory Tagging Extension stödjer inte %<-mabi=ilp32%>" #: config/aarch64/aarch64-builtins.cc:2335 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "%Kargument %d must be a constant immediate in range [0,15]" +#, gcc-internal-format, gfc-internal-format msgid "argument %d must be a constant immediate in range [0,15]" -msgstr "%Kargument %d måste vara en konstant omedelbar i intervallet [0,15]" +msgstr "argument %d måste vara en konstant omedelbar i intervallet [0,15]" #: config/aarch64/aarch64-builtins.cc:3133 #: config/aarch64/aarch64-builtins.cc:3153 @@ -35910,28 +35828,24 @@ msgid "unknown %<#pragma GCC aarch64%> option %qs" msgstr "okänd %<#pragma GCC aarch64%>-flagga %qs" #: config/aarch64/aarch64-sve-builtins.cc:657 -#, fuzzy, gcc-internal-format -#| msgid "calls to functions of type %qT require the SVE ISA extension" +#, gcc-internal-format msgid "ACLE function %qD requires ISA extension %qs" -msgstr "anrop till funktioner av typen %qT behöver ISA-utökningen SVE" +msgstr "ACLE-funktionen %qD behöver ISA-utökningen %qs" #: config/aarch64/aarch64-sve-builtins.cc:659 -#, fuzzy, gcc-internal-format -#| msgid "you can enable SVE using the command-line option %<-march%>, or by using the % attribute or pragma" +#, gcc-internal-format msgid "you can enable %qs using the command-line option %<-march%>, or by using the % attribute or pragma" -msgstr "du kan aktivera SVE genom att använda kommandoradsflaggan %<-march%>, eller genom att använda attributet eller pragmat %" +msgstr "du kan aktivera %qs genom att använda kommandoradsflaggan %<-march%>, eller genom att använda attributet eller pragmat %" #: config/aarch64/aarch64-sve-builtins.cc:679 -#, fuzzy, gcc-internal-format -#| msgid "%qs is incompatible with the use of vector types" +#, gcc-internal-format msgid "ACLE function %qD is incompatible with the use of %qs" -msgstr "%qs är inkompatibel med användningen av vektortyper" +msgstr "ACLE-funktionen %qD är inkompatibel med användningen av %qs" #: config/aarch64/aarch64-sve-builtins.cc:720 -#, fuzzy, gcc-internal-format -#| msgid "argument %d of %qE must be a pointer to a constant size type" +#, gcc-internal-format msgid "argument %d of %qE must be an integer constant expression" -msgstr "argument %d till %qE måste vara en pekare till en typ med konstant storlek" +msgstr "argument %d till %qE måste vara ett konstant heltalsuttryck" #: config/aarch64/aarch64-sve-builtins.cc:732 #, gcc-internal-format @@ -35939,40 +35853,34 @@ msgid "passing %wd to argument %d of %qE, which expects a value in the range [%w msgstr "skickar %wd som argument %d till %qE, vilken förväntar sig ett värdet i intervallet [%wd, %wd]" #: config/aarch64/aarch64-sve-builtins.cc:745 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE with different width due to prototype" +#, gcc-internal-format msgid "passing %wd to argument %d of %qE, which expects either %wd or %wd" -msgstr "skickar argument %d till %qE med annan vidd på grund av prototyp" +msgstr "skickar %wd som argument %d till %qE, vilken förväntar sig %wd eller %wd" #: config/aarch64/aarch64-sve-builtins.cc:758 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE with different width due to prototype" +#, gcc-internal-format msgid "passing %wd to argument %d of %qE, which expects %wd, %wd, %wd or %wd" -msgstr "skickar argument %d till %qE med annan vidd på grund av prototyp" +msgstr "skickar %wd som argument %d till %qE, vilken förväntar sig %wd, %wd, %wd eller %wd" #: config/aarch64/aarch64-sve-builtins.cc:770 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE with different width due to prototype" +#, gcc-internal-format msgid "passing %wd to argument %d of %qE, which expects a valid %qT value" -msgstr "skickar argument %d till %qE med annan vidd på grund av prototyp" +msgstr "skickar %wd som argument %d till %qE, vilken förväntar sig ett giltigt %qT-värde" #: config/aarch64/aarch64-sve-builtins.cc:1211 -#, fuzzy, gcc-internal-format -#| msgid "%qE attribute takes no arguments" +#, gcc-internal-format msgid "%qE has no form that takes %qT arguments" -msgstr "attributet %qE tar inga argument" +msgstr "%qE har ingen form som tar %qT-argument" #: config/aarch64/aarch64-sve-builtins.cc:1277 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE from incompatible pointer type" +#, gcc-internal-format msgid "passing %qT to argument %d of %qE, which expects a 32-bit or 64-bit integer type" -msgstr "skickar argument %d till %qE från inkompatibel pekartyp" +msgstr "skickar %qT som argument %d till %qE, vilken förväntar sig 32-bitars eller 64-bitars heltalstyp" #: config/aarch64/aarch64-sve-builtins.cc:1297 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE from incompatible pointer type" +#, gcc-internal-format msgid "passing %qT to argument %d of %qE, which expects a pointer type" -msgstr "skickar argument %d till %qE från inkompatibel pekartyp" +msgstr "skickar %qT som argument %d till %qE, vilken förväntar sig en pekartyp" #: config/aarch64/aarch64-sve-builtins.cc:1300 #, gcc-internal-format @@ -35980,22 +35888,19 @@ msgid "an explicit type suffix is needed when using a vector of base addresses" msgstr "ett explicit typsuffix behövs när en vektor av basadresser används" #: config/aarch64/aarch64-sve-builtins.cc:1309 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE from incompatible pointer type" +#, gcc-internal-format msgid "passing %qT to argument %d of %qE, but %qT is not a valid SVE element type" -msgstr "skickar argument %d till %qE från inkompatibel pekartyp" +msgstr "skickar %qT som argument %d till %qE, men %qT är inte en giltig SVE-elementtyp" #: config/aarch64/aarch64-sve-builtins.cc:1317 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE makes pointer from integer without a cast" +#, gcc-internal-format msgid "passing %qT to argument %d of %qE, which expects a pointer to 32-bit or 64-bit elements" -msgstr "att skicka argument %d till %qE skapar pekare av ett heltal utan typkonvertering" +msgstr "skickar %qT som argument %d till %qE, vilken förväntar sig en pekare till 32-bitars eller 64-bitars element" #: config/aarch64/aarch64-sve-builtins.cc:1351 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE as integer rather than floating due to prototype" +#, gcc-internal-format msgid "passing %qT to argument %d of %qE, which expects a single SVE vector rather than a tuple" -msgstr "skickar argument %d till %qE som heltal istället för flyttal på grund av prototyp" +msgstr "skickar %qT som argument %d till %qE, vilken förväntar sig en ensam SVE-vektor snarare än en tupel" #: config/aarch64/aarch64-sve-builtins.cc:1355 #, gcc-internal-format @@ -36003,47 +35908,40 @@ msgid "passing single vector %qT to argument %d of %qE, which expects a tuple of msgstr "skickar en ensam vektor %qT som argument %d till %qE, vilken förväntar sig en tupel av %d vektorer" #: config/aarch64/aarch64-sve-builtins.cc:1359 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE with different width due to prototype" +#, gcc-internal-format msgid "passing %qT to argument %d of %qE, which expects a tuple of %d vectors" -msgstr "skickar argument %d till %qE med annan vidd på grund av prototyp" +msgstr "skickar %qT som argument %d till %qE, vilken förväntar sig en tupel av %d vektorer" #: config/aarch64/aarch64-sve-builtins.cc:1367 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE with different width due to prototype" +#, gcc-internal-format msgid "passing %qT to argument %d of %qE, which expects an SVE vector type" -msgstr "skickar argument %d till %qE med annan vidd på grund av prototyp" +msgstr "skickar %qT som argument %d till %qE, vilken förväntar sig en SVE-vektortyp" #: config/aarch64/aarch64-sve-builtins.cc:1370 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE with different width due to prototype" +#, gcc-internal-format msgid "passing %qT to argument %d of %qE, which expects an SVE tuple type" -msgstr "skickar argument %d till %qE med annan vidd på grund av prototyp" +msgstr "skickar %qT som argument %d till %qE, vilken förväntar sig en SVE-tupeltyp" #: config/aarch64/aarch64-sve-builtins.cc:1394 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE with different width due to prototype" +#, gcc-internal-format msgid "passing %qT to argument %d of %qE, which expects a vector of integers" -msgstr "skickar argument %d till %qE med annan vidd på grund av prototyp" +msgstr "skickar %qT som argument %d till %qE, vilken förväntar sig en vektor av heltal" #: config/aarch64/aarch64-sve-builtins.cc:1414 #: config/aarch64/aarch64-sve-builtins.cc:1621 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE with different width due to prototype" +#, gcc-internal-format msgid "passing %qT to argument %d of %qE, which expects a vector of unsigned integers" -msgstr "skickar argument %d till %qE med annan vidd på grund av prototyp" +msgstr "skickar %qT som argument %d till %qE, vilken förväntar sig en vektor av teckenlösa heltal" #: config/aarch64/aarch64-sve-builtins.cc:1435 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE with different width due to prototype" +#, gcc-internal-format msgid "passing %qT to argument %d of %qE, which expects a vector of 32-bit or 64-bit elements" -msgstr "skickar argument %d till %qE med annan vidd på grund av prototyp" +msgstr "skickar %qT som argument %d till %qE, vilken förväntar sig en vektor av 32-bitars eller 64-bitars element" #: config/aarch64/aarch64-sve-builtins.cc:1466 -#, fuzzy, gcc-internal-format -#| msgid "passing argument %d of %qE with different width due to prototype" +#, gcc-internal-format msgid "passing %qT to argument %d of %qE, which expects a vector or scalar type" -msgstr "skickar argument %d till %qE med annan vidd på grund av prototyp" +msgstr "skickar %qT som argument %d till %qE, vilken förväntar sig en vektor eller skalär typ" #: config/aarch64/aarch64-sve-builtins.cc:1488 #: config/aarch64/aarch64-sve-builtins.cc:2054 From 88252529f0fcecadb4b67456e6107384e1a2a6ae Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 28 Mar 2022 14:15:36 -0600 Subject: [PATCH 063/157] Remove --with-gmp-dir and --with-mpfr-dir The top-level configure options --with-gmp-dir and --with-mpfr-dir were obsoleted and marked as "REMOVED" back in 2006. I think that's long enough ago for everyone to have updated their scripts, so this patch removes them entirely. While doing this, I also found one other leftover that wasn't removed by the earlier patch. This is also removed here. 2022-03-28 Tom Tromey * configure.ac: Remove --with-mpfr-dir and --with-gmp-dir. * configure: Rebuild. --- configure | 22 +--------------------- configure.ac | 14 ++------------ 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/configure b/configure index f7e0fa46c9c..69d8fc046c3 100755 --- a/configure +++ b/configure @@ -811,11 +811,9 @@ enable_pgo_build with_mpc with_mpc_include with_mpc_lib -with_mpfr_dir with_mpfr with_mpfr_include with_mpfr_lib -with_gmp_dir with_gmp with_gmp_include with_gmp_lib @@ -1588,14 +1586,12 @@ Optional Packages: --with-mpc-lib=PATH/lib --with-mpc-include=PATH specify directory for installed MPC include files --with-mpc-lib=PATH specify directory for the installed MPC library - --with-mpfr-dir=PATH this option has been REMOVED --with-mpfr=PATH specify prefix directory for installed MPFR package. Equivalent to --with-mpfr-include=PATH/include plus --with-mpfr-lib=PATH/lib --with-mpfr-include=PATH specify directory for installed MPFR include files --with-mpfr-lib=PATH specify directory for the installed MPFR library - --with-gmp-dir=PATH this option has been REMOVED --with-gmp=PATH specify prefix directory for the installed GMP package. Equivalent to --with-gmp-include=PATH/include plus @@ -3768,7 +3764,7 @@ case "${target}" in *-*-dragonfly*) ;; *-*-freebsd*) - if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \ + if test "x$with_gmp" = x \ && ! test -d ${srcdir}/gmp \ && test -f /usr/local/include/gmp.h; then with_gmp=/usr/local @@ -7999,14 +7995,6 @@ fi # Specify a location for mpfr # check for this first so it ends up on the link line before gmp. -# Check whether --with-mpfr-dir was given. -if test "${with_mpfr_dir+set}" = set; then : - withval=$with_mpfr_dir; as_fn_error $? "The --with-mpfr-dir=PATH option has been removed. -Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH" "$LINENO" 5 -fi - - - # Check whether --with-mpfr was given. if test "${with_mpfr+set}" = set; then : withval=$with_mpfr; @@ -8052,14 +8040,6 @@ fi # Specify a location for gmp -# Check whether --with-gmp-dir was given. -if test "${with_gmp_dir+set}" = set; then : - withval=$with_gmp_dir; as_fn_error $? "The --with-gmp-dir=PATH option has been removed. -Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH" "$LINENO" 5 -fi - - - # Check whether --with-gmp was given. if test "${with_gmp+set}" = set; then : withval=$with_gmp; diff --git a/configure.ac b/configure.ac index 434b1a267a4..d0f6d215b99 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, # 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, -# 2014, 2015, 2016, 2019 Free Software Foundation, Inc. +# 2014, 2015, 2016, 2019, 2022 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -1021,7 +1021,7 @@ case "${target}" in *-*-dragonfly*) ;; *-*-freebsd*) - if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \ + if test "x$with_gmp" = x \ && ! test -d ${srcdir}/gmp \ && test -f /usr/local/include/gmp.h; then with_gmp=/usr/local @@ -1568,11 +1568,6 @@ fi # Specify a location for mpfr # check for this first so it ends up on the link line before gmp. -AC_ARG_WITH(mpfr-dir, -[AS_HELP_STRING([--with-mpfr-dir=PATH], [this option has been REMOVED])], -[AC_MSG_ERROR([The --with-mpfr-dir=PATH option has been removed. -Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH])]) - AC_ARG_WITH(mpfr, [AS_HELP_STRING([--with-mpfr=PATH], [specify prefix directory for installed MPFR package. @@ -1612,11 +1607,6 @@ Building GCC with MPFR in the source tree is only handled for MPFR 3.1.0+.]) fi # Specify a location for gmp -AC_ARG_WITH(gmp-dir, -[AS_HELP_STRING([--with-gmp-dir=PATH], [this option has been REMOVED])], -[AC_MSG_ERROR([The --with-gmp-dir=PATH option has been removed. -Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH])]) - AC_ARG_WITH(gmp, [AS_HELP_STRING([--with-gmp=PATH], [specify prefix directory for the installed GMP package. From eed9d091de0324453fb34580f550b1ca296d6516 Mon Sep 17 00:00:00 2001 From: Indu Bhagat Date: Mon, 28 Mar 2022 13:24:45 -0700 Subject: [PATCH 064/157] ctfout: use ctfc_get_num_ctf_vars instead A minor cosmetic fix. 2022-03-28 Indu Bhagat gcc/ChangeLog: * ctfout.cc (ctf_preprocess): Use ctfc_get_num_ctf_vars instead. (output_ctf_vars): Likewise. --- gcc/ctfout.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ctfout.cc b/gcc/ctfout.cc index 9bd918af53c..a23d3775801 100644 --- a/gcc/ctfout.cc +++ b/gcc/ctfout.cc @@ -287,7 +287,7 @@ ctf_preprocess (ctf_container_ref ctfc) ctfc->ctfc_gobjts_list = ggc_vec_alloc(num_global_objts); } - size_t num_ctf_vars = ctfc->ctfc_vars->elements (); + size_t num_ctf_vars = ctfc_get_num_ctf_vars (ctfc); if (num_ctf_vars) { ctf_dvd_preprocess_arg_t dvd_arg; @@ -597,7 +597,7 @@ static void output_ctf_vars (ctf_container_ref ctfc) { size_t i; - size_t num_ctf_vars = ctfc->ctfc_vars->elements (); + size_t num_ctf_vars = ctfc_get_num_ctf_vars (ctfc); if (num_ctf_vars) { /* Iterate over the list of sorted vars and output the asm. */ From aab0127dae4e7d6069fa6963e9f4c5b013a48b66 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Tue, 29 Mar 2022 00:17:13 +0000 Subject: [PATCH 065/157] Daily bump. --- ChangeLog | 5 +++ contrib/ChangeLog | 8 +++++ gcc/ChangeLog | 58 ++++++++++++++++++++++++++++++++ gcc/DATESTAMP | 2 +- gcc/cp/ChangeLog | 74 +++++++++++++++++++++++++++++++++++++++++ gcc/po/ChangeLog | 4 +++ gcc/testsuite/ChangeLog | 73 ++++++++++++++++++++++++++++++++++++++++ libgomp/ChangeLog | 6 ++++ libstdc++-v3/ChangeLog | 11 ++++++ 9 files changed, 240 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a2260e97bc8..0b252306f87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-03-28 Tom Tromey + + * configure.ac: Remove --with-mpfr-dir and --with-gmp-dir. + * configure: Rebuild. + 2022-03-24 Bill Schmidt * MAINTAINERS: Change my information. diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 5af9673def0..6da801bccbe 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,11 @@ +2022-03-28 Martin Liska + + * gcc-changelog/git_commit.py: Match trailing dot literally. + +2022-03-28 Martin Liska + + * gcc-changelog/git_commit.py: Make the parsing stricter. + 2022-03-26 Jakub Jelinek * gcc-changelog/git_update_version.py: Add diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d11799e7f7f..9ec7a7c4663 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,61 @@ +2022-03-28 Indu Bhagat + + * ctfout.cc (ctf_preprocess): Use ctfc_get_num_ctf_vars instead. + (output_ctf_vars): Likewise. + +2022-03-28 Jason Merrill + + PR c++/59426 + * doc/extend.texi: Refer to __is_trivial instead of __is_pod. + +2022-03-28 H.J. Lu + + PR target/105068 + * config/i386/sse.md (*ssse3_pshufbv8qi3): Also replace "Yv" with + "Yw" in clobber. + +2022-03-28 Tom de Vries + + PR target/104818 + * config/nvptx/gen-opt.sh (ptx_isa): Improve help text. + * config/nvptx/nvptx-gen.opt: Regenerate. + * config/nvptx/nvptx.opt (misa, mptx, ptx_version): Improve help text. + * config/nvptx/t-nvptx (s-nvptx-gen-opt): Add missing dependency on + gen-opt.sh. + +2022-03-28 David Malcolm + + PR analyzer/104308 + * gimple-fold.cc (gimple_fold_builtin_memory_op): When optimizing + to loads then stores, set the location of the new load stmt. + +2022-03-28 Richard Biener + + PR tree-optimization/105070 + * tree-switch-conversion.h + (bit_test_cluster::hoist_edge_and_branch_if_true): Add location + argument. + * tree-switch-conversion.cc + (bit_test_cluster::hoist_edge_and_branch_if_true): Annotate + cond with location. + (bit_test_cluster::emit): Annotate all generated expressions + with location. + +2022-03-28 Andre Vieira + + * config/aarch64/aarch64-cores.def: Update Neoverse N2 core entry. + +2022-03-28 liuhongt + + PR target/105066 + * config/i386/sse.md (vec_set_0): Change attr "isa" of + alternative 4 from sse4_noavx to noavx. + +2022-03-28 Jakub Jelinek + + PR tree-optimization/105056 + * tree-predcom.cc (component::component): Initialize also comp_step. + 2022-03-27 H.J. Lu PR target/105068 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 0f81793ddaf..03b2f588835 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20220328 +20220329 diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2c885b2394e..ec38eeb954a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,77 @@ +2022-03-28 Jason Merrill + + * pt.cc (determine_specialization): Add comment. + +2022-03-28 Patrick Palka + + PR c++/105067 + * pt.cc (finish_concept_definition): Check that a concept is + declared with exactly one template parameter list. + +2022-03-28 Patrick Palka + + PR c++/105064 + * constraint.cc (maybe_substitute_reqs_for): Don't assume + DECL_TEMPLATE_INFO is available. + +2022-03-28 Jason Merrill + + PR c++/105003 + PR c++/104008 + PR c++/102869 + * pt.cc (complex_alias_template_r): walk_tree callback, replacing + uses_all_template_parms_r, complex_pack_expansion_r. + (complex_alias_template_p): Adjust. + * tree.cc (strip_typedefs): Revert r12-7710 change. + +2022-03-28 Jason Merrill + + PR c++/102071 + * init.cc (build_new_1): Include cookie in alignment. Omit + constexpr wrapper from alloc_call. + +2022-03-28 Jason Merrill + + PR c++/103291 + * name-lookup.cc (push_local_extern_decl_alias): Call + determine_visibility. + +2022-03-28 Jason Merrill + + PR c++/102123 + * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting + a type template reference. + +2022-03-28 Jason Merrill + + PR c++/103968 + * pt.cc (value_dependent_expression_p): Check + has_value_dependent_address for conversion to reference. + +2022-03-28 Jason Merrill + + PR c++/103943 + * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from + tsubst_baselink. + (instantiation_dependent_scope_ref_p): Check dependent_scope_p. + +2022-03-28 Jason Merrill + + PR c++/102045 + * call.cc (make_base_init_ok): Call make_used. + +2022-03-28 Jason Merrill + + PR c++/104847 + * mangle.cc (write_expression): Don't write a union designator when + undigested. + +2022-03-28 Jason Merrill + + PR c++/99445 + PR c++/103769 + * tree.cc (strip_typedefs): Use build_distinct_type_copy. + 2022-03-26 Patrick Palka PR c++/105050 diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 7f6d237ccf3..6406788b4f8 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,7 @@ +2022-03-28 Joseph Myers + + * sv.po: Update. + 2022-03-21 Joseph Myers * sv.po: Update. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b4168acc6fa..08e5ae798e4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,76 @@ +2022-03-28 Patrick Palka + + PR c++/105067 + * g++.dg/cpp2a/concepts-err4.C: New test. + +2022-03-28 Patrick Palka + + PR c++/105064 + * g++.dg/cpp2a/concepts-friend9.C: New test. + +2022-03-28 Jason Merrill + + PR c++/105003 + PR c++/104008 + PR c++/102869 + * g++.dg/cpp0x/variadic-alias6.C: New test. + * g++.dg/cpp0x/variadic-alias7.C: New test. + +2022-03-28 David Malcolm + + PR analyzer/104308 + * gcc.dg/analyzer/pr104308.c: New test. + * gcc.dg/uninit-40.c (foo): Update expression in expected message. + +2022-03-28 Jason Merrill + + PR c++/102071 + * g++.dg/cpp1z/aligned-new9.C: New test. + +2022-03-28 Jason Merrill + + PR c++/103291 + * g++.dg/ext/visibility/visibility-local-extern1.C: New test. + +2022-03-28 Jason Merrill + + PR c++/102123 + * g++.dg/cpp1z/class-deduction110.C: New test. + +2022-03-28 Jason Merrill + + PR c++/103968 + * g++.dg/cpp0x/alias-decl-mem1.C: New test. + +2022-03-28 Jason Merrill + + PR c++/103943 + * g++.dg/cpp1z/class-deduction109.C: New test. + +2022-03-28 Jason Merrill + + PR c++/102045 + * g++.dg/cpp1z/aggr-base12.C: New test. + +2022-03-28 Jason Merrill + + PR c++/104847 + * g++.dg/abi/mangle-union1.C: New test. + +2022-03-28 Jason Merrill + + PR c++/99445 + PR c++/103769 + * g++.dg/cpp0x/variadic-alias5.C: New test. + +2022-03-28 liuhongt + + * gcc.target/i386/pr105066.c: New test. + +2022-03-28 Richard Biener + + * gcc.dg/torture/pr100786.c: Add dg-require alias. + 2022-03-27 H.J. Lu PR target/105068 diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 5c4009a9ede..495e9e90ba8 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,9 @@ +2022-03-28 Tom de Vries + + * plugin/configfrag.ac: Use /$(libexecdir:\$(exec_prefix)/%=%)/ + instead of /libexec/. + * configure: Regenerate. + 2022-03-25 Tom de Vries PR libgomp/105042 diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b06414764b8..a64630f09dd 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,14 @@ +2022-03-28 Jonathan Wakely + + * testsuite/20_util/optional/monadic/and_then.cc: Fix typo. + * testsuite/20_util/optional/monadic/transform.cc: Likewise. + * testsuite/22_locale/codecvt/always_noconv/char/1.cc: Likewise. + * testsuite/22_locale/codecvt/encoding/char/1.cc: Likewise. + * testsuite/22_locale/codecvt/in/char/1.cc: Likewise. + * testsuite/22_locale/codecvt/max_length/char/1.cc: Likewise. + * testsuite/22_locale/codecvt/out/char/1.cc: Likewise. + * testsuite/22_locale/codecvt/unshift/char/1.cc: Likewise. + 2022-03-27 Jonathan Wakely * doc/doxygen/user.cfg.in: Add new header. From 1203e8f7880c9751ece5f5302e413b20f4608a00 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 28 Mar 2022 20:40:16 -0400 Subject: [PATCH 066/157] analyzer: fix ICE with incorrect lookup of cgraph node [PR105074] gcc/analyzer/ChangeLog: PR analyzer/105074 * region.cc (ipa_ref_requires_tracking): Drop "context_fndecl", instead using the ref->referring to get the cgraph node of the caller. (symnode_requires_tracking_p): Likewise. gcc/testsuite/ChangeLog: PR analyzer/105074 * gcc.dg/analyzer/pr105074.c: New test. * gcc.dg/analyzer/untracked-1.c (extern_fn_char_ptr): New decl. (test_13): New. Signed-off-by: David Malcolm --- gcc/analyzer/region.cc | 13 +++++++------ gcc/testsuite/gcc.dg/analyzer/pr105074.c | 9 +++++++++ gcc/testsuite/gcc.dg/analyzer/untracked-1.c | 6 ++++++ 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/analyzer/pr105074.c diff --git a/gcc/analyzer/region.cc b/gcc/analyzer/region.cc index 9c9e043c658..749e6182b06 100644 --- a/gcc/analyzer/region.cc +++ b/gcc/analyzer/region.cc @@ -1168,11 +1168,10 @@ decl_region::get_svalue_for_initializer (region_model_manager *mgr) const } /* Subroutine of symnode_requires_tracking_p; return true if REF - within CONTEXT_FNDECL might imply that we should be tracking the - value of a decl. */ + might imply that we should be tracking the value of its decl. */ static bool -ipa_ref_requires_tracking (const ipa_ref *ref, tree context_fndecl) +ipa_ref_requires_tracking (ipa_ref *ref) { /* If we have a load/store/alias of the symbol, then we'll track the decl's value. */ @@ -1188,8 +1187,10 @@ ipa_ref_requires_tracking (const ipa_ref *ref, tree context_fndecl) return true; case GIMPLE_CALL: { - cgraph_node *context_cnode = cgraph_node::get (context_fndecl); - cgraph_edge *edge = context_cnode->get_edge (ref->stmt); + cgraph_node *caller_cnode = dyn_cast (ref->referring); + if (caller_cnode == NULL) + return true; + cgraph_edge *edge = caller_cnode->get_edge (ref->stmt); if (!edge) return true; if (edge->callee == NULL) @@ -1232,7 +1233,7 @@ symnode_requires_tracking_p (symtab_node *symnode) if (TREE_CODE (context_fndecl) != FUNCTION_DECL) return true; for (auto ref : symnode->ref_list.referring) - if (ipa_ref_requires_tracking (ref, context_fndecl)) + if (ipa_ref_requires_tracking (ref)) return true; /* If we get here, then we don't have uses of this decl that require diff --git a/gcc/testsuite/gcc.dg/analyzer/pr105074.c b/gcc/testsuite/gcc.dg/analyzer/pr105074.c new file mode 100644 index 00000000000..2735854d79a --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr105074.c @@ -0,0 +1,9 @@ +/* { dg-additional-options "-O2 -fdump-analyzer-untracked" } */ + +void _gnutls_log(const char *); +static void _gnutls_ocsp_verify_mandatory_stapling(void) { + _gnutls_log(__func__); /* { dg-warning "track '__func__': no" } */ +} +void check_ocsp_response_gnutls_x509_cert_verify_peers(void) { + _gnutls_ocsp_verify_mandatory_stapling(); +} diff --git a/gcc/testsuite/gcc.dg/analyzer/untracked-1.c b/gcc/testsuite/gcc.dg/analyzer/untracked-1.c index b7536c399fd..d07c2975670 100644 --- a/gcc/testsuite/gcc.dg/analyzer/untracked-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/untracked-1.c @@ -11,6 +11,7 @@ typedef struct boxed_int { int value; } boxed_int; extern void extern_fn (struct st *); static void __attribute__((noinline)) internal_fn (struct st *) {} extern int extern_get_int (void); +extern void extern_fn_char_ptr (const char *); void test_0 (void) { @@ -97,3 +98,8 @@ int test_12 (void (*fnptr) (struct st *)) static struct st s12 = { __FILE__, __LINE__ }; /* { dg-warning "track 's12': yes" } */ fnptr (&s12); } + +void test_13 (void) +{ + extern_fn_char_ptr (__func__); /* { dg-warning "track '__func__': no" } */ +} From 3734527dfa0d10a50aee2f088d37320000fd65bf Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 28 Mar 2022 20:41:23 -0400 Subject: [PATCH 067/157] analyzer: ensure that we purge state when reusing a conjured_svalue [PR105087] PR analyzer/105087 describes a false positive from -Wanalyzer-double-free in which the analyzer erroneously considers two successive inlined vasprintf calls to have allocated the same pointer. The root cause is that the result written back from vasprintf is a conjured_svalue, and that we normally purge state when reusing a conjured_svalue, but various places in the code were calling region_model_manager::get_or_create_conjured_svalue but failing to then call region_model::purge_state_involving on the result. This patch fixes things by moving responsibility for calling region_model::purge_state_involving into region_model_manager::get_or_create_conjured_svalue, so that it is always called when reusing a conjured_svalue, fixing the false positive. gcc/analyzer/ChangeLog: PR analyzer/105087 * analyzer.h (class conjured_purge): New forward decl. * region-model-asm.cc (region_model::on_asm_stmt): Add conjured_purge param to calls binding_cluster::on_asm and region_model_manager::get_or_create_conjured_svalue. * region-model-impl-calls.cc (call_details::get_or_create_conjured_svalue): Likewise for call to region_model_manager::get_or_create_conjured_svalue. (region_model::impl_call_fgets): Remove call to region_model::purge_state_involving, as this is now done implicitly by call_details::get_or_create_conjured_svalue. (region_model::impl_call_fread): Likewise. (region_model::impl_call_strchr): Pass conjured_purge param to call to region_model_manager::get_or_create_conjured_svalue. * region-model-manager.cc (conjured_purge::purge): New. (region_model_manager::get_or_create_conjured_svalue): Add param "p". Use it to purge state when reusing an existing conjured_svalue. * region-model.cc (region_model::on_call_pre): Replace call to region_model::purge_state_involving with passing conjured_purge to region_model_manager::get_or_create_conjured_svalue. (region_model::handle_unrecognized_call): Pass conjured_purge to store::on_unknown_fncall. * region-model.h (region_model_manager::get_or_create_conjured_svalue): Add param "p". * store.cc (binding_cluster::on_unknown_fncall): Likewise. Pass it on to region_model_manager::get_or_create_conjured_svalue. (binding_cluster::on_asm): Likewise. (store::on_unknown_fncall): Add param "p" and pass it on to binding_cluster::on_unknown_fncall. * store.h (binding_cluster::on_unknown_fncall): Add param p. (binding_cluster::on_asm): Likewise. (store::on_unknown_fncall): Likewise. * svalue.h (class conjured_purge): New. gcc/testsuite/ChangeLog: * gcc.dg/analyzer/pr105087-1.c: New test. * gcc.dg/analyzer/pr105087-2.c: New test. * gcc.dg/analyzer/vasprintf-1.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/analyzer.h | 1 + gcc/analyzer/region-model-asm.cc | 8 +-- gcc/analyzer/region-model-impl-calls.cc | 12 +++-- gcc/analyzer/region-model-manager.cc | 27 ++++++++-- gcc/analyzer/region-model.cc | 8 +-- gcc/analyzer/region-model.h | 3 +- gcc/analyzer/store.cc | 23 +++++---- gcc/analyzer/store.h | 9 ++-- gcc/analyzer/svalue.h | 21 ++++++++ gcc/testsuite/gcc.dg/analyzer/pr105087-1.c | 18 +++++++ gcc/testsuite/gcc.dg/analyzer/pr105087-2.c | 20 ++++++++ gcc/testsuite/gcc.dg/analyzer/vasprintf-1.c | 57 +++++++++++++++++++++ 12 files changed, 180 insertions(+), 27 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/analyzer/pr105087-1.c create mode 100644 gcc/testsuite/gcc.dg/analyzer/pr105087-2.c create mode 100644 gcc/testsuite/gcc.dg/analyzer/vasprintf-1.c diff --git a/gcc/analyzer/analyzer.h b/gcc/analyzer/analyzer.h index a8289d0a0e0..39934a302cb 100644 --- a/gcc/analyzer/analyzer.h +++ b/gcc/analyzer/analyzer.h @@ -70,6 +70,7 @@ class region; class string_region; class bit_range_region; class region_model_manager; +class conjured_purge; struct model_merger; class store_manager; class store; diff --git a/gcc/analyzer/region-model-asm.cc b/gcc/analyzer/region-model-asm.cc index c7389f0e38d..bb73e6eed60 100644 --- a/gcc/analyzer/region-model-asm.cc +++ b/gcc/analyzer/region-model-asm.cc @@ -272,7 +272,8 @@ region_model::on_asm_stmt (const gasm *stmt, region_model_context *ctxt) continue; binding_cluster *cluster = m_store.get_or_create_cluster (base_reg); - cluster->on_asm (stmt, m_mgr->get_store_manager ()); + cluster->on_asm (stmt, m_mgr->get_store_manager (), + conjured_purge (this, ctxt)); } /* Update the outputs. */ @@ -292,8 +293,9 @@ region_model::on_asm_stmt (const gasm *stmt, region_model_context *ctxt) { sval = m_mgr->get_or_create_conjured_svalue (TREE_TYPE (dst_expr), stmt, - dst_reg); - purge_state_involving (sval, ctxt); + dst_reg, + conjured_purge (this, + ctxt)); } set_value (dst_reg, sval, ctxt); } diff --git a/gcc/analyzer/region-model-impl-calls.cc b/gcc/analyzer/region-model-impl-calls.cc index 65daa342824..621e7002ffb 100644 --- a/gcc/analyzer/region-model-impl-calls.cc +++ b/gcc/analyzer/region-model-impl-calls.cc @@ -212,13 +212,15 @@ call_details::dump (bool simple) const pp_flush (&pp); } -/* Get a conjured_svalue for this call for REG. */ +/* Get a conjured_svalue for this call for REG, + and purge any state already relating to that conjured_svalue. */ const svalue * call_details::get_or_create_conjured_svalue (const region *reg) const { region_model_manager *mgr = m_model->get_manager (); - return mgr->get_or_create_conjured_svalue (reg->get_type (), m_call, reg); + return mgr->get_or_create_conjured_svalue (reg->get_type (), m_call, reg, + conjured_purge (m_model, m_ctxt)); } /* Implementations of specific functions. */ @@ -434,7 +436,6 @@ region_model::impl_call_fgets (const call_details &cd) { const region *base_reg = reg->get_base_region (); const svalue *new_sval = cd.get_or_create_conjured_svalue (base_reg); - purge_state_involving (new_sval, cd.get_ctxt ()); set_value (base_reg, new_sval, cd.get_ctxt ()); } } @@ -449,7 +450,6 @@ region_model::impl_call_fread (const call_details &cd) { const region *base_reg = reg->get_base_region (); const svalue *new_sval = cd.get_or_create_conjured_svalue (base_reg); - purge_state_involving (new_sval, cd.get_ctxt ()); set_value (base_reg, new_sval, cd.get_ctxt ()); } } @@ -830,7 +830,9 @@ region_model::impl_call_strchr (const call_details &cd) const svalue *offset = mgr->get_or_create_conjured_svalue (size_type_node, cd.get_call_stmt (), - str_reg); + str_reg, + conjured_purge (model, + ctxt)); result = mgr->get_or_create_binop (lhs_type, POINTER_PLUS_EXPR, str_sval, offset); } diff --git a/gcc/analyzer/region-model-manager.cc b/gcc/analyzer/region-model-manager.cc index 61c7fb32628..5ca333a9ed6 100644 --- a/gcc/analyzer/region-model-manager.cc +++ b/gcc/analyzer/region-model-manager.cc @@ -1169,17 +1169,38 @@ region_model_manager::get_or_create_compound_svalue (tree type, return compound_sval; } +/* class conjured_purge. */ + +/* Purge state relating to SVAL. */ + +void +conjured_purge::purge (const conjured_svalue *sval) const +{ + m_model->purge_state_involving (sval, m_ctxt); +} + /* Return the svalue * of type TYPE for the value conjured for ID_REG - at STMT, creating it if necessary. */ + at STMT, creating it if necessary. + Use P to purge existing state from the svalue, for the case where a + conjured_svalue would be reused along an execution path. */ const svalue * region_model_manager::get_or_create_conjured_svalue (tree type, const gimple *stmt, - const region *id_reg) + const region *id_reg, + const conjured_purge &p) { conjured_svalue::key_t key (type, stmt, id_reg); if (conjured_svalue **slot = m_conjured_values_map.get (key)) - return *slot; + { + const conjured_svalue *sval = *slot; + /* We're reusing an existing conjured_svalue, perhaps from a different + state within this analysis, or perhaps from an earlier state on this + execution path. For the latter, purge any state involving the "new" + svalue from the current program_state. */ + p.purge (sval); + return sval; + } conjured_svalue *conjured_sval = new conjured_svalue (type, stmt, id_reg); RETURN_UNKNOWN_IF_TOO_COMPLEX (conjured_sval); diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index 44bd8026a35..816b4100f3a 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -1324,8 +1324,9 @@ region_model::on_call_pre (const gcall *call, region_model_context *ctxt, use a conjured value, and purge any prior state involving that value (in case this is in a loop). */ sval = m_mgr->get_or_create_conjured_svalue (TREE_TYPE (lhs), call, - lhs_region); - purge_state_involving (sval, ctxt); + lhs_region, + conjured_purge (this, + ctxt)); } set_value (lhs_region, sval, ctxt); } @@ -1802,7 +1803,8 @@ region_model::handle_unrecognized_call (const gcall *call, /* Update bindings for all clusters that have escaped, whether above, or previously. */ - m_store.on_unknown_fncall (call, m_mgr->get_store_manager ()); + m_store.on_unknown_fncall (call, m_mgr->get_store_manager (), + conjured_purge (this, ctxt)); /* Purge dynamic extents from any regions that have escaped mutably: realloc could have been called on them. */ diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h index 13a2ea94a3f..23841718b5c 100644 --- a/gcc/analyzer/region-model.h +++ b/gcc/analyzer/region-model.h @@ -277,7 +277,8 @@ public: const svalue *get_or_create_compound_svalue (tree type, const binding_map &map); const svalue *get_or_create_conjured_svalue (tree type, const gimple *stmt, - const region *id_reg); + const region *id_reg, + const conjured_purge &p); const svalue * get_or_create_asm_output_svalue (tree type, const gasm *asm_stmt, diff --git a/gcc/analyzer/store.cc b/gcc/analyzer/store.cc index 9aa7d690b04..0014633c335 100644 --- a/gcc/analyzer/store.cc +++ b/gcc/analyzer/store.cc @@ -1843,12 +1843,14 @@ binding_cluster::mark_as_escaped () /* If this cluster has escaped (by this call, or by an earlier one, or by being an external param), then unbind all values and mark it - as "touched", so that it has an unknown value, rather than an - initial_svalue. */ + as "touched", so that it has a conjured value, rather than an + initial_svalue. + Use P to purge state involving conjured_svalues. */ void binding_cluster::on_unknown_fncall (const gcall *call, - store_manager *mgr) + store_manager *mgr, + const conjured_purge &p) { if (m_escaped) { @@ -1857,25 +1859,27 @@ binding_cluster::on_unknown_fncall (const gcall *call, /* Bind it to a new "conjured" value using CALL. */ const svalue *sval = mgr->get_svalue_manager ()->get_or_create_conjured_svalue - (m_base_region->get_type (), call, m_base_region); + (m_base_region->get_type (), call, m_base_region, p); bind (mgr, m_base_region, sval); m_touched = true; } } -/* Mark this cluster as having been clobbered by STMT. */ +/* Mark this cluster as having been clobbered by STMT. + Use P to purge state involving conjured_svalues. */ void binding_cluster::on_asm (const gasm *stmt, - store_manager *mgr) + store_manager *mgr, + const conjured_purge &p) { m_map.empty (); /* Bind it to a new "conjured" value using CALL. */ const svalue *sval = mgr->get_svalue_manager ()->get_or_create_conjured_svalue - (m_base_region->get_type (), stmt, m_base_region); + (m_base_region->get_type (), stmt, m_base_region, p); bind (mgr, m_base_region, sval); m_touched = true; @@ -2766,13 +2770,14 @@ store::mark_as_escaped (const region *base_reg) (either in this fncall, or in a prior one). */ void -store::on_unknown_fncall (const gcall *call, store_manager *mgr) +store::on_unknown_fncall (const gcall *call, store_manager *mgr, + const conjured_purge &p) { m_called_unknown_fn = true; for (cluster_map_t::iterator iter = m_cluster_map.begin (); iter != m_cluster_map.end (); ++iter) - (*iter).second->on_unknown_fncall (call, mgr); + (*iter).second->on_unknown_fncall (call, mgr, p); } /* Return true if a non-const pointer to BASE_REG (or something within it) diff --git a/gcc/analyzer/store.h b/gcc/analyzer/store.h index ee084dd81f3..89bb352f6a5 100644 --- a/gcc/analyzer/store.h +++ b/gcc/analyzer/store.h @@ -609,8 +609,10 @@ public: store_manager *mgr); void mark_as_escaped (); - void on_unknown_fncall (const gcall *call, store_manager *mgr); - void on_asm (const gasm *stmt, store_manager *mgr); + void on_unknown_fncall (const gcall *call, store_manager *mgr, + const conjured_purge &p); + void on_asm (const gasm *stmt, store_manager *mgr, + const conjured_purge &p); bool escaped_p () const { return m_escaped; } bool touched_p () const { return m_touched; } @@ -735,7 +737,8 @@ public: model_merger *merger); void mark_as_escaped (const region *base_reg); - void on_unknown_fncall (const gcall *call, store_manager *mgr); + void on_unknown_fncall (const gcall *call, store_manager *mgr, + const conjured_purge &p); bool escaped_p (const region *reg) const; void get_representative_path_vars (const region_model *model, diff --git a/gcc/analyzer/svalue.h b/gcc/analyzer/svalue.h index 8040712ec2e..4bbe8588b8d 100644 --- a/gcc/analyzer/svalue.h +++ b/gcc/analyzer/svalue.h @@ -1306,6 +1306,27 @@ template <> struct default_hash_traits namespace ana { +/* A bundle of state for purging information from a program_state about + a conjured_svalue. We pass this whenever calling + get_or_create_conjured_svalue, so that if the program_state already + has information about this conjured_svalue on an execution path, we + can purge that information, to avoid the analyzer confusing the two + values as being the same. */ + +class conjured_purge +{ +public: + conjured_purge (region_model *model, region_model_context *ctxt) + : m_model (model), m_ctxt (ctxt) + { + } + void purge (const conjured_svalue *sval) const; + +private: + region_model *m_model; + region_model_context *m_ctxt; +}; + /* A defined value arising from a statement, where we want to identify a particular unknown value, rather than resorting to the unknown_value singleton, so that the value can have sm-state. diff --git a/gcc/testsuite/gcc.dg/analyzer/pr105087-1.c b/gcc/testsuite/gcc.dg/analyzer/pr105087-1.c new file mode 100644 index 00000000000..c4acf429359 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr105087-1.c @@ -0,0 +1,18 @@ +#include "analyzer-decls.h" + +extern void *inner_alloc (void); + +void * __attribute__((noinline)) +outer_alloc (void) +{ + return inner_alloc (); +} + +void test_1 (void) +{ + void *p, *q; + + p = outer_alloc (); + q = outer_alloc (); + __analyzer_eval (p == q); /* { dg-warning "UNKNOWN" } */ +} diff --git a/gcc/testsuite/gcc.dg/analyzer/pr105087-2.c b/gcc/testsuite/gcc.dg/analyzer/pr105087-2.c new file mode 100644 index 00000000000..7cd6591b820 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr105087-2.c @@ -0,0 +1,20 @@ +#include "analyzer-decls.h" + +extern void inner_alloc (void **); + +void * __attribute__((noinline)) +outer_alloc (void) +{ + void *result; + inner_alloc (&result); + return result; +} + +void test_1 (void) +{ + void *p, *q; + + p = outer_alloc (); + q = outer_alloc (); + __analyzer_eval (p == q); /* { dg-warning "UNKNOWN" } */ +} diff --git a/gcc/testsuite/gcc.dg/analyzer/vasprintf-1.c b/gcc/testsuite/gcc.dg/analyzer/vasprintf-1.c new file mode 100644 index 00000000000..061cd008c13 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/vasprintf-1.c @@ -0,0 +1,57 @@ +/* { dg-additional-options "-Wno-analyzer-too-complex" } */ + +#define NULL ((void *)0) + +extern int printf (const char *__restrict __format, ...); +extern int vasprintf (char **__restrict __ptr, const char *__restrict __f, + __builtin_va_list __arg) + __attribute__ ((__nothrow__, __format__ (__printf__, 2, 0))) ; +extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__)); + +static char * __attribute__ ((__format__ (__printf__, 1, 2))) +zasprintf (const char *format, ...) +{ + char *resultp; + __builtin_va_list args; + __builtin_va_start (args, format); + int r = vasprintf (&resultp, format, args); + __builtin_va_end (args); + return r < 0 ? NULL : resultp; +} + +int run_test() { + char *buf = NULL; + char *bar = NULL; + char *baz = NULL; + int i = 1232; + + printf("static function check\n"); + + buf = zasprintf("i = %d", i); + if (buf) { + printf("buf = %s\nbuf = %p\n", buf, buf); + } + + bar = zasprintf("i = %d - %d", i, i - 13); + if (bar) { + printf("bar = %s\nbar = %p\n", bar, bar); + printf("buf = %s\nbuf = %p\n", buf, buf); + } + + baz = zasprintf("No i's here"); + if (baz) { + printf("baz = %s\nbaz = %p\n", baz, baz); + printf("bar = %s\nbar = %p\n", bar, bar); + printf("buf = %s\nbuf = %p\n", buf, buf); + } + + free(buf); + free(bar); + free(baz); + + return 1; +} + +int main(int argc, char **argv) { + return run_test(); +} From 28c5df79300ab354cbc381aab200f7c2bd0331ad Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 28 Mar 2022 14:55:49 +0200 Subject: [PATCH 068/157] tree-optimization/105080 - make sure SCEV is available for ranger When doing format diagnostics at -O0 we should make sure to make SCEV available to avoid false positives due to ranges we otherwise can trivially compute. 2022-03-28 Richard Biener PR tree-optimization/105080 * tree-ssa-strlen.cc (printf_strlen_execute): Always init loops and SCEV. * gcc.dg/pr105080.c: New testcase. --- gcc/testsuite/gcc.dg/pr105080.c | 11 +++++++++++ gcc/tree-ssa-strlen.cc | 16 ++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr105080.c diff --git a/gcc/testsuite/gcc.dg/pr105080.c b/gcc/testsuite/gcc.dg/pr105080.c new file mode 100644 index 00000000000..77ee7eeb396 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr105080.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O0 -Wall" } */ + +int main() +{ + char foo[3]; + int i; + + for (i = 0; i < 16; i++) + __builtin_snprintf(foo, sizeof(foo), "%d", i); /* { dg-bogus "truncated" } */ +} diff --git a/gcc/tree-ssa-strlen.cc b/gcc/tree-ssa-strlen.cc index 112f0dce874..b2556366214 100644 --- a/gcc/tree-ssa-strlen.cc +++ b/gcc/tree-ssa-strlen.cc @@ -5858,13 +5858,8 @@ printf_strlen_execute (function *fun, bool warn_only) strlen_optimize = !warn_only; calculate_dominance_info (CDI_DOMINATORS); - - bool use_scev = optimize > 0 && flag_printf_return_value; - if (use_scev) - { - loop_optimizer_init (LOOPS_NORMAL); - scev_initialize (); - } + loop_optimizer_init (LOOPS_NORMAL); + scev_initialize (); gcc_assert (!strlen_to_stridx); if (warn_stringop_overflow || warn_stringop_truncation) @@ -5902,11 +5897,8 @@ printf_strlen_execute (function *fun, bool warn_only) strlen_to_stridx = NULL; } - if (use_scev) - { - scev_finalize (); - loop_optimizer_finalize (); - } + scev_finalize (); + loop_optimizer_finalize (); return walker.m_cleanup_cfg ? TODO_cleanup_cfg : 0; } From b6cccf88cb65043c20a020e4decf249a78180175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Date: Tue, 8 Mar 2022 16:05:52 +0000 Subject: [PATCH 069/157] testsuite: fixup pr97521.c and pr96713.c on i686-* On targets that do not have MXX/SSE enabled by default, pr97521 and pr96713 fail because they emit warnings: pr97521.c:12:1: warning: MMX vector return without MMX enabled changes the ABI [-Wpsabi] pr97521.c:11:1: note: the ABI for passing parameters with 16-byte alignment has changed in GCC 4.6 pr97521.c:11:1: warning: SSE vector argument without SSE enabled changes the ABI [-Wpsabi] Add -Wno-psabi to dg-options. gcc/testsuite/ChangeLog: * gcc.target/i386/pr97521.c: Add -Wno-psabi to dg-options. * gcc.dg/analyzer/pr96713.c: Likewise. --- gcc/testsuite/gcc.dg/analyzer/pr96713.c | 1 + gcc/testsuite/gcc.target/i386/pr97521.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/analyzer/pr96713.c b/gcc/testsuite/gcc.dg/analyzer/pr96713.c index fe9cafd73f1..12170bd4c64 100644 --- a/gcc/testsuite/gcc.dg/analyzer/pr96713.c +++ b/gcc/testsuite/gcc.dg/analyzer/pr96713.c @@ -1,3 +1,4 @@ +/* { dg-options "-Wno-psabi" } */ typedef int __attribute__ ((vector_size (8))) V; void diff --git a/gcc/testsuite/gcc.target/i386/pr97521.c b/gcc/testsuite/gcc.target/i386/pr97521.c index 804ffd61e13..5970bcff383 100644 --- a/gcc/testsuite/gcc.target/i386/pr97521.c +++ b/gcc/testsuite/gcc.target/i386/pr97521.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-O -mno-sse2" } */ +/* { dg-options "-O -mno-sse2 -Wno-psabi" } */ typedef unsigned char __attribute__ ((__vector_size__ (8))) V; typedef unsigned long long __attribute__ ((__vector_size__ (16))) W; From 35464c790382b0ed53c6fd5cc07855b0d3644ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Date: Mon, 21 Feb 2022 10:54:28 +0000 Subject: [PATCH 070/157] testsuite: Check fpic support in pr103275.c Test must check for effective support of fpic. gcc/testsuite/ChangeLog: * gcc.target/i386/pr103275.c: Add missing dg-require-effective-target for checking fpic. --- gcc/testsuite/gcc.target/i386/pr103275.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/testsuite/gcc.target/i386/pr103275.c b/gcc/testsuite/gcc.target/i386/pr103275.c index c93413f3cde..efac7b4b24a 100644 --- a/gcc/testsuite/gcc.target/i386/pr103275.c +++ b/gcc/testsuite/gcc.target/i386/pr103275.c @@ -1,4 +1,5 @@ /* { dg-do compile { target ia32 } } */ +/* { dg-require-effective-target fpic } */ /* { dg-options "-O2 -march=tigerlake -fPIC" } */ /* { dg-final { scan-assembler-not {(?n)kmovd.*@gotntpoff} } } */ From 7255d29c577106c14e42a9c3c88fc6fa6b6e4ecf Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 28 Mar 2022 11:39:21 +0100 Subject: [PATCH 071/157] libstdc++: Fix incorrect preprocessor conditions in The conditions that guard the feature test macros in should match the main definitions of the macros in other headers. This doesn't matter for GCC, because it supports all the conditions being tested here, but it does matter for non-GCC compilers without the relevant C++20 features. libstdc++-v3/ChangeLog: * include/std/version (__cpp_lib_variant): Fix conditions to match . (__cpp_lib_expected): Fix condition to match . --- libstdc++-v3/include/std/version | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index 7dbac23f22d..44b8a9f88b5 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -176,7 +176,7 @@ # define __cpp_lib_to_chars 201611L #endif #define __cpp_lib_unordered_map_try_emplace 201411L -#if !(__cplusplus >= 202002L && __cpp_concepts >= 202002L) +#if !(__cpp_concepts >= 202002L && __cpp_constexpr >= 201811L) // N.B. updated value in C++20 # define __cpp_lib_variant 202102L #endif @@ -293,7 +293,7 @@ # endif #define __cpp_lib_to_address 201711L #define __cpp_lib_to_array 201907L -#if __cplusplus >= 202002L && __cpp_concepts >= 202002L +#if __cpp_concepts >= 202002L && __cpp_constexpr >= 201811L # define __cpp_lib_variant 202106L #endif #endif @@ -306,7 +306,9 @@ #if _GLIBCXX_HOSTED #define __cpp_lib_adaptor_iterator_pair_constructor 202106L -#define __cpp_lib_expected 202202L +#if __cpp_concepts >= 202002L +# define __cpp_lib_expected 202202L +#endif #define __cpp_lib_invoke_r 202106L #define __cpp_lib_ios_noreplace 202200L #if __cpp_lib_concepts From 8bbeffc102bdd0a69576a8df47c588aba5a9b529 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 28 Mar 2022 12:27:23 +0100 Subject: [PATCH 072/157] libstdc++: Workaround for missing 'using enum' in Clang 12 Once we no longer care about older compilers without this feature, we can drop these static data members, so the names don't have to be visible at class scope. libstdc++-v3/ChangeLog: * libsupc++/compare (_Strong_order) [!__cpp_using_enum]: Add static data members for _Fp_fmt enumerators. --- libstdc++-v3/libsupc++/compare | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libstdc++-v3/libsupc++/compare b/libstdc++-v3/libsupc++/compare index 6e1ed53eeed..e9cf9139def 100644 --- a/libstdc++-v3/libsupc++/compare +++ b/libstdc++-v3/libsupc++/compare @@ -677,12 +677,25 @@ namespace std // TODO: _Bfloat16, }; +#ifndef __cpp_using_enum + // XXX Remove these once 'using enum' support is ubiquitous. + static constexpr _Fp_fmt _Binary16 = _Fp_fmt::_Binary16; + static constexpr _Fp_fmt _Binary32 = _Fp_fmt::_Binary32; + static constexpr _Fp_fmt _Binary64 = _Fp_fmt::_Binary64; + static constexpr _Fp_fmt _Binary128 = _Fp_fmt::_Binary128; + static constexpr _Fp_fmt _X86_80bit = _Fp_fmt::_X86_80bit; + static constexpr _Fp_fmt _M68k_80bit = _Fp_fmt::_M68k_80bit; + static constexpr _Fp_fmt _Dbldbl = _Fp_fmt::_Dbldbl; +#endif + // Identify the format used by a floating-point type. template static consteval _Fp_fmt _S_fp_fmt() noexcept { +#ifdef __cpp_using_enum using enum _Fp_fmt; +#endif // Identify these formats first, then assume anything else is IEEE. // N.B. ARM __fp16 alternative format can be handled as binary16. @@ -810,7 +823,9 @@ namespace std return __builtin_bit_cast(int16_t, __val); else { +#ifdef __cpp_using_enum using enum _Fp_fmt; +#endif constexpr auto __fmt = _S_fp_fmt<_Tp>(); if constexpr (__fmt == _X86_80bit || __fmt == _M68k_80bit) { @@ -862,7 +877,9 @@ namespace std if (__ix == __iy) return strong_ordering::equal; // All bits are equal, we're done. +#ifdef __cpp_using_enum using enum _Fp_fmt; +#endif constexpr auto __fmt = _S_fp_fmt<_Tp>(); if constexpr (__fmt == _Dbldbl) // double-double From 2788d42bdc66988449d40bf638f203a7cffc6cd9 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 28 Mar 2022 10:25:16 +0200 Subject: [PATCH 073/157] options: Fix 'enabledby_negargs' typo in 'LangEnabledBy' option property diagnostics Originally introduced almost ten years ago in r193303/commit 0829c7f7c5210cd1581042115cfe95c97283f44c "optc-gen.awk: Factor code out to...". gcc/ * opt-functions.awk (lang_enabled_by): Fix 'enabledby_negargs' typo. --- gcc/opt-functions.awk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk index 5b0bc6634f5..9eccf9b0409 100644 --- a/gcc/opt-functions.awk +++ b/gcc/opt-functions.awk @@ -388,7 +388,7 @@ function lang_enabled_by(enabledby_langs, enabledby_name, enabledby_posarg, enab with_args = "" } else { print "#error " opts[i] " LangEnabledBy("enabledby_langs","enabledby_name", " \ - enabledby_posarg", " enabledby_negargs \ + enabledby_posarg", " enabledby_negarg \ ") with three arguments, it should have either 2 or 4" } @@ -397,7 +397,7 @@ function lang_enabled_by(enabledby_langs, enabledby_name, enabledby_posarg, enab enabledby_index = opt_numbers[enabledby_array[k]]; if (enabledby_index == "") { print "#error " opts[i] " LangEnabledBy("enabledby_langs","enabledby_name", " \ - enabledby_posarg", " enabledby_negargs"), unknown option '" enabledby_name "'" + enabledby_posarg", " enabledby_negarg"), unknown option '" enabledby_name "'" } else { for (j = 1; j <= n_enabledby_arg_langs; j++) { lang_name = lang_sanitized_name(enabledby_arg_langs[j]); From c6c0594ef8382754f9cd8869a0cfb2aa2dcc0f43 Mon Sep 17 00:00:00 2001 From: chenglulu Date: Sat, 27 Nov 2021 15:09:11 +0800 Subject: [PATCH 074/157] LoongArch Port: Regenerate configure 2022-03-29 Chenghua Xu Lulu Cheng ChangeLog: * configure.ac: Add LoongArch tuples. * configure: Regenerate. config/ChangeLog: * picflag.m4: Default add build option '-fpic' for LoongArch. --- config/picflag.m4 | 3 +++ configure | 10 +++++++++- configure.ac | 10 +++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/config/picflag.m4 b/config/picflag.m4 index 8b106f9af88..0aefcf619bf 100644 --- a/config/picflag.m4 +++ b/config/picflag.m4 @@ -44,6 +44,9 @@ case "${$2}" in # sets the default TLS model and affects inlining. $1=-fPIC ;; + loongarch*-*-*) + $1=-fpic + ;; mips-sgi-irix6*) # PIC is the default. ;; diff --git a/configure b/configure index 69d8fc046c3..5dcaab14ae9 100755 --- a/configure +++ b/configure @@ -3056,7 +3056,7 @@ case "${ENABLE_GOLD}" in # Check for target supported by gold. case "${target}" in i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* \ - | aarch64*-*-* | tilegx*-*-* | mips*-*-* | s390*-*-*) + | aarch64*-*-* | tilegx*-*-* | mips*-*-* | s390*-*-* | loongarch*-*-*) configdirs="$configdirs gold" if test x${ENABLE_GOLD} = xdefault; then default_ld=gold @@ -3642,6 +3642,9 @@ case "${target}" in i[3456789]86-*-*) libgloss_dir=i386 ;; + loongarch*-*-*) + libgloss_dir=loongarch + ;; m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) libgloss_dir=m68hc11 ;; @@ -4026,6 +4029,11 @@ case "${target}" in wasm32-*-*) noconfigdirs="$noconfigdirs ld" ;; + loongarch*-*-linux*) + ;; + loongarch*-*-*) + noconfigdirs="$noconfigdirs gprof" + ;; esac # If we aren't building newlib, then don't build libgloss, since libgloss diff --git a/configure.ac b/configure.ac index d0f6d215b99..85977482aee 100644 --- a/configure.ac +++ b/configure.ac @@ -353,7 +353,7 @@ case "${ENABLE_GOLD}" in # Check for target supported by gold. case "${target}" in i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* \ - | aarch64*-*-* | tilegx*-*-* | mips*-*-* | s390*-*-*) + | aarch64*-*-* | tilegx*-*-* | mips*-*-* | s390*-*-* | loongarch*-*-*) configdirs="$configdirs gold" if test x${ENABLE_GOLD} = xdefault; then default_ld=gold @@ -899,6 +899,9 @@ case "${target}" in i[[3456789]]86-*-*) libgloss_dir=i386 ;; + loongarch*-*-*) + libgloss_dir=loongarch + ;; m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) libgloss_dir=m68hc11 ;; @@ -1283,6 +1286,11 @@ case "${target}" in wasm32-*-*) noconfigdirs="$noconfigdirs ld" ;; + loongarch*-*-linux*) + ;; + loongarch*-*-*) + noconfigdirs="$noconfigdirs gprof" + ;; esac # If we aren't building newlib, then don't build libgloss, since libgloss From b44786f64019e7164cab687b19914e7e13c949a4 Mon Sep 17 00:00:00 2001 From: chenglulu Date: Sat, 27 Nov 2021 14:42:57 +0800 Subject: [PATCH 075/157] LoongArch Port: gcc build 2022-03-29 Chenghua Xu Lulu Cheng gcc/ChangeLog: * common/config/loongarch/loongarch-common.cc: New file. * config/loongarch/genopts/genstr.sh: New file. * config/loongarch/genopts/loongarch-strings: New file. * config/loongarch/genopts/loongarch.opt.in: New file. * config/loongarch/loongarch-str.h: New file. * config/loongarch/gnu-user.h: New file. * config/loongarch/linux.h: New file. * config/loongarch/loongarch-cpu.cc: New file. * config/loongarch/loongarch-cpu.h: New file. * config/loongarch/loongarch-def.c: New file. * config/loongarch/loongarch-def.h: New file. * config/loongarch/loongarch-driver.cc: New file. * config/loongarch/loongarch-driver.h: New file. * config/loongarch/loongarch-opts.cc: New file. * config/loongarch/loongarch-opts.h: New file. * config/loongarch/loongarch.opt: New file. * config/loongarch/t-linux: New file. * config/loongarch/t-loongarch: New file. * config.gcc: Add LoongArch support. * configure.ac: Add LoongArch support. contrib/ChangeLog: * gcc_update (files_and_dependencies): Add config/loongarch/loongarch.opt and config/loongarch/loongarch-str.h. --- contrib/gcc_update | 2 + .../config/loongarch/loongarch-common.cc | 43 ++ gcc/config.gcc | 435 ++++++++++++- gcc/config/loongarch/genopts/genstr.sh | 104 ++++ .../loongarch/genopts/loongarch-strings | 58 ++ gcc/config/loongarch/genopts/loongarch.opt.in | 179 ++++++ gcc/config/loongarch/gnu-user.h | 80 +++ gcc/config/loongarch/linux.h | 50 ++ gcc/config/loongarch/loongarch-cpu.cc | 206 +++++++ gcc/config/loongarch/loongarch-cpu.h | 30 + gcc/config/loongarch/loongarch-def.c | 179 ++++++ gcc/config/loongarch/loongarch-def.h | 151 +++++ gcc/config/loongarch/loongarch-driver.cc | 187 ++++++ gcc/config/loongarch/loongarch-driver.h | 68 +++ gcc/config/loongarch/loongarch-opts.cc | 577 ++++++++++++++++++ gcc/config/loongarch/loongarch-opts.h | 90 +++ gcc/config/loongarch/loongarch-str.h | 59 ++ gcc/config/loongarch/loongarch.opt | 186 ++++++ gcc/config/loongarch/t-linux | 53 ++ gcc/config/loongarch/t-loongarch | 71 +++ gcc/configure.ac | 33 +- 21 files changed, 2836 insertions(+), 5 deletions(-) create mode 100644 gcc/common/config/loongarch/loongarch-common.cc create mode 100755 gcc/config/loongarch/genopts/genstr.sh create mode 100644 gcc/config/loongarch/genopts/loongarch-strings create mode 100644 gcc/config/loongarch/genopts/loongarch.opt.in create mode 100644 gcc/config/loongarch/gnu-user.h create mode 100644 gcc/config/loongarch/linux.h create mode 100644 gcc/config/loongarch/loongarch-cpu.cc create mode 100644 gcc/config/loongarch/loongarch-cpu.h create mode 100644 gcc/config/loongarch/loongarch-def.c create mode 100644 gcc/config/loongarch/loongarch-def.h create mode 100644 gcc/config/loongarch/loongarch-driver.cc create mode 100644 gcc/config/loongarch/loongarch-driver.h create mode 100644 gcc/config/loongarch/loongarch-opts.cc create mode 100644 gcc/config/loongarch/loongarch-opts.h create mode 100644 gcc/config/loongarch/loongarch-str.h create mode 100644 gcc/config/loongarch/loongarch.opt create mode 100644 gcc/config/loongarch/t-linux create mode 100644 gcc/config/loongarch/t-loongarch diff --git a/contrib/gcc_update b/contrib/gcc_update index 1cf15f9b3c2..641ce164775 100755 --- a/contrib/gcc_update +++ b/contrib/gcc_update @@ -86,6 +86,8 @@ gcc/config/arm/arm-tables.opt: gcc/config/arm/arm-cpus.in gcc/config/arm/parsecp gcc/config/c6x/c6x-tables.opt: gcc/config/c6x/c6x-isas.def gcc/config/c6x/genopt.sh gcc/config/c6x/c6x-sched.md: gcc/config/c6x/c6x-sched.md.in gcc/config/c6x/gensched.sh gcc/config/c6x/c6x-mult.md: gcc/config/c6x/c6x-mult.md.in gcc/config/c6x/genmult.sh +gcc/config/loongarch/loongarch-str.h: gcc/config/loongarch/genopts/genstr.sh gcc/config/loongarch/genopts/loongarch-string +gcc/config/loongarch/loongarch.opt: gcc/config/loongarch/genopts/genstr.sh gcc/config/loongarch/genopts/loongarch.opt.in gcc/config/m68k/m68k-tables.opt: gcc/config/m68k/m68k-devices.def gcc/config/m68k/m68k-isas.def gcc/config/m68k/m68k-microarchs.def gcc/config/m68k/genopt.sh gcc/config/mips/mips-tables.opt: gcc/config/mips/mips-cpus.def gcc/config/mips/genopt.sh gcc/config/rs6000/rs6000-tables.opt: gcc/config/rs6000/rs6000-cpus.def gcc/config/rs6000/genopt.sh diff --git a/gcc/common/config/loongarch/loongarch-common.cc b/gcc/common/config/loongarch/loongarch-common.cc new file mode 100644 index 00000000000..085d3d98f1c --- /dev/null +++ b/gcc/common/config/loongarch/loongarch-common.cc @@ -0,0 +1,43 @@ +/* Common hooks for LoongArch. + Copyright (C) 2021-2022 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "common/common-target.h" +#include "common/common-target-def.h" +#include "opts.h" +#include "flags.h" +#include "diagnostic-core.h" + +#undef TARGET_OPTION_OPTIMIZATION_TABLE +#define TARGET_OPTION_OPTIMIZATION_TABLE loongarch_option_optimization_table + +/* Set default optimization options. */ +static const struct default_options loongarch_option_optimization_table[] = +{ + { OPT_LEVELS_ALL, OPT_fasynchronous_unwind_tables, NULL, 1 }, + { OPT_LEVELS_NONE, 0, NULL, 0 } +}; + +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS MASK_CHECK_ZERO_DIV + +struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; diff --git a/gcc/config.gcc b/gcc/config.gcc index 3833bfa16a9..7b58e1314ff 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -454,6 +454,13 @@ mips*-*-*) extra_objs="frame-header-opt.o" extra_options="${extra_options} g.opt fused-madd.opt mips/mips-tables.opt" ;; +loongarch*-*-*) + cpu_type=loongarch + extra_headers="larchintrin.h" + extra_objs="loongarch-c.o loongarch-builtins.o loongarch-cpu.o loongarch-opts.o loongarch-def.o" + extra_gcc_objs="loongarch-driver.o loongarch-cpu.o loongarch-opts.o loongarch-def.o" + extra_options="${extra_options} g.opt fused-madd.opt" + ;; nds32*) cpu_type=nds32 extra_headers="nds32_intrinsic.h nds32_isr.h nds32_init.inc" @@ -2495,6 +2502,20 @@ riscv*-*-freebsd*) # automatically detect that GAS supports it, yet we require it. gcc_cv_initfini_array=yes ;; + +loongarch*-*-linux*) + tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file}" + tm_file="${tm_file} loongarch/gnu-user.h loongarch/linux.h" + extra_options="${extra_options} linux-android.opt" + tmake_file="${tmake_file} loongarch/t-linux" + gnu_ld=yes + gas=yes + + # Force .init_array support. The configure script cannot always + # automatically detect that GAS supports it, yet we require it. + gcc_cv_initfini_array=yes + ;; + mips*-*-netbsd*) # NetBSD/mips, either endian. target_cpu_default="MASK_ABICALLS" tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h" @@ -3601,7 +3622,7 @@ case ${target} in ;; *-*-linux* | *-*-gnu*) case ${target} in - aarch64*-* | arm*-* | i[34567]86-* | powerpc*-* | s390*-* | sparc*-* | x86_64-*) + aarch64*-* | arm*-* | i[34567]86-* | powerpc*-* | s390*-* | sparc*-* | x86_64-* | loongarch*-*) default_gnu_indirect_function=yes ;; esac @@ -4933,6 +4954,373 @@ case "${target}" in esac ;; + loongarch*-*-*) + supported_defaults="abi arch tune fpu" + + # Local variables + unset \ + abi_pattern abi_default \ + abiext_pattern abiext_default \ + arch_pattern arch_default \ + fpu_pattern fpu_default \ + tune_pattern tune_default \ + triplet_os triplet_abi + + # Infer ABI from the triplet. + case ${target} in + loongarch64-*-*-*f64) + abi_pattern="lp64d" + triplet_abi="f64" + ;; + loongarch64-*-*-*f32) + abi_pattern="lp64f" + triplet_abi="f32" + ;; + loongarch64-*-*-*sf) + abi_pattern="lp64s" + triplet_abi="sf" + ;; + loongarch64-*-*-*) + abi_pattern="lp64[dfs]" + abi_default="lp64d" + triplet_abi="" + ;; + *) + echo "Unsupported target ${target}." 1>&2 + exit 1 + ;; + esac + + abiext_pattern="*" + abiext_default="base" + + # Get the canonical triplet (multiarch specifier). + case ${target} in + *-linux-gnu*) triplet_os="linux-gnu";; + *-linux-musl*) triplet_os="linux-musl";; + *) + echo "Unsupported target ${target}." 1>&2 + exit 1 + ;; + esac + + la_canonical_triplet="loongarch64-${triplet_os}${triplet_abi}" + + + # Perform initial sanity checks on --with-* options. + case ${with_arch} in + "" | loongarch64 | la464) ;; # OK, append here. + native) + if test x${host} != x${target}; then + echo "--with-arch=native is illegal for cross-compiler." 1>&2 + exit 1 + fi + ;; + "") + echo "Please set a default value for \${with_arch}" \ + "according to your target triplet \"${target}\"." 1>&2 + exit 1 + ;; + *) + echo "Unknown arch in --with-arch=$with_arch" 1>&2 + exit 1 + ;; + esac + + case ${with_abi} in + "" | lp64d | lp64f | lp64s) ;; # OK, append here. + *) + echo "Unsupported ABI given in --with-abi=$with_abi" 1>&2 + exit 1 + ;; + esac + + case ${with_abiext} in + "" | base) ;; # OK, append here. + *) + echo "Unsupported ABI extention type $with_abiext" 1>&2 + exit 1 + ;; + esac + + case ${with_fpu} in + "" | none | 32 | 64) ;; # OK, append here. + 0) + # Convert "0" to "none" for upcoming checks. + with_fpu="none" + ;; + *) + echo "Unknown fpu type in --with-fpu=$with_fpu" 1>&2 + exit 1 + ;; + esac + + + # Set default value for with_abi. + case ${with_abi} in + "") + if test x${abi_default} != x; then + with_abi=${abi_default} + else + with_abi=${abi_pattern} + fi + ;; + + *) + if echo "${with_abi}" | grep -E "^${abi_pattern}$" > /dev/null; then + : # OK + else + echo "Incompatible options:" \ + "--with-abi=${with_abi} and --target=${target}." 1>&2 + exit 1 + fi + ;; + esac + + # Set default value for with_abiext (internal) + case ${with_abiext} in + "") + if test x${abiext_default} != x; then + with_abiext=${abiext_default} + else + with_abiext=${abiext_pattern} + fi + ;; + + *) + if echo "${with_abiext}" | grep -E "^${abiext_pattern}$" > /dev/null; then + : # OK + else + echo "The ABI extension type \"${with_abiext}\"" \ + "is incompatible with --target=${target}." 1>&2 + exit 1 + fi + + ;; + esac + + # Infer ISA-related default options from the ABI: pass 1 + case ${with_abi}/${with_abiext} in + lp64*/base) + # architectures that support lp64* ABI + arch_pattern="native|loongarch64|la464" + # default architecture for lp64* ABI + arch_default="loongarch64" + ;; + *) + echo "Unsupported ABI type ${with_abi}/${with_abiext}." 1>&2 + exit 1 + ;; + esac + + # Infer ISA-related default options from the ABI: pass 2 + case ${with_abi}/${with_abiext} in + lp64d/base) + fpu_pattern="64" + ;; + lp64f/base) + fpu_pattern="32|64" + fpu_default="32" + ;; + lp64s/base) + fpu_pattern="none|32|64" + fpu_default="none" + ;; + *) + echo "Unsupported ABI type ${with_abi}/${with_abiext}." 1>&2 + exit 1 + ;; + esac + + ## Set default value for with_arch. + case ${with_arch} in + "") + if test x${arch_default} != x; then + with_arch=${arch_default} + else + with_arch=${arch_pattern} + fi + ;; + + *) + if echo "${with_arch}" | grep -E "^${arch_pattern}$" > /dev/null; then + : # OK + else + echo "${with_abi}/${with_abiext} ABI cannot be implemented with" \ + "--with-arch=${with_arch}." 1>&2 + exit 1 + fi + ;; + esac + + ## Set default value for with_fpu. + case ${with_fpu} in + "") + if test x${fpu_default} != x; then + with_fpu=${fpu_default} + else + with_fpu=${fpu_pattern} + fi + ;; + + *) + if echo "${with_fpu}" | grep -E "^${fpu_pattern}$" > /dev/null; then + : # OK + else + echo "${with_abi}/${with_abiext} ABI cannot be implemented with" \ + "--with-fpu=${with_fpu}." 1>&2 + exit 1 + fi + ;; + esac + + + # Infer default with_tune from with_arch: pass 1 + case ${with_arch} in + native) + tune_pattern="*" + tune_default="native" + ;; + loongarch64) + tune_pattern="loongarch64|la464" + tune_default="la464" + ;; + *) + # By default, $with_tune == $with_arch + tune_pattern="$with_arch" + ;; + esac + + ## Set default value for with_tune. + case ${with_tune} in + "") + if test x${tune_default} != x; then + with_tune=${tune_default} + else + with_tune=${tune_pattern} + fi + ;; + + *) + if echo "${with_tune}" | grep -E "^${tune_pattern}$" > /dev/null; then + : # OK + else + echo "Incompatible options: --with-tune=${with_tune}" \ + "and --with-arch=${with_arch}." 1>&2 + exit 1 + fi + ;; + esac + + # Handle --with-multilib-list. + if test x"${with_multilib_list}" = x \ + || test x"${with_multilib_list}" = xno \ + || test x"${with_multilib_list}" = xdefault \ + || test x"${enable_multilib}" != xyes; then + + with_multilib_list="${with_abi}/${with_abiext}" + fi + + # Check if the configured default ABI combination is included in + # ${with_multilib_list}. + loongarch_multilib_list_sane=no + + # This one goes to TM_MULTILIB_CONFIG, for use in t-linux. + loongarch_multilib_list_make="" + + # This one goes to tm_defines, for use in loongarch-driver.c. + loongarch_multilib_list_c="" + + # ${with_multilib_list} should not contain whitespaces, + # consecutive commas or slashes. + if echo "${with_multilib_list}" \ + | grep -E -e "[[:space:]]" -e '[,/][,/]' -e '[,/]$' -e '^[,/]' > /dev/null; then + echo "Invalid argument to --with-multilib-list." 1>&2 + exit 1 + fi + + unset component idx elem_abi_base elem_abi_ext elem_tmp + for elem in $(echo "${with_multilib_list}" | tr ',' ' '); do + idx=0 + while true; do + idx=$((idx + 1)) + component=$(echo "${elem}" | awk -F'/' '{print $'"${idx}"'}') + + case ${idx} in + 1) + # Component 1: Base ABI type + case ${component} in + lp64d) elem_tmp="ABI_BASE_LP64D,";; + lp64f) elem_tmp="ABI_BASE_LP64F,";; + lp64s) elem_tmp="ABI_BASE_LP64S,";; + *) + echo "Unknown base ABI \"${component}\" in --with-multilib-list." 1>&2 + exit 1 + ;; + esac + loongarch_multilib_list_c="${loongarch_multilib_list_c}${elem_tmp}" + loongarch_multilib_list_make="${loongarch_multilib_list_make}mabi=${component}" + elem_abi_base="${component}" + ;; + + 2) + # Component 2: ABI extension type + case ${component} in + "" | base) + component="base" + elem_tmp="ABI_EXT_BASE," + ;; + *) + echo "Unknown ABI extension \"${component}\" in --with-multilib-list." 1>&2 + exit 1 + ;; + esac + loongarch_multilib_list_c="${loongarch_multilib_list_c}${elem_tmp}" + loongarch_multilib_list_make="${loongarch_multilib_list_make}" # Add nothing for now. + elem_abi_ext="${component}" + ;; + + *) + # Component 3 and on: optional stuff + case ${component} in + "") + # End of component list. + break + ;; + *) + echo "Unknown ABI \"${elem}\" in --with-multilib-list." 1>&2 + exit 1 + ;; + esac + ;; + esac + done + + if test x${elem_abi_base} = x${with_abi} \ + && test x${elem_abi_ext} = x${with_abiext}; then + loongarch_multilib_list_sane=yes + fi + loongarch_multilib_list_make="${loongarch_multilib_list_make}," + done + + # Check if the default ABI combination is in the default list. + if test x${loongarch_multilib_list_sane} = xno; then + if test x${with_abiext} = xbase; then + with_abiext="" + else + with_abiext="/${with_abiext}" + fi + + echo "Default ABI combination (${with_abi}${with_abiext})" \ + "not found in --with-multilib-list." 1>&2 + exit 1 + fi + + # Remove the excessive appending comma. + loongarch_multilib_list_c=${loongarch_multilib_list_c%,} + loongarch_multilib_list_make=${loongarch_multilib_list_make%,} + ;; + nds32*-*-*) supported_defaults="arch cpu nds32_lib float fpu_config" @@ -5370,6 +5758,51 @@ case ${target} in tmake_file="mips/t-mips $tmake_file" ;; + loongarch*-*-*) + # Export canonical triplet. + tm_defines="${tm_defines} LA_MULTIARCH_TRIPLET=${la_canonical_triplet}" + + # Define macro LA_DISABLE_MULTILIB if --disable-multilib + tm_defines="${tm_defines} TM_MULTILIB_LIST=${loongarch_multilib_list_c}" + if test x$enable_multilib = xyes; then + TM_MULTILIB_CONFIG="${loongarch_multilib_list_make}" + else + tm_defines="${tm_defines} LA_DISABLE_MULTILIB" + fi + + # Let --with- flags initialize the enum variables from loongarch.opt. + # See macro definitions from loongarch-opts.h and loongarch-cpu.h. + case ${with_arch} in + native) tm_defines="${tm_defines} DEFAULT_CPU_ARCH=CPU_NATIVE" ;; + la464) tm_defines="${tm_defines} DEFAULT_CPU_ARCH=CPU_LA464" ;; + loongarch64) tm_defines="${tm_defines} DEFAULT_CPU_ARCH=CPU_LOONGARCH64" ;; + esac + + case ${with_tune} in + native) tm_defines="${tm_defines} DEFAULT_CPU_TUNE=CPU_NATIVE" ;; + la464) tm_defines="${tm_defines} DEFAULT_CPU_TUNE=CPU_LA464" ;; + loongarch64) tm_defines="${tm_defines} DEFAULT_CPU_TUNE=CPU_LOONGARCH64" ;; + esac + + case ${with_abi} in + lp64d) tm_defines="${tm_defines} DEFAULT_ABI_BASE=ABI_BASE_LP64D" ;; + lp64f) tm_defines="${tm_defines} DEFAULT_ABI_BASE=ABI_BASE_LP64F" ;; + lp64s) tm_defines="${tm_defines} DEFAULT_ABI_BASE=ABI_BASE_LP64S" ;; + esac + + case ${with_abiext} in + base) tm_defines="${tm_defines} DEFAULT_ABI_EXT=ABI_EXT_BASE" ;; + esac + + case ${with_fpu} in + none) tm_defines="$tm_defines DEFAULT_ISA_EXT_FPU=ISA_EXT_NOFPU" ;; + 32) tm_defines="$tm_defines DEFAULT_ISA_EXT_FPU=ISA_EXT_FPU32" ;; + 64) tm_defines="$tm_defines DEFAULT_ISA_EXT_FPU=ISA_EXT_FPU64" ;; + esac + + tmake_file="loongarch/t-loongarch $tmake_file" + ;; + powerpc*-*-* | rs6000-*-*) # FIXME: The PowerPC port uses the value set at compile time, # although it's only cosmetic. diff --git a/gcc/config/loongarch/genopts/genstr.sh b/gcc/config/loongarch/genopts/genstr.sh new file mode 100755 index 00000000000..972ef125ff9 --- /dev/null +++ b/gcc/config/loongarch/genopts/genstr.sh @@ -0,0 +1,104 @@ +#!/bin/sh +# A simple script that generates loongarch-str.h and loongarch.opt +# from genopt/loongarch-optstr. +# +# Copyright (C) 2021-2022 Free Software Foundation, Inc. +# +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 3, or (at your option) any later +# version. +# +# GCC is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +# License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +cd "$(dirname "$0")" + +# Generate a header containing definitions from the string table. +gen_defines() { + cat <. */ + +#ifndef LOONGARCH_STR_H +#define LOONGARCH_STR_H +EOF + + sed -e '/^$/n' -e 's@#.*$@@' -e '/^$/d' \ + -e 's@^\([^ \t]\+\)[ \t]*\([^ \t]*\)@#define \1 "\2"@' \ + loongarch-strings + + echo + echo "#endif /* LOONGARCH_STR_H */" +} + + +# Substitute all "@@@@" to "" in loongarch.opt.in +# according to the key-value pairs defined in loongarch-strings. + +gen_options() { + + sed -e '/^$/n' -e 's@#.*$@@' -e '/^$/d' \ + -e 's@^\([^ \t]\+\)[ \t]*\([^ \t]*\)@\1="\2"@' \ + loongarch-strings | { \ + + # read the definitions + while read -r line; do + eval "$line" + done + + # print a header + cat << EOF +; Generated by "genstr" from the template "loongarch.opt.in" +; and definitions from "loongarch-strings". +; +; Please do not edit this file directly. +; It will be automatically updated during a gcc build +; if you change "loongarch.opt.in" or "loongarch-strings". +; +EOF + + # make the substitutions + sed -e 's@"@\\"@g' -e 's/@@\([^@]\+\)@@/${\1}/g' loongarch.opt.in | \ + while read -r line; do + eval "echo \"$line\"" + done + } +} + +main() { + case "$1" in + header) gen_defines;; + opt) gen_options;; + *) echo "Unknown Command: \"$1\". Available: header, opt"; exit 1;; + esac +} + +main "$@" diff --git a/gcc/config/loongarch/genopts/loongarch-strings b/gcc/config/loongarch/genopts/loongarch-strings new file mode 100644 index 00000000000..cb88ed56b68 --- /dev/null +++ b/gcc/config/loongarch/genopts/loongarch-strings @@ -0,0 +1,58 @@ +# Defines the key strings for LoongArch compiler options. +# +# Copyright (C) 2021-2022 Free Software Foundation, Inc. +# +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 3, or (at your option) any later +# version. +# +# GCC is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +# License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# -march= / -mtune= +OPTSTR_ARCH arch +OPTSTR_TUNE tune + +STR_CPU_NATIVE native +STR_CPU_LOONGARCH64 loongarch64 +STR_CPU_LA464 la464 + +# Base architecture +STR_ISA_BASE_LA64V100 la64 + +# -mfpu +OPTSTR_ISA_EXT_FPU fpu +STR_ISA_EXT_NOFPU none +STR_ISA_EXT_FPU0 0 +STR_ISA_EXT_FPU32 32 +STR_ISA_EXT_FPU64 64 + +OPTSTR_SOFT_FLOAT soft-float +OPTSTR_SINGLE_FLOAT single-float +OPTSTR_DOUBLE_FLOAT double-float + +# -mabi= +OPTSTR_ABI_BASE abi +STR_ABI_BASE_LP64D lp64d +STR_ABI_BASE_LP64F lp64f +STR_ABI_BASE_LP64S lp64s + +# ABI extension types +STR_ABI_EXT_BASE base + +# -mcmodel= +OPTSTR_CMODEL cmodel +STR_CMODEL_NORMAL normal +STR_CMODEL_TINY tiny +STR_CMODEL_TS tiny-static +STR_CMODEL_LARGE large +STR_CMODEL_EXTREME extreme diff --git a/gcc/config/loongarch/genopts/loongarch.opt.in b/gcc/config/loongarch/genopts/loongarch.opt.in new file mode 100644 index 00000000000..61e7d72a0a1 --- /dev/null +++ b/gcc/config/loongarch/genopts/loongarch.opt.in @@ -0,0 +1,179 @@ +; Copyright (C) 2021-2022 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 3, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; You should have received a copy of the GNU General Public License +; along with GCC; see the file COPYING3. If not see +; . +; + +; Variables (macros) that should be exported by loongarch.opt: +; la_opt_switches, +; la_opt_abi_base, la_opt_abi_ext, +; la_opt_cpu_arch, la_opt_cpu_tune, +; la_opt_fpu, +; la_cmodel. + +HeaderInclude +config/loongarch/loongarch-opts.h + +HeaderInclude +config/loongarch/loongarch-str.h + +Variable +HOST_WIDE_INT la_opt_switches = 0 + +; ISA related options +;; Base ISA +Enum +Name(isa_base) Type(int) +Basic ISAs of LoongArch: + +EnumValue +Enum(isa_base) String(@@STR_ISA_BASE_LA64V100@@) Value(ISA_BASE_LA64V100) + + +;; ISA extensions / adjustments +Enum +Name(isa_ext_fpu) Type(int) +FPU types of LoongArch: + +EnumValue +Enum(isa_ext_fpu) String(@@STR_ISA_EXT_NOFPU@@) Value(ISA_EXT_NOFPU) + +EnumValue +Enum(isa_ext_fpu) String(@@STR_ISA_EXT_FPU32@@) Value(ISA_EXT_FPU32) + +EnumValue +Enum(isa_ext_fpu) String(@@STR_ISA_EXT_FPU64@@) Value(ISA_EXT_FPU64) + +m@@OPTSTR_ISA_EXT_FPU@@= +Target RejectNegative Joined ToLower Enum(isa_ext_fpu) Var(la_opt_fpu) Init(M_OPTION_NOT_SEEN) +-m@@OPTSTR_ISA_EXT_FPU@@=FPU Generate code for the given FPU. + +m@@OPTSTR_ISA_EXT_FPU@@=@@STR_ISA_EXT_FPU0@@ +Target RejectNegative Alias(m@@OPTSTR_ISA_EXT_FPU@@=,@@STR_ISA_EXT_NOFPU@@) + +m@@OPTSTR_SOFT_FLOAT@@ +Target Driver RejectNegative Var(la_opt_switches) Mask(FORCE_SOFTF) Negative(m@@OPTSTR_SINGLE_FLOAT@@) +Prevent the use of all hardware floating-point instructions. + +m@@OPTSTR_SINGLE_FLOAT@@ +Target Driver RejectNegative Var(la_opt_switches) Mask(FORCE_F32) Negative(m@@OPTSTR_DOUBLE_FLOAT@@) +Restrict the use of hardware floating-point instructions to 32-bit operations. + +m@@OPTSTR_DOUBLE_FLOAT@@ +Target Driver RejectNegative Var(la_opt_switches) Mask(FORCE_F64) Negative(m@@OPTSTR_SOFT_FLOAT@@) +Allow hardware floating-point instructions to cover both 32-bit and 64-bit operations. + + +;; Base target models (implies ISA & tune parameters) +Enum +Name(cpu_type) Type(int) +LoongArch CPU types: + +EnumValue +Enum(cpu_type) String(@@STR_CPU_NATIVE@@) Value(CPU_NATIVE) + +EnumValue +Enum(cpu_type) String(@@STR_CPU_LOONGARCH64@@) Value(CPU_LOONGARCH64) + +EnumValue +Enum(cpu_type) String(@@STR_CPU_LA464@@) Value(CPU_LA464) + +m@@OPTSTR_ARCH@@= +Target RejectNegative Joined Enum(cpu_type) Var(la_opt_cpu_arch) Init(M_OPTION_NOT_SEEN) +-m@@OPTSTR_ARCH@@=PROCESSOR Generate code for the given PROCESSOR ISA. + +m@@OPTSTR_TUNE@@= +Target RejectNegative Joined Enum(cpu_type) Var(la_opt_cpu_tune) Init(M_OPTION_NOT_SEEN) +-m@@OPTSTR_TUNE@@=PROCESSOR Generate optimized code for PROCESSOR. + + +; ABI related options +; (ISA constraints on ABI are handled dynamically) + +;; Base ABI +Enum +Name(abi_base) Type(int) +Base ABI types for LoongArch: + +EnumValue +Enum(abi_base) String(@@STR_ABI_BASE_LP64D@@) Value(ABI_BASE_LP64D) + +EnumValue +Enum(abi_base) String(@@STR_ABI_BASE_LP64F@@) Value(ABI_BASE_LP64F) + +EnumValue +Enum(abi_base) String(@@STR_ABI_BASE_LP64S@@) Value(ABI_BASE_LP64S) + +m@@OPTSTR_ABI_BASE@@= +Target RejectNegative Joined ToLower Enum(abi_base) Var(la_opt_abi_base) Init(M_OPTION_NOT_SEEN) +-m@@OPTSTR_ABI_BASE@@=BASEABI Generate code that conforms to the given BASEABI. + +;; ABI Extension +Variable +int la_opt_abi_ext = M_OPTION_NOT_SEEN + + +mbranch-cost= +Target RejectNegative Joined UInteger Var(loongarch_branch_cost) +-mbranch-cost=COST Set the cost of branches to roughly COST instructions. + +mcheck-zero-division +Target Mask(CHECK_ZERO_DIV) +Trap on integer divide by zero. + +mcond-move-int +Target Var(TARGET_COND_MOVE_INT) Init(1) +Conditional moves for integral are enabled. + +mcond-move-float +Target Var(TARGET_COND_MOVE_FLOAT) Init(1) +Conditional moves for float are enabled. + +mmemcpy +Target Mask(MEMCPY) +Prevent optimizing block moves, which is also the default behavior of -Os. + +mstrict-align +Target Var(TARGET_STRICT_ALIGN) Init(0) +Do not generate unaligned memory accesses. + +mmax-inline-memcpy-size= +Target Joined RejectNegative UInteger Var(loongarch_max_inline_memcpy_size) Init(1024) +-mmax-inline-memcpy-size=SIZE Set the max size of memcpy to inline, default is 1024. + +; The code model option names for -mcmodel. +Enum +Name(cmodel) Type(int) +The code model option names for -mcmodel: + +EnumValue +Enum(cmodel) String(@@STR_CMODEL_NORMAL@@) Value(CMODEL_NORMAL) + +EnumValue +Enum(cmodel) String(@@STR_CMODEL_TINY@@) Value(CMODEL_TINY) + +EnumValue +Enum(cmodel) String(@@STR_CMODEL_TS@@) Value(CMODEL_TINY_STATIC) + +EnumValue +Enum(cmodel) String(@@STR_CMODEL_LARGE@@) Value(CMODEL_LARGE) + +EnumValue +Enum(cmodel) String(@@STR_CMODEL_EXTREME@@) Value(CMODEL_EXTREME) + +mcmodel= +Target RejectNegative Joined Enum(cmodel) Var(la_opt_cmodel) Init(CMODEL_NORMAL) +Specify the code model. diff --git a/gcc/config/loongarch/gnu-user.h b/gcc/config/loongarch/gnu-user.h new file mode 100644 index 00000000000..664dc9206ad --- /dev/null +++ b/gcc/config/loongarch/gnu-user.h @@ -0,0 +1,80 @@ +/* Definitions for LoongArch systems using GNU (glibc-based) userspace, + or other userspace with libc derived from glibc. + Copyright (C) 2021-2022 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +/* Define the size of the wide character type. */ +#undef WCHAR_TYPE +#define WCHAR_TYPE "int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 32 + + +/* GNU-specific SPEC definitions. */ +#define GNU_USER_LINK_EMULATION "elf" ABI_GRLEN_SPEC "loongarch" + +#undef GLIBC_DYNAMIC_LINKER +#define GLIBC_DYNAMIC_LINKER \ + "/lib" ABI_GRLEN_SPEC "/ld-linux-loongarch-" ABI_SPEC ".so.1" + +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER \ + "/lib" ABI_GRLEN_SPEC "/ld-musl-loongarch-" ABI_SPEC ".so.1" + +#undef GNU_USER_TARGET_LINK_SPEC +#define GNU_USER_TARGET_LINK_SPEC \ + "%{G*} %{shared} -m " GNU_USER_LINK_EMULATION \ + "%{!shared: %{static} %{!static: %{rdynamic:-export-dynamic} " \ + "-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" + + +/* Similar to standard Linux, but adding -ffast-math support. */ +#undef GNU_USER_TARGET_MATHFILE_SPEC +#define GNU_USER_TARGET_MATHFILE_SPEC \ + "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" + +#undef LIB_SPEC +#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC + +#undef LINK_SPEC +#define LINK_SPEC GNU_USER_TARGET_LINK_SPEC + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC \ + GNU_USER_TARGET_MATHFILE_SPEC " " \ + GNU_USER_TARGET_ENDFILE_SPEC + +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" + +/* A standard GNU/Linux mapping. On most targets, it is included in + CC1_SPEC itself by config/linux.h, but loongarch.h overrides CC1_SPEC + and provides this hook instead. */ +#undef SUBTARGET_CC1_SPEC +#define SUBTARGET_CC1_SPEC GNU_USER_TARGET_CC1_SPEC + +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + GNU_USER_TARGET_OS_CPP_BUILTINS (); \ + /* The GNU C++ standard library requires this. */ \ + if (c_dialect_cxx ()) \ + builtin_define ("_GNU_SOURCE"); \ + } \ + while (0) diff --git a/gcc/config/loongarch/linux.h b/gcc/config/loongarch/linux.h new file mode 100644 index 00000000000..110d0fab93d --- /dev/null +++ b/gcc/config/loongarch/linux.h @@ -0,0 +1,50 @@ +/* Definitions for Linux-based systems with libraries in ELF format. + Copyright (C) 2021-2022 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +/* Default system library search paths. + * This ensures that a compiler configured with --disable-multilib + * can work in a multilib environment. */ + +#if defined(LA_DISABLE_MULTILIB) && defined(LA_DISABLE_MULTIARCH) + + #if DEFAULT_ABI_BASE == ABI_BASE_LP64D + #define ABI_LIBDIR "lib64" + #elif DEFAULT_ABI_BASE == ABI_BASE_LP64F + #define ABI_LIBDIR "lib64/f32" + #elif DEFAULT_ABI_BASE == ABI_BASE_LP64S + #define ABI_LIBDIR "lib64/sf" + #endif + +#endif + +#ifndef ABI_LIBDIR +#define ABI_LIBDIR "lib" +#endif + +#define STANDARD_STARTFILE_PREFIX_1 "/" ABI_LIBDIR "/" +#define STANDARD_STARTFILE_PREFIX_2 "/usr/" ABI_LIBDIR "/" + + +/* Define this to be nonzero if static stack checking is supported. */ +#define STACK_CHECK_STATIC_BUILTIN 1 + +/* The default value isn't sufficient in 64-bit mode. */ +#define STACK_CHECK_PROTECT (TARGET_64BIT ? 16 * 1024 : 12 * 1024) + +#define TARGET_ASM_FILE_END file_end_indicate_exec_stack diff --git a/gcc/config/loongarch/loongarch-cpu.cc b/gcc/config/loongarch/loongarch-cpu.cc new file mode 100644 index 00000000000..a886dd9323b --- /dev/null +++ b/gcc/config/loongarch/loongarch-cpu.cc @@ -0,0 +1,206 @@ +/* Definitions for LoongArch CPU properties. + Copyright (C) 2021-2022 Free Software Foundation, Inc. + Contributed by Loongson Ltd. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#define IN_TARGET_CODE 1 + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "diagnostic-core.h" + +#include "loongarch-opts.h" +#include "loongarch-cpu.h" +#include "loongarch-str.h" + +/* Native CPU detection with "cpucfg" */ +#define N_CPUCFG_WORDS 0x15 +static uint32_t cpucfg_cache[N_CPUCFG_WORDS] = { 0 }; +static const int cpucfg_useful_idx[] = {0, 1, 2, 16, 17, 18, 19}; + +static uint32_t +read_cpucfg_word (int wordno) +{ + /* To make cross-compiler shut up. */ + (void) wordno; + uint32_t ret = 0; + + #ifdef __loongarch__ + __asm__ __volatile__ ("cpucfg %0,%1\n\t" + :"=r"(ret) + :"r"(wordno) + :); + #endif + + return ret; +} + +void +cache_cpucfg (void) +{ + for (unsigned int i = 0; i < sizeof (cpucfg_useful_idx) / sizeof (int); i++) + { + cpucfg_cache[cpucfg_useful_idx[i]] + = read_cpucfg_word (cpucfg_useful_idx[i]); + } +} + +uint32_t +get_native_prid (void) +{ + /* Fill loongarch_cpu_default_config[CPU_NATIVE] with cpucfg data, + see "Loongson Architecture Reference Manual" + (Volume 1, Section 2.2.10.5) */ + return cpucfg_cache[0]; +} + +const char* +get_native_prid_str (void) +{ + static char prid_str[9]; + sprintf (prid_str, "%08x", cpucfg_cache[0]); + return (const char*) prid_str; +} + +/* Fill property tables for CPU_NATIVE. */ +unsigned int +fill_native_cpu_config (int p_arch_native, int p_tune_native) +{ + int ret_cpu_type; + + /* Nothing needs to be done unless "-march/tune=native" + is given or implied. */ + if (!(p_arch_native || p_tune_native)) + return CPU_NATIVE; + + /* Fill cpucfg_cache with the "cpucfg" instruction. */ + cache_cpucfg (); + + + /* Fill: loongarch_cpu_default_isa[CPU_NATIVE].base + With: base architecture (ARCH) + At: cpucfg_words[1][1:0] */ + + #define NATIVE_BASE_ISA (loongarch_cpu_default_isa[CPU_NATIVE].base) + switch (cpucfg_cache[1] & 0x3) + { + case 0x02: + NATIVE_BASE_ISA = ISA_BASE_LA64V100; + break; + + default: + if (p_arch_native) + fatal_error (UNKNOWN_LOCATION, + "unknown base architecture %<0x%x%>, %qs failed", + (unsigned int) (cpucfg_cache[1] & 0x3), + "-m" OPTSTR_ARCH "=" STR_CPU_NATIVE); + } + + /* Fill: loongarch_cpu_default_isa[CPU_NATIVE].fpu + With: FPU type (FP, FP_SP, FP_DP) + At: cpucfg_words[2][2:0] */ + + #define NATIVE_FPU (loongarch_cpu_default_isa[CPU_NATIVE].fpu) + switch (cpucfg_cache[2] & 0x7) + { + case 0x07: + NATIVE_FPU = ISA_EXT_FPU64; + break; + + case 0x03: + NATIVE_FPU = ISA_EXT_FPU32; + break; + + case 0x00: + NATIVE_FPU = ISA_EXT_NOFPU; + break; + + default: + if (p_arch_native) + fatal_error (UNKNOWN_LOCATION, + "unknown FPU type %<0x%x%>, %qs failed", + (unsigned int) (cpucfg_cache[2] & 0x7), + "-m" OPTSTR_ARCH "=" STR_CPU_NATIVE); + } + + /* Fill: loongarch_cpu_cache[CPU_NATIVE] + With: cache size info + At: cpucfg_words[16:20][31:0] */ + + int l1d_present = 0, l1u_present = 0; + int l2d_present = 0; + uint32_t l1_szword, l2_szword; + + l1u_present |= cpucfg_cache[16] & 3; /* bit[1:0]: unified l1 cache */ + l1d_present |= cpucfg_cache[16] & 4; /* bit[2:2]: l1 dcache */ + l1_szword = l1d_present ? 18 : (l1u_present ? 17 : 0); + l1_szword = l1_szword ? cpucfg_cache[l1_szword]: 0; + + l2d_present |= cpucfg_cache[16] & 24; /* bit[4:3]: unified l2 cache */ + l2d_present |= cpucfg_cache[16] & 128; /* bit[7:7]: l2 dcache */ + l2_szword = l2d_present ? cpucfg_cache[19]: 0; + + loongarch_cpu_cache[CPU_NATIVE].l1d_line_size + = 1 << ((l1_szword & 0x7f000000) >> 24); /* bit[30:24]: log2(linesize) */ + + loongarch_cpu_cache[CPU_NATIVE].l1d_size + = (1 << ((l1_szword & 0x00ff0000) >> 16)) /* bit[23:16]: log2(idx) */ + * ((l1_szword & 0x0000ffff) + 1) /* bit[15:0]: sets - 1 */ + * (1 << ((l1_szword & 0x7f000000) >> 24)) /* bit[30:24]: log2(linesize) */ + >> 10; /* in kilobytes */ + + loongarch_cpu_cache[CPU_NATIVE].l2d_size + = (1 << ((l2_szword & 0x00ff0000) >> 16)) /* bit[23:16]: log2(idx) */ + * ((l2_szword & 0x0000ffff) + 1) /* bit[15:0]: sets - 1 */ + * (1 << ((l2_szword & 0x7f000000) >> 24)) /* bit[30:24]: log2(linesize) */ + >> 10; /* in kilobytes */ + + /* Fill: ret_cpu_type + With: processor ID (PRID) + At: cpucfg_words[0][31:0] */ + + switch (cpucfg_cache[0] & 0x00ffff00) + { + case 0x0014c000: /* LA464 */ + ret_cpu_type = CPU_LA464; + break; + + default: + /* Unknown PRID. This is generally harmless as long as + the properties above can be obtained via "cpucfg". */ + if (p_tune_native) + inform (UNKNOWN_LOCATION, "unknown processor ID %<0x%x%>, " + "some tuning parameters will fall back to default", + cpucfg_cache[0]); + break; + } + + /* Properties that cannot be looked up directly using cpucfg. */ + loongarch_cpu_issue_rate[CPU_NATIVE] + = loongarch_cpu_issue_rate[ret_cpu_type]; + + loongarch_cpu_multipass_dfa_lookahead[CPU_NATIVE] + = loongarch_cpu_multipass_dfa_lookahead[ret_cpu_type]; + + loongarch_cpu_rtx_cost_data[CPU_NATIVE] + = loongarch_cpu_rtx_cost_data[ret_cpu_type]; + + return ret_cpu_type; +} diff --git a/gcc/config/loongarch/loongarch-cpu.h b/gcc/config/loongarch/loongarch-cpu.h new file mode 100644 index 00000000000..93d656f70f5 --- /dev/null +++ b/gcc/config/loongarch/loongarch-cpu.h @@ -0,0 +1,30 @@ +/* Definitions for loongarch native cpu property detection routines. + Copyright (C) 2020-2021 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#ifndef LOONGARCH_CPU_H +#define LOONGARCH_CPU_H + +#include "system.h" + +void cache_cpucfg (void); +unsigned int fill_native_cpu_config (int p_arch_native, int p_tune_native); +uint32_t get_native_prid (void); +const char* get_native_prid_str (void); + +#endif /* LOONGARCH_CPU_H */ diff --git a/gcc/config/loongarch/loongarch-def.c b/gcc/config/loongarch/loongarch-def.c new file mode 100644 index 00000000000..c8769b7d65e --- /dev/null +++ b/gcc/config/loongarch/loongarch-def.c @@ -0,0 +1,179 @@ +/* LoongArch static properties. + Copyright (C) 2021-2022 Free Software Foundation, Inc. + Contributed by Loongson Ltd. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#include "loongarch-def.h" +#include "loongarch-str.h" + +/* Default RTX cost initializer. */ +#define COSTS_N_INSNS(N) ((N) * 4) +#define DEFAULT_COSTS \ + .fp_add = COSTS_N_INSNS (1), \ + .fp_mult_sf = COSTS_N_INSNS (2), \ + .fp_mult_df = COSTS_N_INSNS (4), \ + .fp_div_sf = COSTS_N_INSNS (6), \ + .fp_div_df = COSTS_N_INSNS (8), \ + .int_mult_si = COSTS_N_INSNS (1), \ + .int_mult_di = COSTS_N_INSNS (1), \ + .int_div_si = COSTS_N_INSNS (4), \ + .int_div_di = COSTS_N_INSNS (6), \ + .branch_cost = 2, \ + .memory_latency = 4 + +/* CPU property tables. */ +const char* +loongarch_cpu_strings[N_TUNE_TYPES] = { + [CPU_NATIVE] = STR_CPU_NATIVE, + [CPU_LOONGARCH64] = STR_CPU_LOONGARCH64, + [CPU_LA464] = STR_CPU_LA464, +}; + +struct loongarch_isa +loongarch_cpu_default_isa[N_ARCH_TYPES] = { + [CPU_LOONGARCH64] = { + .base = ISA_BASE_LA64V100, + .fpu = ISA_EXT_FPU64, + }, + [CPU_LA464] = { + .base = ISA_BASE_LA64V100, + .fpu = ISA_EXT_FPU64, + }, +}; + +struct loongarch_cache +loongarch_cpu_cache[N_TUNE_TYPES] = { + [CPU_LOONGARCH64] = { + .l1d_line_size = 64, + .l1d_size = 64, + .l2d_size = 256, + }, + [CPU_LA464] = { + .l1d_line_size = 64, + .l1d_size = 64, + .l2d_size = 256, + }, +}; + +/* The following properties cannot be looked up directly using "cpucfg". + So it is necessary to provide a default value for "unknown native" + tune targets (i.e. -mtune=native while PRID does not correspond to + any known "-mtune" type). */ + +struct loongarch_rtx_cost_data +loongarch_cpu_rtx_cost_data[N_TUNE_TYPES] = { + [CPU_NATIVE] = { + DEFAULT_COSTS + }, + [CPU_LOONGARCH64] = { + DEFAULT_COSTS + }, + [CPU_LA464] = { + DEFAULT_COSTS + }, +}; + +/* RTX costs to use when optimizing for size. */ +extern const struct loongarch_rtx_cost_data +loongarch_rtx_cost_optimize_size = { + .fp_add = 4, + .fp_mult_sf = 4, + .fp_mult_df = 4, + .fp_div_sf = 4, + .fp_div_df = 4, + .int_mult_si = 4, + .int_mult_di = 4, + .int_div_si = 4, + .int_div_di = 4, + .branch_cost = 2, + .memory_latency = 4, +}; + +int +loongarch_cpu_issue_rate[N_TUNE_TYPES] = { + [CPU_NATIVE] = 4, + [CPU_LOONGARCH64] = 4, + [CPU_LA464] = 4, +}; + +int +loongarch_cpu_multipass_dfa_lookahead[N_TUNE_TYPES] = { + [CPU_NATIVE] = 4, + [CPU_LOONGARCH64] = 4, + [CPU_LA464] = 4, +}; + +/* Wiring string definitions from loongarch-str.h to global arrays + with standard index values from loongarch-opts.h, so we can + print config-related messages and do ABI self-spec filtering + from the driver in a self-consistent manner. */ + +const char* +loongarch_isa_base_strings[N_ISA_BASE_TYPES] = { + [ISA_BASE_LA64V100] = STR_ISA_BASE_LA64V100, +}; + +const char* +loongarch_isa_ext_strings[N_ISA_EXT_TYPES] = { + [ISA_EXT_FPU64] = STR_ISA_EXT_FPU64, + [ISA_EXT_FPU32] = STR_ISA_EXT_FPU32, + [ISA_EXT_NOFPU] = STR_ISA_EXT_NOFPU, +}; + +const char* +loongarch_abi_base_strings[N_ABI_BASE_TYPES] = { + [ABI_BASE_LP64D] = STR_ABI_BASE_LP64D, + [ABI_BASE_LP64F] = STR_ABI_BASE_LP64F, + [ABI_BASE_LP64S] = STR_ABI_BASE_LP64S, +}; + +const char* +loongarch_abi_ext_strings[N_ABI_EXT_TYPES] = { + [ABI_EXT_BASE] = STR_ABI_EXT_BASE, +}; + +const char* +loongarch_cmodel_strings[] = { + [CMODEL_NORMAL] = STR_CMODEL_NORMAL, + [CMODEL_TINY] = STR_CMODEL_TINY, + [CMODEL_TINY_STATIC] = STR_CMODEL_TS, + [CMODEL_LARGE] = STR_CMODEL_LARGE, + [CMODEL_EXTREME] = STR_CMODEL_EXTREME, +}; + +const char* +loongarch_switch_strings[] = { + [SW_SOFT_FLOAT] = OPTSTR_SOFT_FLOAT, + [SW_SINGLE_FLOAT] = OPTSTR_SINGLE_FLOAT, + [SW_DOUBLE_FLOAT] = OPTSTR_DOUBLE_FLOAT, +}; + + +/* ABI-related definitions. */ +const struct loongarch_isa +abi_minimal_isa[N_ABI_BASE_TYPES][N_ABI_EXT_TYPES] = { + [ABI_BASE_LP64D] = { + [ABI_EXT_BASE] = {.base = ISA_BASE_LA64V100, .fpu = ISA_EXT_FPU64}, + }, + [ABI_BASE_LP64F] = { + [ABI_EXT_BASE] = {.base = ISA_BASE_LA64V100, .fpu = ISA_EXT_FPU32}, + }, + [ABI_BASE_LP64S] = { + [ABI_EXT_BASE] = {.base = ISA_BASE_LA64V100, .fpu = ISA_EXT_NOFPU}, + }, +}; diff --git a/gcc/config/loongarch/loongarch-def.h b/gcc/config/loongarch/loongarch-def.h new file mode 100644 index 00000000000..c2c35b6ba5c --- /dev/null +++ b/gcc/config/loongarch/loongarch-def.h @@ -0,0 +1,151 @@ +/* LoongArch definitions. + Copyright (C) 2021-2022 Free Software Foundation, Inc. + Contributed by Loongson Ltd. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +/* Definition of standard codes for: + - base architecture types (isa_base), + - ISA extensions (isa_ext), + - base ABI types (abi_base), + - ABI extension types (abi_ext). + + - code models (cmodel) + - other command-line switches (switch) + + These values are primarily used for implementing option handling + logic in "loongarch.opt", "loongarch-driver.c" and "loongarch-opt.c". + + As for the result of this option handling process, the following + scheme is adopted to represent the final configuration: + + - The target ABI is encoded with a tuple (abi_base, abi_ext) + using the code defined below. + + - The target ISA is encoded with a "struct loongarch_isa" defined + in loongarch-cpu.h. + + - The target microarchitecture is represented with a cpu model + index defined in loongarch-cpu.h. +*/ + +#ifndef LOONGARCH_DEF_H +#define LOONGARCH_DEF_H + +#include "loongarch-tune.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* enum isa_base */ +extern const char* loongarch_isa_base_strings[]; +#define ISA_BASE_LA64V100 0 +#define N_ISA_BASE_TYPES 1 + +/* enum isa_ext_* */ +extern const char* loongarch_isa_ext_strings[]; +#define ISA_EXT_NOFPU 0 +#define ISA_EXT_FPU32 1 +#define ISA_EXT_FPU64 2 +#define N_ISA_EXT_FPU_TYPES 3 +#define N_ISA_EXT_TYPES 3 + +/* enum abi_base */ +extern const char* loongarch_abi_base_strings[]; +#define ABI_BASE_LP64D 0 +#define ABI_BASE_LP64F 1 +#define ABI_BASE_LP64S 2 +#define N_ABI_BASE_TYPES 3 + +/* enum abi_ext */ +extern const char* loongarch_abi_ext_strings[]; +#define ABI_EXT_BASE 0 +#define N_ABI_EXT_TYPES 1 + +/* enum cmodel */ +extern const char* loongarch_cmodel_strings[]; +#define CMODEL_NORMAL 0 +#define CMODEL_TINY 1 +#define CMODEL_TINY_STATIC 2 +#define CMODEL_LARGE 3 +#define CMODEL_EXTREME 4 +#define N_CMODEL_TYPES 5 + +/* enum switches */ +/* The "SW_" codes represent command-line switches (options that + accept no parameters). Definition for other switches that affects + the target ISA / ABI configuration will also be appended here + in the future. */ + +extern const char* loongarch_switch_strings[]; +#define SW_SOFT_FLOAT 0 +#define SW_SINGLE_FLOAT 1 +#define SW_DOUBLE_FLOAT 2 +#define N_SWITCH_TYPES 3 + +/* The common default value for variables whose assignments + are triggered by command-line options. */ + +#define M_OPTION_NOT_SEEN -1 +#define M_OPT_ABSENT(opt_enum) ((opt_enum) == M_OPTION_NOT_SEEN) + + +/* Internal representation of the target. */ +struct loongarch_isa +{ + unsigned char base; /* ISA_BASE_ */ + unsigned char fpu; /* ISA_EXT_FPU_ */ +}; + +struct loongarch_abi +{ + unsigned char base; /* ABI_BASE_ */ + unsigned char ext; /* ABI_EXT_ */ +}; + +struct loongarch_target +{ + struct loongarch_isa isa; + struct loongarch_abi abi; + unsigned char cpu_arch; /* CPU_ */ + unsigned char cpu_tune; /* same */ + unsigned char cpu_native; /* same */ + unsigned char cmodel; /* CMODEL_ */ +}; + +/* CPU properties. */ +/* index */ +#define CPU_NATIVE 0 +#define CPU_LOONGARCH64 1 +#define CPU_LA464 2 +#define N_ARCH_TYPES 3 +#define N_TUNE_TYPES 3 + +/* parallel tables. */ +extern const char* loongarch_cpu_strings[]; +extern struct loongarch_isa loongarch_cpu_default_isa[]; +extern int loongarch_cpu_issue_rate[]; +extern int loongarch_cpu_multipass_dfa_lookahead[]; + +extern struct loongarch_cache loongarch_cpu_cache[]; +extern struct loongarch_rtx_cost_data loongarch_cpu_rtx_cost_data[]; + +#ifdef __cplusplus +} +#endif +#endif /* LOONGARCH_DEF_H */ diff --git a/gcc/config/loongarch/loongarch-driver.cc b/gcc/config/loongarch/loongarch-driver.cc new file mode 100644 index 00000000000..0adcc923b7d --- /dev/null +++ b/gcc/config/loongarch/loongarch-driver.cc @@ -0,0 +1,187 @@ +/* Subroutines for the gcc driver. + Copyright (C) 2021-2022 Free Software Foundation, Inc. + Contributed by Loongson Ltd. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#define IN_TARGET_CODE 1 + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "obstack.h" +#include "diagnostic-core.h" + +#include "loongarch-opts.h" +#include "loongarch-driver.h" + +static int + opt_arch_driver = M_OPTION_NOT_SEEN, + opt_tune_driver = M_OPTION_NOT_SEEN, + opt_fpu_driver = M_OPTION_NOT_SEEN, + opt_abi_base_driver = M_OPTION_NOT_SEEN, + opt_abi_ext_driver = M_OPTION_NOT_SEEN, + opt_cmodel_driver = M_OPTION_NOT_SEEN; + +int opt_switches = 0; + +/* This flag is set to 1 if we believe that the user might be avoiding + linking (implicitly) against something from the startfile search paths. */ +static int no_link = 0; + +#define LARCH_DRIVER_SET_M_FLAG(OPTS_ARRAY, N_OPTS, FLAG, STR) \ + for (int i = 0; i < (N_OPTS); i++) \ + { \ + if ((OPTS_ARRAY)[i] != 0) \ + if (strcmp ((STR), (OPTS_ARRAY)[i]) == 0) \ + (FLAG) = i; \ + } + +/* Use the public obstack from the gcc driver (defined in gcc.c). + This is for allocating space for the returned string. */ +extern struct obstack opts_obstack; + +#define APPEND_LTR(S) \ + obstack_grow (&opts_obstack, (const void*) (S), \ + sizeof ((S)) / sizeof (char) -1) + +#define APPEND_VAL(S) \ + obstack_grow (&opts_obstack, (const void*) (S), strlen ((S))) + + +const char* +driver_set_m_flag (int argc, const char **argv) +{ + int parm_off = 0; + + if (argc != 1) + return "%eset_m_flag requires exactly 1 argument."; + +#undef PARM +#define PARM (argv[0] + parm_off) + +/* Note: sizeof (OPTSTR_##NAME) equals the length of "\tSet to be the multiarch include subdirectory." msgstr "" #: common.opt:3433 -#, fuzzy, no-c-format -#| msgid " -o Place the output into \n" +#, no-c-format msgid "-o \tPlace output into ." -msgstr " -o Spremi izlaz u \n" +msgstr "-o \tSmjesti (upiše) izlaz u ." #: common.opt:3437 #, no-c-format @@ -14964,10 +14936,9 @@ msgid "Suppress warnings." msgstr "" #: common.opt:3537 -#, fuzzy, no-c-format -#| msgid " -shared Create a shared library\n" +#, no-c-format msgid "Create a shared library." -msgstr " -shared Napravi dijeljenu biblioteku\n" +msgstr "Stvori zajedničku (dijeljenu) biblioteku." #: common.opt:3589 #, no-c-format @@ -15095,10 +15066,9 @@ msgid "The smallest number of different values for which it is best to use a jum msgstr "" #: params.opt:111 -#, fuzzy, no-c-format -#| msgid "Probability that COMDAT function will be shared with different compilation unit" +#, no-c-format msgid "Probability that COMDAT function will be shared with different compilation unit." -msgstr "Vjerojatnost da će se COMDAT funkcija dijeliti s drugom kompilacijskom jedinicom" +msgstr "Vjerojatnost da će COMDAT funkcija biti dijeljena s različitom kompilacijskom jedinicom." #: params.opt:115 #, no-c-format @@ -15276,10 +15246,9 @@ msgid "How much can given compilation unit grow because of the interprocedural c msgstr "" #: params.opt:270 -#, fuzzy, no-c-format -#| msgid "The size of function body to be considered large" +#, no-c-format msgid "The size of translation unit that IPA-CP pass considers large." -msgstr "Veličina tijela funkcije koja se smatra velikom" +msgstr "Veličina jedinice prijevoda koju IPA-CP prolaz smatra velikom." #: params.opt:274 #, no-c-format @@ -15407,16 +15376,14 @@ msgid "Maximal growth due to inlining of large function (in percent)." msgstr "" #: params.opt:382 -#, fuzzy, no-c-format -#| msgid "The size of function body to be considered large" +#, no-c-format msgid "The size of function body to be considered large." -msgstr "Veličina tijela funkcije koja se smatra velikom" +msgstr "Veličina tijela funkcije koja se smatra velikom." #: params.opt:386 -#, fuzzy, no-c-format -#| msgid "The size of stack frame to be considered large" +#, no-c-format msgid "The size of stack frame to be considered large." -msgstr "Veličina okvira stoga koja se smatra velikom" +msgstr "Veličina okvira stoga koja se smatra velikim." #: params.opt:390 #, no-c-format @@ -15424,10 +15391,9 @@ msgid "Maximal stack frame growth due to inlining (in percent)." msgstr "" #: params.opt:394 -#, fuzzy, no-c-format -#| msgid "The size of function body to be considered large" +#, no-c-format msgid "The size of translation unit to be considered large." -msgstr "Veličina tijela funkcije koja se smatra velikom" +msgstr "Veličina jedinice prijevoda koja se smatra velikom." #: params.opt:398 #, no-c-format @@ -15550,10 +15516,9 @@ msgid "The maximum length of path considered in cse." msgstr "" #: params.opt:494 -#, fuzzy, no-c-format -#| msgid "The maximum amount of memory to be allocated by GCSE" +#, no-c-format msgid "The maximum memory locations recorded by cselib." -msgstr "Najveća količina memorije koju će alocirati GCSE" +msgstr "Maksimalni broj memorijskih lokacija zabilježenih s cselib." #: params.opt:498 #, no-c-format @@ -15601,10 +15566,9 @@ msgid "The maximum ratio of insertions to deletions of expressions in GCSE." msgstr "" #: params.opt:534 -#, fuzzy, no-c-format -#| msgid "The maximum amount of memory to be allocated by GCSE" +#, no-c-format msgid "The maximum amount of memory to be allocated by GCSE, in kilobytes." -msgstr "Najveća količina memorije koju će alocirati GCSE" +msgstr "Maksimalna količina memorije koju GCSE dodijeli, u kilobajtima." #: params.opt:538 #, no-c-format @@ -16336,7 +16300,7 @@ msgstr "" #: collect-utils.cc:206 #, c-format msgid "[cannot find %s]" -msgstr "[ne mogu naći %s]" +msgstr "[nije moguće naći %s]" #: collect2.cc:1557 #, c-format @@ -16370,7 +16334,7 @@ msgstr[2] "" #: collect2.cc:1825 #, c-format msgid "[Leaving %s]\n" -msgstr "[Napuštam %s]\n" +msgstr "[Napuštamo %s]\n" #: collect2.cc:2055 #, c-format @@ -16410,38 +16374,22 @@ msgstr "" #: diagnostic.cc:622 #, c-format msgid "compilation terminated due to -fmax-errors=%u.\n" -msgstr "kompajliranje prekinuto zbog -fmax-errors=%u.\n" +msgstr "kompilacija je prekinuta zbog -fmax-errors=%u.\n" #: diagnostic.cc:650 #, c-format msgid "compilation terminated due to -Wfatal-errors.\n" -msgstr "kompajliranje prekinuto zbog -Wfatal-errors.\n" +msgstr "kompilacija je prekinuta zbog -Wfatal-errors.\n" #: diagnostic.cc:671 -#, fuzzy, c-format -#| msgid "" -#| "Please submit a full bug report,\n" -#| "with preprocessed source if appropriate.\n" -#| "See %s for instructions.\n" +#, c-format msgid "Please submit a full bug report, with preprocessed source.\n" -msgstr "" -"Molim pošaljite prijavu greške,\n" -"s pretprocesiranim izvornim kodom\n" -"ako je moguće.\n" -"Pogledajte %s za upute.\n" +msgstr "Pošaljite cjelovito izvješće o grešci, s prethodno obrađenim izvorom.\n" #: diagnostic.cc:674 -#, fuzzy, c-format -#| msgid "" -#| "Please submit a full bug report,\n" -#| "with preprocessed source if appropriate.\n" -#| "See %s for instructions.\n" +#, c-format msgid "Please submit a full bug report, with preprocessed source (by using -freport-bug).\n" -msgstr "" -"Molim pošaljite prijavu greške,\n" -"s pretprocesiranim izvornim kodom\n" -"ako je moguće.\n" -"Pogledajte %s za upute.\n" +msgstr "Pošaljite cjelovito izvješće o grešci, s prethodno obrađenim izvorom (koristeći -freport-bug).\n" #: diagnostic.cc:678 #, c-format @@ -16456,7 +16404,7 @@ msgstr "" #: diagnostic.cc:689 #, c-format msgid "compilation terminated.\n" -msgstr "kompajliranje prekinuto.\n" +msgstr "kompilacija je prekinuta.\n" #: diagnostic.cc:783 msgid " from" @@ -16492,13 +16440,12 @@ msgstr "" #: diagnostic.cc:1362 #, c-format msgid "%s:%d: confused by earlier errors, bailing out\n" -msgstr "%s:%d: zbunjen prethodnim greškama, odustajem\n" +msgstr "%s:%d: zbunjeni prethodnim greškama, odustajemo\n" #: diagnostic.cc:1997 -#, fuzzy, c-format -#| msgid "Internal compiler error: Error reporting routines re-entered.\n" +#, c-format msgid "internal compiler error: error reporting routines re-entered.\n" -msgstr "Interna greška kompajlera: Ponovni ulazak u potprograme za prijavu grešaka.\n" +msgstr "Interna greška kompajlera: rutine za prijavu grešaka iznova prozvane.\n" #: diagnostic.cc:2028 diagnostic.cc:2047 #, gcc-internal-format, gfc-internal-format @@ -16507,15 +16454,15 @@ msgstr "" #: final.cc:1113 msgid "negative insn length" -msgstr "negativna insn duljina" +msgstr "negativna duljina instrukcije" #: final.cc:2861 msgid "could not split insn" -msgstr "ne mogu razdvojiti insn" +msgstr "nije moguće razdijeliti instrukciju" #: final.cc:3228 msgid "invalid 'asm': " -msgstr "neispravni „asm”: " +msgstr "nevaljani „asm“: " #: final.cc:3361 #, c-format @@ -16535,7 +16482,7 @@ msgstr "" #: final.cc:3546 final.cc:3587 #, c-format msgid "operand number out of range" -msgstr "broj operanada je izvan granica" +msgstr "broj operanda je izvan granica" #: final.cc:3604 #, c-format @@ -16545,7 +16492,7 @@ msgstr "neispravni %%-kod" #: final.cc:3638 #, c-format msgid "'%%l' operand isn't a label" -msgstr "operand „%%l” nije oznaka" +msgstr "operand „%%l“ nije oznaka" #. We can't handle floating point constants; #. PRINT_OPERAND must handle them. @@ -16560,7 +16507,7 @@ msgstr "" #: config/pdp11/pdp11.cc:1872 #, c-format msgid "invalid expression as operand" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani izraz kao operand" #: gcc.cc:119 #, c-format @@ -16626,235 +16573,202 @@ msgstr "Opcije:\n" #: gcc.cc:3759 msgid " -pass-exit-codes Exit with highest error code from a phase.\n" -msgstr "" +msgstr " -pass-exit-codes iziđe s najvišim kodom greške u fazi\n" #: gcc.cc:3760 -#, fuzzy -#| msgid " --help Display this information\n" msgid " --help Display this information.\n" -msgstr " --help Prikaži ove informacije\n" +msgstr " --help ova prikazana pomoć\n" #: gcc.cc:3761 -#, fuzzy -#| msgid " --help Display this information\n" msgid " --target-help Display target specific command line options.\n" -msgstr " --help Prikaži ove informacije\n" +msgstr " --target-help specifične opcije naredbenog retka za cilj\n" #: gcc.cc:3762 msgid " --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].\n" msgstr "" #: gcc.cc:3763 -#, fuzzy -#| msgid " --help Display this information\n" msgid " Display specific types of command line options.\n" -msgstr " --help Prikaži ove informacije\n" +msgstr " Pokaže specifične vrste opcija naredbenog retka.\n" #: gcc.cc:3765 msgid " (Use '-v --help' to display command line options of sub-processes).\n" -msgstr "" +msgstr " (Koristite „-v --help“ za prikaz opcija potprocesa).\n" #: gcc.cc:3766 -#, fuzzy -#| msgid " --version Display compiler version information\n" msgid " --version Display compiler version information.\n" -msgstr " --version Prikaži informacije o inačici kompajlera\n" +msgstr " --version informacije o inačici kompajlera\n" #: gcc.cc:3767 -#, fuzzy -#| msgid " -dumpversion Display the version of the compiler\n" msgid " -dumpspecs Display all of the built in spec strings.\n" -msgstr " -dumpversion Prikaži inačicu kompajlera\n" +msgstr " -dumpspecs svi ugrađeni specifikacijski stringovi\n" #: gcc.cc:3768 -#, fuzzy -#| msgid " -dumpversion Display the version of the compiler\n" msgid " -dumpversion Display the version of the compiler.\n" -msgstr " -dumpversion Prikaži inačicu kompajlera\n" +msgstr " -dumpversion inačica kompajlera\n" #: gcc.cc:3769 -#, fuzzy -#| msgid " -dumpversion Display the version of the compiler\n" msgid " -dumpmachine Display the compiler's target processor.\n" -msgstr " -dumpversion Prikaži inačicu kompajlera\n" +msgstr " -dumpmachine ciljni procesor kompajlera\n" #: gcc.cc:3770 msgid " -foffload= Specify offloading targets.\n" -msgstr "" +msgstr " -foffload= spcificira offloading targets (ciljeve)\n" #: gcc.cc:3771 -#, fuzzy -#| msgid " -dumpversion Display the version of the compiler\n" msgid " -print-search-dirs Display the directories in the compiler's search path.\n" -msgstr " -dumpversion Prikaži inačicu kompajlera\n" +msgstr " -print-search-dirs direktoriji na stazi pretraživanja kompajlera\n" #: gcc.cc:3772 msgid " -print-libgcc-file-name Display the name of the compiler's companion library.\n" -msgstr "" +msgstr " -print-libgcc-file-name ime popratne biblioteke kompajlera\n" #: gcc.cc:3773 msgid " -print-file-name= Display the full path to library .\n" -msgstr "" +msgstr " -print-file-name= potpuna staza do biblioteke \n" #: gcc.cc:3774 msgid " -print-prog-name= Display the full path to compiler component .\n" -msgstr "" +msgstr " -print-prog-name= potpuna staza do komponente kompajlera\n" #: gcc.cc:3775 msgid "" " -print-multiarch Display the target's normalized GNU triplet, used as\n" " a component in the library path.\n" msgstr "" +" -print-multiarch ciljni normalizirani GNU triplet, koji se koristi\n" +" kao komponenta staze do biblioteke\n" +"\n" #: gcc.cc:3778 msgid " -print-multi-directory Display the root directory for versions of libgcc.\n" -msgstr "" +msgstr " -print-multi-directory root direktorij za inačice od libgcc\n" #: gcc.cc:3779 msgid "" " -print-multi-lib Display the mapping between command line options and\n" " multiple library search directories.\n" msgstr "" +" -print-multi-lib mapiranje između opcija naredbenog retka i\n" +" višestrukih direktorija za traženje biblioteka\n" #: gcc.cc:3782 msgid " -print-multi-os-directory Display the relative path to OS libraries.\n" -msgstr "" +msgstr " -print-multi-os-directory relativne staze do OS biblioteka\n" #: gcc.cc:3783 -#, fuzzy -#| msgid " -dumpversion Display the version of the compiler\n" msgid " -print-sysroot Display the target libraries directory.\n" -msgstr " -dumpversion Prikaži inačicu kompajlera\n" +msgstr " -print-sysroot direktorij ciljnih biblioteka\n" #: gcc.cc:3784 msgid " -print-sysroot-headers-suffix Display the sysroot suffix used to find headers.\n" -msgstr "" +msgstr " -print-sysroot-headers-suffix sysroot sufiks koji se koristi da nađe zaglavlja\n" #: gcc.cc:3785 msgid " -Wa, Pass comma-separated on to the assembler.\n" -msgstr "" +msgstr " -Wa, proslijedi zarezom odvojene asembleru\n" #: gcc.cc:3786 msgid " -Wp, Pass comma-separated on to the preprocessor.\n" -msgstr "" +msgstr " -Wp, proslijedi zarezom odvojene pretprocesoru\n" #: gcc.cc:3787 msgid " -Wl, Pass comma-separated on to the linker.\n" -msgstr "" +msgstr " -Wl, proslijedi zarezom odvojene linkeru\n" #: gcc.cc:3788 msgid " -Xassembler Pass on to the assembler.\n" -msgstr "" +msgstr " -Xassembler proslijedi asembleru\n" #: gcc.cc:3789 msgid " -Xpreprocessor Pass on to the preprocessor.\n" -msgstr "" +msgstr " -Xpreprocessor proslijedi pretprocesoru\n" #: gcc.cc:3790 msgid " -Xlinker Pass on to the linker.\n" -msgstr "" +msgstr " -Xlinker proslijedi linkeru\n" #: gcc.cc:3791 -#, fuzzy -#| msgid " -pipe Use pipes rather than intermediate files\n" msgid " -save-temps Do not delete intermediate files.\n" -msgstr " -pipe Koristi cjevovode umjesto posrednih datoteka\n" +msgstr " -save-temps ne briše posredne datoteke\n" #: gcc.cc:3792 msgid " -save-temps= Do not delete intermediate files.\n" -msgstr "" +msgstr " -save-temps= ne briše posredne datoteke\n" #: gcc.cc:3793 msgid "" " -no-canonical-prefixes Do not canonicalize paths when building relative\n" " prefixes to other gcc components.\n" msgstr "" +" -no-canonical-prefixes ne kanonizira staze kad gradi relativne prefikse\n" +" drugim gcc komponentama\n" #: gcc.cc:3796 -#, fuzzy -#| msgid " -pipe Use pipes rather than intermediate files\n" msgid " -pipe Use pipes rather than intermediate files.\n" -msgstr " -pipe Koristi cjevovode umjesto posrednih datoteka\n" +msgstr " -pipe koristi cijevi umjesto posrednih datoteka\n" #: gcc.cc:3797 -#, fuzzy -#| msgid " -time Time the execution of each subprocess\n" msgid " -time Time the execution of each subprocess.\n" -msgstr " -time Vrijeme izvršavanja svakog potprocesa\n" +msgstr " -time mjeri vrijem izvršavanja svakog potprocesa\n" #: gcc.cc:3798 -#, fuzzy -#| msgid " -o Place the output into \n" msgid " -specs= Override built-in specs with the contents of .\n" -msgstr " -o Spremi izlaz u \n" +msgstr " -specs= nadjača ugrađene specifikacije sa sadržajem od \n" #: gcc.cc:3799 msgid " -std= Assume that the input sources are for .\n" -msgstr "" +msgstr " -std= pretpostavi da su ulazni izvori za \n" #: gcc.cc:3800 -#, fuzzy -#| msgid "" -#| " --sysroot= Use as the root directory for headers\n" -#| " and libraries\n" msgid "" " --sysroot= Use as the root directory for headers\n" " and libraries.\n" msgstr "" -" --sysroot= Koristi kao korijenski direktorij\n" -" za zaglavlja i biblioteke\n" +" --sysroot= koristi kao root direktorij za zaglavlja\n" +" i biblioteke\n" #: gcc.cc:3803 msgid " -B Add to the compiler's search paths.\n" -msgstr "" +msgstr " -B doda stazama koje pretražuje kompajler\n" #: gcc.cc:3804 -#, fuzzy -#| msgid " -v Display the programs invoked by the compiler\n" msgid " -v Display the programs invoked by the compiler.\n" -msgstr " -v Prikaži programe koje poziva kompajler\n" +msgstr " -v izlista programe pokrenute (pozvane) kompajlerom\n" #: gcc.cc:3805 -#, fuzzy -#| msgid " -### Like -v but options quoted and commands not executed\n" msgid " -### Like -v but options quoted and commands not executed.\n" -msgstr "" -" -### Kao -v ali prikaži opcije pod navodnicima i\n" -" naredbe koje se ne izvršavaju\n" +msgstr " -### isto kao -v ali navede opcije i neizvršene naredbe\n" #: gcc.cc:3806 -#, fuzzy -#| msgid " -v Display the programs invoked by the compiler\n" msgid " -E Preprocess only; do not compile, assemble or link.\n" -msgstr " -v Prikaži programe koje poziva kompajler\n" +msgstr "" +" -E samo pretprocesi; ne kompilira, ne asemblira,\n" +" ne linka\n" #: gcc.cc:3807 msgid " -S Compile only; do not assemble or link.\n" -msgstr "" +msgstr " -S samo kompilira; ne asemblira, ne linka\n" #: gcc.cc:3808 -#, fuzzy -#| msgid " -h, --help Print this help, then exit\n" msgid " -c Compile and assemble, but do not link.\n" -msgstr " -h, --help Ispiši ovu pomoć, zatim izađi\n" +msgstr " -c kompilira i asemblira, ali ne linka\n" #: gcc.cc:3809 -#, fuzzy -#| msgid " -o Place the output into \n" msgid " -o Place the output into .\n" -msgstr " -o Spremi izlaz u \n" +msgstr " -o zapiše izlaz u datoteku \n" #: gcc.cc:3810 msgid "" " -pie Create a dynamically linked position independent\n" " executable.\n" msgstr "" +" -pie stvori dinamički linkanu (position independent)\n" +" izvršnu datoteku\n" #: gcc.cc:3812 -#, fuzzy -#| msgid " -shared Create a shared library\n" msgid " -shared Create a shared library.\n" -msgstr " -shared Napravi dijeljenu biblioteku\n" +msgstr " -shared stvori zajedničku (dijeljenu) biblioteku\n" #: gcc.cc:3813 msgid "" @@ -16872,36 +16786,40 @@ msgid "" " passed on to the various sub-processes invoked by %s. In order to pass\n" " other options on to these processes the -W options must be used.\n" msgstr "" +"\n" +"Opcije koje započinju s -g, -f, -m, -O, -W, or --param se automatski proslijede\n" +" raznim potprocesima pokrenutim s %s. Da bi proslijedili ostale opcije na te\n" +" potprocese, morate koristiti -W.\n" #: gcc.cc:6789 #, c-format msgid "Processing spec (%s), which is '%s'\n" -msgstr "" +msgstr "Obrađujemo specifikaciju (%s), koja je „%s“\n" #: gcc.cc:7550 #, c-format msgid "Target: %s\n" -msgstr "" +msgstr "Cilj: %s\n" #: gcc.cc:7551 #, c-format msgid "Configured with: %s\n" -msgstr "" +msgstr "Konfiguriran s: %s\n" #: gcc.cc:7565 #, c-format msgid "Thread model: %s\n" -msgstr "" +msgstr "Model dretve: %s\n" #: gcc.cc:7566 #, c-format msgid "Supported LTO compression algorithms: zlib" -msgstr "" +msgstr "Podržani algoritam kompresije: zlib" #: gcc.cc:7568 #, c-format msgid " zstd" -msgstr "" +msgstr " zstd" #: gcc.cc:7570 gcov.cc:1510 gcov.cc:1568 gcov.cc:1580 gcov.cc:2894 #, c-format @@ -16916,7 +16834,7 @@ msgstr "gcc inačica %s %s\n" #: gcc.cc:7584 #, c-format msgid "gcc driver version %s %sexecuting gcc version %s\n" -msgstr "" +msgstr "inačica drajvera %s %s izvršava gcc inačicu %s\n" #: gcc.cc:7657 gcc.cc:7867 #, c-format @@ -16931,12 +16849,12 @@ msgstr "" #: gcc.cc:8642 #, c-format msgid "install: %s%s\n" -msgstr "" +msgstr "instalacija: %s%s\n" #: gcc.cc:8645 #, c-format msgid "programs: %s\n" -msgstr "" +msgstr "programi: %s\n" #: gcc.cc:8647 #, c-format @@ -16950,7 +16868,7 @@ msgid "" "For bug reporting instructions, please see:\n" msgstr "" "\n" -"Za upute o prijavljivanju grešaka, molim pogledajte:\n" +"Za upute o prijavljivanju grešaka pogledajte:\n" #: gcc.cc:8780 gcov-tool.cc:527 #, c-format @@ -16980,6 +16898,10 @@ msgid "" "==============\n" "\n" msgstr "" +"\n" +"Opcije linkera\n" +"==============\n" +"\n" #: gcc.cc:9128 #, c-format @@ -16987,6 +16909,8 @@ msgid "" "Use \"-Wl,OPTION\" to pass \"OPTION\" to the linker.\n" "\n" msgstr "" +"Koristite „-Wl,OPCIJA“ da proslijedite „OPCIJA“ linkeru.\n" +"\n" #: gcc.cc:10543 #, c-format @@ -16995,6 +16919,9 @@ msgid "" "=================\n" "\n" msgstr "" +"Opcije asemblera\n" +"=================\n" +"\n" #: gcc.cc:10544 #, c-format @@ -17002,97 +16929,93 @@ msgid "" "Use \"-Wa,OPTION\" to pass \"OPTION\" to the assembler.\n" "\n" msgstr "" +"Koristite „-Wa,OPCIJA“ da proslijedite „OPCIJA“ asembleru.\n" +"\n" #: gcov-tool.cc:175 #, c-format msgid " merge [options] Merge coverage file contents\n" -msgstr "" +msgstr " merge [opcije] spoji sadržaj datoteka pokrivenosti\n" #: gcov-tool.cc:176 gcov-tool.cc:271 -#, fuzzy, c-format -#| msgid " -n, --no-output Do not create an output file\n" +#, c-format msgid " -o, --output Output directory\n" -msgstr " -n, --no-output Nemoj raditi izlazne datoteke\n" +msgstr " -o, --output direktorij za izlaz podataka\n" #: gcov-tool.cc:177 gcov-tool.cc:273 gcov-tool.cc:425 -#, fuzzy, c-format -#| msgid " -v, --version Print version number, then exit\n" +#, c-format msgid " -v, --verbose Verbose mode\n" -msgstr " -v, --version Ispiši broj inačice, zatim izađi\n" +msgstr " -v, --verbose opširnije informacije\n" #: gcov-tool.cc:178 #, c-format msgid " -w, --weight Set weights (float point values)\n" -msgstr "" +msgstr " -w, --weight postavi skale (float point values)\n" #: gcov-tool.cc:194 #, c-format msgid "Merge subcomand usage:" -msgstr "" +msgstr "Uporaba podnaredbe merge:" #: gcov-tool.cc:269 #, c-format msgid " rewrite [options] Rewrite coverage file contents\n" -msgstr "" +msgstr " rewrite [opcije] prepiše sadržaj datoteke pokrivenosti\n" #: gcov-tool.cc:270 #, c-format msgid " -n, --normalize Normalize the profile\n" -msgstr "" +msgstr " -n, --normalize normalizira profil\n" #: gcov-tool.cc:272 #, c-format msgid " -s, --scale Scale the profile counters\n" -msgstr "" +msgstr " -s, --scale skalira profiliranje brojila\n" #: gcov-tool.cc:290 #, c-format msgid "Rewrite subcommand usage:" -msgstr "" +msgstr "Uporaba podnaredbe rewrite:" #: gcov-tool.cc:329 #, c-format msgid "scaling cannot co-exist with normalization, skipping\n" -msgstr "" +msgstr "skaliranje ne može koegzistirati s normalizacijom, preskačemo\n" #: gcov-tool.cc:342 gcov-tool.cc:352 #, c-format msgid "incorrect format in scaling, using 1/1\n" -msgstr "" +msgstr "nekorektni format u skaliranju, koristimo 1/1\n" #: gcov-tool.cc:362 #, c-format msgid "normalization cannot co-exist with scaling\n" -msgstr "" +msgstr "normalizacija ne može koegzistirati sa skaliranjem\n" #: gcov-tool.cc:419 #, c-format msgid " overlap [options] Compute the overlap of two profiles\n" -msgstr "" +msgstr " overlap [opcije] računa preklapanje dvaju profila\n" #: gcov-tool.cc:420 -#, fuzzy, c-format -#| msgid " -h, --help Print this help, then exit\n" +#, c-format msgid " -f, --function Print function level info\n" -msgstr " -h, --help Ispiši ovu pomoć, zatim izađi\n" +msgstr " -f, --function ispiše informaciju razine funkcije\n" #: gcov-tool.cc:421 -#, fuzzy, c-format -#| msgid " -h, --help Print this help, then exit\n" +#, c-format msgid " -F, --fullname Print full filename\n" -msgstr " -h, --help Ispiši ovu pomoć, zatim izađi\n" +msgstr " -F, --fullname ispiše potpuno ime datoteke\n" #: gcov-tool.cc:422 -#, fuzzy, c-format -#| msgid " -h, --help Print this help, then exit\n" +#, c-format msgid " -h, --hotonly Only print info for hot objects/functions\n" -msgstr " -h, --help Ispiši ovu pomoć, zatim izađi\n" +msgstr "" #: gcov-tool.cc:423 -#, fuzzy, c-format -#| msgid " -h, --help Print this help, then exit\n" +#, c-format msgid " -o, --object Print object level info\n" -msgstr " -h, --help Ispiši ovu pomoć, zatim izađi\n" +msgstr " -o, --object ispiše informacije razine objekta\n" #: gcov-tool.cc:424 #, c-format @@ -17102,18 +17025,15 @@ msgstr "" #: gcov-tool.cc:444 #, c-format msgid "Overlap subcomand usage:" -msgstr "" +msgstr "Uporaba podnaredbe overlap:" #: gcov-tool.cc:510 -#, fuzzy, c-format -#| msgid "" -#| "Usage: gcov [OPTION]... SOURCE|OBJ...\n" -#| "\n" +#, c-format msgid "" "Usage: %s [OPTION]... SUB_COMMAND [OPTION]...\n" "\n" msgstr "" -"Uporaba: gcov [OPCIJA]... IZVOR|OBJ...\n" +"Uporaba: %s [OPCIJA]... PODNAREDBA [OPCIJA]...\n" "\n" #: gcov-tool.cc:511 @@ -17122,18 +17042,18 @@ msgid "" "Offline tool to handle gcda counts\n" "\n" msgstr "" +"Samostalni (vanjski) alat za rad s gcda brojilom\n" +"\n" #: gcov-tool.cc:512 -#, fuzzy, c-format -#| msgid " -h, --help Print this help, then exit\n" +#, c-format msgid " -h, --help Print this help, then exit\n" -msgstr " -h, --help Ispiši ovu pomoć, zatim izađi\n" +msgstr " -h, --help ispiše ovu pomoć, pa iziđe\n" #: gcov-tool.cc:513 -#, fuzzy, c-format -#| msgid " -v, --version Print version number, then exit\n" +#, c-format msgid " -v, --version Print version number, then exit\n" -msgstr " -v, --version Ispiši broj inačice, zatim izađi\n" +msgstr " -v, --version ispiše broj inačice, pa iziđe\n" #: gcov-tool.cc:517 gcov.cc:956 #, c-format @@ -17149,18 +17069,15 @@ msgstr "" #: gcov-tool.cc:528 #, c-format msgid "Copyright %s 2022 Free Software Foundation, Inc.\n" -msgstr "" +msgstr "Copyright %s 2022 Free Software Foundation, Inc.\n" #: gcov.cc:925 -#, fuzzy, c-format -#| msgid "" -#| "Usage: gcov [OPTION]... SOURCE|OBJ...\n" -#| "\n" +#, c-format msgid "" "Usage: gcov [OPTION...] SOURCE|OBJ...\n" "\n" msgstr "" -"Uporaba: gcov [OPCIJA]... IZVOR|OBJ...\n" +"Uporaba: gcov [OPCIJA...] IZVOR|OBJ...\n" "\n" #: gcov.cc:926 @@ -17169,43 +17086,47 @@ msgid "" "Print code coverage information.\n" "\n" msgstr "" +"Pokaže podatke o pokrivenosti kȏda.\n" +"\n" #: gcov.cc:927 #, c-format msgid " -a, --all-blocks Show information for every basic block\n" -msgstr " -a, --all-blocks Prikaži informacije za svaki temeljni blok\n" +msgstr " -a, --all-blocks pokaže podatke za svaki temeljni blok\n" #: gcov.cc:928 #, c-format msgid " -b, --branch-probabilities Include branch probabilities in output\n" msgstr "" +" -b, --branch-probabilities uključi vjerojatnost grananja na izlazu\n" +"\n" #: gcov.cc:929 #, c-format msgid "" " -c, --branch-counts Output counts of branches taken\n" " rather than percentages\n" -msgstr "" +msgstr " -c, --branch-counts ispiše količine (broj) grana a ne postotak\n" #: gcov.cc:931 #, c-format msgid " -d, --display-progress Display progress information\n" -msgstr " -d, --display-progress Prikaži podatke o napredovanju\n" +msgstr " -d, --display-progress pokaže podatke o napredovanju\n" #: gcov.cc:932 #, c-format msgid " -D, --debug\t\t\t Display debugging dumps\n" -msgstr "" +msgstr " -D, --debug\t\t\t pokaže dijagnostičke podatke\n" #: gcov.cc:933 #, c-format msgid " -f, --function-summaries Output summaries for each function\n" -msgstr " -f, --function-summaries Ispiši sažetke svake funkcije\n" +msgstr " -f, --function-summaries ispiše sažetke za svaku funkciju\n" #: gcov.cc:934 #, c-format msgid " -h, --help Print this help, then exit\n" -msgstr " -h, --help Ispiši ovu pomoć, zatim izađi\n" +msgstr " -h, --help ispiše ovu pomoć, pa iziđe\n" #: gcov.cc:935 #, c-format @@ -17213,104 +17134,108 @@ msgid "" " -j, --json-format Output JSON intermediate format\n" " into .gcov.json.gz file\n" msgstr "" +" -j, --json-format izlaz zapiše .gcov.json.gz datoteku\n" +" u JSON (intermediate) formatu\n" #: gcov.cc:937 #, c-format msgid " -H, --human-readable Output human readable numbers\n" -msgstr "" +msgstr " -H, --human-readable ispis brojaka u lako čitljivom obliku\n" #: gcov.cc:938 -#, fuzzy, c-format -#| msgid " -n, --no-output Do not create an output file\n" +#, c-format msgid " -k, --use-colors Emit colored output\n" -msgstr " -n, --no-output Nemoj raditi izlazne datoteke\n" +msgstr " -k, --use-colors koristi obojeni ispis\n" #: gcov.cc:939 #, c-format msgid "" " -l, --long-file-names Use long output file names for included\n" " source files\n" -msgstr "" +msgstr " -l, --long-file-names ispiše puna imena uključenih izvornih kódova\n" #: gcov.cc:941 #, c-format msgid " -m, --demangled-names Output demangled function names\n" msgstr "" +" -m, --demangled-names ispiše dešifrirana imena funkcija\n" +"\n" #: gcov.cc:942 #, c-format msgid " -n, --no-output Do not create an output file\n" -msgstr " -n, --no-output Nemoj raditi izlazne datoteke\n" +msgstr " -n, --no-output ne proizvodi izlazne datoteke\n" #: gcov.cc:943 #, c-format msgid " -o, --object-directory DIR|FILE Search for object files in DIR or called FILE\n" msgstr "" +" -o, --object-directory DIR|FILE traži objektne datoteke u direktoriju DIR\n" +" ili u pozvanoj datoteci FILE\n" #: gcov.cc:944 #, c-format msgid " -p, --preserve-paths Preserve all pathname components\n" -msgstr "" +msgstr " -p, --preserve-paths sačuva (spremi) sve komponente imena staze\n" #: gcov.cc:945 #, c-format msgid " -q, --use-hotness-colors Emit perf-like colored output for hot lines\n" -msgstr "" +msgstr " -q, --use-hotness-colors oboji izlaz u perf-stilu za vruće retke\n" #: gcov.cc:946 #, c-format msgid " -r, --relative-only Only show data for relative sources\n" -msgstr "" +msgstr " -r, --relative-only pokaže podatke samo za relativne izvore\n" #: gcov.cc:947 #, c-format msgid " -s, --source-prefix DIR Source prefix to elide\n" -msgstr "" +msgstr " -s, --source-prefix DIR izostavi prefiks izvora\n" #: gcov.cc:948 -#, fuzzy, c-format -#| msgid " -n, --no-output Do not create an output file\n" +#, c-format msgid " -t, --stdout Output to stdout instead of a file\n" -msgstr " -n, --no-output Nemoj raditi izlazne datoteke\n" +msgstr " -n, --no-output ne proizvodi izlazne datoteke\n" #: gcov.cc:949 #, c-format msgid " -u, --unconditional-branches Show unconditional branch counts too\n" -msgstr "" +msgstr " -u, --unconditional-branches pokaže i bezuvjetnu količinu (broj) grana\n" #: gcov.cc:950 #, c-format msgid " -v, --version Print version number, then exit\n" -msgstr " -v, --version Ispiši broj inačice, zatim izađi\n" +msgstr " -v, --version ispiše broj inačice, pa iziđe\n" #: gcov.cc:951 -#, fuzzy, c-format -#| msgid " -v, --version Print version number, then exit\n" +#, c-format msgid " -w, --verbose Print verbose informations\n" -msgstr " -v, --version Ispiši broj inačice, zatim izađi\n" +msgstr " -w, --verbose ispisuje opširnije informacije\n" #: gcov.cc:952 #, c-format msgid " -x, --hash-filenames Hash long pathnames\n" -msgstr "" +msgstr " -x, --hash-filenames hašira (hash) dugačka imena staza\n" #: gcov.cc:953 -#, fuzzy, c-format -#| msgid "Options:\n" +#, c-format msgid "" "\n" "Obsolete options:\n" -msgstr "Opcije:\n" +msgstr "" +"\n" +"Zastarjele opcije:\n" #: gcov.cc:954 #, c-format msgid " -i, --json-format Replaced with -j, --json-format\n" -msgstr "" +msgstr " -i, --json-format zamijenjeno s -j, --json-format\n" #: gcov.cc:955 #, c-format msgid " -j, --human-readable Replaced with -H, --human-readable\n" -msgstr "" +msgstr " -j, --human-readable zamijenjeno s -H, --human-readable\n" #: gcov.cc:966 #, c-format @@ -17320,167 +17245,162 @@ msgstr "gcov %s%s\n" #: gcov.cc:1354 #, c-format msgid "'%s' file is already processed\n" -msgstr "" +msgstr "„%s“ datoteka je već obrađena\n" #: gcov.cc:1470 gcov.cc:1599 #, c-format msgid "Creating '%s'\n" -msgstr "Stvaram „%s”\n" +msgstr "Stvaramo „%s”\n" #: gcov.cc:1474 #, c-format msgid "Error writing output file '%s'\n" -msgstr "" +msgstr "Greška pri pisanju izlazne datoteke „%s“\n" #: gcov.cc:1482 #, c-format msgid "Could not open output file '%s'\n" -msgstr "Ne mogu otvoriti izlaznu datoteku „%s”\n" +msgstr "Nije moguće otvoriti izlaznu datoteku „%s“\n" #: gcov.cc:1489 #, c-format msgid "Removing '%s'\n" -msgstr "Uklanjam „%s”\n" +msgstr "Uklanjamo „%s”\n" #: gcov.cc:1604 -#, fuzzy, c-format -#| msgid "Could not open output file '%s'\n" +#, c-format msgid "Cannot open JSON output file %s\n" -msgstr "Ne mogu otvoriti izlaznu datoteku „%s”\n" +msgstr "Nije moguće otvoriti izlaznu JSON datoteku %s\n" #: gcov.cc:1613 -#, fuzzy, c-format -#| msgid "Could not open output file '%s'\n" +#, c-format msgid "Error writing JSON output file %s\n" -msgstr "Ne mogu otvoriti izlaznu datoteku „%s”\n" +msgstr "Nije moguće zapisati izlaznu JSON datoteku %s\n" #: gcov.cc:1778 #, c-format msgid "%s:source file is newer than notes file '%s'\n" -msgstr "" +msgstr "%s:izvorni kȏd je noviji od datoteke s bilješkama „%s“\n" #: gcov.cc:1783 -#, fuzzy, c-format -#| msgid "(the message is only displayed one per source file)\n" +#, c-format msgid "(the message is displayed only once per source file)\n" -msgstr "(ova poruka se prikazuje samo jednom za datoteku koda)\n" +msgstr "(ova se poruka prikazuje samo jednom po izvornom kȏdu )\n" #: gcov.cc:1803 -#, fuzzy, c-format -#| msgid "Cannot open source file %s\n" +#, c-format msgid "%s:cannot open notes file\n" -msgstr "Ne mogu otvoriti datoteku koda %s\n" +msgstr "%s:nije moguće otvoriti datoteku s bilješkama\n" #: gcov.cc:1810 -#, fuzzy, c-format -#| msgid "%s:not a gcov data file\n" +#, c-format msgid "%s:not a gcov notes file\n" -msgstr "%s:nije gcov podatkovna datoteka\n" +msgstr "%s:nije gcov datoteka s bilješkama\n" #: gcov.cc:1824 #, c-format msgid "%s:version '%.4s', prefer '%.4s'\n" -msgstr "" +msgstr "%s:inačica '%.4s', ali preferira se '%.4s'\n" #: gcov.cc:1877 #, c-format msgid "%s:already seen blocks for '%s'\n" -msgstr "" +msgstr "%s:već viđeni blokovi za „%s“\n" #: gcov.cc:1993 gcov.cc:2107 #, c-format msgid "%s:corrupted\n" -msgstr "" +msgstr "%s:oštećen\n" #: gcov.cc:2001 #, c-format msgid "%s:no functions found\n" -msgstr "%s:nisu pronađene funkcije\n" +msgstr "%s:nijedna funkcija nije pronađena\n" #: gcov.cc:2019 #, c-format msgid "%s:cannot open data file, assuming not executed\n" -msgstr "" +msgstr "%s:nije moguće otvoriti, pretpostavljamo da ne radi\n" #: gcov.cc:2026 #, c-format msgid "%s:not a gcov data file\n" -msgstr "%s:nije gcov podatkovna datoteka\n" +msgstr "%s:nije gcov datoteka\n" #: gcov.cc:2040 #, c-format msgid "%s:version '%.4s', prefer version '%.4s'\n" -msgstr "" +msgstr "%s:inačica '%.4s', preferira se '%.4s'\n" #: gcov.cc:2047 #, c-format msgid "%s:stamp mismatch with notes file\n" -msgstr "" +msgstr "%s:nepodudaranje pečata s bilješkama\n" #: gcov.cc:2084 #, c-format msgid "%s:profile mismatch for '%s'\n" -msgstr "" +msgstr "%s:nepodudaranje profila za „%s“\n" #: gcov.cc:2106 #, c-format msgid "%s:overflowed\n" -msgstr "%s:preljev\n" +msgstr "%s:prelijevanje\n" #: gcov.cc:2154 #, c-format msgid "%s:'%s' lacks entry and/or exit blocks\n" -msgstr "%s:„%s” nema ulazni ili izlazni blok\n" +msgstr "%s:„%s“ nema ulazne i/ili izlazne blokove\n" #: gcov.cc:2159 #, c-format msgid "%s:'%s' has arcs to entry block\n" -msgstr "" +msgstr "%s:„%s“ ima lukove do ulaznog bloka\n" #: gcov.cc:2167 #, c-format msgid "%s:'%s' has arcs from exit block\n" -msgstr "" +msgstr "%s:„%s“ ima lukove od izlaznog bloka\n" #: gcov.cc:2376 #, c-format msgid "%s:graph is unsolvable for '%s'\n" -msgstr "" +msgstr "%s:graf je nerješiv za „%s“\n" #: gcov.cc:2492 #, c-format msgid "Lines executed:%s of %d\n" -msgstr "Izvršeno redaka:%s od %d\n" +msgstr "Izvršeno %s od %d\n" #: gcov.cc:2495 #, c-format msgid "No executable lines\n" -msgstr "" +msgstr "Nema izvršivih redaka\n" #: gcov.cc:2503 gcov.cc:2512 #, c-format msgid "%s '%s'\n" -msgstr "%s '%s'\n" +msgstr "%s „%s“\n" #: gcov.cc:2519 #, c-format msgid "Branches executed:%s of %d\n" -msgstr "" +msgstr "Izvršene %s grana od %d\n" #: gcov.cc:2523 #, c-format msgid "Taken at least once:%s of %d\n" -msgstr "" +msgstr "%s uzeto barem jednom od %d grana\n" #: gcov.cc:2529 #, c-format msgid "No branches\n" -msgstr "" +msgstr "Nema grana\n" #: gcov.cc:2531 #, c-format msgid "Calls executed:%s of %d\n" -msgstr "Izvršeno poziva:%s od %d\n" +msgstr "Izvršeno %s poziva od %d\n" #: gcov.cc:2535 #, c-format @@ -17495,27 +17415,27 @@ msgstr "%s:nema redaka za „%s”\n" #: gcov.cc:2874 #, c-format msgid "call %2d returned %s\n" -msgstr "" +msgstr "poziv %2d vratio %s\n" #: gcov.cc:2879 #, c-format msgid "call %2d never executed\n" -msgstr "" +msgstr "poziv %2d nikada izvršen\n" #: gcov.cc:2884 #, c-format msgid "branch %2d taken %s%s" -msgstr "" +msgstr "grana %2d uzeta %s%s" #: gcov.cc:2889 #, c-format msgid "branch %2d never executed" -msgstr "" +msgstr "grana %2d nikada izvršena" #: gcov.cc:2892 #, c-format msgid " (BB %d)" -msgstr "" +msgstr " (BB %d)" #: gcov.cc:2899 #, c-format @@ -17530,7 +17450,7 @@ msgstr "" #: gcov.cc:3154 #, c-format msgid "Cannot open source file %s\n" -msgstr "Ne mogu otvoriti datoteku koda %s\n" +msgstr "Nije moguće otvoriti izvorni kȏd %s\n" #: gcse.cc:2578 msgid "PRE disabled" @@ -17578,7 +17498,7 @@ msgstr "„" #. Closing quotation mark. #: intl.cc:65 msgid "'" -msgstr "”" +msgstr "“" #: langhooks.cc:384 msgid "At top level:" @@ -17675,10 +17595,9 @@ msgid " No options with the desired characteristics were found\n" msgstr " Nisu pronađene opcije sa željenim svojstvima\n" #: opts.cc:1783 -#, fuzzy, c-format -#| msgid " None found. Use --help=%s to show *all* the options supported by the %s front-end\n" +#, c-format msgid " None found. Use --help=%s to show *all* the options supported by the %s front-end.\n" -msgstr " Ništa nije pronađeno. Koristite --help=%s za prikaz *svih* opcija koje podržava sučelje %s\n" +msgstr " Nijedan nije nađen. Koristite --help=%s za ispis *svih* opcija koje podržava %s front-end sučelje.\n" #: opts.cc:1789 #, c-format @@ -17691,10 +17610,12 @@ msgid "" " Known valid arguments for %s option:\n" " " msgstr "" +" Znani valjani argument za %s opciju:\n" +" " #: opts.cc:1884 msgid "The following options are target specific" -msgstr "" +msgstr "Sljedeće opcije su specifične za cilj" #: opts.cc:1887 msgid "The following options control compiler warning messages" @@ -17702,17 +17623,15 @@ msgstr "Sljedeće opcije upravljaju porukama upozorenja kompajlera" #: opts.cc:1890 msgid "The following options control optimizations" -msgstr "Sljedeće opcije upravljaju optimizacijama" +msgstr "Sljedeće opcije upravljaju s optimiranjem" #: opts.cc:1893 opts.cc:1933 msgid "The following options are language-independent" msgstr "Sljedeće opcije su neovisne o jeziku" #: opts.cc:1896 -#, fuzzy -#| msgid "The following options control optimizations" msgid "The following options control parameters" -msgstr "Sljedeće opcije upravljaju optimizacijama" +msgstr "Sljedeće opcije upravljaju s parametrima" #: opts.cc:1902 msgid "The following options are specific to just the language " @@ -17790,24 +17709,20 @@ msgstr "insn ne zadovoljava svoja ograničenja:" #: targhooks.cc:2157 #, c-format msgid "created and used with differing settings of '%s'" -msgstr "napravljeno i korišteno s različitim postavkama „%s”" +msgstr "stvoren i korišten s različitim postavkama „%s”" #: targhooks.cc:2172 -#, fuzzy -#| msgid "created and used with different settings of -fpic" msgid "created and used with different settings of %<-fpic%>" -msgstr "napravljeno i korišteno s različitim postavkama -fpic" +msgstr "stvoren i korišten s različitim postavkama %<-fpic%>" #: targhooks.cc:2174 -#, fuzzy -#| msgid "created and used with different settings of -fpie" msgid "created and used with different settings of %<-fpie%>" -msgstr "napravljeno i korišteno s različitim postavkama -fpie" +msgstr "stvoren i korišten s različitim postavkama of %<-fpie%>" #: toplev.cc:318 #, c-format msgid "unrecoverable error" -msgstr "greška, nemoguć oporavak" +msgstr "nepopravljiva greška" #: toplev.cc:611 #, c-format @@ -17816,18 +17731,19 @@ msgid "" "%s\tcompiled by GNU C version %s, " msgstr "" "%s%s%s %sinačica %s (%s)\n" -"%s\tkompajlirao GNU C inačica %s, " +"%s\tkompilirano s GNU C inačica %s, " #: toplev.cc:613 #, c-format msgid "%s%s%s %sversion %s (%s) compiled by CC, " -msgstr "%s%s%s %sinačica %s (%s) kompajlirao CC, " +msgstr "%s%s%s %sinačica %s (%s) kompilirao CC, " #: toplev.cc:617 -#, fuzzy, c-format -#| msgid "GMP version %s, MPFR version %s, MPC version %s\n" +#, c-format msgid "GMP version %s, MPFR version %s, MPC version %s, isl version %s\n" -msgstr "GMP inačica %s, MPFR inačica %s, MPC inačica %s\n" +msgstr "" +"GMP inačica %s, MPFR inačica %s, MPC inačica %s, isl inačica %s\n" +"\n" #: toplev.cc:619 #, c-format @@ -18161,27 +18077,24 @@ msgid "missing operand" msgstr "" #: config/aarch64/aarch64.cc:11294 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid constant" -msgstr "neispravni %%-kod" +msgstr "nevaljana konstanta" #: config/aarch64/aarch64.cc:11297 -#, fuzzy, c-format -#| msgid "invalid expression as operand" +#, c-format msgid "invalid operand" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani operand" #: config/aarch64/aarch64.cc:11425 config/aarch64/aarch64.cc:11430 #, c-format msgid "invalid operand prefix '%%%c'" -msgstr "" +msgstr "nevaljani prefiks operanda „%%%c“" #: config/aarch64/aarch64.cc:11450 -#, fuzzy, c-format -#| msgid "invalid 'asm': " +#, c-format msgid "invalid address mode" -msgstr "neispravni „asm”: " +msgstr "nevaljani način adresiranja" #: config/aarch64/aarch64.cc:25851 config/arm/arm.cc:33859 msgid "invalid conversion from type %" @@ -18293,65 +18206,59 @@ msgid "invalid operand address" msgstr "" #: config/arc/arc.cc:4517 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid operand to %%Z code" -msgstr "neispravni %%-kod" +msgstr "nevaljani operand za %%Z kȏd" #: config/arc/arc.cc:4525 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid operand to %%z code" -msgstr "neispravni %%-kod" +msgstr "nevaljani operand za %%z kȏd" #: config/arc/arc.cc:4533 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid operands to %%c code" -msgstr "neispravni %%-kod" +msgstr "nevaljani operandi za %%c kȏd" #: config/arc/arc.cc:4541 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid operand to %%M code" -msgstr "neispravni %%-kod" +msgstr "nevaljani operandi za %%M kȏd" #: config/arc/arc.cc:4549 config/m32r/m32r.cc:2086 #, c-format msgid "invalid operand to %%p code" -msgstr "" +msgstr "nevaljani operand za %%p kȏd" #: config/arc/arc.cc:4560 config/m32r/m32r.cc:2079 #, c-format msgid "invalid operand to %%s code" -msgstr "" +msgstr "nevaljani operand za %%s kȏd" #: config/arc/arc.cc:4708 config/m32r/m32r.cc:2112 #, c-format msgid "invalid operand to %%R code" -msgstr "" +msgstr "nevaljani operand za %%R kȏd" #: config/arc/arc.cc:4784 config/m32r/m32r.cc:2135 #, c-format msgid "invalid operand to %%H/%%L code" -msgstr "" +msgstr "nevaljani operand za %%H%%L kȏd" #: config/arc/arc.cc:4852 config/m32r/m32r.cc:2206 #, c-format msgid "invalid operand to %%U code" -msgstr "" +msgstr "nevaljani operand za %%U kȏd" #: config/arc/arc.cc:4864 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid operand to %%V code" -msgstr "neispravni %%-kod" +msgstr "nevaljani operand za %%V kȏd" #: config/arc/arc.cc:4921 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid operand to %%O code" -msgstr "neispravni %%-kod" +msgstr "nevaljani operand za %%O kȏd" #. Unknown flag. #. Undocumented flag. @@ -18360,13 +18267,12 @@ msgstr "neispravni %%-kod" #: config/sparc/sparc.cc:9636 #, c-format msgid "invalid operand output code" -msgstr "" +msgstr "nevaljani izlazni kȏd operanda" #: config/arc/arc.cc:6487 -#, fuzzy, c-format -#| msgid "invalid expression as operand" +#, c-format msgid "invalid UNSPEC as operand: %d" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani UNSPEC kao operand: %d" #: config/arc/arc.cc:6703 msgid "unrecognized supposed constant" @@ -18524,10 +18430,8 @@ msgid "invalid const_double operand" msgstr "" #: config/bpf/bpf.cc:921 -#, fuzzy -#| msgid "invalid expression as operand" msgid "invalid address in operand" -msgstr "neispravni izraz kao operand" +msgstr "nevaljana adresa kao operand" #. Fallthrough. #: config/bpf/bpf.cc:928 @@ -18756,10 +18660,9 @@ msgstr "" #: config/gcn/gcn.cc:5860 config/gcn/gcn.cc:5883 config/gcn/gcn.cc:5915 #: config/gcn/gcn.cc:5931 config/gcn/gcn.cc:5946 config/gcn/gcn.cc:5965 #: config/gcn/gcn.cc:6041 config/gcn/gcn.cc:6237 config/gcn/gcn.cc:6352 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid operand %%xn code" -msgstr "neispravni %%-kod" +msgstr "nevaljani operand %%xn kȏd" #: config/gcn/gcn.cc:6340 #, c-format @@ -18794,27 +18697,24 @@ msgid "invalid use of asm flag output" msgstr "" #: config/i386/i386.cc:13121 -#, fuzzy, c-format -#| msgid "invalid expression as operand" +#, c-format msgid "invalid operand size for operand code 'O'" -msgstr "neispravni izraz kao operand" +msgstr "nevaljana veličina operanda za operand kȏd 'O'" #: config/i386/i386.cc:13156 -#, fuzzy, c-format -#| msgid "invalid expression as operand" +#, c-format msgid "invalid operand size for operand code 'z'" -msgstr "neispravni izraz kao operand" +msgstr "nevaljana veličina operanda za operand kȏd 'z'" #: config/i386/i386.cc:13225 #, c-format msgid "invalid operand type used with operand code 'Z'" -msgstr "" +msgstr "nevaljana vrsta operanda korištena s operandom kod „Z“" #: config/i386/i386.cc:13230 -#, fuzzy, c-format -#| msgid "invalid expression as operand" +#, c-format msgid "invalid operand size for operand code 'Z'" -msgstr "neispravni izraz kao operand" +msgstr "nevaljana veličina operanda za operand kȏd 'Z'" #: config/i386/i386.cc:13307 #, c-format @@ -18867,10 +18767,9 @@ msgid "invalid constraints for operand" msgstr "" #: config/i386/i386.cc:13768 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid vector immediate" -msgstr "neispravni %%-kod" +msgstr "nevaljana vektorska konstanta" #: config/i386/i386.cc:16847 msgid "unknown insn mode" @@ -19069,16 +18968,14 @@ msgid "invalid operand prefix" msgstr "" #: config/msp430/msp430.cc:4376 -#, fuzzy, c-format -#| msgid "invalid expression as operand" +#, c-format msgid "invalid zero extract" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani nulo ekstrakt" #: config/or1k/or1k.cc:1154 config/or1k/or1k.cc:1162 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid relocation" -msgstr "neispravni %%-kod" +msgstr "nevaljana relokacija" #: config/or1k/or1k.cc:1256 #, c-format @@ -19187,10 +19084,9 @@ msgid "Bad 128-bit move" msgstr "" #: config/rs6000/rs6000.cc:13674 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid %%A value" -msgstr "neispravni %%-kod" +msgstr "nevaljana %%A vrijednost" #: config/rs6000/rs6000.cc:13683 config/xtensa/xtensa.cc:2403 #, c-format @@ -19198,10 +19094,9 @@ msgid "invalid %%D value" msgstr "" #: config/rs6000/rs6000.cc:13698 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid %%e value" -msgstr "neispravni %%-kod" +msgstr "nevaljana %%e vrijednost" #: config/rs6000/rs6000.cc:13719 #, c-format @@ -19249,10 +19144,9 @@ msgid "invalid %%q value" msgstr "" #: config/rs6000/rs6000.cc:13943 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid %%t value" -msgstr "neispravni %%-kod" +msgstr "nevaljani %%t kȏd" #: config/rs6000/rs6000.cc:13960 #, c-format @@ -19270,10 +19164,9 @@ msgid "invalid %%v value" msgstr "" #: config/rs6000/rs6000.cc:14036 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid %%V value" -msgstr "neispravni %%-kod" +msgstr "nevaljana %%V vrijednost" #: config/rs6000/rs6000.cc:14053 config/xtensa/xtensa.cc:2467 #, c-format @@ -19281,10 +19174,9 @@ msgid "invalid %%x value" msgstr "" #: config/rs6000/rs6000.cc:14110 -#, fuzzy, c-format -#| msgid "invalid %%-code" +#, c-format msgid "invalid %%z value" -msgstr "neispravni %%-kod" +msgstr "nevaljani %%z kȏd" #: config/rs6000/rs6000.cc:14179 #, c-format @@ -19706,7 +19598,7 @@ msgstr "" #: cp/parser.cc:15233 cp/parser.cc:32259 cp/parser.cc:32872 #, gcc-internal-format msgid "expected %<;%>" -msgstr "očekujem %<;%>" +msgstr "očekivano je %<;%>" #: c/c-parser.cc:3049 c/c-parser.cc:4019 c/c-parser.cc:4214 c/c-parser.cc:4279 #: c/c-parser.cc:4337 c/c-parser.cc:4699 c/c-parser.cc:4720 c/c-parser.cc:4729 @@ -19727,7 +19619,7 @@ msgstr "očekujem %<;%>" #: c/c-parser.cc:7124 cp/parser.cc:32920 #, gcc-internal-format msgid "expected %<)%>" -msgstr "očekujem %<)%>" +msgstr "očekivano je %<)%>" #: c/c-parser.cc:4108 c/c-parser.cc:4840 c/c-parser.cc:4988 c/c-parser.cc:5014 #: c/c-parser.cc:5015 c/c-parser.cc:5429 c/c-parser.cc:5465 c/c-parser.cc:7223 @@ -19735,11 +19627,11 @@ msgstr "očekujem %<)%>" #: c/c-parser.cc:13216 c/gimple-parser.cc:1740 cp/parser.cc:32884 #, gcc-internal-format msgid "expected %<]%>" -msgstr "očekujem %<]%>" +msgstr "očekivano je %<]%>" #: c/c-parser.cc:4317 msgid "expected %<;%>, %<,%> or %<)%>" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %<;%>, %<,%> ili %<)%>" #. Look for the two `(' tokens. #: c/c-parser.cc:4749 c/c-parser.cc:4754 c/c-parser.cc:13796 @@ -19753,13 +19645,13 @@ msgstr "očekujem %<;%>, %<,%> ili %<)%>" #: c/gimple-parser.cc:2293 c/c-parser.cc:13618 cp/parser.cc:32875 #, gcc-internal-format msgid "expected %<(%>" -msgstr "očekujem %<(%>" +msgstr "očekivano je %<(%>" #: c/c-parser.cc:4984 c/c-parser.cc:4986 c/c-parser.cc:13133 #: cp/parser.cc:32887 cp/parser.cc:36617 go/gofrontend/embed.cc:439 #, gcc-internal-format msgid "expected %<[%>" -msgstr "očekujem %<[%>" +msgstr "očekivano je %<[%>" #: c/c-parser.cc:5600 c/c-parser.cc:11708 c/c-parser.cc:18404 #: c/c-parser.cc:18490 c/c-parser.cc:19142 c/c-parser.cc:20024 @@ -19768,7 +19660,7 @@ msgstr "očekujem %<[%>" #: cp/parser.cc:20871 cp/parser.cc:32881 go/gofrontend/embed.cc:370 #, gcc-internal-format msgid "expected %<{%>" -msgstr "očekujem %<{%>" +msgstr "očekivano je %<{%>" #: c/c-parser.cc:5890 c/c-parser.cc:5899 c/c-parser.cc:7656 c/c-parser.cc:8745 #: c/c-parser.cc:11472 c/c-parser.cc:11868 c/c-parser.cc:11932 @@ -19782,12 +19674,12 @@ msgstr "očekujem %<{%>" #: cp/parser.cc:37466 cp/parser.cc:38341 go/gofrontend/embed.cc:403 #, gcc-internal-format msgid "expected %<:%>" -msgstr "očekujem %<:%>" +msgstr "očekivano je %<:%>" #: c/c-parser.cc:6681 cp/parser.cc:32801 #, gcc-internal-format msgid "expected %" -msgstr "očekujem %" +msgstr "očekivano je %" #: c/c-parser.cc:8504 c/c-parser.cc:8696 c/c-parser.cc:9164 c/c-parser.cc:9207 #: c/c-parser.cc:9345 c/c-parser.cc:10094 c/c-parser.cc:14621 @@ -19796,27 +19688,27 @@ msgstr "očekujem %" #: c/gimple-parser.cc:1525 cp/parser.cc:32257 cp/parser.cc:32890 #, gcc-internal-format msgid "expected %<,%>" -msgstr "očekujem %<,%>" +msgstr "očekivano je %<,%>" #: c/c-parser.cc:9061 msgid "expected %<.%>" -msgstr "očekujem %<.%>" +msgstr "očekivano je %<.%>" #: c/c-parser.cc:10931 c/c-parser.cc:10963 c/c-parser.cc:11203 #: cp/parser.cc:35167 cp/parser.cc:35188 #, gcc-internal-format msgid "expected %<@end%>" -msgstr "očekujem %<@end%>" +msgstr "očekivano je %<@end%>" #: c/c-parser.cc:11621 c/gimple-parser.cc:1355 cp/parser.cc:32899 #, gcc-internal-format msgid "expected %<>%>" -msgstr "očekujem %<>%>" +msgstr "očekivano je %<>%>" #: c/c-parser.cc:15157 c/c-parser.cc:16391 cp/parser.cc:32923 #, gcc-internal-format msgid "expected %<,%> or %<)%>" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je %<,%> ili %<)%>" #. All following cases are statements with LHS. #: c/c-parser.cc:15907 c/c-parser.cc:18297 c/c-parser.cc:18344 @@ -19826,7 +19718,7 @@ msgstr "očekujem %<,%> ili %<)%>" #: cp/parser.cc:32902 cp/parser.cc:40914 cp/parser.cc:41087 #, gcc-internal-format msgid "expected %<=%>" -msgstr "očekujem %<=%>" +msgstr "očekivano je %<=%>" #: c/c-parser.cc:18432 c/c-parser.cc:18512 c/c-parser.cc:18866 #: c/c-parser.cc:19190 c/gimple-parser.cc:1573 c/gimple-parser.cc:1605 @@ -19834,13 +19726,12 @@ msgstr "očekujem %<=%>" #: cp/parser.cc:35377 #, gcc-internal-format msgid "expected %<}%>" -msgstr "očekujem %<}%>" +msgstr "očekivano je %<}%>" #: c/c-parser.cc:18525 cp/parser.cc:41012 -#, fuzzy, gcc-internal-format -#| msgid "expected %" +#, gcc-internal-format msgid "expected %" -msgstr "očekujem %" +msgstr "očekivano %" #: c/c-parser.cc:20069 c/c-parser.cc:20058 cp/parser.cc:43252 #, gcc-internal-format @@ -19862,10 +19753,9 @@ msgstr "" #: c/gimple-parser.cc:2343 c/gimple-parser.cc:2370 c/gimple-parser.cc:2209 #: c/gimple-parser.cc:2246 -#, fuzzy, gcc-internal-format -#| msgid "expected %" +#, gcc-internal-format msgid "expected label" -msgstr "očekujem %" +msgstr "očekivana je oznaka" #: cp/call.cc:4007 msgid "candidate:" @@ -20901,10 +20791,9 @@ msgstr "" #: go/gofrontend/expressions.cc:5221 c/c-parser.cc:15820 c/c-parser.cc:15827 #: cp/parser.cc:38961 cp/parser.cc:38968 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected integer" -msgstr "očekujem kraj retka" +msgstr "očekivan je cijeli broj" #: go/gofrontend/expressions.cc:7000 msgid "invalid comparison of nil with nil" @@ -21598,10 +21487,9 @@ msgid "mismatching parens" msgstr "" #: jit/docs/examples/tut05-bf.c:310 -#, fuzzy, gcc-internal-format -#| msgid "failed to open %s" +#, gcc-internal-format msgid "unable to open file" -msgstr "nisam uspio otvoriti %s" +msgstr "nije moguće otvoriti datoteku" #: fortran/lang.opt:428 #, gcc-internal-format @@ -21614,10 +21502,9 @@ msgid "Unrecognized option to floating-point init value: %qs" msgstr "" #: fortran/lang.opt:784 -#, fuzzy, gcc-internal-format -#| msgid "unrecognizable insn:" +#, gcc-internal-format msgid "Unrecognized option: %qs" -msgstr "neprepoznati insn:" +msgstr "Neprepoznata opcija: %qs" #: c-family/c.opt:43 c-family/c.opt:46 c-family/c.opt:181 #, gcc-internal-format @@ -21954,10 +21841,9 @@ msgid "wrong number of arguments specified for %qE attribute" msgstr "" #: attribs.cc:733 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "expected %<@end%>" +#, gcc-internal-format, gfc-internal-format msgid "expected %i or more, found %i" -msgstr "očekujem %<@end%>" +msgstr "očekivano je %i ili više, pronađeno %i" #: attribs.cc:736 #, gcc-internal-format, gfc-internal-format @@ -22125,16 +22011,14 @@ msgid "offset exceeds 16 bytes" msgstr "" #: auto-profile.cc:863 -#, fuzzy, gcc-internal-format -#| msgid "expected %<.%>" +#, gcc-internal-format msgid "Not expected TAG." -msgstr "očekujem %<.%>" +msgstr "TAG nije očekivan." #: auto-profile.cc:928 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "Cannot open source file %s\n" +#, gcc-internal-format, gfc-internal-format msgid "cannot open profile file %s" -msgstr "Ne mogu otvoriti datoteku koda %s\n" +msgstr "nije moguće otvoriti profil datoteku %s" #: auto-profile.cc:934 #, gcc-internal-format @@ -22329,10 +22213,9 @@ msgid "last argument of %qD is not integer constant between 0 and 3" msgstr "" #: calls.cc:1232 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "[cannot find %s]" +#, gcc-internal-format, gfc-internal-format msgid "cannot tail-call: %s" -msgstr "[ne mogu naći %s]" +msgstr "nije moguće tail-call: %s" #: calls.cc:2728 #, gcc-internal-format @@ -23445,10 +23328,9 @@ msgid "nodes with unreleased memory found" msgstr "" #: collect-utils.cc:106 -#, fuzzy, gcc-internal-format -#| msgid "can't get program status" +#, gcc-internal-format msgid "cannot get program status: %m" -msgstr "ne mogu dohvatiti stanje programa" +msgstr "nije moguće dobiti stanje programa: %m" #: collect-utils.cc:120 #, gcc-internal-format, gfc-internal-format @@ -23476,17 +23358,15 @@ msgid "could not close response file %s" msgstr "" #: collect-utils.cc:221 -#, fuzzy, gcc-internal-format -#| msgid "[cannot find %s]" +#, gcc-internal-format msgid "cannot find %qs" -msgstr "[ne mogu naći %s]" +msgstr "nije moguće naći %qs" #: collect-utils.cc:225 collect2.cc:2385 collect2.cc:2555 gcc.cc:3413 #: gcc.cc:7704 -#, fuzzy, gcc-internal-format -#| msgid "pex_init failed" +#, gcc-internal-format msgid "% failed: %m" -msgstr "pex_init nije uspio" +msgstr "% neuspješan: %m" #: collect-utils.cc:234 collect2.cc:2394 collect2.cc:2563 gcc.cc:2697 #, gcc-internal-format @@ -23494,10 +23374,9 @@ msgid "%s: %m" msgstr "" #: collect2.cc:613 -#, fuzzy, gcc-internal-format -#| msgid "environment variable COLLECT_GCC must be set" +#, gcc-internal-format msgid "environment variable % must be set" -msgstr "varijabla okoline COLLECT_GCC mora biti postavljena " +msgstr "varijabla okoline % mora imati postavku" #: collect2.cc:756 #, gcc-internal-format, gfc-internal-format @@ -23522,10 +23401,9 @@ msgstr "" #: collect2.cc:1324 graph.cc:55 lto-wrapper.cc:1707 lto-wrapper.cc:1763 #: toplev.cc:1556 objc/objc-act.cc:461 -#, fuzzy, gcc-internal-format -#| msgid "[cannot find %s]" +#, gcc-internal-format msgid "cannot open %s: %m" -msgstr "[ne mogu naći %s]" +msgstr "nije moguće otvoriti %s: %m" #: collect2.cc:1444 #, gcc-internal-format @@ -23550,10 +23428,9 @@ msgid "%s: %s" msgstr "" #: collect2.cc:2359 -#, fuzzy, gcc-internal-format -#| msgid "[cannot find %s]" +#, gcc-internal-format msgid "cannot find %" -msgstr "[ne mogu naći %s]" +msgstr "nije moguće naći %" #: collect2.cc:2407 #, gcc-internal-format @@ -23571,10 +23448,9 @@ msgid "fini function found in object %s" msgstr "" #: collect2.cc:2530 -#, fuzzy, gcc-internal-format -#| msgid "[cannot find %s]" +#, gcc-internal-format msgid "cannot find %" -msgstr "[ne mogu naći %s]" +msgstr "nije moguće naći %" #: collect2.cc:2576 #, gcc-internal-format @@ -23802,10 +23678,9 @@ msgid "global constructors not supported on this target" msgstr "" #: diagnostic.cc:2163 -#, fuzzy, gcc-internal-format -#| msgid "debug: " +#, gcc-internal-format msgid "debug path" -msgstr "debug: " +msgstr "staza za debug (dijagnostiku)" #: dominance.cc:1170 #, gcc-internal-format, gfc-internal-format @@ -24078,10 +23953,9 @@ msgid "function returns an aggregate" msgstr "" #: gcc.cc:2201 -#, fuzzy, gcc-internal-format -#| msgid "Cannot open source file %s\n" +#, gcc-internal-format msgid "cannot open nested response file" -msgstr "Ne mogu otvoriti datoteku koda %s\n" +msgstr "nije moguće otvoriti ugniježđenu datoteku odgovora" #: gcc.cc:2238 #, gcc-internal-format @@ -24105,10 +23979,9 @@ msgstr "" #. This leaves DESC open, but the OS will save us. #: gcc.cc:2306 -#, fuzzy, gcc-internal-format -#| msgid "Cannot open source file %s\n" +#, gcc-internal-format msgid "cannot read spec file %qs: %m" -msgstr "Ne mogu otvoriti datoteku koda %s\n" +msgstr "nije moguće otvoriti spec datoteku %qs: %m" #: gcc.cc:2400 gcc.cc:2421 #, gcc-internal-format, gfc-internal-format @@ -24182,10 +24055,9 @@ msgid "%s signal terminated program %s" msgstr "" #: gcc.cc:3985 opts-common.cc:1544 opts-common.cc:1576 -#, fuzzy, gcc-internal-format -#| msgid "unrecognizable insn:" +#, gcc-internal-format msgid "unrecognized command-line option %qs" -msgstr "neprepoznati insn:" +msgstr "neprepoznat opcija na naredbenom retku %qs" #: gcc.cc:4027 #, gcc-internal-format @@ -24379,7 +24251,7 @@ msgstr "" #: gcc.cc:8867 #, gcc-internal-format msgid "cannot specify %<-o%> with %<-c%>, %<-S%> or %<-E%> with multiple files" -msgstr "" +msgstr "%<-o%> with %<-c%>, %<-S%> or %<-E%> ne možete specificirati s više datoteka" #: gcc.cc:8909 #, gcc-internal-format, gfc-internal-format @@ -24510,10 +24382,9 @@ msgid "error in removing %s" msgstr "" #: gcov-tool.cc:104 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "ignoring duplicate directory \"%s\"\n" +#, gcc-internal-format, gfc-internal-format msgid "Cannot make directory %s" -msgstr "zanemarujem direktorij duplikat „%s”\n" +msgstr "Nije moguće napraviti direktorij %s" #: gcov-tool.cc:112 #, gcc-internal-format @@ -24521,10 +24392,9 @@ msgid "Cannot get current directory name" msgstr "" #: gcov-tool.cc:116 gcov-tool.cc:130 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "ignoring duplicate directory \"%s\"\n" +#, gcc-internal-format, gfc-internal-format msgid "Cannot change directory to %s" -msgstr "zanemarujem direktorij duplikat „%s”\n" +msgstr "Nije se moguće premjestiti (change) u direktorij %s" #: gcov-tool.cc:123 #, gcc-internal-format, gfc-internal-format @@ -24766,10 +24636,9 @@ msgid "null pointer dereference" msgstr "" #: gimple-ssa-isolate-paths.cc:413 -#, fuzzy, gcc-internal-format -#| msgid "function body not available" +#, gcc-internal-format msgid "function may return address of local variable" -msgstr "tijelo funkcije nije dostupno" +msgstr "funkcija može vratiti adresu lokalne varijable" #: gimple-ssa-isolate-paths.cc:414 c/c-typeck.cc:10987 #, gcc-internal-format @@ -27217,10 +27086,9 @@ msgid "Cgraph edge statement index not found" msgstr "" #: lto-streamer-in.cc:1215 -#, fuzzy, gcc-internal-format -#| msgid "operand number out of range" +#, gcc-internal-format msgid "Reference statement index out of range" -msgstr "broj operanada je izvan granica" +msgstr "Index referente izjave je izvan granica" #: lto-streamer-in.cc:1219 #, gcc-internal-format @@ -27273,10 +27141,9 @@ msgid "bytecode stream in file %qs generated with LTO version %d.%d instead of t msgstr "" #: lto-wrapper.cc:131 -#, fuzzy, gcc-internal-format -#| msgid "deleting LTRANS file %s" +#, gcc-internal-format msgid "deleting LTRANS file %s: %m" -msgstr "uklanjam LTRANS datoteku %s" +msgstr "uklanjam LTRANS datoteku %s: %m" #: lto-wrapper.cc:324 #, gcc-internal-format, gfc-internal-format @@ -27329,23 +27196,20 @@ msgid "installation error, cannot find %" msgstr "" #: lto-wrapper.cc:1436 -#, fuzzy, gcc-internal-format -#| msgid "environment variable COLLECT_GCC must be set" +#, gcc-internal-format msgid "environment variable % must be set" -msgstr "varijabla okoline COLLECT_GCC mora biti postavljena " +msgstr "varijabla okoline % mora biti postavljena" #: lto-wrapper.cc:1440 -#, fuzzy, gcc-internal-format -#| msgid "environment variable COLLECT_GCC_OPTIONS must be set" +#, gcc-internal-format msgid "environment variable % must be set" -msgstr "varijabla okoline COLLECT_GCC_OPTIONS mora biti postavljena" +msgstr "varijabla okoline % mora biti postavljena" #: lto-wrapper.cc:1710 lto-wrapper.cc:1768 c-family/c-pch.cc:213 #: c-family/c-pch.cc:248 c-family/c-pch.cc:286 -#, fuzzy, gcc-internal-format -#| msgid "[cannot find %s]" +#, gcc-internal-format msgid "cannot read %s: %m" -msgstr "[ne mogu naći %s]" +msgstr "nije moguće čitati %s: %m" #: lto-wrapper.cc:1737 #, gcc-internal-format, gfc-internal-format @@ -27353,16 +27217,14 @@ msgid "invalid format of %s" msgstr "" #: lto-wrapper.cc:1903 -#, fuzzy, gcc-internal-format -#| msgid "fopen: %s" +#, gcc-internal-format msgid "%: %s: %m" -msgstr "fopen: %s" +msgstr "%: %s: %m" #: lto-wrapper.cc:1920 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "Could not open output file '%s'\n" +#, gcc-internal-format, gfc-internal-format msgid "corrupted ltrans output file %s" -msgstr "Ne mogu otvoriti izlaznu datoteku „%s”\n" +msgstr "oštećeni izlazna datoteka ltrans %s" #: lto-wrapper.cc:1962 #, gcc-internal-format, gfc-internal-format @@ -27370,10 +27232,9 @@ msgid "using serial compilation of %d LTRANS jobs" msgstr "" #: lto-wrapper.cc:2135 -#, fuzzy, gcc-internal-format -#| msgid "pex_init failed" +#, gcc-internal-format msgid "% failed" -msgstr "pex_init nije uspio" +msgstr "% neuspješan" #: multiple_target.cc:76 #, gcc-internal-format @@ -27631,10 +27492,9 @@ msgid "%<%s taskgroup%> construct not closely nested inside of % reg msgstr "" #: omp-low.cc:3459 -#, fuzzy, gcc-internal-format -#| msgid "invalid 'asm': " +#, gcc-internal-format msgid "invalid arguments" -msgstr "neispravni „asm”: " +msgstr "nevaljani argumenti" #: omp-low.cc:3465 #, gcc-internal-format @@ -27880,10 +27740,9 @@ msgid "insufficient partitioning available to parallelize loop" msgstr "" #: omp-simd-clone.cc:197 -#, fuzzy, gcc-internal-format -#| msgid "ignoring duplicate directory \"%s\"\n" +#, gcc-internal-format msgid "ignoring large linear step" -msgstr "zanemarujem direktorij duplikat „%s”\n" +msgstr "ignoriramo veliki linearni korak" #: omp-simd-clone.cc:203 #, gcc-internal-format @@ -27906,10 +27765,9 @@ msgid "indirect jumps are not available on this target" msgstr "" #: optinfo-emit-json.cc:113 -#, fuzzy, gcc-internal-format -#| msgid "Failed to open file %s for writing state: %s" +#, gcc-internal-format msgid "cannot open file %qs for writing optimization records" -msgstr "Nisam uspio otvoriti datoteku %s za pisanje stanja: %s" +msgstr "nije uspjelo otvoriti datoteku %qs za pisanje optimizacijskih zapisa" #: optinfo-emit-json.cc:121 #, gcc-internal-format @@ -27987,10 +27845,9 @@ msgid "argument to %qs is bigger than %d" msgstr "" #: opts-common.cc:1962 -#, fuzzy, gcc-internal-format -#| msgid "malformed COLLECT_GCC_OPTIONS" +#, gcc-internal-format msgid "malformed %" -msgstr "izobličen COLLECT_GCC_OPTIONS" +msgstr "deformirani %" #: opts-global.cc:102 #, gcc-internal-format @@ -28484,10 +28341,9 @@ msgid "cannot find %s in plugin %s: %s" msgstr "" #: plugin.cc:735 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "failed to open %s" +#, gcc-internal-format, gfc-internal-format msgid "failed to initialize plugin %s" -msgstr "nisam uspio otvoriti %s" +msgstr "nije uspjelo inicijalizirati plugin %s" #: plugin.cc:1009 #, gcc-internal-format @@ -28592,7 +28448,7 @@ msgstr "" #: read-rtl-function.cc:265 #, gcc-internal-format, gfc-internal-format msgid "insn with UID %i not found for operand %i (`%s') of insn %i" -msgstr "" +msgstr "insn s UID-om %i nnije pronađen za operand %i („%s“) od insn %i" #: read-rtl-function.cc:269 #, gcc-internal-format, gfc-internal-format @@ -28615,15 +28471,14 @@ msgid "more than one 'crtl' directive" msgstr "" #: read-rtl-function.cc:985 -#, fuzzy, gcc-internal-format -#| msgid "unrecognizable insn:" +#, gcc-internal-format msgid "unrecognized enum value: %qs" -msgstr "neprepoznati insn:" +msgstr "neprepoznati enum vrijednost: %qs" #: read-rtl-function.cc:1141 read-rtl-function.cc:1200 #, gcc-internal-format, gfc-internal-format msgid "was expecting `%s'" -msgstr "" +msgstr "očekivali smo „%s“" #: read-rtl-function.cc:1594 #, gcc-internal-format, gfc-internal-format @@ -29148,10 +29003,9 @@ msgid "symtab_node::verify failed" msgstr "" #: symtab.cc:1381 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format, gfc-internal-format msgid "invalid order in asm node %i" -msgstr "neispravni izraz kao operand" +msgstr "krivi poredak u asm čvoru %i" #: symtab.cc:1405 #, gcc-internal-format @@ -29204,10 +29058,9 @@ msgid "%<#pragma GCC target%> is not supported for this machine" msgstr "" #: toplev.cc:721 -#, fuzzy, gcc-internal-format -#| msgid "Failed to open file %s for writing state: %s" +#, gcc-internal-format msgid "cannot open %qs for writing: %m" -msgstr "Nisam uspio otvoriti datoteku %s za pisanje stanja: %s" +msgstr "nije moguće otvoriti %qs za pisanje: %m" #: toplev.cc:740 #, gcc-internal-format @@ -29235,10 +29088,9 @@ msgid "stack usage is %wu bytes" msgstr "" #: toplev.cc:975 -#, fuzzy, gcc-internal-format -#| msgid "Failed to open file %s for writing state: %s" +#, gcc-internal-format msgid "cannot open %s for writing: %m" -msgstr "Nisam uspio otvoriti datoteku %s za pisanje stanja: %s" +msgstr "nije moguće otvoriti %s za pisanje: %m" #: toplev.cc:1251 #, gcc-internal-format @@ -29526,10 +29378,9 @@ msgid "non-scalar %qs" msgstr "" #: tree-cfg.cc:3070 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "invalid position or size operand to %qs" -msgstr "neispravni izraz kao operand" +msgstr "nevaljana pozicija ili veličina operanda za %qs" #: tree-cfg.cc:3076 #, gcc-internal-format @@ -29577,10 +29428,9 @@ msgid "type mismatch in %qs" msgstr "" #: tree-cfg.cc:3173 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "invalid %qs offset operator" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani offset operator %qs" #: tree-cfg.cc:3197 #, gcc-internal-format @@ -29593,16 +29443,14 @@ msgid "conversion of register to a different size in %qs" msgstr "" #: tree-cfg.cc:3225 tree-cfg.cc:3251 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "invalid address operand in %qs" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani adresni operator za %qs" #: tree-cfg.cc:3232 tree-cfg.cc:3258 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "invalid offset operand in %qs" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani offset operand u %qs" #: tree-cfg.cc:3239 tree-cfg.cc:3265 #, gcc-internal-format @@ -29796,10 +29644,9 @@ msgid "invalid non-vector operands to %qs" msgstr "" #: tree-cfg.cc:3975 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "invalid (pointer) operands %qs" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani (pointer) operandi %qs" #: tree-cfg.cc:4198 #, gcc-internal-format @@ -30371,10 +30218,9 @@ msgid "%s from %s called in %s" msgstr "" #: tree-profile.cc:624 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "invalid regular expression %qs in %qs" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani regularni izraz %qs u %qs" #: tree-profile.cc:714 #, gcc-internal-format @@ -31410,7 +31256,7 @@ msgstr "" #: varasm.cc:6193 varasm.cc:6315 #, gcc-internal-format msgid "%qs is not supported in this configuration" -msgstr "" +msgstr "%qs nije podržan u ovoj konfiguraciji" #: varasm.cc:6221 #, gcc-internal-format @@ -33405,7 +33251,7 @@ msgstr "" #: c-family/c-format.cc:3573 #, gcc-internal-format msgid "grave accent %<`%> in format" -msgstr "" +msgstr "dijakritički znak (grave accent) %<`%> u formatu `" #: c-family/c-format.cc:3575 #, gcc-internal-format @@ -33875,10 +33721,9 @@ msgid "%qD specified in % clause but not in an explicit privatization msgstr "" #: c-family/c-omp.cc:2831 c-family/c-omp.cc:2846 -#, fuzzy, gcc-internal-format -#| msgid "%s:no functions found\n" +#, gcc-internal-format msgid "%qD is not a function argument" -msgstr "%s:nisu pronađene funkcije\n" +msgstr "%qD nije argument funkcije" #: c-family/c-opts.cc:341 #, gcc-internal-format @@ -34031,10 +33876,9 @@ msgid "cannot write to %s: %m" msgstr "" #: c-family/c-pch.cc:183 -#, fuzzy, gcc-internal-format -#| msgid "[cannot find %s]" +#, gcc-internal-format msgid "cannot write %s: %m" -msgstr "[ne mogu naći %s]" +msgstr "nije moguće pisati %s: %m" #: c-family/c-pch.cc:392 #, gcc-internal-format @@ -35411,10 +35255,9 @@ msgid "valid arguments are: %s" msgstr "" #: common/config/arm/arm-common.cc:418 common/config/arm/arm-common.cc:472 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "unrecognizable insn:" +#, gcc-internal-format, gfc-internal-format msgid "unrecognized %s target: %s" -msgstr "neprepoznati insn:" +msgstr "neprepoznati %s cilj: %s" #: common/config/arm/arm-common.cc:508 #, gcc-internal-format @@ -35734,10 +35577,9 @@ msgid "could not understand % %q.*s" msgstr "" #: config/darwin-driver.cc:232 -#, fuzzy, gcc-internal-format -#| msgid "collect2 version %s\n" +#, gcc-internal-format msgid "could not understand version %qs" -msgstr "collect2 inačica %s\n" +msgstr "nije bilo moguće shvatiti inačicu %qs" #: config/darwin-driver.cc:306 #, gcc-internal-format @@ -35865,10 +35707,9 @@ msgid "embedded NUL in CFString literal" msgstr "" #: config/host-darwin.cc:107 -#, fuzzy, gcc-internal-format -#| msgid "function body not available" +#, gcc-internal-format msgid "PCH memory not available %m" -msgstr "tijelo funkcije nije dostupno" +msgstr "PCH memorija nije dostupna %m" #: config/sol2-c.cc:91 config/sol2-c.cc:107 #, gcc-internal-format @@ -36336,10 +36177,9 @@ msgid "the %qE attribute cannot be applied to an SVE function type" msgstr "" #: config/aarch64/aarch64.cc:2265 config/aarch64/aarch64.cc:2279 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "unexpected %<%s%> after %<%s%>" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je %<%s%> after %<%s%>" #: config/aarch64/aarch64.cc:2732 #, gcc-internal-format @@ -36431,10 +36271,9 @@ msgid "tuning string missing in option (%s)" msgstr "" #: config/aarch64/aarch64.cc:16437 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "%s:unknown function '%u'\n" +#, gcc-internal-format, gfc-internal-format msgid "unknown tuning option (%s)" -msgstr "%s:nepoznata funkcija „%u”\n" +msgstr "nepoznata tuning opcija (%s)" #: config/aarch64/aarch64.cc:16605 config/riscv/riscv.cc:5061 #, gcc-internal-format @@ -37849,7 +37688,7 @@ msgstr "" #: config/bfin/bfin.cc:2393 config/m68k/m68k.cc:590 #, gcc-internal-format msgid "cannot specify both %<-msep-data%> and %<-mid-shared-library%>" -msgstr "" +msgstr "ne možete specificirati %<-msep-data%> i %<-mid-shared-library%> zajedno" #: config/bfin/bfin.cc:2413 #, gcc-internal-format @@ -37917,18 +37756,14 @@ msgid "too many function arguments for eBPF" msgstr "" #: config/bpf/bpf.cc:785 config/bpf/bpf.cc:787 -#, fuzzy, gcc-internal-format -#| msgid "%d constructor found\n" -#| msgid_plural "%d constructors found\n" +#, gcc-internal-format msgid "no constructors" -msgstr "%d konstruktor pronađen\n" +msgstr "nijedan konstruktor nije pronađen" #: config/bpf/bpf.cc:803 config/bpf/bpf.cc:805 -#, fuzzy, gcc-internal-format -#| msgid "%d destructor found\n" -#| msgid_plural "%d destructors found\n" +#, gcc-internal-format msgid "no destructors" -msgstr "%d destruktor pronađen\n" +msgstr "nema destruktora" #: config/bpf/bpf.cc:857 #, gcc-internal-format @@ -38233,10 +38068,9 @@ msgid "using %, ignoring %d" msgstr "" #: config/gcn/gcn.cc:5091 config/gcn/gcn.cc:5118 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "operand number out of range" +#, gcc-internal-format, gfc-internal-format msgid "offload dimension out of range (%d)" -msgstr "broj operanada je izvan granica" +msgstr "dimenzija rasterećenja (offload) je izvan granica (%d)" #: config/gcn/gcn.cc:5591 #, gcc-internal-format @@ -38245,10 +38079,9 @@ msgstr "" #: config/gcn/mkoffload.cc:165 config/i386/intelmic-mkoffload.cc:73 #: config/nvptx/mkoffload.cc:88 -#, fuzzy, gcc-internal-format -#| msgid "deleting LTRANS file %s" +#, gcc-internal-format msgid "deleting file %s: %m" -msgstr "uklanjam LTRANS datoteku %s" +msgstr "uklanjamo datoteku %s: %m" #: config/gcn/mkoffload.cc:771 config/nvptx/mkoffload.cc:365 #, gcc-internal-format @@ -38256,10 +38089,9 @@ msgid "environment variable COLLECT_GCC_OPTIONS must be set" msgstr "varijabla okoline COLLECT_GCC_OPTIONS mora biti postavljena" #: config/gcn/mkoffload.cc:830 config/nvptx/mkoffload.cc:422 -#, fuzzy, gcc-internal-format -#| msgid "environment variable COLLECT_GCC must be set" +#, gcc-internal-format msgid "COLLECT_GCC must be set." -msgstr "varijabla okoline COLLECT_GCC mora biti postavljena " +msgstr "COLLECT_GCC mora biti postavljena." #: config/gcn/mkoffload.cc:876 config/i386/intelmic-mkoffload.cc:606 #, gcc-internal-format, gfc-internal-format @@ -38268,10 +38100,9 @@ msgstr "" #: config/gcn/mkoffload.cc:899 config/i386/intelmic-mkoffload.cc:625 #: config/nvptx/mkoffload.cc:493 -#, fuzzy, gcc-internal-format -#| msgid "unrecognizable insn:" +#, gcc-internal-format msgid "unrecognizable argument of option " -msgstr "neprepoznati insn:" +msgstr "neprepoznati argument opcije" #: config/gcn/mkoffload.cc:947 #, gcc-internal-format @@ -38281,10 +38112,9 @@ msgstr "" #: config/gcn/mkoffload.cc:1021 config/gcn/mkoffload.cc:1145 #: config/i386/intelmic-mkoffload.cc:260 config/i386/intelmic-mkoffload.cc:335 #: config/i386/intelmic-mkoffload.cc:387 config/nvptx/mkoffload.cc:557 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "[cannot find %s]" +#, gcc-internal-format, gfc-internal-format msgid "cannot open '%s'" -msgstr "[ne mogu naći %s]" +msgstr "nije moguće otvoriti „%s“" #: config/gcn/mkoffload.cc:1141 #, gcc-internal-format @@ -39234,10 +39064,9 @@ msgid "%<-fexcess-precision=16%> is not compatible with %<-mfpmath=387%>" msgstr "" #: config/i386/intelmic-mkoffload.cc:601 -#, fuzzy, gcc-internal-format -#| msgid "environment variable COLLECT_GCC must be set" +#, gcc-internal-format msgid "COLLECT_GCC must be set" -msgstr "varijabla okoline COLLECT_GCC mora biti postavljena " +msgstr "COLLECT_GCC mora biti postavljena " #: config/i386/intelmic-mkoffload.cc:641 #, gcc-internal-format @@ -40048,10 +39877,9 @@ msgid "invalid argument to built-in function %s" msgstr "" #: config/nds32/nds32-intrinsic.cc:131 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "operand number out of range" +#, gcc-internal-format, gfc-internal-format msgid "constant argument out of range for %s" -msgstr "broj operanada je izvan granica" +msgstr "argument konstanta je izvan granica za %s" #: config/nds32/nds32-intrinsic.cc:1003 #, gcc-internal-format @@ -40372,10 +40200,9 @@ msgid "either %<-fopenacc%> or %<-fopenmp%> must be set" msgstr "" #: config/nvptx/mkoffload.cc:596 -#, fuzzy, gcc-internal-format -#| msgid "Cannot open source file %s\n" +#, gcc-internal-format msgid "cannot open intermediate ptx file" -msgstr "Ne mogu otvoriti datoteku koda %s\n" +msgstr "nije moguće privremenu ptx datoteku" #: config/nvptx/nvptx.cc:206 #, gcc-internal-format @@ -40438,10 +40265,9 @@ msgid "variable %qD adjusted for OpenACC privatization level: %qs" msgstr "" #: config/or1k/or1k.cc:1311 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "expected %<@end%>" +#, gcc-internal-format, gfc-internal-format msgid "unexpected operand: %d" -msgstr "očekujem %<@end%>" +msgstr "očekivano je operand: %d" #: config/pa/pa.cc:529 #, gcc-internal-format @@ -40459,10 +40285,9 @@ msgid "%<-g%> is only supported when using GAS on this processor" msgstr "" #: config/pa/pa.cc:540 -#, fuzzy, gcc-internal-format -#| msgid "options enabled: " +#, gcc-internal-format msgid "%<-g%> option disabled" -msgstr "omogućene opcije: " +msgstr "opcije %<-g%> su omemogućene" #: config/pru/pru-passes.cc:111 #, gcc-internal-format @@ -40866,7 +40691,7 @@ msgstr "" #: config/rs6000/rs6000-c.cc:2017 #, gcc-internal-format msgid "%qs is not supported in this compiler configuration" -msgstr "" +msgstr "%qs nije podržan u ovoj konfiguraciji" #: config/rs6000/rs6000-call.cc:387 #, gcc-internal-format @@ -43667,7 +43492,7 @@ msgstr "" #: c/c-parser.cc:1324 cp/parser.cc:32926 #, gcc-internal-format msgid "expected end of line" -msgstr "očekujem kraj retka" +msgstr "očekivan je kraj retka" #: c/c-parser.cc:1643 #, gcc-internal-format @@ -44144,10 +43969,9 @@ msgid "%qE is not a valid % qualifier" msgstr "" #: c/c-parser.cc:7132 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %<:%> or %<)%>" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je %<:%> ili %<)%>" #: c/c-parser.cc:7431 cp/parser.cc:4487 #, gcc-internal-format @@ -44584,10 +44408,9 @@ msgid "expected %<=%> after Objective-C %qE" msgstr "" #: c/c-parser.cc:12124 cp/parser.cc:36063 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected %qE selector name" -msgstr "očekujem kraj retka" +msgstr "očekivano je ime selektora za %qE" #: c/c-parser.cc:12140 cp/parser.cc:36082 #, gcc-internal-format @@ -44656,10 +44479,9 @@ msgid "expression must be integral" msgstr "" #: c/c-parser.cc:13256 c/c-parser.cc:13268 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %<)%> or %<,%>" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano %<)%> or %<,%>" #: c/c-parser.cc:13419 c/c-parser.cc:23098 #, gcc-internal-format @@ -44677,29 +44499,25 @@ msgid "collapse argument needs positive constant integer expression" msgstr "" #: c/c-parser.cc:13560 cp/parser.cc:37315 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected % or %" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je % ili %" #: c/c-parser.cc:13562 cp/parser.cc:37317 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, %, % or %" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, %, % ili %" #: c/c-parser.cc:13683 cp/parser.cc:37429 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, %, % or %" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, %, % ili %" #: c/c-parser.cc:13703 c/c-parser.cc:20890 c/c-parser.cc:20976 #: cp/parser.cc:37447 cp/parser.cc:44061 cp/parser.cc:44152 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>" +#, gcc-internal-format msgid "expected %" -msgstr "očekujem %<;%>" +msgstr "očekivano je %" #: c/c-parser.cc:13756 cp/parser.cc:37502 #, gcc-internal-format @@ -44760,10 +44578,9 @@ msgid "expected %, %, %, %, %, %, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, % or %" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, % ili %" #: c/c-parser.cc:14289 cp/parser.cc:37947 #, gcc-internal-format @@ -44792,10 +44609,9 @@ msgid "too many % arguments" msgstr "" #: c/c-parser.cc:14484 cp/parser.cc:37042 -#, fuzzy, gcc-internal-format -#| msgid "expected %<@end%>" +#, gcc-internal-format msgid "unexpected argument" -msgstr "očekujem %<@end%>" +msgstr "neočekivani argument" #: c/c-parser.cc:14651 cp/semantics.cc:8614 #, gcc-internal-format @@ -44803,23 +44619,20 @@ msgid "% argument needs positive integral constant" msgstr "" #: c/c-parser.cc:14726 cp/parser.cc:38000 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected % or %" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "%, % or %" #: c/c-parser.cc:14735 c/c-parser.cc:14741 cp/parser.cc:38009 #: cp/parser.cc:38019 -#, fuzzy, gcc-internal-format -#| msgid "expected %<@end%>" +#, gcc-internal-format msgid "expected %" -msgstr "očekujem %<@end%>" +msgstr "očekivano je %" #: c/c-parser.cc:14777 cp/parser.cc:38059 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, % or %" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, % ili %" #: c/c-parser.cc:14830 cp/parser.cc:38127 #, gcc-internal-format @@ -44877,10 +44690,9 @@ msgid "% clause alignment expression must be positive constant integer msgstr "" #: c/c-parser.cc:15526 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected % or %" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je % ili %" #: c/c-parser.cc:15533 #, gcc-internal-format @@ -44919,10 +44731,9 @@ msgstr "" #: c/c-parser.cc:16135 cp/parser.cc:39340 cp/parser.cc:39662 #: cp/parser.cc:39712 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "invalid depend kind" -msgstr "neispravni izraz kao operand" +msgstr "nevaljana vrsta ovisnosti" #: c/c-parser.cc:16205 cp/parser.cc:39410 #, gcc-internal-format @@ -44940,10 +44751,9 @@ msgid "%<#pragma omp target%> with modifier other than % or %on msgstr "" #: c/c-parser.cc:16251 cp/parser.cc:39465 -#, fuzzy, gcc-internal-format -#| msgid "invalid 'asm': " +#, gcc-internal-format msgid "invalid map kind" -msgstr "neispravni „asm”: " +msgstr "nevaljana vrsta dodjele" #: c/c-parser.cc:16303 cp/parser.cc:39524 #, gcc-internal-format @@ -44951,10 +44761,9 @@ msgid "% device modifier not preceded by % directive with msgstr "" #: c/c-parser.cc:16315 cp/parser.cc:39535 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected % or %" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je % ili %" #: c/c-parser.cc:16338 cp/semantics.cc:7500 #, gcc-internal-format @@ -44972,10 +44781,9 @@ msgid "invalid proc_bind kind" msgstr "" #: c/c-parser.cc:16494 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, % or %" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, % ili %" #: c/c-parser.cc:16571 cp/semantics.cc:7900 #, gcc-internal-format @@ -45049,10 +44857,9 @@ msgid "variable %qD used more than once with %<#pragma acc declare%>" msgstr "" #: c/c-parser.cc:17420 cp/parser.cc:44747 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected % after %<#pragma acc %s%>" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je % iza %<#pragma acc %s%>" #: c/c-parser.cc:17436 cp/parser.cc:44764 #, gcc-internal-format @@ -45065,10 +44872,9 @@ msgid "%qE has not been declared" msgstr "" #: c/c-parser.cc:17690 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected function name" -msgstr "očekujem kraj retka" +msgstr "očekivano je ime funkcije" #: c/c-parser.cc:17708 cp/parser.cc:46982 #, gcc-internal-format @@ -45101,10 +44907,9 @@ msgid "%<#pragma acc update%> must contain at least one % or % o msgstr "" #: c/c-parser.cc:17902 cp/parser.cc:40440 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>" +#, gcc-internal-format msgid "expected %" -msgstr "očekujem %<;%>" +msgstr "očekivano je " #: c/c-parser.cc:17918 #, gcc-internal-format @@ -45117,16 +44922,14 @@ msgid "%<#pragma omp allocate%> not yet supported" msgstr "" #: c/c-parser.cc:18075 cp/parser.cc:40592 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, %, %, or % clause" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, %, %, ili % naredba" #: c/c-parser.cc:18114 cp/parser.cc:40631 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, % or %" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, % ili %" #: c/c-parser.cc:18138 cp/parser.cc:40660 #, gcc-internal-format @@ -45166,10 +44969,9 @@ msgid "%<#pragma omp atomic write%> incompatible with % clause" msgstr "" #: c/c-parser.cc:18393 cp/parser.cc:40892 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %<==%> comparison in % condition" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivan je %<==%> usporedba u uvjetu %" #: c/c-parser.cc:18400 cp/parser.cc:40899 #, gcc-internal-format @@ -45183,10 +44985,9 @@ msgid "invalid form of %<#pragma omp atomic compare%>" msgstr "" #: c/c-parser.cc:18484 cp/parser.cc:40975 -#, fuzzy, gcc-internal-format -#| msgid "expected %" +#, gcc-internal-format msgid "unexpected %" -msgstr "očekujem %" +msgstr "očekivano je %" #: c/c-parser.cc:18544 cp/parser.cc:41412 #, gcc-internal-format @@ -45219,22 +45020,19 @@ msgid "% expression is not lvalue expression" msgstr "" #: c/c-parser.cc:19034 cp/parser.cc:41567 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, %, % or %" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, %, % ili %" #: c/c-parser.cc:19046 cp/parser.cc:41583 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, % or % clause" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, % ili % naredba" #: c/c-parser.cc:19084 cp/parser.cc:41623 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, %, % or %" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, %, % ili %" #: c/c-parser.cc:19092 cp/parser.cc:41631 #, gcc-internal-format @@ -45247,16 +45045,14 @@ msgid "expected %<(%> or end of line" msgstr "" #: c/c-parser.cc:19176 cp/parser.cc:42350 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected % or % clause" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je % ili % naredba" #: c/c-parser.cc:19181 cp/parser.cc:42356 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %<#pragma omp scan%>" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je %<#pragma omp scan%>" #: c/c-parser.cc:19237 cp/parser.cc:42407 #, gcc-internal-format @@ -45304,16 +45100,14 @@ msgid "%<#pragma omp ordered%> with % clause may only be used in compou msgstr "" #: c/c-parser.cc:20190 cp/parser.cc:43380 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected % after %qs" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je % iza %qs" #: c/c-parser.cc:20532 cp/parser.cc:43724 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>" +#, gcc-internal-format msgid "expected %" -msgstr "očekujem %<;%>" +msgstr "očekivano je %" #: c/c-parser.cc:20787 cp/parser.cc:43999 #, gcc-internal-format @@ -45416,10 +45210,9 @@ msgid "expected %, %, % or %" msgstr "" #: c/c-parser.cc:21808 cp/parser.cc:45538 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>" +#, gcc-internal-format msgid "expected %" -msgstr "očekujem %<;%>" +msgstr "očekivano je %" #: c/c-parser.cc:21828 #, gcc-internal-format @@ -45457,16 +45250,14 @@ msgid "directive with only % clauses ignored" msgstr "" #: c/c-parser.cc:22076 cp/parser.cc:45929 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>" +#, gcc-internal-format msgid "expected %" -msgstr "očekujem %<;%>" +msgstr "očekivano je %" #: c/c-parser.cc:22083 cp/parser.cc:45936 -#, fuzzy, gcc-internal-format -#| msgid "expected %" +#, gcc-internal-format msgid "expected %" -msgstr "očekujem %" +msgstr "očekivano je %" #: c/c-parser.cc:22089 cp/parser.cc:45943 #, gcc-internal-format @@ -45514,10 +45305,9 @@ msgid "expected % or function-name" msgstr "" #: c/c-parser.cc:22349 -#, fuzzy, gcc-internal-format -#| msgid "expected %<(%>" +#, gcc-internal-format msgid "expected function-name %<(%>" -msgstr "očekujem %<(%>" +msgstr "očekivano je function-name %<(%>" #: c/c-parser.cc:22368 #, gcc-internal-format @@ -45525,16 +45315,14 @@ msgid "one of the initializer call arguments should be %<&omp_priv%>" msgstr "" #: c/c-parser.cc:22499 cp/parser.cc:46431 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, %, % or %" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, %, % ili %" #: c/c-parser.cc:22566 cp/parser.cc:46497 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, % or %" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, % ili %" #: c/c-parser.cc:22595 cp/parser.cc:46532 #, gcc-internal-format @@ -45577,16 +45365,14 @@ msgid "variable sized type %qT in % clause" msgstr "" #: c/c-parser.cc:22837 cp/parser.cc:46650 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>, %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %, % or % clause" -msgstr "očekujem %<;%>, %<,%> ili %<)%>" +msgstr "očekivano je %, % ili % naredba" #: c/c-parser.cc:22870 cp/parser.cc:46685 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %qs or %qs" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je %qs ili %qs" #: c/c-parser.cc:22927 cp/parser.cc:46747 #, gcc-internal-format @@ -47127,10 +46913,9 @@ msgid "step expression refers to outer iterator %qD" msgstr "" #: c/c-typeck.cc:14097 cp/semantics.cc:6665 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected pointer in %qs clause" -msgstr "očekujem kraj retka" +msgstr "očekivana je kazaljka (pointer) u %qs naredbi" #: c/c-typeck.cc:14185 cp/semantics.cc:6746 #, gcc-internal-format @@ -47451,10 +47236,9 @@ msgid "C++ requires promoted type, not enum type, in %" msgstr "" #: c/gimple-parser.cc:166 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected frequency quality" -msgstr "očekujem kraj retka" +msgstr "očekivana je frekvencija" #: c/gimple-parser.cc:175 #, gcc-internal-format @@ -47462,10 +47246,9 @@ msgid "unknown profile quality" msgstr "" #: c/gimple-parser.cc:187 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected frequency value" -msgstr "očekujem kraj retka" +msgstr "očekivana je vrijednost frekvencije" #: c/gimple-parser.cc:326 #, gcc-internal-format @@ -47473,16 +47256,14 @@ msgid "edge not found" msgstr "" #: c/gimple-parser.cc:478 c/gimple-parser.cc:484 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected block index" -msgstr "očekujem kraj retka" +msgstr "očekivan je indeks bloka" #: c/gimple-parser.cc:492 -#, fuzzy, gcc-internal-format -#| msgid "invalid %%-code" +#, gcc-internal-format msgid "invalid block index" -msgstr "neispravni %%-kod" +msgstr "nevaljani indeks bloka" #: c/gimple-parser.cc:503 #, gcc-internal-format @@ -47490,10 +47271,9 @@ msgid "expected block specifier" msgstr "" #: c/gimple-parser.cc:521 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected loop number" -msgstr "očekujem kraj retka" +msgstr "očekivan je broj petlje" #: c/gimple-parser.cc:539 #, gcc-internal-format @@ -47501,10 +47281,9 @@ msgid "unknown block specifier" msgstr "" #: c/gimple-parser.cc:552 c/gimple-parser.cc:1964 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected count value" -msgstr "očekujem kraj retka" +msgstr "očekivana je vrijednost za količinu (broj)" #: c/gimple-parser.cc:575 c/gimple-parser.cc:662 #, gcc-internal-format @@ -47522,10 +47301,9 @@ msgid "invalid source block specification" msgstr "" #: c/gimple-parser.cc:886 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "unexpected RHS for assignment" -msgstr "očekujem kraj retka" +msgstr "neočekivani RHS za dodjeliti" #: c/gimple-parser.cc:990 #, gcc-internal-format @@ -47548,10 +47326,9 @@ msgid "% not valid in GIMPLE" msgstr "" #: c/gimple-parser.cc:1192 c/gimple-parser.cc:1529 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected constant offset" -msgstr "očekujem kraj retka" +msgstr "očekivani je stalni (constant) odmak (offset)" #: c/gimple-parser.cc:1253 #, gcc-internal-format @@ -47574,22 +47351,19 @@ msgid "expecting internal function name" msgstr "" #: c/gimple-parser.cc:1323 -#, fuzzy, gcc-internal-format -#| msgid "%s:unknown function '%u'\n" +#, gcc-internal-format msgid "unknown internal function %qE" -msgstr "%s:nepoznata funkcija „%u”\n" +msgstr "nepoznata interna funkcija %qE" #: c/gimple-parser.cc:1461 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "invalid type of %<__MEM%> operand" -msgstr "neispravni izraz kao operand" +msgstr "nevaljana vrsta operanda %<__MEM%>" #: c/gimple-parser.cc:1523 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected constant size" -msgstr "očekujem kraj retka" +msgstr "očekivana je veličina konstante" #: c/gimple-parser.cc:1561 c/gimple-parser.cc:1591 c/gimple-parser.cc:1631 #: c/gimple-parser.cc:1639 c/gimple-parser.cc:1648 @@ -47618,22 +47392,19 @@ msgid "dereference of non-pointer" msgstr "" #: c/gimple-parser.cc:1945 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected pass name" -msgstr "očekujem kraj retka" +msgstr "" #: c/gimple-parser.cc:1984 -#, fuzzy, gcc-internal-format -#| msgid "invalid %%-code" +#, gcc-internal-format msgid "invalid operation" -msgstr "neispravni %%-kod" +msgstr "Interna greška: invalid operation" #: c/gimple-parser.cc:2130 -#, fuzzy, gcc-internal-format -#| msgid "compilation terminated.\n" +#, gcc-internal-format msgid "comparison required" -msgstr "kompajliranje prekinuto.\n" +msgstr "potrebna je usporedba" #: c/gimple-parser.cc:2182 #, gcc-internal-format @@ -47641,10 +47412,9 @@ msgid "% is not supported" msgstr "" #: c/gimple-parser.cc:2184 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected % or %" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je % ili %" #: c/gimple-parser.cc:2228 c/gimple-parser.cc:2265 #, gcc-internal-format @@ -47657,10 +47427,9 @@ msgid "expected else statement" msgstr "" #: c/gimple-parser.cc:2379 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected case label" -msgstr "očekujem kraj retka" +msgstr "Interna greška: expected case label" #. A bad conversion for 'this' must be discarding cv-quals. #: cp/call.cc:3785 @@ -47887,10 +47656,9 @@ msgid "% in %<%E[%E]%>" msgstr "" #: cp/call.cc:5194 -#, fuzzy, gcc-internal-format -#| msgid "%s\n" +#, gcc-internal-format msgid "%qs" -msgstr "%s\n" +msgstr "%qs" #: cp/call.cc:5197 #, gcc-internal-format @@ -49781,10 +49549,9 @@ msgid "%qE does not satisfy return-type-requirement, because" msgstr "" #: cp/constraint.cc:2089 -#, fuzzy, gcc-internal-format -#| msgid "insn does not satisfy its constraints:" +#, gcc-internal-format msgid "%qE does not satisfy return-type-requirement" -msgstr "insn ne zadovoljava svoja ograničenja:" +msgstr "%qE ne zadovoljava „return-type-requirement“" #: cp/constraint.cc:2100 #, gcc-internal-format @@ -50122,13 +49889,12 @@ msgstr "" #: cp/coroutines.cc:2552 #, gcc-internal-format msgid "duplicate info for %qE" -msgstr "" +msgstr "dvostruke informacije za %qE" #: cp/coroutines.cc:3703 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "await expressions are not permitted in handlers" -msgstr "neispravni izraz kao operand" +msgstr "„await“ izraz nije dopušten u rukovateljima (handlers)" #: cp/coroutines.cc:3934 #, gcc-internal-format @@ -50213,10 +49979,9 @@ msgid "% does not contain only non-static data me msgstr "" #: cp/cp-gimplify.cc:3212 -#, fuzzy, gcc-internal-format -#| msgid "Creating '%s'\n" +#, gcc-internal-format msgid "evaluating %qs" -msgstr "Stvaram „%s”\n" +msgstr "procjenjujemo %qs" #: cp/cvt.cc:92 msgid "cannot convert from incomplete type %qH to %qI" @@ -52922,10 +52687,9 @@ msgid "a concept cannot be a member function" msgstr "" #: cp/decl.cc:13853 cp/decl.cc:14199 -#, fuzzy, gcc-internal-format -#| msgid "[cannot find %s]" +#, gcc-internal-format msgid "%qD cannot be %qs" -msgstr "[ne mogu naći %s]" +msgstr "%qD ne može bit %qs" #: cp/decl.cc:13862 #, gcc-internal-format @@ -53549,10 +53313,9 @@ msgid "no conversion operators declared" msgstr "" #: cp/decl2.cc:810 -#, fuzzy, gcc-internal-format -#| msgid "%s:no functions found\n" +#, gcc-internal-format msgid "no functions named %qD" -msgstr "%s:nisu pronađene funkcije\n" +msgstr "nema funkcije nazvane %qD" #: cp/decl2.cc:812 #, gcc-internal-format @@ -53870,10 +53633,9 @@ msgid "use of deleted function %qD" msgstr "" #: cp/decl2.cc:5840 -#, fuzzy, gcc-internal-format -#| msgid "insn does not satisfy its constraints:" +#, gcc-internal-format msgid "use of function %qD with unsatisfied constraints" -msgstr "insn ne zadovoljava svoja ograničenja:" +msgstr "funkcija %qD se koristi s nezadovoljenim ograničenjima" #: cp/decl2.cc:5872 #, gcc-internal-format @@ -54713,16 +54475,14 @@ msgid "failed %s mapper %qs line %u" msgstr "" #: cp/mapper-client.cc:308 -#, fuzzy, gcc-internal-format -#| msgid "failed to open %s" +#, gcc-internal-format msgid "failed %s mapper %qs" -msgstr "nisam uspio otvoriti %s" +msgstr "neuspješni %s „mapper“ %ss" #: cp/mapper-client.cc:320 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "failed to open %s" +#, gcc-internal-format, gfc-internal-format msgid "failed mapper handshake %s" -msgstr "nisam uspio otvoriti %s" +msgstr "" #: cp/mapper-client.cc:354 #, gcc-internal-format, gfc-internal-format @@ -55072,16 +54832,14 @@ msgid "compiled module file is %qs" msgstr "" #: cp/module.cc:17385 cp/module.cc:17390 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "collect2 version %s\n" +#, gcc-internal-format, gfc-internal-format msgid "compiled module is %sversion %s" -msgstr "collect2 inačica %s\n" +msgstr "kompilirani modul je %sversion %s" #: cp/module.cc:17396 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "collect2 version %s\n" +#, gcc-internal-format, gfc-internal-format msgid "compiler is %sversion %s%s%s" -msgstr "collect2 inačica %s\n" +msgstr "kompajler je %sversion %s%s%s" #: cp/module.cc:17426 #, gcc-internal-format @@ -55134,10 +54892,9 @@ msgid "failed to read compiled module cluster %u: %s" msgstr "" #: cp/module.cc:18162 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "failed to open %s" +#, gcc-internal-format, gfc-internal-format msgid "failed to read compiled module: %s" -msgstr "nisam uspio otvoriti %s" +msgstr "nije uspjelo pročitati kompilirani modul: %s" #: cp/module.cc:18172 #, gcc-internal-format @@ -55155,16 +54912,14 @@ msgid "returning to the gate for a mechanical issue" msgstr "" #: cp/module.cc:18670 -#, fuzzy, gcc-internal-format -#| msgid "Creating '%s'\n" +#, gcc-internal-format msgid "reading CMI %qs" -msgstr "Stvaram „%s”\n" +msgstr "čitamo CMI %qs" #: cp/module.cc:18814 -#, fuzzy, gcc-internal-format -#| msgid "failed to open %s" +#, gcc-internal-format msgid "failed to load binding %<%E%s%E%>" -msgstr "nisam uspio otvoriti %s" +msgstr "nije uspjelo učitati vezanja %<%E%s%E%>" #: cp/module.cc:18815 #, gcc-internal-format @@ -55182,10 +54937,9 @@ msgid "during load of binding %<%E%s%E@%s%>" msgstr "" #: cp/module.cc:18881 -#, fuzzy, gcc-internal-format -#| msgid "failed to open %s" +#, gcc-internal-format msgid "failed to load pendings for %<%E%s%E%>" -msgstr "nisam uspio otvoriti %s" +msgstr "nije uspjelo učitati jedinice na čekanju za %<%E%s%E%>" #: cp/module.cc:18885 #, gcc-internal-format @@ -55290,10 +55044,9 @@ msgid "not writing module %qs due to errors" msgstr "" #: cp/module.cc:19902 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "failed to open %s" +#, gcc-internal-format, gfc-internal-format msgid "failed to write compiled module: %s" -msgstr "nisam uspio otvoriti %s" +msgstr "nije uspjelo zapisati kompilirani modul: %s" #: cp/module.cc:20039 #, gcc-internal-format @@ -55311,11 +55064,9 @@ msgid "%q#D conflicts with a previous declaration" msgstr "" #: cp/name-lookup.cc:2898 -#, fuzzy, gcc-internal-format -#| msgid "%d constructor found\n" -#| msgid_plural "%d constructors found\n" +#, gcc-internal-format msgid "%q#D hides constructor for %q#D" -msgstr "%d konstruktor pronađen\n" +msgstr "%q#D skriva konstruktora za %q#D" #: cp/name-lookup.cc:3047 #, gcc-internal-format @@ -55353,10 +55104,9 @@ msgid "%s %<%s(%E)%> %p %d" msgstr "" #: cp/name-lookup.cc:4236 -#, fuzzy, gcc-internal-format -#| msgid "%s %s%s\n" +#, gcc-internal-format msgid "%s %s %p %d" -msgstr "%s %s%s\n" +msgstr "%s %s %p %d" #: cp/name-lookup.cc:4848 #, gcc-internal-format @@ -55980,16 +55730,14 @@ msgid "expected binary operator" msgstr "" #: cp/parser.cc:5387 -#, fuzzy, gcc-internal-format -#| msgid "Unexpected type..." +#, gcc-internal-format msgid "expected ..." -msgstr "Neočekivana vrsta..." +msgstr "očekujemo ..." #: cp/parser.cc:5399 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "binary expression in operand of fold-expression" -msgstr "neispravni izraz kao operand" +msgstr "binarni izraz u operandu od „fold-expression“" #: cp/parser.cc:5404 #, gcc-internal-format @@ -56565,10 +56313,9 @@ msgid "expected jump-statement" msgstr "" #: cp/parser.cc:14523 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected module-name" -msgstr "očekujem kraj retka" +msgstr "očekivano je ime modula" #: cp/parser.cc:14558 #, gcc-internal-format @@ -56847,10 +56594,9 @@ msgid "expected empty string after % keyword" msgstr "" #: cp/parser.cc:17373 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "invalid encoding prefix in literal operator" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani prefiks kodiranja u doslovnom (literal) operatoru" #: cp/parser.cc:17407 #, gcc-internal-format @@ -57030,10 +56776,9 @@ msgid "concept defined here" msgstr "" #: cp/parser.cc:20060 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected % or % after %qE" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je % ili % iza %qE" #: cp/parser.cc:20067 #, gcc-internal-format @@ -57534,7 +57279,7 @@ msgstr "" #: cp/parser.cc:26410 #, gcc-internal-format msgid "cannot specify % for a class" -msgstr "" +msgstr "ne možete specificirati % za klasu" #: cp/parser.cc:26418 #, gcc-internal-format @@ -57595,10 +57340,9 @@ msgid "ISO C++ forbids typename key in template template parameter; use %<-std=c msgstr "" #: cp/parser.cc:26769 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected % or %" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je % ili %" #: cp/parser.cc:27019 #, gcc-internal-format @@ -57716,10 +57460,9 @@ msgid "types may not be defined in exception-declarations" msgstr "" #: cp/parser.cc:28802 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "expected OpenMP directive name" -msgstr "očekujem kraj retka" +msgstr "očekivano je ime direktive OpenMP" #: cp/parser.cc:28811 #, gcc-internal-format @@ -57727,10 +57470,9 @@ msgid "expected attribute argument as balanced token sequence" msgstr "" #: cp/parser.cc:28856 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected % or %" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je % ili %" #: cp/parser.cc:28955 #, gcc-internal-format @@ -57759,10 +57501,9 @@ msgid "attribute %qs specified multiple times" msgstr "" #: cp/parser.cc:29165 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected attribute before %<...%>" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivan je atribut ispred %<...%>" #: cp/parser.cc:29225 #, gcc-internal-format @@ -57999,10 +57740,9 @@ msgid "expected %" msgstr "" #: cp/parser.cc:32840 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>" +#, gcc-internal-format msgid "expected %" -msgstr "očekujem %<;%>" +msgstr "očekivano je %" #: cp/parser.cc:32843 #, gcc-internal-format @@ -58035,10 +57775,9 @@ msgid "expected %<__transaction_relaxed%>" msgstr "" #: cp/parser.cc:32861 -#, fuzzy, gcc-internal-format -#| msgid "expected %<@end%>" +#, gcc-internal-format msgid "expected %" -msgstr "očekujem %<@end%>" +msgstr "očekivano je %" #: cp/parser.cc:32893 #, gcc-internal-format @@ -59736,22 +59475,19 @@ msgid "placeholder constraints not satisfied" msgstr "" #: cp/pt.cc:30247 -#, fuzzy, gcc-internal-format -#| msgid "insn does not satisfy its constraints:" +#, gcc-internal-format msgid "deduced initializer does not satisfy placeholder constraints" -msgstr "insn ne zadovoljava svoja ograničenja:" +msgstr "izvedeni inicijalizator ne zadovoljava ograničenja zamjenskih znakova" #: cp/pt.cc:30251 -#, fuzzy, gcc-internal-format -#| msgid "insn does not satisfy its constraints:" +#, gcc-internal-format msgid "deduced return type does not satisfy placeholder constraints" -msgstr "insn ne zadovoljava svoja ograničenja:" +msgstr "izvedena vrsta vraćanja ne zadovoljava ograničenja zamjenskih znakova" #: cp/pt.cc:30255 -#, fuzzy, gcc-internal-format -#| msgid "insn does not satisfy its constraints:" +#, gcc-internal-format msgid "deduced expression type does not satisfy placeholder constraints" -msgstr "insn ne zadovoljava svoja ograničenja:" +msgstr "izvedena vrsta izraza ne zadovoljava ograničenja zamjenskih znakova" #: cp/pt.cc:30395 #, gcc-internal-format @@ -61646,10 +61382,9 @@ msgid "invalid cast to abstract class type %qT" msgstr "" #: cp/typeck2.cc:209 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "invalid new-expression of abstract class type %qT" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani new-izraz apstraktne klase vrste %qT" #: cp/typeck2.cc:212 #, gcc-internal-format @@ -62255,10 +61990,9 @@ msgid "missing or corrupt object.d" msgstr "" #: d/types.cc:720 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format, gfc-internal-format msgid "invalid expression for static array dimension: %s" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani izraz za statičko polje (array) dimenzije: %s" #: fortran/arith.cc:47 #, gcc-internal-format, gfc-internal-format @@ -63854,10 +63588,9 @@ msgid "To enable preprocessing, use %<-cpp%>" msgstr "" #: fortran/cpp.cc:580 fortran/cpp.cc:591 fortran/cpp.cc:719 -#, fuzzy, gcc-internal-format -#| msgid "Could not open output file '%s'\n" +#, gcc-internal-format msgid "opening output file %qs: %s" -msgstr "Ne mogu otvoriti izlaznu datoteku „%s”\n" +msgstr "otvaramo izlaznu datoteku %qs: %s" #: fortran/data.cc:65 #, gcc-internal-format, gfc-internal-format @@ -65273,10 +65006,9 @@ msgid "Unexpected character in variable list at %C" msgstr "" #: fortran/decl.cc:8837 -#, fuzzy, gcc-internal-format -#| msgid "expected %<(%>" +#, gcc-internal-format msgid "Expected %<(%> at %C" -msgstr "očekujem %<(%>" +msgstr "Očekivano je %<(%> pri %C" #: fortran/decl.cc:8851 fortran/decl.cc:8891 #, gcc-internal-format, gfc-internal-format @@ -65530,10 +65262,9 @@ msgid "ABSTRACT type at %C" msgstr "" #: fortran/decl.cc:10200 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "failed to close state file %s [%s]" +#, gcc-internal-format, gfc-internal-format msgid "Failed to create structure type '%s' at %C" -msgstr "nisam uspio zatvoriti datoteku stanja %s [%s]" +msgstr "Nije uspjelo stvoriti strukturu tipa „%s“ pri %C" #: fortran/decl.cc:10206 #, gcc-internal-format @@ -65751,10 +65482,9 @@ msgid "GENERIC at %C must be inside a derived-type CONTAINS" msgstr "" #: fortran/decl.cc:11390 -#, fuzzy, gcc-internal-format -#| msgid "expected %<:%>" +#, gcc-internal-format msgid "Expected %<::%> at %C" -msgstr "očekujem %<:%>" +msgstr "Očekivano je %<::%> pri %C" #: fortran/decl.cc:11402 #, gcc-internal-format, gfc-internal-format @@ -65767,10 +65497,9 @@ msgid "Malformed GENERIC statement at %C" msgstr "" #: fortran/decl.cc:11434 -#, fuzzy, gcc-internal-format -#| msgid "expected %<=%>" +#, gcc-internal-format msgid "Expected %<=>%> at %C" -msgstr "očekujem %<=%>" +msgstr "Očekivano je %<=>%> pri %C" #: fortran/decl.cc:11470 #, gcc-internal-format @@ -65818,10 +65547,9 @@ msgid "Expected module procedure name at %C" msgstr "" #: fortran/decl.cc:11639 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%>" +#, gcc-internal-format msgid "Expected %<,%> at %C" -msgstr "očekujem %<,%>" +msgstr "Očekivano je %<,%> pri %C" #: fortran/decl.cc:11645 #, gcc-internal-format @@ -66618,10 +66346,9 @@ msgid "Removing call to impure function at %L" msgstr "" #: fortran/frontend-passes.cc:1356 fortran/frontend-passes.cc:1395 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "bad expression" -msgstr "neispravni izraz kao operand" +msgstr "loši izraz" #: fortran/frontend-passes.cc:1391 #, gcc-internal-format @@ -68595,10 +68322,9 @@ msgid "Association target at %L cannot be a BOZ literal constant" msgstr "" #: fortran/match.cc:1972 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "Expected %<)%> or %<,%> at %C" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "Očekivano je %<)%> ili %<,%> pri %C" #: fortran/match.cc:1990 #, gcc-internal-format, gfc-internal-format @@ -69551,34 +69277,29 @@ msgid "write_symtree(): Symbol not written" msgstr "" #: fortran/module.cc:6489 -#, fuzzy, gcc-internal-format -#| msgid "Failed to open file %s for writing state: %s" +#, gcc-internal-format msgid "Cannot open module file %qs for writing at %C: %s" -msgstr "Nisam uspio otvoriti datoteku %s za pisanje stanja: %s" +msgstr "Nije moguće otvoriti modul datoteku %qs za pisanje pri %C: %s" #: fortran/module.cc:6510 -#, fuzzy, gcc-internal-format -#| msgid "Failed to open file %s for writing state: %s" +#, gcc-internal-format msgid "Error writing module file %qs for writing: %s" -msgstr "Nisam uspio otvoriti datoteku %s za pisanje stanja: %s" +msgstr "Greška pri zapisivanju modul datoteke %qs za pisanje: %s" #: fortran/module.cc:6521 -#, fuzzy, gcc-internal-format -#| msgid "Cannot open source file %s\n" +#, gcc-internal-format msgid "Cannot delete module file %qs: %s" -msgstr "Ne mogu otvoriti datoteku koda %s\n" +msgstr "Nije moguće izbrisati modul datoteku %qs: %s" #: fortran/module.cc:6524 -#, fuzzy, gcc-internal-format -#| msgid "Cannot open source file %s\n" +#, gcc-internal-format msgid "Cannot rename module file %qs to %qs: %s" -msgstr "Ne mogu otvoriti datoteku koda %s\n" +msgstr "Nije moguće preimenovati modul datoteku %qs u %qs: %s" #: fortran/module.cc:6530 -#, fuzzy, gcc-internal-format -#| msgid "could not write to temporary file %s" +#, gcc-internal-format msgid "Cannot delete temporary module file %qs: %s" -msgstr "ne mogu pisati u privremenu datoteku %s" +msgstr "Nije moguće izbrisati privremenu modul datoteku %qs: %s" #: fortran/module.cc:6587 #, gcc-internal-format @@ -69661,10 +69382,9 @@ msgid "IEEE_ARITHMETIC module at %C" msgstr "" #: fortran/module.cc:7347 -#, fuzzy, gcc-internal-format -#| msgid "Failed to open file %s for writing state: %s" +#, gcc-internal-format msgid "Cannot open module file %qs for reading at %C: %s" -msgstr "Nisam uspio otvoriti datoteku %s za pisanje stanja: %s" +msgstr "Nije moguće otvoriti modul datoteku %qs za čitanje pri %C: %s" #: fortran/module.cc:7350 #, gcc-internal-format @@ -69697,10 +69417,9 @@ msgid "Cannot USE a module that is currently built" msgstr "" #: fortran/openmp.cc:68 fortran/openmp.cc:6028 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "Unexpected type..." +#, gcc-internal-format, gfc-internal-format msgid "Unexpected junk at %C" -msgstr "Neočekivana vrsta..." +msgstr "Neočekivano smeće pri %C" #: fortran/openmp.cc:349 #, gcc-internal-format, gfc-internal-format @@ -69794,16 +69513,14 @@ msgid "Duplicated %qs clause at %L" msgstr "" #: fortran/openmp.cc:1402 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "Expected %<(%> after %qs at %C" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "Očekivano je %<(%> iza %qs pri %C" #: fortran/openmp.cc:1409 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "Invalid expression after %<%s(%> at %C" -msgstr "neispravni izraz kao operand" +msgstr "Nevaljani izraz iza %<%s(%> pri %C" #: fortran/openmp.cc:1471 #, gcc-internal-format, gfc-internal-format @@ -69811,10 +69528,9 @@ msgid "Clause expected at %C after trailing comma" msgstr "" #: fortran/openmp.cc:1533 -#, fuzzy, gcc-internal-format -#| msgid "expected %<:%>" +#, gcc-internal-format msgid "Expected %<:%> at %C" -msgstr "očekujem %<:%>" +msgstr "Očekivano je %<:%> pri %C" #: fortran/openmp.cc:1576 #, gcc-internal-format, gfc-internal-format @@ -70027,10 +69743,9 @@ msgid "Unexpected junk after $OMP CRITICAL statement at %C" msgstr "" #: fortran/openmp.cc:3765 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "Expected %<( depobj )%> at %C" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "Očekivano je %<( depobj )%> pri %C" #: fortran/openmp.cc:3781 #, gcc-internal-format @@ -70194,10 +69909,9 @@ msgstr "" #: fortran/openmp.cc:4734 fortran/openmp.cc:4879 fortran/openmp.cc:4978 #: fortran/openmp.cc:5045 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "expected %<(%>" +#, gcc-internal-format, gfc-internal-format msgid "expected '(' at %C" -msgstr "očekujem %<(%>" +msgstr "očekivano je '(' at %C" #: fortran/openmp.cc:4742 #, gcc-internal-format, gfc-internal-format @@ -70211,16 +69925,14 @@ msgstr "" #: fortran/openmp.cc:4756 fortran/openmp.cc:4869 fortran/openmp.cc:5026 #: fortran/openmp.cc:5054 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "expected %<)%>" +#, gcc-internal-format, gfc-internal-format msgid "expected ')' at %C" -msgstr "očekujem %<)%>" +msgstr "očekivano je ')' pri %C" #: fortran/openmp.cc:4762 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "expected %<:%>" +#, gcc-internal-format, gfc-internal-format msgid "expected : at %C" -msgstr "očekujem %<:%>" +msgstr "očekivano je : pri %C" #: fortran/openmp.cc:4779 #, gcc-internal-format, gfc-internal-format @@ -70228,10 +69940,9 @@ msgid "property must be constant integer expression or string literal at %C" msgstr "" #: fortran/openmp.cc:4799 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format, gfc-internal-format msgid "expected identifier at %C" -msgstr "očekujem kraj retka" +msgstr "očekivano je identifikator pri %C" #: fortran/openmp.cc:4818 #, gcc-internal-format, gfc-internal-format @@ -70259,28 +69970,24 @@ msgid "expected 'construct', 'device', 'implementation' or 'user' at %C" msgstr "" #: fortran/openmp.cc:4934 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "expected %<=%>" +#, gcc-internal-format, gfc-internal-format msgid "expected '=' at %C" -msgstr "očekujem %<=%>" +msgstr "očekivano je '=' pri %C" #: fortran/openmp.cc:4941 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "expected %<{%>" +#, gcc-internal-format, gfc-internal-format msgid "expected '{' at %C" -msgstr "očekujem %<{%>" +msgstr "očekivano je '{' pri %C" #: fortran/openmp.cc:4956 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "expected %<}%>" +#, gcc-internal-format, gfc-internal-format msgid "expected '}' at %C" -msgstr "očekujem %<}%>" +msgstr "očekivano je '}' pri %C" #: fortran/openmp.cc:4985 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format, gfc-internal-format msgid "expected name at %C" -msgstr "očekujem kraj retka" +msgstr "očekivano je ime pri %C" #: fortran/openmp.cc:4996 #, gcc-internal-format, gfc-internal-format @@ -71344,7 +71051,7 @@ msgstr "" #: fortran/options.cc:690 #, gcc-internal-format msgid "%<-static-libgfortran%> is not supported in this configuration" -msgstr "" +msgstr "%<-static-libgfortran%> nije podržan u ovoj konfiguraciji" #: fortran/options.cc:713 #, gcc-internal-format, gfc-internal-format @@ -71447,10 +71154,9 @@ msgid "%s statement at %C cannot follow %s statement at %L" msgstr "" #: fortran/parse.cc:3063 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "Unexpected end of file in %qs" -msgstr "očekujem kraj retka" +msgstr "Neočekivani kraj datoteke u %qs" #: fortran/parse.cc:3098 #, gcc-internal-format @@ -71573,16 +71279,14 @@ msgid "Noncoarray component %s at %L of type EVENT_TYPE or with subcomponent of msgstr "" #: fortran/parse.cc:3426 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "failed to open %s" +#, gcc-internal-format, gfc-internal-format msgid "failed to create map component '%s'" -msgstr "nisam uspio otvoriti %s" +msgstr "" #: fortran/parse.cc:3459 -#, fuzzy, gcc-internal-format, gfc-internal-format -#| msgid "failed to open %s" +#, gcc-internal-format, gfc-internal-format msgid "failed to create union component '%s'" -msgstr "nisam uspio otvoriti %s" +msgstr "" #: fortran/parse.cc:3514 #, gcc-internal-format, gfc-internal-format @@ -74939,10 +74643,9 @@ msgid "Include directory %qs: %s" msgstr "" #: fortran/scanner.cc:313 -#, fuzzy, gcc-internal-format -#| msgid "ignoring nonexistent directory \"%s\"\n" +#, gcc-internal-format msgid "Nonexistent include directory %qs" -msgstr "zanemarujem nepostojeći direktorij „%s”\n" +msgstr "nepostojeći „include“ direktorij „%qs”" #: fortran/scanner.cc:318 #, gcc-internal-format @@ -75020,22 +74723,19 @@ msgid "File %qs is being included recursively" msgstr "" #: fortran/scanner.cc:2563 -#, fuzzy, gcc-internal-format -#| msgid "Cannot open source file %s\n" +#, gcc-internal-format msgid "Cannot open file %qs" -msgstr "Ne mogu otvoriti datoteku koda %s\n" +msgstr "Nije moguće otvoriti datoteku %qs" #: fortran/scanner.cc:2573 -#, fuzzy, gcc-internal-format -#| msgid "Cannot open source file %s\n" +#, gcc-internal-format msgid "Cannot open included file %qs" -msgstr "Ne mogu otvoriti datoteku koda %s\n" +msgstr "Nije moguće otvoriti „included“ datoteku %qs" #: fortran/scanner.cc:2575 -#, fuzzy, gcc-internal-format -#| msgid "Cannot open source file %s\n" +#, gcc-internal-format msgid "Cannot open pre-included file %qs" -msgstr "Ne mogu otvoriti datoteku koda %s\n" +msgstr "Nije moguće otvoriti „pre-included“ datoteku %qs" #: fortran/scanner.cc:2583 fortran/scanner.cc:2585 #, gcc-internal-format @@ -75416,7 +75116,7 @@ msgstr "" #: fortran/symbol.cc:200 #, gcc-internal-format, gfc-internal-format msgid "Cannot specify IMPLICIT at %C after IMPLICIT NONE" -msgstr "" +msgstr "Ne možete specificirati IMPLICIT pri %C iza IMPLICIT NONE" #: fortran/symbol.cc:210 #, gcc-internal-format @@ -75795,10 +75495,9 @@ msgid "Symbol %qs is used before it is typed at %L" msgstr "" #: fortran/target-memory.cc:137 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "Invalid expression in gfc_element_size." -msgstr "neispravni izraz kao operand" +msgstr "Nevaljani izraz u „gfc_element_size“." #: fortran/target-memory.cc:361 #, gcc-internal-format @@ -76075,16 +75774,14 @@ msgid "optional class parameter" msgstr "" #: fortran/trans-openmp.cc:3388 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "unhandled expression type" -msgstr "neispravni izraz kao operand" +msgstr "neobrađena vrsta izraza" #: fortran/trans-openmp.cc:3542 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "unhandled expression" -msgstr "neispravni izraz kao operand" +msgstr "neobrađeni izraz" #: fortran/trans-openmp.cc:7248 #, gcc-internal-format @@ -76122,10 +75819,9 @@ msgid "The base procedure at %L must have an explicit interface" msgstr "" #: fortran/trans-openmp.cc:7665 -#, fuzzy, gcc-internal-format -#| msgid "[cannot find %s]" +#, gcc-internal-format msgid "Cannot find symbol %qs" -msgstr "[ne mogu naći %s]" +msgstr "Nije moguće naći simbol %qs" #: fortran/trans-openmp.cc:7676 #, gcc-internal-format @@ -76238,10 +75934,9 @@ msgid "invalid embedcfg: not a JSON object" msgstr "" #: go/gofrontend/embed.cc:285 -#, fuzzy, gcc-internal-format -#| msgid "invalid expression as operand" +#, gcc-internal-format msgid "invalid embedcfg: missing Patterns" -msgstr "neispravni izraz kao operand" +msgstr "nevaljani embedcfg: nedostaje Patterns" #: go/gofrontend/embed.cc:290 #, gcc-internal-format @@ -76279,16 +75974,14 @@ msgid "empty file" msgstr "" #: go/gofrontend/embed.cc:391 go/gofrontend/embed.cc:520 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>" +#, gcc-internal-format msgid "expected %<\"%>" -msgstr "očekujem %<;%>" +msgstr "očekivan je %<\"%>" #: go/gofrontend/embed.cc:474 -#, fuzzy, gcc-internal-format -#| msgid "expected %<,%> or %<)%>" +#, gcc-internal-format msgid "expected %<,%> or %<]%>" -msgstr "očekujem %<,%> ili %<)%>" +msgstr "očekivano je %<,%> ili %<]%>" #: go/gofrontend/embed.cc:506 #, gcc-internal-format @@ -76307,22 +76000,19 @@ msgid "invalid hex digit" msgstr "" #: go/gofrontend/embed.cc:604 -#, fuzzy, gcc-internal-format -#| msgid "unrecognizable insn:" +#, gcc-internal-format msgid "unrecognized string escape" -msgstr "neprepoznati insn:" +msgstr "neprepoznata maska (escape) stringa" #: go/gofrontend/embed.cc:625 -#, fuzzy, gcc-internal-format -#| msgid "expected end of line" +#, gcc-internal-format msgid "extraneous data at end of file" -msgstr "očekujem kraj retka" +msgstr "dodatni čudni podaci na kraju datoteke" #: go/gofrontend/embed.cc:645 -#, fuzzy, gcc-internal-format -#| msgid "expected %<;%>" +#, gcc-internal-format msgid "unexpected EOF" -msgstr "očekujem %<;%>" +msgstr "neočekivani EOF" #: jit/dummy-frontend.cc:207 lto/lto-lang.cc:310 #, gcc-internal-format @@ -76415,10 +76105,9 @@ msgid "Level not found, use none, slim, blocks, vops." msgstr "" #: lto/lto-dump.cc:273 -#, fuzzy, gcc-internal-format -#| msgid "%s:no functions found\n" +#, gcc-internal-format msgid "Function not found." -msgstr "%s:nisu pronađene funkcije\n" +msgstr "Funkcija nije pronađena." #: lto/lto-dump.cc:350 lto/lto-dump.cc:360 #, gcc-internal-format @@ -76461,10 +76150,9 @@ msgid "min partition size cannot be greater than max partition size" msgstr "" #: lto/lto-symtab.cc:169 -#, fuzzy, gcc-internal-format -#| msgid "%s terminated with signal %d [%s]" +#, gcc-internal-format msgid "%qD is defined with tls model %s" -msgstr "%s prekinut signalom %d [%s]" +msgstr "%qD je definiran s TLS modelom %s" #: lto/lto-symtab.cc:171 #, gcc-internal-format, gfc-internal-format @@ -76537,10 +76225,9 @@ msgid "% failed" msgstr "" #: lto/lto.cc:199 -#, fuzzy, gcc-internal-format -#| msgid "pex_init failed" +#, gcc-internal-format msgid "waitpid failed" -msgstr "pex_init nije uspio" +msgstr "waitpid neuspješan" #: lto/lto.cc:202 #, gcc-internal-format @@ -77284,10 +76971,9 @@ msgid "cannot find interface declaration for %qE, superclass of %qE" msgstr "" #: objc/objc-act.cc:7001 -#, fuzzy, gcc-internal-format -#| msgid "function body not available" +#, gcc-internal-format msgid "class %qE is not available" -msgstr "tijelo funkcije nije dostupno" +msgstr "klasa %qE nije dostupna" #: objc/objc-act.cc:7034 #, gcc-internal-format From 95768878c718f80e3d562130e2118831bc7fdbf6 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 28 Mar 2022 22:05:01 +0100 Subject: [PATCH 100/157] testsuite: Disable tests for C++23 that depend on std::unexpected These tests depend on unexpected handlers, which are no longer declared for C++23 mode. Adjust the target specifier so they don't run. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/noexcept06.C: Disable for C++23. libstdc++-v3/ChangeLog: * testsuite/18_support/exception/38732.cc: Disable for C++23. * testsuite/18_support/headers/exception/synopsis.cc: Likewise. * testsuite/18_support/unexpected_handler.cc: Likewise. --- gcc/testsuite/g++.dg/cpp0x/noexcept06.C | 2 +- libstdc++-v3/testsuite/18_support/exception/38732.cc | 2 ++ libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc | 2 +- libstdc++-v3/testsuite/18_support/unexpected_handler.cc | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept06.C b/gcc/testsuite/g++.dg/cpp0x/noexcept06.C index ea152237d54..0183ad6d918 100644 --- a/gcc/testsuite/g++.dg/cpp0x/noexcept06.C +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept06.C @@ -1,6 +1,6 @@ // Test that checking of a nothrow specification uses the one on the // definition. -// { dg-do run { target c++11 } } +// { dg-do run { target { c++11 && { ! c++23 } } } } // { dg-options "-Wno-terminate" } #include diff --git a/libstdc++-v3/testsuite/18_support/exception/38732.cc b/libstdc++-v3/testsuite/18_support/exception/38732.cc index 7b68921d074..a3888353a4b 100644 --- a/libstdc++-v3/testsuite/18_support/exception/38732.cc +++ b/libstdc++-v3/testsuite/18_support/exception/38732.cc @@ -15,6 +15,8 @@ // with this library; see the file COPYING3. If not see // . +// { dg-do run { target { c++11 && { ! c++23 } } } } + #include #include #include "unwind.h" diff --git a/libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc b/libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc index efc0bc64c18..ceb7d1f754b 100644 --- a/libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc +++ b/libstdc++-v3/testsuite/18_support/headers/exception/synopsis.cc @@ -1,4 +1,4 @@ -// { dg-do compile { target c++11 } } +// { dg-do compile { target { c++11 && { ! c++23 } } } } // Copyright (C) 2007-2022 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/18_support/unexpected_handler.cc b/libstdc++-v3/testsuite/18_support/unexpected_handler.cc index efd00abf879..344e7e08294 100644 --- a/libstdc++-v3/testsuite/18_support/unexpected_handler.cc +++ b/libstdc++-v3/testsuite/18_support/unexpected_handler.cc @@ -16,7 +16,7 @@ // . // { dg-options "-Wno-deprecated-declarations" } -// { dg-do run { target c++11 } } +// { dg-do run { target { c++11 && { ! c++23 } } } } // D.11 Violating exception-specifications From eb59ddf57fbc4bf1d2deaf0665ede4aa37181069 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 29 Mar 2022 11:17:01 +0100 Subject: [PATCH 101/157] testsuite: Allow setting gpp_std_list in configuration files This allows the gpp_std_list variable to be set in ~/.dejagnurc instead of using the GXX_TESTSUITE_STDS environment variable. This is consistent with how other defaults such as tool_timeout can be set. The environment variable can still be used to override the default. gcc/testsuite/ChangeLog: * lib/g++-dg.exp: Update comments. * lib/g++.exp (gpp_std_list): Check for an existing value before setting it to an empty list. --- gcc/testsuite/lib/g++-dg.exp | 7 ++++--- gcc/testsuite/lib/g++.exp | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp index a1bc37074b5..59e8081a29d 100644 --- a/gcc/testsuite/lib/g++-dg.exp +++ b/gcc/testsuite/lib/g++-dg.exp @@ -27,8 +27,8 @@ proc g++-dg-prune { system text } { return [gcc-dg-prune $system $text] } -# Modified dg-runtest that runs tests in both C++98 and C++11 modes -# unless they specifically specify one or the other. +# Modified dg-runtest that runs tests in multiple standard modes, +# unless they specifically specify one standard. proc g++-dg-runtest { testcases flags default-extra-flags } { global runtests @@ -39,7 +39,7 @@ proc g++-dg-runtest { testcases flags default-extra-flags } { } # If the testcase specifies a standard, use that one. - # If not, run it under both standards, allowing GNU extensions + # If not, run it under several standards, allowing GNU extensions # if there's a dg-options line. if ![search_for $test "-std=*++"] { if [search_for $test "dg-options"] { @@ -48,6 +48,7 @@ proc g++-dg-runtest { testcases flags default-extra-flags } { set std_prefix "-std=c++" } + # See g++.exp for the initial value of this list. global gpp_std_list if { [llength $gpp_std_list] > 0 } { set std_list $gpp_std_list diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 3744ebe4b44..24ef068b239 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -32,7 +32,11 @@ load_lib target-libpath.exp set gpp_compile_options "" -set gpp_std_list { } +# Allow gpp_std_list to be set in configuration files, e.g., ~/.dejagnurc +if ![info exists gpp_std_list] { + set gpp_std_list { } +} +# Allow gpp_std_list to be set from the environment. if [info exists env(GXX_TESTSUITE_STDS)] { set gpp_std_list [split $env(GXX_TESTSUITE_STDS) ","] } From 69db6e7f4e1d07bf8f33e93a29139cc16c1e0a2f Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Tue, 29 Mar 2022 22:12:15 +0200 Subject: [PATCH 102/157] Fortran: avoid NULL pointer dereference checking elemental procedure args gcc/fortran/ChangeLog: PR fortran/104571 * resolve.cc (resolve_elemental_actual): Avoid NULL pointer dereference. gcc/testsuite/ChangeLog: PR fortran/104571 * gfortran.dg/pr104571.f90: New test. Co-authored-by: Steven G. Kargl --- gcc/fortran/resolve.cc | 5 +++-- gcc/testsuite/gfortran.dg/pr104571.f90 | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/pr104571.f90 diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc index 290767723d8..21c8797c938 100644 --- a/gcc/fortran/resolve.cc +++ b/gcc/fortran/resolve.cc @@ -2397,8 +2397,9 @@ resolve_elemental_actual (gfc_expr *expr, gfc_code *c) if (rank > 0 && esym && expr == NULL) for (eformal = esym->formal, arg = arg0; arg && eformal; arg = arg->next, eformal = eformal->next) - if ((eformal->sym->attr.intent == INTENT_OUT - || eformal->sym->attr.intent == INTENT_INOUT) + if (eformal->sym + && (eformal->sym->attr.intent == INTENT_OUT + || eformal->sym->attr.intent == INTENT_INOUT) && arg->expr && arg->expr->rank == 0) { gfc_error ("Actual argument at %L for INTENT(%s) dummy %qs of " diff --git a/gcc/testsuite/gfortran.dg/pr104571.f90 b/gcc/testsuite/gfortran.dg/pr104571.f90 new file mode 100644 index 00000000000..9a6f2d0e872 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr104571.f90 @@ -0,0 +1,12 @@ +! { dg-do compile } +! { dg-options "-std=legacy" } +! PR fortran/104571 - ICE in resolve_elemental_actual +! Contributed by G.Steinmetz + +program p + real :: x(3) + call g(x) ! { dg-error "Missing alternate return" } +contains + elemental subroutine g(*) ! { dg-error "Alternate return specifier" } + end +end From c788a0eae0a7144e6f148162512fa2e93a45a035 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 29 Mar 2022 17:50:48 -0400 Subject: [PATCH 103/157] analyzer: skip constant pool in -fdump-analyzer-untracked [PR testsuite/105085] In r12-7809-g5f6197d7c197f9 I added -fdump-analyzer-untracked as support for DejaGnu testing of an optimization of -fanalyzer, PR analyzer/104954. PR testsuite/105085 notes testsuite failures of the form: FAIL: gcc.dg/analyzer/untracked-1.c (test for excess errors) Excess errors: cc1: warning: track '*.LC1': yes where these warnings are emitted on some targets where the test causes labelled constants to be created in the constant pool. We probably ought not to be tracking the values of such decls in the store, given that they're meant to be constant, and I attempted various fixes to make the "should we track this decl" logic smarter, but given that we're in stage 4, the simplest fix seems to be for -fdump-analyzer-untracked to skip such decls in its output, to minimize test output differences between targets. gcc/analyzer/ChangeLog: PR testsuite/105085 * region-model-manager.cc (dump_untracked_region): Skip decls in the constant pool. gcc/testsuite/ChangeLog: PR testsuite/105085 * gcc.dg/analyzer/untracked-1.c: Add further test coverage. Signed-off-by: David Malcolm --- gcc/analyzer/region-model-manager.cc | 7 ++++++ gcc/testsuite/gcc.dg/analyzer/untracked-1.c | 26 +++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/gcc/analyzer/region-model-manager.cc b/gcc/analyzer/region-model-manager.cc index 5ca333a9ed6..56d60768749 100644 --- a/gcc/analyzer/region-model-manager.cc +++ b/gcc/analyzer/region-model-manager.cc @@ -1770,6 +1770,13 @@ dump_untracked_region (const decl_region *decl_reg) tree decl = decl_reg->get_decl (); if (TREE_CODE (decl) != VAR_DECL) return; + /* For now, don't emit the status of decls in the constant pool, to avoid + differences in DejaGnu test results between targets that use these vs + those that don't. + (Eventually these decls should probably be untracked and we should test + for that, but that's not stage 4 material). */ + if (DECL_IN_CONSTANT_POOL (decl)) + return; warning_at (DECL_SOURCE_LOCATION (decl), 0, "track %qD: %s", decl, (decl_reg->tracked_p () ? "yes" : "no")); diff --git a/gcc/testsuite/gcc.dg/analyzer/untracked-1.c b/gcc/testsuite/gcc.dg/analyzer/untracked-1.c index d07c2975670..9f3a639db5c 100644 --- a/gcc/testsuite/gcc.dg/analyzer/untracked-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/untracked-1.c @@ -1,5 +1,7 @@ /* { dg-additional-options "-fdump-analyzer-untracked" } */ +#include "analyzer-decls.h" + struct st { const char *m_filename; @@ -39,6 +41,16 @@ void test_3 (void) extern_fn (&s3); } +void test_3a (void) +{ + struct st s3a = { "foo.c", 42 }; /* { dg-warning "track 's3a': yes" } */ + __analyzer_eval (s3a.m_filename[0] == 'f'); /* { dg-warning "TRUE" } */ + __analyzer_eval (s3a.m_line == 42); /* { dg-warning "TRUE" } */ + extern_fn (&s3a); + __analyzer_eval (s3a.m_filename[0] == 'f'); /* { dg-warning "UNKNOWN" } */ + __analyzer_eval (s3a.m_line == 42); /* { dg-warning "UNKNOWN" } */ +} + extern void called_by_test_4 (int *); int test_4 (void) @@ -103,3 +115,17 @@ void test_13 (void) { extern_fn_char_ptr (__func__); /* { dg-warning "track '__func__': no" } */ } + +char t14_global_unused[100]; /* { dg-warning "track 't14_global_unused': yes" } */ +static char t14_static_unused[100]; /* { dg-warning "track 't14_static_unused': yes" } */ +char t14_global_used[100]; /* { dg-warning "track 't14_global_used': yes" } */ +static char t14_static_used[100]; /* { dg-warning "track 't14_static_used': yes" } */ +void test_14 (void) +{ + extern_fn_char_ptr (t14_global_unused); + extern_fn_char_ptr (t14_static_unused); + extern_fn_char_ptr (t14_global_used); + __analyzer_eval (t14_global_used[0] == '\0'); /* { dg-warning "UNKNOWN" } */ + extern_fn_char_ptr (t14_static_used); + __analyzer_eval (t14_static_used[0] == '\0'); /* { dg-warning "UNKNOWN" } */ +} From 9f774626c021c244be6f4c9589c9dac71d544b15 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Wed, 30 Mar 2022 00:16:49 +0000 Subject: [PATCH 104/157] Daily bump. --- ChangeLog | 11 +++ config/ChangeLog | 5 ++ contrib/ChangeLog | 11 +++ gcc/ChangeLog | 146 ++++++++++++++++++++++++++++++++++++++++ gcc/DATESTAMP | 2 +- gcc/analyzer/ChangeLog | 52 ++++++++++++++ gcc/fortran/ChangeLog | 13 ++++ gcc/po/ChangeLog | 4 ++ gcc/testsuite/ChangeLog | 112 ++++++++++++++++++++++++++++++ libgcc/ChangeLog | 18 +++++ libgomp/ChangeLog | 5 ++ libstdc++-v3/ChangeLog | 17 +++++ 12 files changed, 395 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0b252306f87..5c545e5c186 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2022-03-29 Chenghua Xu + + * MAINTAINERS: (CPU Port Maintainers): Add myself and + Lulu as LoongArch port maintainer. + +2022-03-29 Chenghua Xu + Lulu Cheng + + * configure.ac: Add LoongArch tuples. + * configure: Regenerate. + 2022-03-28 Tom Tromey * configure.ac: Remove --with-mpfr-dir and --with-gmp-dir. diff --git a/config/ChangeLog b/config/ChangeLog index 066c01f9b56..abeeecdb94d 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2022-03-29 Chenghua Xu + Lulu Cheng + + * picflag.m4: Default add build option '-fpic' for LoongArch. + 2021-12-21 Iain Buclaw PR d/103528 diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 6da801bccbe..8820ec9a3bb 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,14 @@ +2022-03-29 Chenghua Xu + Lulu Cheng + + * config-list.mk: Add LoongArch triplet. + +2022-03-29 Chenghua Xu + Lulu Cheng + + * gcc_update (files_and_dependencies): Add + config/loongarch/loongarch.opt and config/loongarch/loongarch-str.h. + 2022-03-28 Martin Liska * gcc-changelog/git_commit.py: Match trailing dot literally. diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9ec7a7c4663..fd8498f9c48 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,149 @@ +2022-03-29 Marek Polacek + Jakub Jelinek + + PR middle-end/103597 + * gimplify.cc (collect_fallthrough_labels): Don't push UNUSED_LABEL_Ps + into labels. Maybe set prev to the statement preceding UNUSED_LABEL_P. + (gimplify_cond_expr): Set UNUSED_LABEL_P. + * tree.h (UNUSED_LABEL_P): New. + +2022-03-29 Michael Meissner + + * config/rs6000/vsx.md (vsx_extract_): Allow destination to + be any VSX register. + +2022-03-29 Richard Earnshaw + + PR target/102024 + * config/aarch64/aarch64.cc (aapcs_vfp_sub_candidate): Handle + zero-sized bit-fields. Detect cases where a warning may be needed. + (aarch64_vfp_is_call_or_return_candidate): Emit a note if a + zero-sized bit-field has caused parameter passing to change. + +2022-03-29 Richard Earnshaw + + PR target/102024 + * config/arm/arm.cc (aapcs_vfp_sub_candidate): Handle zero-sized + bit-fields. Detect cases where a warning may be needed. + (aapcs_vfp_is_call_or_return_candidate): Emit a note if + a zero-sized bit-field has caused parameter passing to change. + +2022-03-29 Richard Earnshaw + + PR target/96882 + * config/arm/arm.cc (arm_get_pcs_model): Disable selection of + ARM_PCS_AAPCS_LOCAL. + +2022-03-29 Tom de Vries + + PR target/104857 + * config/nvptx/nvptx-c.cc (nvptx_cpu_cpp_builtins): Emit + __PTX_ISA_VERSION_MAJOR__ and __PTX_ISA_VERSION_MINOR__. + * config/nvptx/nvptx.cc (ptx_version_to_number): New function. + * config/nvptx/nvptx-protos.h (ptx_version_to_number): Declare. + +2022-03-29 Tom de Vries + + * config/nvptx/nvptx.opt (m64): Update help text to reflect that it + is ignored. + +2022-03-29 Tom de Vries + + PR target/104714 + * config/nvptx/nvptx.opt (march-map=*): Add aliases. + +2022-03-29 Jan Hubicka + + * config/i386/i386-builtins.cc (ix86_vectorize_builtin_gather): Test + TARGET_USE_GATHER_2PARTS and TARGET_USE_GATHER_4PARTS. + * config/i386/i386.h (TARGET_USE_GATHER_2PARTS): New macro. + (TARGET_USE_GATHER_4PARTS): New macro. + * config/i386/x86-tune.def (X86_TUNE_USE_GATHER_2PARTS): New tune + (X86_TUNE_USE_GATHER_4PARTS): New tune + +2022-03-29 Tom de Vries + + * config/nvptx/nvptx.opt (march): Add alias of misa. + +2022-03-29 Chenghua Xu + Lulu Cheng + + * doc/install.texi: Add LoongArch options section. + * doc/invoke.texi: Add LoongArch options section. + * doc/md.texi: Add LoongArch options section. + +2022-03-29 Chenghua Xu + Lulu Cheng + + * config/loongarch/loongarch-c.cc + +2022-03-29 Chenghua Xu + Lulu Cheng + + * config/loongarch/larchintrin.h: New file. + * config/loongarch/loongarch-builtins.cc: New file. + +2022-03-29 Chenghua Xu + Lulu Cheng + + * config/host-linux.cc: Add LoongArch support. + * config/loongarch/loongarch-protos.h: New file. + * config/loongarch/loongarch-tune.h: Likewise. + * config/loongarch/loongarch.cc: Likewise. + * config/loongarch/loongarch.h: Likewise. + +2022-03-29 Chenghua Xu + Lulu Cheng + + * config/loongarch/constraints.md: New file. + * config/loongarch/generic.md: New file. + * config/loongarch/la464.md: New file. + * config/loongarch/loongarch-ftypes.def: New file. + * config/loongarch/loongarch-modes.def: New file. + * config/loongarch/loongarch.md: New file. + * config/loongarch/predicates.md: New file. + * config/loongarch/sync.md: New file. + +2022-03-29 Chenghua Xu + Lulu Cheng + + * configure: Regenerate file. + +2022-03-29 Chenghua Xu + Lulu Cheng + + * common/config/loongarch/loongarch-common.cc: New file. + * config/loongarch/genopts/genstr.sh: New file. + * config/loongarch/genopts/loongarch-strings: New file. + * config/loongarch/genopts/loongarch.opt.in: New file. + * config/loongarch/loongarch-str.h: New file. + * config/loongarch/gnu-user.h: New file. + * config/loongarch/linux.h: New file. + * config/loongarch/loongarch-cpu.cc: New file. + * config/loongarch/loongarch-cpu.h: New file. + * config/loongarch/loongarch-def.c: New file. + * config/loongarch/loongarch-def.h: New file. + * config/loongarch/loongarch-driver.cc: New file. + * config/loongarch/loongarch-driver.h: New file. + * config/loongarch/loongarch-opts.cc: New file. + * config/loongarch/loongarch-opts.h: New file. + * config/loongarch/loongarch.opt: New file. + * config/loongarch/t-linux: New file. + * config/loongarch/t-loongarch: New file. + * config.gcc: Add LoongArch support. + * configure.ac: Add LoongArch support. + +2022-03-29 Thomas Schwinge + + * opt-functions.awk (lang_enabled_by): Fix 'enabledby_negargs' + typo. + +2022-03-29 Richard Biener + + PR tree-optimization/105080 + * tree-ssa-strlen.cc (printf_strlen_execute): Always init + loops and SCEV. + 2022-03-28 Indu Bhagat * ctfout.cc (ctf_preprocess): Use ctfc_get_num_ctf_vars instead. diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 03b2f588835..5ef3293bd94 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20220329 +20220330 diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index d0c74b48105..123e8cbd554 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,3 +1,55 @@ +2022-03-29 David Malcolm + + PR testsuite/105085 + * region-model-manager.cc (dump_untracked_region): Skip decls in + the constant pool. + +2022-03-29 David Malcolm + + PR analyzer/105087 + * analyzer.h (class conjured_purge): New forward decl. + * region-model-asm.cc (region_model::on_asm_stmt): Add + conjured_purge param to calls binding_cluster::on_asm and + region_model_manager::get_or_create_conjured_svalue. + * region-model-impl-calls.cc + (call_details::get_or_create_conjured_svalue): Likewise for call + to region_model_manager::get_or_create_conjured_svalue. + (region_model::impl_call_fgets): Remove call to + region_model::purge_state_involving, as this is now done + implicitly by call_details::get_or_create_conjured_svalue. + (region_model::impl_call_fread): Likewise. + (region_model::impl_call_strchr): Pass conjured_purge param to + call to region_model_manager::get_or_create_conjured_svalue. + * region-model-manager.cc (conjured_purge::purge): New. + (region_model_manager::get_or_create_conjured_svalue): Add + param "p". Use it to purge state when reusing an existing + conjured_svalue. + * region-model.cc (region_model::on_call_pre): Replace call to + region_model::purge_state_involving with passing conjured_purge + to region_model_manager::get_or_create_conjured_svalue. + (region_model::handle_unrecognized_call): Pass conjured_purge to + store::on_unknown_fncall. + * region-model.h + (region_model_manager::get_or_create_conjured_svalue): Add param + "p". + * store.cc (binding_cluster::on_unknown_fncall): Likewise. Pass + it on to region_model_manager::get_or_create_conjured_svalue. + (binding_cluster::on_asm): Likewise. + (store::on_unknown_fncall): Add param "p" and pass it on to + binding_cluster::on_unknown_fncall. + * store.h (binding_cluster::on_unknown_fncall): Add param p. + (binding_cluster::on_asm): Likewise. + (store::on_unknown_fncall): Likewise. + * svalue.h (class conjured_purge): New. + +2022-03-29 David Malcolm + + PR analyzer/105074 + * region.cc (ipa_ref_requires_tracking): Drop "context_fndecl", + instead using the ref->referring to get the cgraph node of the + caller. + (symnode_requires_tracking_p): Likewise. + 2022-03-26 David Malcolm PR analyzer/105057 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a2aac51bd2e..0e05013d94a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,16 @@ +2022-03-29 Harald Anlauf + Steven G. Kargl + + PR fortran/104571 + * resolve.cc (resolve_elemental_actual): Avoid NULL pointer + dereference. + +2022-03-29 Harald Anlauf + + PR fortran/50549 + * resolve.cc (resolve_structure_cons): Reject pointer assignments + of character with different lengths in structure constructor. + 2022-03-25 Jakub Jelinek PR fortran/103691 diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 6406788b4f8..4d1997b2d04 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,7 @@ +2022-03-29 Joseph Myers + + * hr.po: Update. + 2022-03-28 Joseph Myers * sv.po: Update. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 08e5ae798e4..f3335e7254c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,115 @@ +2022-03-29 David Malcolm + + PR testsuite/105085 + * gcc.dg/analyzer/untracked-1.c: Add further test coverage. + +2022-03-29 Harald Anlauf + Steven G. Kargl + + PR fortran/104571 + * gfortran.dg/pr104571.f90: New test. + +2022-03-29 Jonathan Wakely + + * lib/g++-dg.exp: Update comments. + * lib/g++.exp (gpp_std_list): Check for an existing value before + setting it to an empty list. + +2022-03-29 Jonathan Wakely + + * g++.dg/cpp0x/noexcept06.C: Disable for C++23. + +2022-03-29 Harald Anlauf + + PR fortran/50549 + * gfortran.dg/char_pointer_assign_7.f90: New test. + +2022-03-29 Marek Polacek + Jakub Jelinek + + PR middle-end/103597 + * c-c++-common/Wimplicit-fallthrough-39.c: New test. + +2022-03-29 Patrick Palka + + PR c++/71637 + * c-c++-common/Wmisleading-indentation-6.c: New test. + +2022-03-29 Richard Earnshaw + + * gcc.target/aarch64/aapcs64/test_28.c: New test. + +2022-03-29 Richard Earnshaw + + PR target/102024 + * gcc.target/arm/aapcs/vfp26.c: New test. + +2022-03-29 Tom de Vries + + PR target/104857 + * gcc.target/nvptx/ptx31.c: New test. + * gcc.target/nvptx/ptx60.c: New test. + * gcc.target/nvptx/ptx63.c: New test. + * gcc.target/nvptx/ptx70.c: New test. + +2022-03-29 Tom de Vries + + PR target/104714 + * gcc.target/nvptx/march-map.c: New test. + +2022-03-29 Tom de Vries + + * gcc.target/nvptx/main.c: New test. + * gcc.target/nvptx/march.c: New test. + +2022-03-29 Chenghua Xu + Lulu Cheng + + * g++.dg/cpp0x/constexpr-rom.C: Add build options for LoongArch. + * g++.old-deja/g++.abi/ptrmem.C: Add LoongArch support. + * g++.old-deja/g++.pt/ptrmem6.C: xfail for LoongArch. + * gcc.dg/20020312-2.c: Add LoongArch support. + * c-c++-common/zero-scratch-regs-10.c: Like wise + * c-c++-common/zero-scratch-regs-11.c: Like wise + * c-c++-common/zero-scratch-regs-8.c: Like wise + * c-c++-common/zero-scratch-regs-9.c: Like wise + * gcc.dg/loop-8.c: Skip on LoongArch. + * gcc.dg/torture/stackalign/builtin-apply-2.c: Likewise. + * gcc.dg/tree-ssa/ssa-fre-3.c: Likewise. + * go.test/go-test.exp: Define the LoongArch target. + * lib/target-supports.exp: Like wise. + * gcc.target/loongarch/loongarch.exp: New file. + * gcc.target/loongarch/tst-asm-const.c: Like wise. + * gcc.target/loongarch/larch-builtin.c: Like wise. + +2022-03-29 Marc Poulhiès + + * gcc.target/i386/pr103275.c: Add missing + dg-require-effective-target for checking fpic. + +2022-03-29 Marc Poulhiès + + * gcc.target/i386/pr97521.c: Add -Wno-psabi to dg-options. + * gcc.dg/analyzer/pr96713.c: Likewise. + +2022-03-29 Richard Biener + + PR tree-optimization/105080 + * gcc.dg/pr105080.c: New testcase. + +2022-03-29 David Malcolm + + * gcc.dg/analyzer/pr105087-1.c: New test. + * gcc.dg/analyzer/pr105087-2.c: New test. + * gcc.dg/analyzer/vasprintf-1.c: New test. + +2022-03-29 David Malcolm + + PR analyzer/105074 + * gcc.dg/analyzer/pr105074.c: New test. + * gcc.dg/analyzer/untracked-1.c (extern_fn_char_ptr): New decl. + (test_13): New. + 2022-03-28 Patrick Palka PR c++/105067 diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index b488ef2ca84..8b2b9f4c191 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,21 @@ +2022-03-29 Chenghua Xu + Lulu Cheng + + * configure: Regenerate file. + +2022-03-29 Chenghua Xu + Lulu Cheng + + * config/loongarch/crtfastmath.c: New file. + * config/loongarch/linux-unwind.h: Like wise. + * config/loongarch/sfp-machine.h: Like wise. + * config/loongarch/t-crtstuff: Like wise. + * config/loongarch/t-loongarch: Like wise. + * config/loongarch/t-loongarch64: Like wise. + * config/loongarch/t-softfp-tf: Like wise. + * config.host: Add LoongArch tuples. + * configure.ac: Add LoongArch support. + 2022-03-19 Sergei Trofimovich PR libgcc/86224 diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 495e9e90ba8..d63ef50118a 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2022-03-29 Chenghua Xu + Lulu Cheng + + * configure.tgt: Add LoongArch triplet. + 2022-03-28 Tom de Vries * plugin/configfrag.ac: Use /$(libexecdir:\$(exec_prefix)/%=%)/ diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a64630f09dd..e40b4f334a9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,20 @@ +2022-03-29 Jonathan Wakely + + * testsuite/18_support/exception/38732.cc: Disable for C++23. + * testsuite/18_support/headers/exception/synopsis.cc: Likewise. + * testsuite/18_support/unexpected_handler.cc: Likewise. + +2022-03-29 Jonathan Wakely + + * libsupc++/compare (_Strong_order) [!__cpp_using_enum]: Add + static data members for _Fp_fmt enumerators. + +2022-03-29 Jonathan Wakely + + * include/std/version (__cpp_lib_variant): Fix conditions to + match . + (__cpp_lib_expected): Fix condition to match . + 2022-03-28 Jonathan Wakely * testsuite/20_util/optional/monadic/and_then.cc: Fix typo. From a5a8d512782cf4765cf17fc79dd7ecc2a392e0a9 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 29 Mar 2022 22:47:18 -0300 Subject: [PATCH 105/157] gcc.dg/weak/typeof-2: arm may use constant pool Some ARM configurations, such as with -mlong-calls, load the call target from the constant pool, breaking the expectation of the test as on several other targets. for gcc/testsuite/ChangeLog * gcc.dg/weak/typeof-2.c: Add arm*-*-* to targets that may place the call target in a constant pool. --- gcc/testsuite/gcc.dg/weak/typeof-2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/testsuite/gcc.dg/weak/typeof-2.c b/gcc/testsuite/gcc.dg/weak/typeof-2.c index afce17f53cb..c6e45624810 100644 --- a/gcc/testsuite/gcc.dg/weak/typeof-2.c +++ b/gcc/testsuite/gcc.dg/weak/typeof-2.c @@ -40,6 +40,8 @@ int bar3 (int x) // { dg-final { if [string match {sh[elb1-9]*-*-*} $target_triplet ] {return} } } // Likewise for S/390 targets // { dg-final { if [string match s390*-*-* $target_triplet ] {return} } } +// Likewise for ARM targets +// { dg-final { if [string match arm*-*-* $target_triplet ] {return} } } // Likewise for CRIS targets. // { dg-final { if [string match cris-*-* $target_triplet ] {return} } } // Likewise for m68k targets. From e3d2b0d040e9baf6c0548b865ed5244dec464cc1 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 29 Mar 2022 22:47:19 -0300 Subject: [PATCH 106/157] analyzer/strndup-1.c: skip on *-*-vxworks* Add vxworks to the set of operating systems whose C libraries don't support strndup. for gcc/testsuite/ChangeLog * gcc.dg/analyzer/strndup-1.c: Add *-*-vxworks* to no-strndup in libc. --- gcc/testsuite/gcc.dg/analyzer/strndup-1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/analyzer/strndup-1.c b/gcc/testsuite/gcc.dg/analyzer/strndup-1.c index edf494ac284..8cf7a42bf53 100644 --- a/gcc/testsuite/gcc.dg/analyzer/strndup-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/strndup-1.c @@ -1,4 +1,5 @@ -/* { dg-skip-if "no strndup in libc" { *-*-darwin[789]* *-*-darwin10* *-*-mingw* } } */ +/* { dg-skip-if "no strndup in libc" { *-*-darwin[789]* *-*-darwin10* *-*-mingw* *-*-vxworks* } } */ + #include #include From 78291af555e957a149c00a68f0fefdc419feee6f Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 24 Mar 2022 22:17:23 +0100 Subject: [PATCH 107/157] options: Remove 'gcc/c-family/c.opt:Warray-bounds' option definition record A one-argument form of the 'LangEnabledBy' option property isn't defined, and effectively appears to be a no-op. Removing that one, the 'gcc/c-family/c.opt:Warray-bounds' option definition record becomes empty, and doesn't add anything over 'gcc/common.opt:Warray-bounds', and may thus be removed entirely. This only changes 'build-gcc/gcc/optionlist' accordingly, but no other generated files. Clean-up after r262912/commit 0d7f90652080c42cddca6f9b68f6895218c70880 "PR middle-end/82063 - issues with arguments enabled by -Wall". gcc/c-family/ * c.opt (Warray-bounds): Remove. --- gcc/c-family/c.opt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 790d47caf0a..3c2ec7744b0 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -342,10 +342,6 @@ Wno-alloca-larger-than C ObjC C++ LTO ObjC++ Alias(Walloca-larger-than=,18446744073709551615EiB,none) Warning Disable Walloca-larger-than= warning. Equivalent to Walloca-larger-than= or larger. -Warray-bounds -LangEnabledBy(C ObjC C++ LTO ObjC++) -; in common.opt - Warray-bounds= LangEnabledBy(C ObjC C++ LTO ObjC++,Wall,1,0) ; in common.opt From 4319304f61ebc6103e625ad737f55d3ac10d05eb Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sat, 26 Mar 2022 22:07:54 +0100 Subject: [PATCH 108/157] options: Remove 'gcc/c-family/c.opt:Wuse-after-free' option definition record A one-argument form of the 'LangEnabledBy' option property isn't defined, and effectively appears to be a no-op. Removing that one, the 'gcc/c-family/c.opt:Wuse-after-free' option definition record becomes empty, and doesn't add anything over 'gcc/common.opt:Wuse-after-free', and may thus be removed entirely. This only changes 'build-gcc/gcc/optionlist' accordingly, but no other generated files. Clean-up after recent commit 671a283636de75f7ed638ee6b01ed2d44361b8b6 "Add -Wuse-after-free [PR80532]". gcc/c-family/ * c.opt (Wuse-after-free): Remove. --- gcc/c-family/c.opt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 3c2ec7744b0..1034a1b3946 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -1373,14 +1373,10 @@ Wunused-const-variable= C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_unused_const_variable) Warning LangEnabledBy(C ObjC,Wunused-variable, 1, 0) IntegerRange(0, 2) Warn when a const variable is unused. -; Defining these options here in addition to common.opt is necessary +; Defining this option here in addition to common.opt is necessary ; in order for the default -Wall setting of -Wuse-after-free=2 to take ; effect. -Wuse-after-free -LangEnabledBy(C ObjC C++ LTO ObjC++) -; in common.opt - Wuse-after-free= LangEnabledBy(C ObjC C++ LTO ObjC++, Wall,2,0) ; in common.opt From 0087f3600be51167f6bcaf2d887b0ac8a320ede2 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sat, 26 Mar 2022 22:21:14 +0100 Subject: [PATCH 109/157] options, '-Wc++[...]-extensions': Remove undefined one-argument 'LangEnabledBy' option properties A one-argument form of the 'LangEnabledBy' option property isn't defined, and effectively appears to be a no-op. Removing these only changes 'build-gcc/gcc/optionlist' accordingly, but no other generated files. Clean-up for commit ee336ecb2a7161bc28f6c5343d97870a8d15e177 "c++: Add new warning options for C++ language mismatches". gcc/c-family/ * c.opt (Wc++11-extensions, Wc++14-extensions, Wc++17-extensions) (Wc++20-extensions, Wc++23-extensions): Remove 'LangEnabledBy' option properties. --- gcc/c-family/c.opt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 1034a1b3946..07da40ef43b 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -459,23 +459,23 @@ C++ ObjC++ Var(warn_cxx20_compat) Warning LangEnabledBy(C++ ObjC++,Wall) Warn about C++ constructs whose meaning differs between ISO C++ 2017 and ISO C++ 2020. Wc++11-extensions -C++ ObjC++ Var(warn_cxx11_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1) +C++ ObjC++ Var(warn_cxx11_extensions) Warning Init(1) Warn about C++11 constructs in code compiled with an older standard. Wc++14-extensions -C++ ObjC++ Var(warn_cxx14_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1) +C++ ObjC++ Var(warn_cxx14_extensions) Warning Init(1) Warn about C++14 constructs in code compiled with an older standard. Wc++17-extensions -C++ ObjC++ Var(warn_cxx17_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1) +C++ ObjC++ Var(warn_cxx17_extensions) Warning Init(1) Warn about C++17 constructs in code compiled with an older standard. Wc++20-extensions -C++ ObjC++ Var(warn_cxx20_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1) +C++ ObjC++ Var(warn_cxx20_extensions) Warning Init(1) Warn about C++20 constructs in code compiled with an older standard. Wc++23-extensions -C++ ObjC++ Var(warn_cxx23_extensions) Warning LangEnabledBy(C++ ObjC++) Init(1) +C++ ObjC++ Var(warn_cxx23_extensions) Warning Init(1) Warn about C++23 constructs in code compiled with an older standard. Wcast-function-type From d8e91994bad073b713f2b47bc6171f3a4e422562 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 28 Mar 2022 10:55:49 +0200 Subject: [PATCH 110/157] options: Improve 'LangEnabledBy' option property diagnostics No changes in generated files. gcc/ * opt-functions.awk (n_args): New function. (lang_enabled_by): Merge function into... * optc-gen.awk : ... sole user here. Improve diagnostics. --- gcc/opt-functions.awk | 47 +++++++++--------------------------- gcc/optc-gen.awk | 56 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 62 insertions(+), 41 deletions(-) diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk index 9eccf9b0409..2aee0b9f1c3 100644 --- a/gcc/opt-functions.awk +++ b/gcc/opt-functions.awk @@ -82,6 +82,17 @@ function opt_args_non_empty(name, flags, description) return args } +# Return the number of comma-separated element of S. +function n_args(s) +{ + n = 1 + while (s ~ ",") { + n++ + sub("[^,]*, *", "", s) + } + return n +} + # Return the Nth comma-separated element of S. Return the empty string # if S does not contain N elements. function nth_arg(n, s) @@ -376,39 +387,3 @@ function integer_range_info(range_option, init, option, uinteger_used) else return "-1, -1" } - -# Handle LangEnabledBy(ENABLED_BY_LANGS, ENABLEDBY_NAME, ENABLEDBY_POSARG, -# ENABLEDBY_NEGARG). This function does not return anything. -function lang_enabled_by(enabledby_langs, enabledby_name, enabledby_posarg, enabledby_negarg) -{ - n_enabledby_arg_langs = split(enabledby_langs, enabledby_arg_langs, " "); - if (enabledby_posarg != "" && enabledby_negarg != "") { - with_args = "," enabledby_posarg "," enabledby_negarg - } else if (enabledby_posarg == "" && enabledby_negarg == "") { - with_args = "" - } else { - print "#error " opts[i] " LangEnabledBy("enabledby_langs","enabledby_name", " \ - enabledby_posarg", " enabledby_negarg \ - ") with three arguments, it should have either 2 or 4" - } - - n_enabledby_array = split(enabledby_name, enabledby_array, " \\|\\| "); - for (k = 1; k <= n_enabledby_array; k++) { - enabledby_index = opt_numbers[enabledby_array[k]]; - if (enabledby_index == "") { - print "#error " opts[i] " LangEnabledBy("enabledby_langs","enabledby_name", " \ - enabledby_posarg", " enabledby_negarg"), unknown option '" enabledby_name "'" - } else { - for (j = 1; j <= n_enabledby_arg_langs; j++) { - lang_name = lang_sanitized_name(enabledby_arg_langs[j]); - lang_index = lang_numbers[enabledby_arg_langs[j]]; - if (enables[lang_name,enabledby_array[k]] == "") { - enabledby[lang_name,n_enabledby_lang[lang_index]] = enabledby_array[k]; - n_enabledby_lang[lang_index]++; - } - enables[lang_name,enabledby_array[k]] \ - = enables[lang_name,enabledby_array[k]] opts[i] with_args ";"; - } - } - } -} diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index 5f7946cf49b..f2198b253ad 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -98,11 +98,57 @@ for (i = 0; i < n_opts; i++) { enabledby_arg = opt_args("LangEnabledBy", flags[i]); if (enabledby_arg != "") { - enabledby_langs = nth_arg(0, enabledby_arg); - enabledby_name = nth_arg(1, enabledby_arg); - enabledby_posarg = nth_arg(2, enabledby_arg); - enabledby_negarg = nth_arg(3, enabledby_arg); - lang_enabled_by(enabledby_langs, enabledby_name, enabledby_posarg, enabledby_negarg); + enabledby_n_args = n_args(enabledby_arg) + if (enabledby_n_args != 2 \ + && enabledby_n_args != 4) { + print "#error " opts[i] " LangEnabledBy(" enabledby_arg ") must specify two or four arguments" + } + + enabledby_langs = nth_arg(0, enabledby_arg); + if (enabledby_langs == "") + print "#error " opts[i] " LangEnabledBy(" enabledby_arg ") must specify LANGUAGE" + enabledby_opt = nth_arg(1, enabledby_arg); + if (enabledby_opt == "") + print "#error " opts[i] " LangEnabledBy(" enabledby_arg ") must specify OPT" + + enabledby_posarg_negarg = "" + if (enabledby_n_args == 4) { + enabledby_posarg = nth_arg(2, enabledby_arg); + enabledby_negarg = nth_arg(3, enabledby_arg); + if (enabledby_posarg == "" \ + || enabledby_negarg == "") + print "#error " opts[i] " LangEnabledBy(" enabledby_arg ") with four arguments must specify POSARG and NEGARG" + else + enabledby_posarg_negarg = "," enabledby_posarg "," enabledby_negarg + } + + n_enabledby_arg_langs = split(enabledby_langs, enabledby_arg_langs, " "); + n_enabledby_array = split(enabledby_opt, enabledby_array, " \\|\\| "); + for (k = 1; k <= n_enabledby_array; k++) { + enabledby_index = opt_numbers[enabledby_array[k]]; + if (enabledby_index == "") { + print "#error " opts[i] " LangEnabledBy(" enabledby_arg "), unknown option '" enabledby_opt "'" + continue + } + + for (j = 1; j <= n_enabledby_arg_langs; j++) { + lang_name = enabledby_arg_langs[j] + lang_index = lang_numbers[lang_name]; + if (lang_index == "") { + print "#error " opts[i] " LangEnabledBy(" enabledby_arg "), unknown language '" lang_name "'" + continue + } + + lang_name = lang_sanitized_name(lang_name); + + if (enables[lang_name,enabledby_array[k]] == "") { + enabledby[lang_name,n_enabledby_lang[lang_index]] = enabledby_array[k]; + n_enabledby_lang[lang_index]++; + } + enables[lang_name,enabledby_array[k]] \ + = enables[lang_name,enabledby_array[k]] opts[i] enabledby_posarg_negarg ";"; + } + } } if (flag_set_p("Param", flags[i]) && !(opts[i] ~ "^-param=")) From 4f2795218a6ba6a7b7b9b18ca7a6e390661e1608 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 30 Mar 2022 09:16:41 +0200 Subject: [PATCH 111/157] c++: Fox template-introduction tentative parsing in class bodies clear colon_corrects_to_scope_p [PR105061] The concepts support (in particular template introductions from concepts TS) broke the following testcase, valid unnamed bitfields with dependent types (or even just typedefs) were diagnosed as typos (: instead of correct ::) in template introduction during their tentative parsing. The following patch fixes that by not doing this : to :: correction when member_p is true. 2022-03-30 Jakub Jelinek PR c++/105061 * parser.cc (cp_parser_template_introduction): If member_p, temporarily clear parser->colon_corrects_to_scope_p around tentative parsing of nested name specifier. * g++.dg/concepts/pr105061.C: New test. --- gcc/cp/parser.cc | 7 +++++++ gcc/testsuite/g++.dg/concepts/pr105061.C | 13 +++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/g++.dg/concepts/pr105061.C diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index d3c22ee6227..7e1c777364e 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -31417,9 +31417,15 @@ cp_parser_template_introduction (cp_parser* parser, bool member_p) tree saved_scope = parser->scope; tree saved_object_scope = parser->object_scope; tree saved_qualifying_scope = parser->qualifying_scope; + bool saved_colon_corrects_to_scope_p = parser->colon_corrects_to_scope_p; cp_token *start_token = cp_lexer_peek_token (parser->lexer); + /* In classes don't parse valid unnamed bitfields as invalid + template introductions. */ + if (member_p) + parser->colon_corrects_to_scope_p = false; + /* Look for the optional `::' operator. */ cp_parser_global_scope_opt (parser, /*current_scope_valid_p=*/false); @@ -31440,6 +31446,7 @@ cp_parser_template_introduction (cp_parser* parser, bool member_p) parser->scope = saved_scope; parser->object_scope = saved_object_scope; parser->qualifying_scope = saved_qualifying_scope; + parser->colon_corrects_to_scope_p = saved_colon_corrects_to_scope_p; if (concept_name == error_mark_node || (seen_error () && !concept_definition_p (tmpl_decl))) diff --git a/gcc/testsuite/g++.dg/concepts/pr105061.C b/gcc/testsuite/g++.dg/concepts/pr105061.C new file mode 100644 index 00000000000..3f6f0e4d6e1 --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/pr105061.C @@ -0,0 +1,13 @@ +// PR c++/105061 + +template +struct A { T : V, u : U; }; +template +struct B { unsigned : V, u : U; }; +typedef unsigned uns; +template +struct C { uns : V, u : U; }; + +A a = { 13 }; +B<5, 6> b = { 26 }; +C<8, 9> c = { 42 }; From 9778a7dc0b3000813a1d25669bf2735f38219650 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 29 Mar 2022 15:24:07 +0200 Subject: [PATCH 112/157] [nvptx, doc] Update misa and mptx, add march and march-map Update nvptx documentation: - Use meaningful terms: "PTX ISA target architecture" and "PTX ISA version". - Remove invalid claim that "ISA strings must be lower-case". - Add missing sm_xx entries. - Fix misa default. - Add march, copying misa doc. - Declare misa an march alias. - Add march-map. - Fix "for given the specified" typo. gcc/ChangeLog: 2022-03-29 Tom de Vries * doc/invoke.texi (misa, mptx): Update. (march, march-map): Add. --- gcc/doc/invoke.texi | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 554e04ecbf3..43b75132c91 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -27540,18 +27540,31 @@ These options are defined for Nvidia PTX: Ignored, but preserved for backward compatibility. Only 64-bit ABI is supported. -@item -misa=@var{ISA-string} +@item -march=@var{architecture-string} @opindex march -Generate code for given the specified PTX ISA (e.g.@: @samp{sm_35}). ISA -strings must be lower-case. Valid ISA strings include @samp{sm_30} and -@samp{sm_35}. The default ISA is sm_35. +Generate code for the specified PTX ISA target architecture +(e.g.@: @samp{sm_35}). Valid architecture strings are @samp{sm_30}, +@samp{sm_35}, @samp{sm_53}, @samp{sm_70}, @samp{sm_75} and +@samp{sm_80}. The default target architecture is sm_30. + +@item -misa=@var{architecture-string} +@opindex misa +Alias of @option{-march=}. + +@item -march-map=@var{architecture-string} +@opindex march +Select the closest available @option{-march=} value that is not more +capable. For instance, for @option{-march-map=sm_50} select +@option{-march=sm_35}, and for @option{-march-map=sm_53} select +@option{-march=sm_53}. @item -mptx=@var{version-string} @opindex mptx -Generate code for given the specified PTX version (e.g.@: @samp{7.0}). +Generate code for the specified PTX ISA version (e.g.@: @samp{7.0}). Valid version strings include @samp{3.1}, @samp{6.0}, @samp{6.3}, and -@samp{7.0}. The default PTX version is 6.0, unless a higher minimal -version is required for specified PTX ISA via option @option{-misa=}. +@samp{7.0}. The default PTX ISA version is 6.0, unless a higher +version is required for specified PTX ISA target architecture via +option @option{-march=}. @item -mmainkernel @opindex mmainkernel From 410f39f56c14b195f066b9a18a3c6e8ffa03f848 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 30 Mar 2022 09:38:51 +0200 Subject: [PATCH 113/157] openmp: Ensure DECL_CONTEXT of OpenMP iterators in templates [PR105092] cp_parser_omp_iterators does: DECL_ARTIFICIAL (iter_var) = 1; DECL_CONTEXT (iter_var) = current_function_decl; pushdecl (iter_var); on the newly created iterator vars, but when we instantiate templates containing them, we just tsubst_decl them (which apparently for automatic vars clears DECL_CONTEXT with a comment that pushdecl should be called on them later). The result is that we have automatic vars in the IL which have NULL DECL_CONTEXT and the analyzer is upset about those. Fixed by setting DECL_CONTEXT and calling pushdecl during the instantiation. 2022-03-30 Jakub Jelinek PR c++/105092 * pt.cc (tsubst_omp_clause_decl): When handling iterators, set DECL_CONTEXT of the iterator var to current_function_decl and call pushdecl. * g++.dg/gomp/pr105092.C: New test. --- gcc/cp/pt.cc | 2 ++ gcc/testsuite/g++.dg/gomp/pr105092.C | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/g++.dg/gomp/pr105092.C diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index ece839c22e3..bdba5cf3b85 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -17575,6 +17575,8 @@ tsubst_omp_clause_decl (tree decl, tree args, tsubst_flags_t complain, *tp = copy_node (it); TREE_VEC_ELT (*tp, 0) = tsubst_decl (TREE_VEC_ELT (it, 0), args, complain); + DECL_CONTEXT (TREE_VEC_ELT (*tp, 0)) = current_function_decl; + pushdecl (TREE_VEC_ELT (*tp, 0)); TREE_VEC_ELT (*tp, 1) = tsubst_expr (TREE_VEC_ELT (it, 1), args, complain, in_decl, /*integral_constant_expression_p=*/false); diff --git a/gcc/testsuite/g++.dg/gomp/pr105092.C b/gcc/testsuite/g++.dg/gomp/pr105092.C new file mode 100644 index 00000000000..5f4e38aae40 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr105092.C @@ -0,0 +1,26 @@ +// PR c++/105092 +// { dg-do compile { target analyzer } } +// { dg-options "-fanalyzer -fopenmp" } + +struct S { S () {} }; + +template +struct U { + T c[10]; + U () { +#pragma omp task affinity (iterator (i = 0 : 10 : 1): c[i]) + ; + } +}; + +template +struct V { + T c[10]; + V () { +#pragma omp task depend (iterator (i = 0 : 10 : 1), inout: c[i]) + ; + } +}; + +U u; +V v; From 387e818cda0ffde86f624228c3da1ab28f453685 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 30 Mar 2022 10:21:16 +0200 Subject: [PATCH 114/157] store-merging: Avoid ICEs on roughly ~0ULL/8 sized stores [PR105094] On the following testcase on 64-bit targets, store-merging sees a MEM_REF store from {} ctor with "negative" bitsize where bitoff + bitsize wraps around to very small end offset. This later confuses the code so that it allocates just a few bytes of memory but fills in huge amounts of it. Later on there is a param_store_merging_max_size size check but due to the wrap-around we pass that. The following patch punts on such large bitsizes. 2022-03-30 Jakub Jelinek PR tree-optimization/105094 * gimple-ssa-store-merging.cc (mem_valid_for_store_merging): Punt if bitsize <= 0 rather than just == 0. * gcc.dg/pr105094.c: New test. --- gcc/gimple-ssa-store-merging.cc | 2 +- gcc/testsuite/gcc.dg/pr105094.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/pr105094.c diff --git a/gcc/gimple-ssa-store-merging.cc b/gcc/gimple-ssa-store-merging.cc index e2e2157f1cb..b952ce57917 100644 --- a/gcc/gimple-ssa-store-merging.cc +++ b/gcc/gimple-ssa-store-merging.cc @@ -4940,7 +4940,7 @@ mem_valid_for_store_merging (tree mem, poly_uint64 *pbitsize, tree base_addr = get_inner_reference (mem, &bitsize, &bitpos, &offset, &mode, &unsignedp, &reversep, &volatilep); *pbitsize = bitsize; - if (known_eq (bitsize, 0)) + if (known_le (bitsize, 0)) return NULL_TREE; if (TREE_CODE (mem) == COMPONENT_REF diff --git a/gcc/testsuite/gcc.dg/pr105094.c b/gcc/testsuite/gcc.dg/pr105094.c new file mode 100644 index 00000000000..da6dc172a64 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr105094.c @@ -0,0 +1,13 @@ +/* PR tree-optimization/105094 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +struct S { short a; char b[~(__SIZE_TYPE__)0 / __CHAR_BIT__ - 1]; }; +void bar (struct S *); + +void +foo (void) +{ + struct S s = { 5 }; + bar (&s); +} From e3e68fa59ead502c24950298b53c637bbe535a74 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 30 Mar 2022 10:49:47 +0200 Subject: [PATCH 115/157] ubsan: Fix ICE due to -fsanitize=object-size [PR105093] The following testcase ICEs, because for a volatile X & RESULT_DECL ubsan wants to take address of that reference. instrument_object_size is called with x, so the base is equal to the access and the var is automatic, so there is no risk of an out of bounds access for it. Normally we wouldn't instrument those because we fold address of the t - address of inner to 0, add constant size of the decl and it is equal to what __builtin_object_size computes. But the volatile results in the subtraction not being folded. The first hunk fixes it by punting if we access the whole automatic decl, so that even volatile won't cause a problem. The second hunk (not strictly needed for this testcase) is similar to what has been added to asan.cc recently, if we actually take address of a decl and keep it in the IL, we better mark it addressable. 2022-03-30 Jakub Jelinek PR sanitizer/105093 * ubsan.cc (instrument_object_size): If t is equal to inner and is a decl other than global var, punt. When emitting call to UBSAN_OBJECT_SIZE ifn, make sure base is addressable. * g++.dg/ubsan/pr105093.C: New test. --- gcc/testsuite/g++.dg/ubsan/pr105093.C | 12 ++++++++++++ gcc/ubsan.cc | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 gcc/testsuite/g++.dg/ubsan/pr105093.C diff --git a/gcc/testsuite/g++.dg/ubsan/pr105093.C b/gcc/testsuite/g++.dg/ubsan/pr105093.C new file mode 100644 index 00000000000..49f75ed69cf --- /dev/null +++ b/gcc/testsuite/g++.dg/ubsan/pr105093.C @@ -0,0 +1,12 @@ +// PR sanitizer/105093 +// { dg-do compile } +// { dg-options "-O2 -fsanitize=undefined -Wno-volatile" } + +struct X { X (); ~X (); }; + +volatile X +foo () +{ + X x; + return x; +} diff --git a/gcc/ubsan.cc b/gcc/ubsan.cc index a858994c841..0f5b372b195 100644 --- a/gcc/ubsan.cc +++ b/gcc/ubsan.cc @@ -2123,6 +2123,8 @@ instrument_object_size (gimple_stmt_iterator *gsi, tree t, bool is_lhs) || TREE_CODE (inner) == RESULT_DECL) && DECL_REGISTER (inner)) return; + if (t == inner && !is_global_var (t)) + return; base = inner; } else if (TREE_CODE (inner) == MEM_REF) @@ -2219,6 +2221,11 @@ instrument_object_size (gimple_stmt_iterator *gsi, tree t, bool is_lhs) } } + if (DECL_P (base) + && decl_function_context (base) == current_function_decl + && !TREE_ADDRESSABLE (base)) + mark_addressable (base); + if (bos_stmt && gimple_call_builtin_p (bos_stmt, BUILT_IN_OBJECT_SIZE)) ubsan_create_edge (bos_stmt); From c8cd03f5b52ad297f73e7181e9f0c643a88a51e3 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Wed, 30 Mar 2022 09:50:18 +0200 Subject: [PATCH 116/157] [nvptx, doc] Document predefined macros at march and mptx Document predefined macros: - __PTX_SM__ , - __PTX_ISA_VERSION_MAJOR__ and - __PTX_ISA_VERSION_MINOR__ . gcc/ChangeLog: 2022-03-29 Tom de Vries * doc/invoke.texi (march): Document __PTX_SM__. (mptx): Document __PTX_ISA_VERSION_MAJOR__ and __PTX_ISA_VERSION_MINOR__. Co-Authored-By: Tobias Burnus --- gcc/doc/invoke.texi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 43b75132c91..09715a510b4 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -27547,6 +27547,10 @@ Generate code for the specified PTX ISA target architecture @samp{sm_35}, @samp{sm_53}, @samp{sm_70}, @samp{sm_75} and @samp{sm_80}. The default target architecture is sm_30. +This option sets the value of the preprocessor macro +@code{__PTX_SM__}; for instance, for @samp{sm_35}, it has the value +@samp{350}. + @item -misa=@var{architecture-string} @opindex misa Alias of @option{-march=}. @@ -27566,6 +27570,11 @@ Valid version strings include @samp{3.1}, @samp{6.0}, @samp{6.3}, and version is required for specified PTX ISA target architecture via option @option{-march=}. +This option sets the values of the preprocessor macros +@code{__PTX_ISA_VERSION_MAJOR__} and @code{__PTX_ISA_VERSION_MINOR__}; +for instance, for @samp{3.1} the macros have the values @samp{3} and +@samp{1}, respectively. + @item -mmainkernel @opindex mmainkernel Link in code for a __main kernel. This is for stand-alone instead of From f8c1f29a0b47b4b4a3c1506678f7ca2ce4b7ffbb Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 25 Mar 2022 17:46:07 -0400 Subject: [PATCH 117/157] c++: ICE with aggregate assignment and DMI [PR104583] The attached 93280 test no longer ICEs but looks like it was never added to the testsuite. The 104583 test, modified so that it closely resembles 93280, still ICEs. The problem is that in 104583 we have a value-init from {} (the line A a{};), so this code in convert_like_internal 7960 /* If we're initializing from {}, it's value-initialization. */ 7961 if (BRACE_ENCLOSED_INITIALIZER_P (expr) 7962 && CONSTRUCTOR_NELTS (expr) == 0 7963 && TYPE_HAS_DEFAULT_CONSTRUCTOR (totype) 7964 && !processing_template_decl) 7965 { 7966 bool direct = CONSTRUCTOR_IS_DIRECT_INIT (expr); ... 7974 TARGET_EXPR_DIRECT_INIT_P (expr) = direct; sets TARGET_EXPR_DIRECT_INIT_P. This does not happen in 93280 where we initialize from {0}. In 104583, when gimplifying, the d = {}; line, we have d = {.a=TARGET_EXPR >> >>>>} where the TARGET_EXPR is the one with TARGET_EXPR_DIRECT_INIT_P set. In gimplify_init_ctor_preeval we do 4724 FOR_EACH_VEC_SAFE_ELT (v, ix, ce) 4725 gimplify_init_ctor_preeval (&ce->value, pre_p, post_p, data); so we gimplify the TARGET_EXPR, crashing at 744 case TARGET_EXPR: 745 /* A TARGET_EXPR that expresses direct-initialization should have been 746 elided by cp_gimplify_init_expr. */ 747 gcc_checking_assert (!TARGET_EXPR_DIRECT_INIT_P (*expr_p)); but there is no INIT_EXPR so cp_gimplify_init_expr was never called! Now, the fix for c++/93280 says "let's only set TARGET_EXPR_DIRECT_INIT_P when we're using the DMI in a constructor." and the comment talks about the full initialization. Is is accurate to say that our TARGET_EXPR does not represent the full initialization, because it only initializes the 'a' subobject? If so, then maybe get_nsdmi should clear TARGET_EXPR_DIRECT_INIT_P when in_ctor is false. I've compared the 93280.s and 104583.s files, they differ only in one movl $0, so there are no extra calls and similar. PR c++/93280 PR c++/104583 gcc/cp/ChangeLog: * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/nsdmi-list7.C: New test. * g++.dg/cpp0x/nsdmi-list8.C: New test. --- gcc/cp/init.cc | 8 ++++---- gcc/testsuite/g++.dg/cpp0x/nsdmi-list7.C | 17 +++++++++++++++++ gcc/testsuite/g++.dg/cpp0x/nsdmi-list8.C | 17 +++++++++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/nsdmi-list7.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/nsdmi-list8.C diff --git a/gcc/cp/init.cc b/gcc/cp/init.cc index 91b5c2c0f69..01e762320f3 100644 --- a/gcc/cp/init.cc +++ b/gcc/cp/init.cc @@ -679,10 +679,10 @@ get_nsdmi (tree member, bool in_ctor, tsubst_flags_t complain) if (simple_target) init = TARGET_EXPR_INITIAL (init); init = break_out_target_exprs (init, /*loc*/true); - if (in_ctor && init && TREE_CODE (init) == TARGET_EXPR) - /* This expresses the full initialization, prevent perform_member_init from - calling another constructor (58162). */ - TARGET_EXPR_DIRECT_INIT_P (init) = true; + if (init && TREE_CODE (init) == TARGET_EXPR) + /* In a constructor, this expresses the full initialization, prevent + perform_member_init from calling another constructor (58162). */ + TARGET_EXPR_DIRECT_INIT_P (init) = in_ctor; if (simple_target && TREE_CODE (init) != CONSTRUCTOR) /* Now put it back so C++17 copy elision works. */ init = get_target_expr (init); diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-list7.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-list7.C new file mode 100644 index 00000000000..62b07429bec --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-list7.C @@ -0,0 +1,17 @@ +// PR c++/93280 +// { dg-do compile { target c++11 } } + +struct A { + template A(T); + int c; +}; + +struct D { + A a{0}; +}; + +void g() +{ + D d; + d = {}; +} diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-list8.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-list8.C new file mode 100644 index 00000000000..fe73da8f98d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-list8.C @@ -0,0 +1,17 @@ +// PR c++/104583 +// { dg-do compile { target c++11 } } + +struct A { + A(); + int c; +}; + +struct D { + A a{}; +}; + +void g() +{ + D d; + d = {}; +} From 6a777ceb0e975f0efc823d2d82e676346f068151 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 30 Mar 2022 16:04:52 +0200 Subject: [PATCH 118/157] testsuite: Change pr80334.C testcase to dg-do compile [PR102772] The testcase has UB at runtime, placement new shouldn't construct an object with certain alignment requirements into an unaligned buffer. 2022-03-30 Jakub Jelinek PR tree-optimization/80334 PR target/102772 * g++.dg/torture/pr80334.C: Change from dg-do run to dg-do compile. --- gcc/testsuite/g++.dg/torture/pr80334.C | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/g++.dg/torture/pr80334.C b/gcc/testsuite/g++.dg/torture/pr80334.C index aee15487636..d25b6777cb9 100644 --- a/gcc/testsuite/g++.dg/torture/pr80334.C +++ b/gcc/testsuite/g++.dg/torture/pr80334.C @@ -1,4 +1,8 @@ -// { dg-do run } +// This used to be dg-do run testcase, but it is invalid at runtime: +// trying to do a placement new of A which is 16-byte sized and aligned +// into a 16-byte buffer at offset 17 bytes from 16-byte aligned address +// is UB. +// { dg-do compile } struct A { alignas(16) char c; }; struct B { A unpacked; char d; } __attribute__((packed)); From 3aaf9bf77047aecc23072fe3db7f13ecff72a7cf Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Wed, 30 Mar 2022 10:13:11 -0400 Subject: [PATCH 119/157] c++: ICE with failed __is_constructible constraint [PR100474] Here we're crashing when diagnosing an unsatisfied __is_constructible constraint because diagnose_trait_expr doesn't recognize this trait (along with a bunch of other traits). Fix this by adding handling for all remaining traits and removing the default case so that when adding a new trait we'll get a warning that diagnose_trait_expr needs to handle it. PR c++/100474 gcc/cp/ChangeLog: * constraint.cc (diagnose_trait_expr): Handle all remaining traits appropriately. Remove default case. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-traits3.C: New test. --- gcc/cp/constraint.cc | 43 +++++++++++- gcc/testsuite/g++.dg/cpp2a/concepts-traits3.C | 66 +++++++++++++++++++ 2 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/cpp2a/concepts-traits3.C diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc index c5a991b9e71..94f6222b436 100644 --- a/gcc/cp/constraint.cc +++ b/gcc/cp/constraint.cc @@ -3654,8 +3654,49 @@ diagnose_trait_expr (tree expr, tree args) case CPTK_IS_UNION: inform (loc, " %qT is not a union", t1); break; - default: + case CPTK_IS_AGGREGATE: + inform (loc, " %qT is not an aggregate", t1); + break; + case CPTK_IS_TRIVIALLY_COPYABLE: + inform (loc, " %qT is not trivially copyable", t1); + break; + case CPTK_IS_ASSIGNABLE: + inform (loc, " %qT is not assignable from %qT", t1, t2); + break; + case CPTK_IS_TRIVIALLY_ASSIGNABLE: + inform (loc, " %qT is not trivially assignable from %qT", t1, t2); + break; + case CPTK_IS_NOTHROW_ASSIGNABLE: + inform (loc, " %qT is not % assignable from %qT", t1, t2); + break; + case CPTK_IS_CONSTRUCTIBLE: + if (!t2) + inform (loc, " %qT is not default constructible", t1); + else + inform (loc, " %qT is not constructible from %qE", t1, t2); + break; + case CPTK_IS_TRIVIALLY_CONSTRUCTIBLE: + if (!t2) + inform (loc, " %qT is not trivially default constructible", t1); + else + inform (loc, " %qT is not trivially constructible from %qE", t1, t2); + break; + case CPTK_IS_NOTHROW_CONSTRUCTIBLE: + if (!t2) + inform (loc, " %qT is not % default constructible", t1); + else + inform (loc, " %qT is not % constructible from %qE", t1, t2); + break; + case CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS: + inform (loc, " %qT does not have unique object representations", t1); + break; + case CPTK_BASES: + case CPTK_DIRECT_BASES: + case CPTK_UNDERLYING_TYPE: + /* We shouldn't see these non-expression traits. */ gcc_unreachable (); + /* We deliberately omit the default case so that when adding a new + trait we'll get reminded (by way of a warning) to handle it here. */ } } diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-traits3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-traits3.C new file mode 100644 index 00000000000..f20608b6918 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-traits3.C @@ -0,0 +1,66 @@ +// PR c++/100474 +// { dg-do compile { target c++20 } } + +struct S { S() = delete; S(const S&); }; + +template +concept Aggregate = __is_aggregate(T); +// { dg-message "'S' is not an aggregate" "" { target *-*-* } .-1 } + +template +concept TriviallyCopyable = __is_trivially_copyable(T); +// { dg-message "'S' is not trivially copyable" "" { target *-*-* } .-1 } + +template +concept Assignable = __is_assignable(T, U); +// { dg-message "'S' is not assignable from 'int'" "" { target *-*-* } .-1 } + +template +concept TriviallyAssignable = __is_trivially_assignable(T, U); +// { dg-message "'S' is not trivially assignable from 'int'" "" { target *-*-* } .-1 } + +template +concept NothrowAssignable = __is_nothrow_assignable(T, U); +// { dg-message "'S' is not 'nothrow' assignable from 'int'" "" { target *-*-* } .-1 } + +template +concept Constructible = __is_constructible(T, Args...); +// { dg-message "'S' is not default constructible" "" { target *-*-* } .-1 } +// { dg-message "'S' is not constructible from 'int'" "" { target *-*-* } .-2 } +// { dg-message "'S' is not constructible from 'int, char'" "" { target *-*-* } .-3 } + +template +concept TriviallyConstructible = __is_trivially_constructible(T, Args...); +// { dg-message "'S' is not trivially default constructible" "" { target *-*-* } .-1 } +// { dg-message "'S' is not trivially constructible from 'int'" "" { target *-*-* } .-2 } +// { dg-message "'S' is not trivially constructible from 'int, char'" "" { target *-*-* } .-3 } + +template +concept NothrowConstructible = __is_nothrow_constructible(T, Args...); +// { dg-message "'S' is not 'nothrow' default constructible" "" { target *-*-* } .-1 } +// { dg-message "'S' is not 'nothrow' constructible from 'int'" "" { target *-*-* } .-2 } +// { dg-message "'S' is not 'nothrow' constructible from 'int, char'" "" { target *-*-* } .-3 } + +template +concept UniqueObjReps = __has_unique_object_representations(T); +// { dg-message "'S' does not have unique object representations" "" { target *-*-* } .-1 } + +static_assert(Aggregate); // { dg-error "assert" } +static_assert(TriviallyCopyable); // { dg-error "assert" } +static_assert(Assignable); // { dg-error "assert" } +static_assert(TriviallyAssignable); // { dg-error "assert" } +static_assert(NothrowAssignable); // { dg-error "assert" } + +static_assert(Constructible); // { dg-error "assert" } +static_assert(Constructible); // { dg-error "assert" } +static_assert(Constructible); // { dg-error "assert" } + +static_assert(TriviallyConstructible); // { dg-error "assert" } +static_assert(TriviallyConstructible); // { dg-error "assert" } +static_assert(TriviallyConstructible); // { dg-error "assert" } + +static_assert(NothrowConstructible); // { dg-error "assert" } +static_assert(NothrowConstructible); // { dg-error "assert" } +static_assert(NothrowConstructible); // { dg-error "assert" } + +static_assert(UniqueObjReps); // { dg-error "assert" } From 5db9ce171019f8915885cebd5cc5f4101bb926e6 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 29 Mar 2022 14:36:55 -0400 Subject: [PATCH 120/157] c-family: ICE with -Wconversion and A ?: B [PR101030] This patch fixes a crash in conversion_warning on a null expression. It is null because the testcase uses the GNU A ?: B extension. We could also use op0 instead of op1 in this case, but it doesn't seem to be necessary. PR c++/101030 gcc/c-family/ChangeLog: * c-warn.cc (conversion_warning) : Don't call conversion_warning when OP1 is null. gcc/testsuite/ChangeLog: * g++.dg/ext/cond5.C: New test. --- gcc/c-family/c-warn.cc | 2 +- gcc/testsuite/g++.dg/ext/cond5.C | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/ext/cond5.C diff --git a/gcc/c-family/c-warn.cc b/gcc/c-family/c-warn.cc index 9025fc1c20e..f24ac5d0539 100644 --- a/gcc/c-family/c-warn.cc +++ b/gcc/c-family/c-warn.cc @@ -1300,7 +1300,7 @@ conversion_warning (location_t loc, tree type, tree expr, tree result) tree op1 = TREE_OPERAND (expr, 1); tree op2 = TREE_OPERAND (expr, 2); - return (conversion_warning (loc, type, op1, result) + return ((op1 && conversion_warning (loc, type, op1, result)) || conversion_warning (loc, type, op2, result)); } diff --git a/gcc/testsuite/g++.dg/ext/cond5.C b/gcc/testsuite/g++.dg/ext/cond5.C new file mode 100644 index 00000000000..a92f28998f9 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/cond5.C @@ -0,0 +1,13 @@ +// PR c++/101030 +// { dg-do compile { target { c++11 } } } +// { dg-options "-Wconversion" } + +template +struct jj { + int ii[N ?: 1]; + char c = N ?: 1; // { dg-warning "conversion from .int. to .char. changes value from .300. to " } +}; + +int main() { + jj<300> kk; +} From 58a3fda072e6caf149ce5b9616fc52129efaf2e9 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 30 Mar 2022 16:47:10 +0200 Subject: [PATCH 121/157] Revert "testsuite: Change pr80334.C testcase to dg-do compile [PR102772]" This reverts commit 6a777ceb0e975f0efc823d2d82e676346f068151. --- gcc/testsuite/g++.dg/torture/pr80334.C | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gcc/testsuite/g++.dg/torture/pr80334.C b/gcc/testsuite/g++.dg/torture/pr80334.C index d25b6777cb9..aee15487636 100644 --- a/gcc/testsuite/g++.dg/torture/pr80334.C +++ b/gcc/testsuite/g++.dg/torture/pr80334.C @@ -1,8 +1,4 @@ -// This used to be dg-do run testcase, but it is invalid at runtime: -// trying to do a placement new of A which is 16-byte sized and aligned -// into a 16-byte buffer at offset 17 bytes from 16-byte aligned address -// is UB. -// { dg-do compile } +// { dg-do run } struct A { alignas(16) char c; }; struct B { A unpacked; char d; } __attribute__((packed)); From 22b0476a814a4759bb68f38b9415624a0fe52a7d Mon Sep 17 00:00:00 2001 From: "Vladimir N. Makarov" Date: Wed, 30 Mar 2022 13:03:44 -0400 Subject: [PATCH 122/157] [PR105032] LRA: modify loop condition to find reload insns for hard reg splitting When trying to split hard reg live range to assign hard reg to a reload pseudo, LRA searches for reload insns of the reload pseudo assuming a specific order of the reload insns. This order is violated if reload involved in inheritance transformation. In such case, the loop used for reload insn searching can become infinite. The patch fixes this. gcc/ChangeLog: PR middle-end/105032 * lra-assigns.cc (find_reload_regno_insns): Modify loop condition. gcc/testsuite/ChangeLog: PR middle-end/105032 * gcc.target/i386/pr105032.c: New. --- gcc/lra-assigns.cc | 3 +- gcc/testsuite/gcc.target/i386/pr105032.c | 36 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr105032.c diff --git a/gcc/lra-assigns.cc b/gcc/lra-assigns.cc index af30a673142..486e94f2006 100644 --- a/gcc/lra-assigns.cc +++ b/gcc/lra-assigns.cc @@ -1730,7 +1730,8 @@ find_reload_regno_insns (int regno, rtx_insn * &start, rtx_insn * &finish) { for (prev_insn = PREV_INSN (start_insn), next_insn = NEXT_INSN (start_insn); - insns_num != 1 && (prev_insn != NULL || next_insn != NULL); ) + insns_num != 1 && (prev_insn != NULL + || (next_insn != NULL && second_insn == NULL)); ) { if (prev_insn != NULL) { diff --git a/gcc/testsuite/gcc.target/i386/pr105032.c b/gcc/testsuite/gcc.target/i386/pr105032.c new file mode 100644 index 00000000000..57b21d3cd7a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr105032.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-options "-w" } */ +/* { dg-additional-options "-m32" { target x86_64-*-* } } */ + +typedef unsigned int size_t; +__extension__ typedef long int __off_t; +typedef __off_t off_t; +static void *__sys_mmap(void *addr, size_t length, int prot, int flags, int fd, + off_t offset) +{ + offset >>= 12; + return (void *)({ long _ret; + register long _num asm("eax") = (192); + register long _arg1 asm("ebx") = (long)(addr); + register long _arg2 asm("ecx") = (long)(length); + register long _arg3 asm("edx") = (long)(prot); + register long _arg4 asm("esi") = (long)(flags); + register long _arg5 asm("edi") = (long)(fd); + long _arg6 = (long)(offset); + asm volatile ("pushl %[_arg6]\n\t" + "pushl %%ebp\n\t" + "movl 4(%%esp), %%ebp\n\t" + "int $0x80\n\t" + "popl %%ebp\n\t" + "addl $4,%%esp\n\t" + : "=a"(_ret) + : "r"(_num), "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4),"r"(_arg5), [_arg6]"m"(_arg6) + : "memory", "cc" ); + _ret; }); +} + +int main(void) +{ + __sys_mmap(((void *)0), 0x1000, 0x1 | 0x2, 0x20 | 0x02, -1, 0); + return 0; +} From d32a5f4b52aa1f845c4fb56d4e849d4386299100 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Fri, 28 Jan 2022 11:50:25 -0600 Subject: [PATCH 123/157] rs6000: vec_neg built-ins wrongly require POWER8 As the subject states. Fixing this is accomplished by moving the built-ins to the correct stanzas, [altivec] and [vsx]. 2022-01-27 Bill Schmidt gcc/ * config/rs6000/rs6000-builtins.def (NEG_V16QI): Move to [altivec] stanza. (NEG_V4SF): Likewise. (NEG_V4SI): Likewise. (NEG_V8HI): Likewise. (NEG_V2DF): Move to [vsx] stanza. (NEG_V2DI): Likewise. --- gcc/config/rs6000/rs6000-builtins.def | 36 +++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def index 221bbc7ee6a..296f36e0f9b 100644 --- a/gcc/config/rs6000/rs6000-builtins.def +++ b/gcc/config/rs6000/rs6000-builtins.def @@ -410,6 +410,18 @@ const vss __builtin_altivec_nabs_v8hi (vss); NABS_V8HI nabsv8hi2 {} + const vsc __builtin_altivec_neg_v16qi (vsc); + NEG_V16QI negv16qi2 {} + + const vf __builtin_altivec_neg_v4sf (vf); + NEG_V4SF negv4sf2 {} + + const vsi __builtin_altivec_neg_v4si (vsi); + NEG_V4SI negv4si2 {} + + const vss __builtin_altivec_neg_v8hi (vss); + NEG_V8HI negv8hi2 {} + void __builtin_altivec_stvebx (vsc, signed long, void *); STVEBX altivec_stvebx {stvec} @@ -1175,6 +1187,12 @@ const vsll __builtin_altivec_nabs_v2di (vsll); NABS_V2DI nabsv2di2 {} + const vd __builtin_altivec_neg_v2df (vd); + NEG_V2DF negv2df2 {} + + const vsll __builtin_altivec_neg_v2di (vsll); + NEG_V2DI negv2di2 {} + void __builtin_altivec_stvx_v2df (vd, signed long, void *); STVX_V2DF altivec_stvx_v2df {stvec} @@ -2118,24 +2136,6 @@ const vus __builtin_altivec_nand_v8hi_uns (vus, vus); NAND_V8HI_UNS nandv8hi3 {} - const vsc __builtin_altivec_neg_v16qi (vsc); - NEG_V16QI negv16qi2 {} - - const vd __builtin_altivec_neg_v2df (vd); - NEG_V2DF negv2df2 {} - - const vsll __builtin_altivec_neg_v2di (vsll); - NEG_V2DI negv2di2 {} - - const vf __builtin_altivec_neg_v4sf (vf); - NEG_V4SF negv4sf2 {} - - const vsi __builtin_altivec_neg_v4si (vsi); - NEG_V4SI negv4si2 {} - - const vss __builtin_altivec_neg_v8hi (vss); - NEG_V8HI negv8hi2 {} - const vsc __builtin_altivec_orc_v16qi (vsc, vsc); ORC_V16QI orcv16qi3 {} From e30c0657293bde1b4c48dcc3302ebfdf0bcfd375 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 30 Mar 2022 20:14:00 +0000 Subject: [PATCH 124/157] Update gcc hr.po * hr.po: Update. --- gcc/po/hr.po | 377 ++++++++++++++++++++++++++------------------------- 1 file changed, 193 insertions(+), 184 deletions(-) diff --git a/gcc/po/hr.po b/gcc/po/hr.po index 05385fbc5be..ce9bfa10693 100644 --- a/gcc/po/hr.po +++ b/gcc/po/hr.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: gcc-12.1-b20220213\n" "Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n" "POT-Creation-Date: 2022-02-11 23:10+0000\n" -"PO-Revision-Date: 2022-03-28 15:16-0700\n" +"PO-Revision-Date: 2022-03-29 18:03-0700\n" "Last-Translator: Božidar Putanec \n" "Language-Team: Croatian \n" "Language: hr\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Bugs: Report translation errors to the Language-Team address.\n" -"X-Generator: Poedit 3.0.1\n" +"X-Generator: Lokalize 21.12.3\n" "X-Poedit-Basepath: ../sources/gcc-12-20220213\n" "X-Poedit-Bookmarks: 13750,0,-1,-1,-1,-1,-1,-1,-1,-1\n" "X-Poedit-SearchPath-0: .\n" @@ -81,7 +81,7 @@ msgstr "" #: cif-code.def:88 msgid "call is considered never executed and code size would grow" -msgstr "smatra se da poziv nikada nije izvršen i veličina koda će rasti" +msgstr "smatra se da poziv nikada nije izvršen i veličina kȏda će rasti" #: cif-code.def:92 msgid "function not declared inline and code size would grow" @@ -16454,11 +16454,11 @@ msgstr "" #: final.cc:1113 msgid "negative insn length" -msgstr "negativna duljina instrukcije" +msgstr "negativna insn duljina" #: final.cc:2861 msgid "could not split insn" -msgstr "nije moguće razdijeliti instrukciju" +msgstr "nije moguće razdijeliti insn" #: final.cc:3228 msgid "invalid 'asm': " @@ -16487,7 +16487,7 @@ msgstr "broj operanda je izvan granica" #: final.cc:3604 #, c-format msgid "invalid %%-code" -msgstr "neispravni %%-kod" +msgstr "neispravni %%-kȏd" #: final.cc:3638 #, c-format @@ -16573,7 +16573,7 @@ msgstr "Opcije:\n" #: gcc.cc:3759 msgid " -pass-exit-codes Exit with highest error code from a phase.\n" -msgstr " -pass-exit-codes iziđe s najvišim kodom greške u fazi\n" +msgstr " -pass-exit-codes iziđe s najvišim kȏdom greške u fazi\n" #: gcc.cc:3760 msgid " --help Display this information.\n" @@ -16581,19 +16581,19 @@ msgstr " --help ova prikazana pomoć\n" #: gcc.cc:3761 msgid " --target-help Display target specific command line options.\n" -msgstr " --target-help specifične opcije naredbenog retka za cilj\n" +msgstr " --target-help pokaže opcije naredbenog retka specifične za cilj\n" #: gcc.cc:3762 msgid " --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].\n" -msgstr "" +msgstr " --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].\n" #: gcc.cc:3763 msgid " Display specific types of command line options.\n" -msgstr " Pokaže specifične vrste opcija naredbenog retka.\n" +msgstr " pokaže specifične vrste opcija naredbenog retka.\n" #: gcc.cc:3765 msgid " (Use '-v --help' to display command line options of sub-processes).\n" -msgstr " (Koristite „-v --help“ za prikaz opcija potprocesa).\n" +msgstr " (Koristite „-v --help“ za ispis opcija naredbenog retka za potprocese).\n" #: gcc.cc:3766 msgid " --version Display compiler version information.\n" @@ -16601,7 +16601,7 @@ msgstr " --version informacije o inačici kompajlera\n" #: gcc.cc:3767 msgid " -dumpspecs Display all of the built in spec strings.\n" -msgstr " -dumpspecs svi ugrađeni specifikacijski stringovi\n" +msgstr " -dumpspecs pokaže sve ugrađene specifikacijske stringove\n" #: gcc.cc:3768 msgid " -dumpversion Display the version of the compiler.\n" @@ -16609,19 +16609,19 @@ msgstr " -dumpversion inačica kompajlera\n" #: gcc.cc:3769 msgid " -dumpmachine Display the compiler's target processor.\n" -msgstr " -dumpmachine ciljni procesor kompajlera\n" +msgstr " -dumpmachine pokaže ciljani procesor kompajlera\n" #: gcc.cc:3770 msgid " -foffload= Specify offloading targets.\n" -msgstr " -foffload= spcificira offloading targets (ciljeve)\n" +msgstr " -foffload= specificira offloading ciljeve\n" #: gcc.cc:3771 msgid " -print-search-dirs Display the directories in the compiler's search path.\n" -msgstr " -print-search-dirs direktoriji na stazi pretraživanja kompajlera\n" +msgstr " -print-search-dirs pokaže direktorije na stazi pretraživanja kompajlera\n" #: gcc.cc:3772 msgid " -print-libgcc-file-name Display the name of the compiler's companion library.\n" -msgstr " -print-libgcc-file-name ime popratne biblioteke kompajlera\n" +msgstr " -print-libgcc-file-name pokaže ime popratne biblioteke kompajlera\n" #: gcc.cc:3773 msgid " -print-file-name= Display the full path to library .\n" @@ -16636,65 +16636,66 @@ msgid "" " -print-multiarch Display the target's normalized GNU triplet, used as\n" " a component in the library path.\n" msgstr "" -" -print-multiarch ciljni normalizirani GNU triplet, koji se koristi\n" -" kao komponenta staze do biblioteke\n" -"\n" +" -print-multiarch pokaže ciljani normalizirani GNU triplet koji se\n" +" koristi kao komponenta staze do biblioteke\n" #: gcc.cc:3778 msgid " -print-multi-directory Display the root directory for versions of libgcc.\n" -msgstr " -print-multi-directory root direktorij za inačice od libgcc\n" +msgstr " -print-multi-directory ispiše root direktorij za inačice od libgcc\n" #: gcc.cc:3779 msgid "" " -print-multi-lib Display the mapping between command line options and\n" " multiple library search directories.\n" msgstr "" -" -print-multi-lib mapiranje između opcija naredbenog retka i\n" +" -print-multi-lib pokaže mapiranje između opcija naredbenog retka i\n" " višestrukih direktorija za traženje biblioteka\n" #: gcc.cc:3782 msgid " -print-multi-os-directory Display the relative path to OS libraries.\n" -msgstr " -print-multi-os-directory relativne staze do OS biblioteka\n" +msgstr " -print-multi-os-directory pokaže relativne staze do OS biblioteka\n" #: gcc.cc:3783 msgid " -print-sysroot Display the target libraries directory.\n" -msgstr " -print-sysroot direktorij ciljnih biblioteka\n" +msgstr " -print-sysroot direktorij ciljanih biblioteka\n" #: gcc.cc:3784 msgid " -print-sysroot-headers-suffix Display the sysroot suffix used to find headers.\n" -msgstr " -print-sysroot-headers-suffix sysroot sufiks koji se koristi da nađe zaglavlja\n" +msgstr "" +" -print-sysroot-headers-suffix pokaže sysroot sufiks koji se koristi\n" +" za traženje zaglavlja\n" #: gcc.cc:3785 msgid " -Wa, Pass comma-separated on to the assembler.\n" -msgstr " -Wa, proslijedi zarezom odvojene asembleru\n" +msgstr " -Wa, preda zarezom odvojene opcije asembleru\n" #: gcc.cc:3786 msgid " -Wp, Pass comma-separated on to the preprocessor.\n" -msgstr " -Wp, proslijedi zarezom odvojene pretprocesoru\n" +msgstr " -Wp, preda zarezom odvojene opcije pretprocesoru\n" #: gcc.cc:3787 msgid " -Wl, Pass comma-separated on to the linker.\n" -msgstr " -Wl, proslijedi zarezom odvojene linkeru\n" +msgstr " -Wl, preda zarezom odvojene opcije linkeru\n" #: gcc.cc:3788 msgid " -Xassembler Pass on to the assembler.\n" -msgstr " -Xassembler proslijedi asembleru\n" +msgstr " -Xassembler preda argumente asembleru\n" #: gcc.cc:3789 msgid " -Xpreprocessor Pass on to the preprocessor.\n" -msgstr " -Xpreprocessor proslijedi pretprocesoru\n" +msgstr " -Xpreprocessor preda argumente pretprocesoru\n" #: gcc.cc:3790 msgid " -Xlinker Pass on to the linker.\n" -msgstr " -Xlinker proslijedi linkeru\n" +msgstr " -Xlinker preda argumente linkeru\n" #: gcc.cc:3791 msgid " -save-temps Do not delete intermediate files.\n" -msgstr " -save-temps ne briše posredne datoteke\n" +msgstr " -save-temps ne briše privremene datoteke\n" #: gcc.cc:3792 msgid " -save-temps= Do not delete intermediate files.\n" -msgstr " -save-temps= ne briše posredne datoteke\n" +msgstr " -save-temps= ne briše privremene datoteke\n" #: gcc.cc:3793 msgid "" @@ -16706,15 +16707,15 @@ msgstr "" #: gcc.cc:3796 msgid " -pipe Use pipes rather than intermediate files.\n" -msgstr " -pipe koristi cijevi umjesto posrednih datoteka\n" +msgstr " -pipe koristi cijevi umjesto privremenih datoteka\n" #: gcc.cc:3797 msgid " -time Time the execution of each subprocess.\n" -msgstr " -time mjeri vrijem izvršavanja svakog potprocesa\n" +msgstr " -time mjeri vrijeme izvršavanja svakog potprocesa\n" #: gcc.cc:3798 msgid " -specs= Override built-in specs with the contents of .\n" -msgstr " -specs= nadjača ugrađene specifikacije sa sadržajem od \n" +msgstr " -specs= ugrađene specifikacije prepiše sadržajem od \n" #: gcc.cc:3799 msgid " -std= Assume that the input sources are for .\n" @@ -16763,7 +16764,7 @@ msgid "" " -pie Create a dynamically linked position independent\n" " executable.\n" msgstr "" -" -pie stvori dinamički linkanu (position independent)\n" +" -pie stvori dinamički linkanu poziciono neovisnu\n" " izvršnu datoteku\n" #: gcc.cc:3812 @@ -16777,6 +16778,10 @@ msgid "" " 'none' means revert to the default behavior of\n" " guessing the language based on the file's extension.\n" msgstr "" +" -x Specificirajte jezik sljedećih ulaznih datoteka.\n" +" Dopušteni jezici uključuju: c c++ asembler none\n" +" „none“ znači povratak na zadano ponašanje pogađanja\n" +" jezika na temelju ekstenzije datoteke.\n" #: gcc.cc:3820 #, c-format @@ -16789,7 +16794,7 @@ msgstr "" "\n" "Opcije koje započinju s -g, -f, -m, -O, -W, or --param se automatski proslijede\n" " raznim potprocesima pokrenutim s %s. Da bi proslijedili ostale opcije na te\n" -" potprocese, morate koristiti -W.\n" +" potprocese, morate koristiti opciju -W.\n" #: gcc.cc:6789 #, c-format @@ -16839,12 +16844,12 @@ msgstr "inačica drajvera %s %s izvršava gcc inačicu %s\n" #: gcc.cc:7657 gcc.cc:7867 #, c-format msgid "The bug is not reproducible, so it is likely a hardware or OS problem.\n" -msgstr "" +msgstr "Greška se ne može reproducirati, pa je vjerojatno problem hardvera ili OS-a.\n" #: gcc.cc:7791 #, c-format msgid "Preprocessed source stored into %s file, please attach this to your bugreport.\n" -msgstr "" +msgstr "Prethodno obrađeni izvorni kȏd spremljen je u datoteku %s, priložite ovo svom izvješću o greškama.\n" #: gcc.cc:8642 #, c-format @@ -16886,7 +16891,7 @@ msgid "" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" "\n" msgstr "" -"Ovo je slobodan softver; pogledajte kod za upute o kopiranju. NEMA\n" +"Ovo je slobodan softver; pogledajte kȏd za upute o kopiranju. NEMA\n" "jamstava; čak ni za TRGOVINSKU PRIKLADNOST ili ODGOVARANJE ODREĐENOJ SVRSI.\n" "\n" @@ -16955,7 +16960,7 @@ msgstr " -w, --weight postavi skale (float point value #: gcov-tool.cc:194 #, c-format msgid "Merge subcomand usage:" -msgstr "Uporaba podnaredbe merge:" +msgstr "Uporaba podnaredbe „merge“:" #: gcov-tool.cc:269 #, c-format @@ -16975,7 +16980,7 @@ msgstr " -s, --scale skalira profiliranje brojila\n" #: gcov-tool.cc:290 #, c-format msgid "Rewrite subcommand usage:" -msgstr "Uporaba podnaredbe rewrite:" +msgstr "Uporaba podnaredbe „rewrite“:" #: gcov-tool.cc:329 #, c-format @@ -17005,27 +17010,29 @@ msgstr " -f, --function ispiše informaciju razine funkc #: gcov-tool.cc:421 #, c-format msgid " -F, --fullname Print full filename\n" -msgstr " -F, --fullname ispiše potpuno ime datoteke\n" +msgstr " -F, --fullname ispiše puno ime datoteke\n" #: gcov-tool.cc:422 #, c-format msgid " -h, --hotonly Only print info for hot objects/functions\n" msgstr "" +" -h, --hotonly informacije ispiše samo vruće\n" +" objekte/funkcije\n" #: gcov-tool.cc:423 #, c-format msgid " -o, --object Print object level info\n" -msgstr " -o, --object ispiše informacije razine objekta\n" +msgstr " -o, --object ispiše informacije razinu objekta\n" #: gcov-tool.cc:424 #, c-format msgid " -t , --hot_threshold Set the threshold for hotness\n" -msgstr "" +msgstr " -t , --hot_threshold postavite prag „vrućine“\n" #: gcov-tool.cc:444 #, c-format msgid "Overlap subcomand usage:" -msgstr "Uporaba podnaredbe overlap:" +msgstr "Uporaba podnaredbe „overlap“:" #: gcov-tool.cc:510 #, c-format @@ -17086,7 +17093,7 @@ msgid "" "Print code coverage information.\n" "\n" msgstr "" -"Pokaže podatke o pokrivenosti kȏda.\n" +"Ispiše podatke o pokrivenosti kȏda.\n" "\n" #: gcov.cc:927 @@ -17186,17 +17193,17 @@ msgstr " -q, --use-hotness-colors oboji izlaz u perf-stilu za vruće ret #: gcov.cc:946 #, c-format msgid " -r, --relative-only Only show data for relative sources\n" -msgstr " -r, --relative-only pokaže podatke samo za relativne izvore\n" +msgstr " -r, --relative-only pokaže samo podatke za relativne izvore\n" #: gcov.cc:947 #, c-format msgid " -s, --source-prefix DIR Source prefix to elide\n" -msgstr " -s, --source-prefix DIR izostavi prefiks izvora\n" +msgstr " -s, --source-prefix DIR izostavi prefiks izvornog kȏda\n" #: gcov.cc:948 #, c-format msgid " -t, --stdout Output to stdout instead of a file\n" -msgstr " -n, --no-output ne proizvodi izlazne datoteke\n" +msgstr " -t, --stdout izlaz na stdout umjesto u datoteku\n" #: gcov.cc:949 #, c-format @@ -17285,7 +17292,7 @@ msgstr "%s:izvorni kȏd je noviji od datoteke s bilješkama „%s“\n" #: gcov.cc:1783 #, c-format msgid "(the message is displayed only once per source file)\n" -msgstr "(ova se poruka prikazuje samo jednom po izvornom kȏdu )\n" +msgstr "(ova poruka se ispiše samo jedamput po izvornom kȏdu)\n" #: gcov.cc:1803 #, c-format @@ -17300,7 +17307,7 @@ msgstr "%s:nije gcov datoteka s bilješkama\n" #: gcov.cc:1824 #, c-format msgid "%s:version '%.4s', prefer '%.4s'\n" -msgstr "%s:inačica '%.4s', ali preferira se '%.4s'\n" +msgstr "%s:inačica „%.4s“, ali preferira se „%.4s“\n" #: gcov.cc:1877 #, c-format @@ -17330,7 +17337,7 @@ msgstr "%s:nije gcov datoteka\n" #: gcov.cc:2040 #, c-format msgid "%s:version '%.4s', prefer version '%.4s'\n" -msgstr "%s:inačica '%.4s', preferira se '%.4s'\n" +msgstr "%s:inačica „%.4s“, ali preferira se „%.4s“\n" #: gcov.cc:2047 #, c-format @@ -17385,7 +17392,7 @@ msgstr "%s „%s“\n" #: gcov.cc:2519 #, c-format msgid "Branches executed:%s of %d\n" -msgstr "Izvršene %s grana od %d\n" +msgstr "Izvršeno %s grana od %d\n" #: gcov.cc:2523 #, c-format @@ -17415,12 +17422,12 @@ msgstr "%s:nema redaka za „%s”\n" #: gcov.cc:2874 #, c-format msgid "call %2d returned %s\n" -msgstr "poziv %2d vratio %s\n" +msgstr "poziv %2d vratio je %s\n" #: gcov.cc:2879 #, c-format msgid "call %2d never executed\n" -msgstr "poziv %2d nikada izvršen\n" +msgstr "poziv %2d nikada nije izvršen\n" #: gcov.cc:2884 #, c-format @@ -17430,7 +17437,7 @@ msgstr "grana %2d uzeta %s%s" #: gcov.cc:2889 #, c-format msgid "branch %2d never executed" -msgstr "grana %2d nikada izvršena" +msgstr "grana %2d nikada nije izvršena" #: gcov.cc:2892 #, c-format @@ -17440,12 +17447,12 @@ msgstr " (BB %d)" #: gcov.cc:2899 #, c-format msgid "unconditional %2d taken %s\n" -msgstr "" +msgstr "bezuvjetno %2d uzeto %s\n" #: gcov.cc:2902 #, c-format msgid "unconditional %2d never executed\n" -msgstr "" +msgstr "bezuvjetno %2d nikada nije izvršeno\n" #: gcov.cc:3154 #, c-format @@ -17463,17 +17470,17 @@ msgstr "GCSE onemogućen" #: incpath.cc:77 #, c-format msgid "ignoring duplicate directory \"%s\"\n" -msgstr "zanemarujem direktorij duplikat „%s”\n" +msgstr "ignoriramo duplikat direktorija „%s”\n" #: incpath.cc:80 #, c-format msgid " as it is a non-system directory that duplicates a system directory\n" -msgstr " jer nije direktorij sustava, a duplikat je direktorija sustava\n" +msgstr " jer nije direktorij sustava koji duplicira direktorij sustava\n" #: incpath.cc:84 #, c-format msgid "ignoring nonexistent directory \"%s\"\n" -msgstr "zanemarujem nepostojeći direktorij „%s”\n" +msgstr "ignoriramo nepostojeći direktorij „%s”\n" #: incpath.cc:391 #, c-format @@ -17502,30 +17509,30 @@ msgstr "“" #: langhooks.cc:384 msgid "At top level:" -msgstr "" +msgstr "Vrhovna razina:" #: langhooks.cc:400 cp/error.cc:3623 #, c-format msgid "In member function %qs" -msgstr "" +msgstr "U funkciji člana %qs" #: langhooks.cc:404 cp/error.cc:3626 #, c-format msgid "In function %qs" -msgstr "" +msgstr "U funkciji %qs" #: langhooks.cc:449 cp/error.cc:3576 msgid " inlined from %qs at %r%s:%d:%d%R" -msgstr "" +msgstr " umetnuto od %qs pri %r%s:%d:%d%R" #: langhooks.cc:454 cp/error.cc:3581 msgid " inlined from %qs at %r%s:%d%R" -msgstr "" +msgstr " umetnuto od %qs pri %r%s:%d%R" #: langhooks.cc:460 cp/error.cc:3587 #, c-format msgid " inlined from %qs" -msgstr "" +msgstr " umetnuto od %qs" #: lra-assigns.cc:1837 reload1.cc:2073 msgid "this is the insn:" @@ -17533,44 +17540,44 @@ msgstr "ovo je insn:" #: lra-constraints.cc:3142 msgid "unable to generate reloads for impossible constraints:" -msgstr "" +msgstr "nije moguće generirati ponovna učitavanja za nemoguća ograničenja:" #: lra-constraints.cc:4168 reload.cc:3841 msgid "unable to generate reloads for:" -msgstr "" +msgstr "nije moguće generirati ponovno učitavanje za:" #. What to print when a switch has no documentation. #: opts.cc:313 msgid "This option lacks documentation." -msgstr "" +msgstr "Ova opcija nije dokumentirana." #: opts.cc:314 msgid "Uses of this option are diagnosed." -msgstr "" +msgstr "Upotreba ove opcije je dijagnosticirana." #: opts.cc:1577 #, c-format msgid "Same as %s%s (or, in negated form, %s%s)." -msgstr "" +msgstr "Isto kao %s%s (ili, u negiranom obliku, %s%s)." #: opts.cc:1582 #, c-format msgid "Same as %s%s." -msgstr "" +msgstr "Isto kao %s%s." #: opts.cc:1587 #, c-format msgid "Same as %s." -msgstr "" +msgstr "Isto kao %s." #: opts.cc:1595 #, c-format msgid "%s Same as %s." -msgstr "" +msgstr "%s je identično s %s." #: opts.cc:1658 msgid "[available in " -msgstr "" +msgstr "[dostupno u " #: opts.cc:1690 msgid "[default]" @@ -17579,7 +17586,7 @@ msgstr "[zadano]" #: opts.cc:1699 #, c-format msgid "%llu bytes" -msgstr "" +msgstr "%llu bajta" #: opts.cc:1736 msgid "[enabled]" @@ -17623,7 +17630,7 @@ msgstr "Sljedeće opcije upravljaju porukama upozorenja kompajlera" #: opts.cc:1890 msgid "The following options control optimizations" -msgstr "Sljedeće opcije upravljaju s optimiranjem" +msgstr "Sljedeće opcije upravljaju s optimizacijama" #: opts.cc:1893 opts.cc:1933 msgid "The following options are language-independent" @@ -17647,25 +17654,25 @@ msgstr "Sljedeće opcije nisu dokumentirane" #: opts.cc:1917 msgid "The following options take separate arguments" -msgstr "Sljedeće opcije primaju odvojene argumente" +msgstr "Sljedeće opcije uzimaju odvojene argumente" #: opts.cc:1919 msgid "The following options take joined arguments" -msgstr "Sljedeće opcije primaju spojene argumente" +msgstr "Sljedeće opcije uzimaju spojene argumente" #: opts.cc:1931 msgid "The following options are language-related" -msgstr "Sljedeće opcije su vezane uz jezik" +msgstr "Sljedeće opcije se odnose na jezik" #: passes.cc:1832 #, c-format msgid "during %s pass: %s\n" -msgstr "" +msgstr "tijekom %s prolaza: %s\n" #: passes.cc:1837 #, c-format msgid "dump file: %s\n" -msgstr "" +msgstr "istovari datoteku: %s\n" #: plugin.cc:926 msgid "Event" @@ -17673,30 +17680,30 @@ msgstr "Događaj" #: plugin.cc:926 msgid "Plugins" -msgstr "Priključci" +msgstr "Plugini" #: plugin.cc:958 #, c-format msgid "*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.\n" -msgstr "*** UPOZORENJE *** neki priključci su aktivni, nemojte prijavljivati kao grešku ako ju ne možete ponoviti bez omogućivanja priključaka.\n" +msgstr "*** UPOZORENJE *** neki plugini su aktivni, nemojte prijaviti ovo kao grešku osim ako ju ne možete reproducirati bez omogućavanja plugina.\n" #: postreload-gcse.cc:1355 msgid "using simple load CSE after register allocation" -msgstr "" +msgstr "Nakon mapiranja registra koristi se jednostavan CSE" #. It's the compiler's fault. #: reload1.cc:5994 msgid "could not find a spill register" -msgstr "" +msgstr "nije pronađen registar prelijevanja" #. It's the compiler's fault. #: reload1.cc:7876 msgid "VOIDmode on an output" -msgstr "" +msgstr "VOIDmode na izlazu" #: reload1.cc:8609 msgid "failure trying to reload:" -msgstr "" +msgstr "ponovno učitavanje nije uspjelo:" #: rtl-error.cc:116 msgid "unrecognizable insn:" @@ -17748,30 +17755,30 @@ msgstr "" #: toplev.cc:619 #, c-format msgid "%s%swarning: %s header version %s differs from library version %s.\n" -msgstr "" +msgstr "%s%supozorenje: %s inačica zaglavlja %s različita je od inačice biblioteke %s\n" #: toplev.cc:621 #, c-format msgid "%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n" -msgstr "" +msgstr "%s%sGGC heuristika: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n" #: tree-diagnostic-path.cc:257 tree-diagnostic.cc:290 c/c-decl.cc:6073 #: c/c-typeck.cc:7894 cp/error.cc:1165 c-family/c-pretty-print.cc:424 #, gcc-internal-format msgid "" -msgstr "" +msgstr "" #: c-family/c-format.cc:437 msgid "format" -msgstr "" +msgstr "format" #: c-family/c-format.cc:438 msgid "field width specifier" -msgstr "" +msgstr "specifikacija širine polja" #: c-family/c-format.cc:439 msgid "field precision specifier" -msgstr "" +msgstr "specifikacija preciznosti polja" #: c-family/c-format.cc:558 c-family/c-format.cc:582 #: config/i386/msformat-c.cc:45 @@ -17791,7 +17798,7 @@ msgstr "" #: c-family/c-format.cc:559 c-family/c-format.cc:583 c-family/c-format.cc:614 #: config/i386/msformat-c.cc:46 msgid "the '+' printf flag" -msgstr "" +msgstr " " #: c-family/c-format.cc:560 c-family/c-format.cc:584 c-family/c-format.cc:615 #: c-family/c-format.cc:655 config/i386/msformat-c.cc:47 @@ -17845,33 +17852,33 @@ msgstr "" #: c-family/c-format.cc:656 c-family/c-format.cc:684 config/sol2-c.cc:43 #: config/i386/msformat-c.cc:51 config/i386/msformat-c.cc:68 msgid "field width" -msgstr "" +msgstr "širina polja" #: c-family/c-format.cc:565 c-family/c-format.cc:587 config/sol2-c.cc:43 #: config/i386/msformat-c.cc:51 msgid "field width in printf format" -msgstr "" +msgstr "širina polja u printf formatu" #: c-family/c-format.cc:566 c-family/c-format.cc:588 c-family/c-format.cc:617 #: config/i386/msformat-c.cc:52 msgid "precision" -msgstr "" +msgstr "preciznost" #: c-family/c-format.cc:566 c-family/c-format.cc:588 c-family/c-format.cc:617 #: config/i386/msformat-c.cc:52 msgid "precision in printf format" -msgstr "" +msgstr "preciznost u printf formatu" #: c-family/c-format.cc:567 c-family/c-format.cc:589 c-family/c-format.cc:618 #: c-family/c-format.cc:634 c-family/c-format.cc:687 config/sol2-c.cc:44 #: config/i386/msformat-c.cc:53 config/i386/msformat-c.cc:69 msgid "length modifier" -msgstr "" +msgstr "modifikator dužine" #: c-family/c-format.cc:567 c-family/c-format.cc:589 c-family/c-format.cc:618 #: config/sol2-c.cc:44 config/i386/msformat-c.cc:53 msgid "length modifier in printf format" -msgstr "" +msgstr "modifikator dužine u prinf formatu" #: c-family/c-format.cc:616 msgid "'q' flag" @@ -17883,11 +17890,11 @@ msgstr "" #: c-family/c-format.cc:630 config/i386/msformat-c.cc:66 msgid "assignment suppression" -msgstr "" +msgstr "ukidanje dodjele" #: c-family/c-format.cc:630 config/i386/msformat-c.cc:66 msgid "the assignment suppression scanf feature" -msgstr "" +msgstr "ukidanje dodjele scanf značajke" #: c-family/c-format.cc:631 config/i386/msformat-c.cc:67 msgid "'a' flag" @@ -17979,7 +17986,7 @@ msgstr "" #: c-family/c-format.cc:678 msgid "fill character in strfmon format" -msgstr "" +msgstr "znak za ispunjavanje i strfmon formatu" #: c-family/c-format.cc:679 msgid "the '^' strfmon flag" @@ -18011,7 +18018,7 @@ msgstr "" #: c-family/c-format.cc:684 msgid "field width in strfmon format" -msgstr "" +msgstr "širina poljau u strfmon formatu" #: c-family/c-format.cc:685 msgid "left precision" @@ -18041,7 +18048,7 @@ msgstr "" #: config/aarch64/aarch64.cc:10978 #, c-format msgid "unsupported operand for code '%c'" -msgstr "" +msgstr "nepodržani operand za kȏd „%c“" #: config/aarch64/aarch64.cc:10987 config/aarch64/aarch64.cc:11000 #: config/aarch64/aarch64.cc:11012 config/aarch64/aarch64.cc:11023 @@ -18053,13 +18060,13 @@ msgstr "" #: config/pru/pru.cc:1752 config/pru/pru.cc:1824 #, c-format msgid "invalid operand for '%%%c'" -msgstr "" +msgstr "nevaljani operand za „%%%c“" #: config/aarch64/aarch64.cc:11091 config/aarch64/aarch64.cc:11102 #: config/aarch64/aarch64.cc:11257 config/aarch64/aarch64.cc:11268 #, c-format msgid "invalid vector constant" -msgstr "" +msgstr "nevaljana vektorska konstanta" #: config/aarch64/aarch64.cc:11114 config/aarch64/aarch64.cc:11126 #, c-format @@ -18069,12 +18076,12 @@ msgstr "" #: config/aarch64/aarch64.cc:11143 #, c-format msgid "incompatible register operand for '%%%c'" -msgstr "" +msgstr "nekompatibilan operand registra za „%%%c“" #: config/aarch64/aarch64.cc:11209 config/arm/arm.cc:24405 #, c-format msgid "missing operand" -msgstr "" +msgstr "nedostaje operand" #: config/aarch64/aarch64.cc:11294 #, c-format @@ -18098,99 +18105,99 @@ msgstr "nevaljani način adresiranja" #: config/aarch64/aarch64.cc:25851 config/arm/arm.cc:33859 msgid "invalid conversion from type %" -msgstr "" +msgstr "nevaljana konverzija od vrste %" #: config/aarch64/aarch64.cc:25853 config/arm/arm.cc:33861 msgid "invalid conversion to type %" -msgstr "" +msgstr "nevaljana konverzija u vrstu %" #: config/aarch64/aarch64.cc:25868 config/aarch64/aarch64.cc:25884 #: config/arm/arm.cc:33876 config/arm/arm.cc:33892 msgid "operation not permitted on type %" -msgstr "" +msgstr "nedopuštena operacija na vrsti %" #: config/aarch64/aarch64.cc:25892 msgid "cannot combine GNU and SVE vectors in a binary operation" -msgstr "" +msgstr "ne mogu se kombinirati GNU i SVE vektori u binarnoj operaciji" #: config/alpha/alpha.cc:5076 config/i386/i386.cc:13519 #: config/rs6000/rs6000.cc:14232 config/sparc/sparc.cc:9357 #, c-format msgid "'%%&' used without any local dynamic TLS references" -msgstr "" +msgstr "„%%&“ je upotrebljen bez ikakve dinamičke TLS referencije" #: config/alpha/alpha.cc:5134 config/bfin/bfin.cc:1428 #, c-format msgid "invalid %%J value" -msgstr "" +msgstr "nevaljana %%J vrijednost" #: config/alpha/alpha.cc:5164 config/ia64/ia64.cc:5577 #: config/or1k/or1k.cc:1249 #, c-format msgid "invalid %%r value" -msgstr "" +msgstr "nevaljana %%r vrijednos" #: config/alpha/alpha.cc:5174 config/ia64/ia64.cc:5531 #: config/rs6000/rs6000.cc:13926 config/xtensa/xtensa.cc:2460 #, c-format msgid "invalid %%R value" -msgstr "" +msgstr "nevaljana %%R vrijednost" #: config/alpha/alpha.cc:5180 config/rs6000/rs6000.cc:13846 #: config/xtensa/xtensa.cc:2427 #, c-format msgid "invalid %%N value" -msgstr "" +msgstr "nevaljana %%N vrijednost" #: config/alpha/alpha.cc:5188 config/rs6000/rs6000.cc:13874 #, c-format msgid "invalid %%P value" -msgstr "" +msgstr "nevaljana %%P vrijednost" #: config/alpha/alpha.cc:5196 #, c-format msgid "invalid %%h value" -msgstr "" +msgstr "nevaljana %%h vrijednost" #: config/alpha/alpha.cc:5204 config/xtensa/xtensa.cc:2453 #, c-format msgid "invalid %%L value" -msgstr "" +msgstr "nevaljana %%L vrijednost" #: config/alpha/alpha.cc:5223 #, c-format msgid "invalid %%m value" -msgstr "" +msgstr "nevaljana %%m vrijednost" #: config/alpha/alpha.cc:5229 #, c-format msgid "invalid %%M value" -msgstr "" +msgstr "nevaljana %%M vrijednost" #: config/alpha/alpha.cc:5266 #, c-format msgid "invalid %%U value" -msgstr "" +msgstr "nevaljana %%U vrijednost" #: config/alpha/alpha.cc:5274 config/rs6000/rs6000.cc:13934 #, c-format msgid "invalid %%s value" -msgstr "" +msgstr "nevaljana %%s vrijednost" #: config/alpha/alpha.cc:5285 #, c-format msgid "invalid %%C value" -msgstr "" +msgstr "nevaljana %%C vrijednost" #: config/alpha/alpha.cc:5322 config/rs6000/rs6000.cc:13710 #, c-format msgid "invalid %%E value" -msgstr "" +msgstr "nevaljana %%E vrijednost" #: config/alpha/alpha.cc:5347 config/alpha/alpha.cc:5397 #, c-format msgid "unknown relocation unspec" -msgstr "" +msgstr "nepoznata relokacija unspec" #: config/alpha/alpha.cc:5356 config/cr16/cr16.cc:1572 config/gcn/gcn.cc:6050 #: config/gcn/gcn.cc:6059 config/gcn/gcn.cc:6119 config/gcn/gcn.cc:6127 @@ -18198,12 +18205,12 @@ msgstr "" #: config/gcn/gcn.cc:6331 config/gcn/gcn.cc:6442 config/rs6000/rs6000.cc:14237 #, c-format msgid "invalid %%xn code" -msgstr "" +msgstr "nevaljani %%xn kȏd" #: config/alpha/alpha.cc:5462 #, c-format msgid "invalid operand address" -msgstr "" +msgstr "nevaljani operand adrese" #: config/arc/arc.cc:4517 #, c-format @@ -18276,29 +18283,29 @@ msgstr "nevaljani UNSPEC kao operand: %d" #: config/arc/arc.cc:6703 msgid "unrecognized supposed constant" -msgstr "" +msgstr "neprepoznata pretpostavljena konstanta" #: config/arm/arm.cc:20769 config/arm/arm.cc:20794 config/arm/arm.cc:20804 #: config/arm/arm.cc:20813 config/arm/arm.cc:20822 #, c-format msgid "invalid shift operand" -msgstr "" +msgstr "nevaljai operand pomaka (shift)" #: config/arm/arm.cc:23678 config/arm/arm.cc:23696 #, c-format msgid "predicated Thumb instruction" -msgstr "" +msgstr "predviđena Thumb instrukcija" #: config/arm/arm.cc:23684 #, c-format msgid "predicated instruction in conditional sequence" -msgstr "" +msgstr "predviđena instrukcija u uvjetnoj sekvenciji" #: config/arm/arm.cc:23802 config/arm/arm.cc:23815 config/arm/arm.cc:23840 #: config/nios2/nios2.cc:3081 #, c-format msgid "Unsupported operand for code '%c'" -msgstr "" +msgstr "Nepodržani operand za kȏd „%c“" #: config/arm/arm.cc:23917 config/arm/arm.cc:23939 config/arm/arm.cc:23949 #: config/arm/arm.cc:23959 config/arm/arm.cc:23969 config/arm/arm.cc:24008 @@ -18312,105 +18319,105 @@ msgstr "" #: config/bfin/bfin.cc:1492 config/nds32/nds32.cc:3543 #, c-format msgid "invalid operand for code '%c'" -msgstr "" +msgstr "nevaljani operand za kȏd „%c“" #: config/arm/arm.cc:24021 #, c-format msgid "instruction never executed" -msgstr "" +msgstr "instrukcija nije nikada izvršena" #. Former Maverick support, removed after GCC-4.7. #: config/arm/arm.cc:24042 #, c-format msgid "obsolete Maverick format code '%c'" -msgstr "" +msgstr "zastarjela Maverick format kȏd „%c“" #: config/avr/avr.cc:2642 #, c-format msgid "address operand requires constraint for X, Y, or Z register" -msgstr "" +msgstr "operand adrese zahtjeva ograničenje za for X, Y, ili Z registar" #: config/avr/avr.cc:2825 msgid "operands to %T/%t must be reg + const_int:" -msgstr "" +msgstr "operandi za %T/%t moraju biti reg + const_int:" #: config/avr/avr.cc:2875 config/avr/avr.cc:2942 msgid "bad address, not an I/O address:" -msgstr "" +msgstr "loša adresa, nije U/I (I/O) adresa:" #: config/avr/avr.cc:2884 msgid "bad address, not a constant:" -msgstr "" +msgstr "loša adresa, nije konstanta:" #: config/avr/avr.cc:2902 config/avr/avr.cc:2909 msgid "bad address, not (reg+disp):" -msgstr "" +msgstr "loša adresa, nije (reg+disp):" #: config/avr/avr.cc:2916 msgid "bad address, not post_inc or pre_dec:" -msgstr "" +msgstr "loša adresa, nije post_inc ili pre_dec:" #: config/avr/avr.cc:2928 msgid "internal compiler error. Bad address:" -msgstr "" +msgstr "interna greška kompajlera. Loša adresa:" #: config/avr/avr.cc:2961 #, c-format msgid "Unsupported code '%c' for fixed-point:" -msgstr "" +msgstr "Nepodržani kȏd „%c“ za nepomični zarez (fixed-point):" #: config/avr/avr.cc:2969 msgid "internal compiler error. Unknown mode:" -msgstr "" +msgstr "interna greška kompajlera. Nepozat način rada:" #: config/avr/avr.cc:3866 config/avr/avr.cc:4810 config/avr/avr.cc:5257 msgid "invalid insn:" -msgstr "" +msgstr "nevaljani insn:" #: config/avr/avr.cc:3920 config/avr/avr.cc:4032 config/avr/avr.cc:4090 #: config/avr/avr.cc:4142 config/avr/avr.cc:4161 config/avr/avr.cc:4353 #: config/avr/avr.cc:4661 config/avr/avr.cc:4946 config/avr/avr.cc:5150 #: config/avr/avr.cc:5314 config/avr/avr.cc:5407 config/avr/avr.cc:5606 msgid "incorrect insn:" -msgstr "" +msgstr "netočni insn:" #: config/avr/avr.cc:4177 config/avr/avr.cc:4452 config/avr/avr.cc:4732 #: config/avr/avr.cc:5018 config/avr/avr.cc:5196 config/avr/avr.cc:5463 #: config/avr/avr.cc:5664 msgid "unknown move insn:" -msgstr "" +msgstr "nepoznati insn za pomicanje, kopiranje:" #: config/avr/avr.cc:6131 msgid "bad shift insn:" -msgstr "" +msgstr "loš pomak (shift) insn:" #: config/avr/avr.cc:6239 config/avr/avr.cc:6722 config/avr/avr.cc:7139 msgid "internal compiler error. Incorrect shift:" -msgstr "" +msgstr "interna greška kompajlera. Netočni pomak (shift):" #: config/avr/avr.cc:8547 msgid "unsupported fixed-point conversion" -msgstr "" +msgstr "nepodržana konverzija nepomičnog zareza (fixed-point conversion)" #: config/avr/avr.cc:9916 msgid "variable" -msgstr "" +msgstr "varijabla" #: config/avr/avr.cc:9921 msgid "function parameter" -msgstr "" +msgstr "parametar funkcije" #: config/avr/avr.cc:9926 msgid "structure field" -msgstr "" +msgstr "strukturno polje" #: config/avr/avr.cc:9932 msgid "return type of function" -msgstr "" +msgstr "vrsta vrijednosti koju funkcija vrati" #: config/avr/avr.cc:9937 msgid "pointer" -msgstr "" +msgstr "kazaljka (pointer)" #: config/avr/driver-avr.cc:50 #, c-format @@ -18418,6 +18425,8 @@ msgid "" "Running spec function '%s' with %d args\n" "\n" msgstr "" +"Nepoznata spec funkcija „%s“ s %d argumentima\n" +"\n" #: config/bfin/bfin.cc:1390 #, c-format @@ -18431,7 +18440,7 @@ msgstr "" #: config/bpf/bpf.cc:921 msgid "invalid address in operand" -msgstr "nevaljana adresa kao operand" +msgstr "nevaljana adresa u operandu" #. Fallthrough. #: config/bpf/bpf.cc:928 @@ -18699,72 +18708,72 @@ msgstr "" #: config/i386/i386.cc:13121 #, c-format msgid "invalid operand size for operand code 'O'" -msgstr "nevaljana veličina operanda za operand kȏd 'O'" +msgstr "nevaljana veličina operanda za operand kȏd „O“" #: config/i386/i386.cc:13156 #, c-format msgid "invalid operand size for operand code 'z'" -msgstr "nevaljana veličina operanda za operand kȏd 'z'" +msgstr "nevaljana veličina operanda za operand kȏd „z“" #: config/i386/i386.cc:13225 #, c-format msgid "invalid operand type used with operand code 'Z'" -msgstr "nevaljana vrsta operanda korištena s operandom kod „Z“" +msgstr "nevaljana vrsta operanda korištena s operandom kȏda „Z“" #: config/i386/i386.cc:13230 #, c-format msgid "invalid operand size for operand code 'Z'" -msgstr "nevaljana veličina operanda za operand kȏd 'Z'" +msgstr "nevaljana veličina operanda za operand kȏd „Z“" #: config/i386/i386.cc:13307 #, c-format msgid "operand is not a condition code, invalid operand code 'Y'" -msgstr "" +msgstr "operand nije kȏd uvjeta, nevaljani operand kȏd „Y“" #: config/i386/i386.cc:13386 #, c-format msgid "operand is not a condition code, invalid operand code 'D'" -msgstr "" +msgstr "operand nije kȏd uvjeta, nevaljani operand kȏd „D“" #: config/i386/i386.cc:13404 #, c-format msgid "operand is not a condition code, invalid operand code '%c'" -msgstr "" +msgstr "operand nije kȏd uvjeta, nevaljani operand kȏd „%c“" #: config/i386/i386.cc:13417 #, c-format msgid "operand is not an offsettable memory reference, invalid operand code 'H'" -msgstr "" +msgstr "operand nije pokretljiva (offsettable) referencija memorije, nevaljani operand kȏd „H“" #: config/i386/i386.cc:13432 #, c-format msgid "operand is not an integer, invalid operand code 'K'" -msgstr "" +msgstr "operand nije cijeli broj, nevaljani operand kȏd „K“" #: config/i386/i386.cc:13460 #, c-format msgid "operand is not a specific integer, invalid operand code 'r'" -msgstr "" +msgstr "operand nije određeni cijeli broj, nevaljani operand kȏd „r“" #: config/i386/i386.cc:13478 #, c-format msgid "operand is not an integer, invalid operand code 'R'" -msgstr "" +msgstr "operand nije cijeli broj, nevaljani operand kȏd „R“" #: config/i386/i386.cc:13501 #, c-format msgid "operand is not a specific integer, invalid operand code 'R'" -msgstr "" +msgstr "operand nije određeni cijeli broj, nevaljani operand kȏd „R“" #: config/i386/i386.cc:13605 #, c-format msgid "invalid operand code '%c'" -msgstr "" +msgstr "nevaljani operand kȏd „%c“" #: config/i386/i386.cc:13667 config/i386/i386.cc:14056 #, c-format msgid "invalid constraints for operand" -msgstr "" +msgstr "nevaljano ograničenje za operand" #: config/i386/i386.cc:13768 #, c-format @@ -18773,7 +18782,7 @@ msgstr "nevaljana vektorska konstanta" #: config/i386/i386.cc:16847 msgid "unknown insn mode" -msgstr "" +msgstr "nepoznati insn način" #: config/ia64/ia64.cc:5459 #, c-format @@ -18832,7 +18841,7 @@ msgstr "" #: config/m32r/m32r.cc:2144 msgid "bad insn for 'A'" -msgstr "" +msgstr "loš insn za „A“" #: config/m32r/m32r.cc:2191 #, c-format @@ -28448,7 +28457,7 @@ msgstr "" #: read-rtl-function.cc:265 #, gcc-internal-format, gfc-internal-format msgid "insn with UID %i not found for operand %i (`%s') of insn %i" -msgstr "insn s UID-om %i nnije pronađen za operand %i („%s“) od insn %i" +msgstr "insn s UID-om %i nije pronađen za operand %i („%s“) od insn %i" #: read-rtl-function.cc:269 #, gcc-internal-format, gfc-internal-format @@ -44924,7 +44933,7 @@ msgstr "" #: c/c-parser.cc:18075 cp/parser.cc:40592 #, gcc-internal-format msgid "expected %, %, %, or % clause" -msgstr "očekivano je %, %, %, ili % naredba" +msgstr "očekivano je %, %, %, ili % klauzula" #: c/c-parser.cc:18114 cp/parser.cc:40631 #, gcc-internal-format @@ -45027,7 +45036,7 @@ msgstr "očekivano je %, %, % ili %" #: c/c-parser.cc:19046 cp/parser.cc:41583 #, gcc-internal-format msgid "expected %, % or % clause" -msgstr "očekivano je %, % ili % naredba" +msgstr "očekivano je %, % ili % klauzula" #: c/c-parser.cc:19084 cp/parser.cc:41623 #, gcc-internal-format @@ -45047,7 +45056,7 @@ msgstr "" #: c/c-parser.cc:19176 cp/parser.cc:42350 #, gcc-internal-format msgid "expected % or % clause" -msgstr "očekivano je % ili % naredba" +msgstr "očekivano je % ili % klauzula" #: c/c-parser.cc:19181 cp/parser.cc:42356 #, gcc-internal-format @@ -45367,7 +45376,7 @@ msgstr "" #: c/c-parser.cc:22837 cp/parser.cc:46650 #, gcc-internal-format msgid "expected %, % or % clause" -msgstr "očekivano je %, % ili % naredba" +msgstr "očekivano je %, % ili % klauzula" #: c/c-parser.cc:22870 cp/parser.cc:46685 #, gcc-internal-format @@ -46915,7 +46924,7 @@ msgstr "" #: c/c-typeck.cc:14097 cp/semantics.cc:6665 #, gcc-internal-format msgid "expected pointer in %qs clause" -msgstr "očekivana je kazaljka (pointer) u %qs naredbi" +msgstr "očekivana je kazaljka (pointer) u %qs klauzuli" #: c/c-typeck.cc:14185 cp/semantics.cc:6746 #, gcc-internal-format From b4e4b35f4ebe561826489bed971324efc99c5423 Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Wed, 30 Mar 2022 22:36:12 +0200 Subject: [PATCH 125/157] Fortran: NULL pointer dereference checking arguments to ASSOCIATED intrinsic gcc/fortran/ChangeLog: PR fortran/100892 * check.cc (gfc_check_associated): Avoid NULL pointer dereference. gcc/testsuite/ChangeLog: PR fortran/100892 * gfortran.dg/associated_target_8.f90: New test. --- gcc/fortran/check.cc | 2 +- .../gfortran.dg/associated_target_8.f90 | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/associated_target_8.f90 diff --git a/gcc/fortran/check.cc b/gcc/fortran/check.cc index fc97bb1371e..0c2cb50c6a7 100644 --- a/gcc/fortran/check.cc +++ b/gcc/fortran/check.cc @@ -1504,7 +1504,7 @@ gfc_check_associated (gfc_expr *pointer, gfc_expr *target) argument of intrinsic inquiry functions. */ if (pointer->rank != -1 && !rank_check (target, 0, pointer->rank)) t = false; - if (target->rank > 0) + if (target->rank > 0 && target->ref) { for (i = 0; i < target->rank; i++) if (target->ref->u.ar.dimen_type[i] == DIMEN_VECTOR) diff --git a/gcc/testsuite/gfortran.dg/associated_target_8.f90 b/gcc/testsuite/gfortran.dg/associated_target_8.f90 new file mode 100644 index 00000000000..75c2740a188 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/associated_target_8.f90 @@ -0,0 +1,16 @@ +! { dg-do compile } +! PR fortran/100892 - procedure pointer to function returning array of size n + +module m + implicit none + procedure(func1), pointer :: my_ptr => null() +contains + subroutine test_sub + if (associated (my_ptr, func1)) print *,'associated' + end subroutine test_sub + function func1 (n) + integer, intent(in) :: n + real, dimension(n) :: func1 + func1 = 0. + end function +end module m From 150ab50f7449cf5b496bbe6e5c60cb1adb2e2d6c Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 31 Mar 2022 00:16:28 +0000 Subject: [PATCH 126/157] Daily bump. --- gcc/ChangeLog | 47 +++++++++++++++++++++++++++ gcc/DATESTAMP | 2 +- gcc/c-family/ChangeLog | 20 ++++++++++++ gcc/cp/ChangeLog | 26 +++++++++++++++ gcc/fortran/ChangeLog | 5 +++ gcc/po/ChangeLog | 4 +++ gcc/testsuite/ChangeLog | 72 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 175 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fd8498f9c48..63f0ff626f4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,50 @@ +2022-03-30 Bill Schmidt + + * config/rs6000/rs6000-builtins.def (NEG_V16QI): Move to [altivec] + stanza. + (NEG_V4SF): Likewise. + (NEG_V4SI): Likewise. + (NEG_V8HI): Likewise. + (NEG_V2DF): Move to [vsx] stanza. + (NEG_V2DI): Likewise. + +2022-03-30 Vladimir N. Makarov + + PR middle-end/105032 + * lra-assigns.cc (find_reload_regno_insns): Modify loop condition. + +2022-03-30 Tom de Vries + Tobias Burnus + + * doc/invoke.texi (march): Document __PTX_SM__. + (mptx): Document __PTX_ISA_VERSION_MAJOR__ and + __PTX_ISA_VERSION_MINOR__. + +2022-03-30 Jakub Jelinek + + PR sanitizer/105093 + * ubsan.cc (instrument_object_size): If t is equal to inner and + is a decl other than global var, punt. When emitting call to + UBSAN_OBJECT_SIZE ifn, make sure base is addressable. + +2022-03-30 Jakub Jelinek + + PR tree-optimization/105094 + * gimple-ssa-store-merging.cc (mem_valid_for_store_merging): Punt if + bitsize <= 0 rather than just == 0. + +2022-03-30 Tom de Vries + + * doc/invoke.texi (misa, mptx): Update. + (march, march-map): Add. + +2022-03-30 Thomas Schwinge + + * opt-functions.awk (n_args): New function. + (lang_enabled_by): Merge function into... + * optc-gen.awk : ... sole user here. + Improve diagnostics. + 2022-03-29 Marek Polacek Jakub Jelinek diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 5ef3293bd94..30d76ef0a80 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20220330 +20220331 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index a85f82f490b..5ca3182088b 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,23 @@ +2022-03-30 Marek Polacek + + PR c++/101030 + * c-warn.cc (conversion_warning) : Don't call + conversion_warning when OP1 is null. + +2022-03-30 Thomas Schwinge + + * c.opt (Wc++11-extensions, Wc++14-extensions, Wc++17-extensions) + (Wc++20-extensions, Wc++23-extensions): Remove 'LangEnabledBy' + option properties. + +2022-03-30 Thomas Schwinge + + * c.opt (Wuse-after-free): Remove. + +2022-03-30 Thomas Schwinge + + * c.opt (Warray-bounds): Remove. + 2022-03-26 Thomas Schwinge * c.opt: Properly quote comment. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ec38eeb954a..766e76c06fd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,29 @@ +2022-03-30 Patrick Palka + + PR c++/100474 + * constraint.cc (diagnose_trait_expr): Handle all remaining + traits appropriately. Remove default case. + +2022-03-30 Marek Polacek + + PR c++/93280 + PR c++/104583 + * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor. + +2022-03-30 Jakub Jelinek + + PR c++/105092 + * pt.cc (tsubst_omp_clause_decl): When handling iterators, set + DECL_CONTEXT of the iterator var to current_function_decl and + call pushdecl. + +2022-03-30 Jakub Jelinek + + PR c++/105061 + * parser.cc (cp_parser_template_introduction): If member_p, temporarily + clear parser->colon_corrects_to_scope_p around tentative parsing of + nested name specifier. + 2022-03-28 Jason Merrill * pt.cc (determine_specialization): Add comment. diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 0e05013d94a..3f5ccf6ea64 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2022-03-30 Harald Anlauf + + PR fortran/100892 + * check.cc (gfc_check_associated): Avoid NULL pointer dereference. + 2022-03-29 Harald Anlauf Steven G. Kargl diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 4d1997b2d04..fcc463d039d 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,7 @@ +2022-03-30 Joseph Myers + + * hr.po: Update. + 2022-03-29 Joseph Myers * hr.po: Update. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f3335e7254c..b6721c24e82 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,75 @@ +2022-03-30 Harald Anlauf + + PR fortran/100892 + * gfortran.dg/associated_target_8.f90: New test. + +2022-03-30 Vladimir N. Makarov + + PR middle-end/105032 + * gcc.target/i386/pr105032.c: New. + +2022-03-30 Jakub Jelinek + + Revert: + 2022-03-30 Jakub Jelinek + + PR tree-optimization/80334 + PR target/102772 + * g++.dg/torture/pr80334.C: Change from dg-do run to dg-do compile. + +2022-03-30 Marek Polacek + + PR c++/101030 + * g++.dg/ext/cond5.C: New test. + +2022-03-30 Patrick Palka + + PR c++/100474 + * g++.dg/cpp2a/concepts-traits3.C: New test. + +2022-03-30 Jakub Jelinek + + PR tree-optimization/80334 + PR target/102772 + * g++.dg/torture/pr80334.C: Change from dg-do run to dg-do compile. + +2022-03-30 Marek Polacek + + PR c++/93280 + PR c++/104583 + * g++.dg/cpp0x/nsdmi-list7.C: New test. + * g++.dg/cpp0x/nsdmi-list8.C: New test. + +2022-03-30 Jakub Jelinek + + PR sanitizer/105093 + * g++.dg/ubsan/pr105093.C: New test. + +2022-03-30 Jakub Jelinek + + PR tree-optimization/105094 + * gcc.dg/pr105094.c: New test. + +2022-03-30 Jakub Jelinek + + PR c++/105092 + * g++.dg/gomp/pr105092.C: New test. + +2022-03-30 Jakub Jelinek + + PR c++/105061 + * g++.dg/concepts/pr105061.C: New test. + +2022-03-30 Alexandre Oliva + + * gcc.dg/analyzer/strndup-1.c: Add *-*-vxworks* to no-strndup + in libc. + +2022-03-30 Alexandre Oliva + + * gcc.dg/weak/typeof-2.c: Add arm*-*-* to targets that may + place the call target in a constant pool. + 2022-03-29 David Malcolm PR testsuite/105085 From 0ce8154f1c72e6d701bff969a007938e2f986369 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 30 Mar 2022 13:57:22 -0400 Subject: [PATCH 127/157] c++: parse trivial DMI immediately [PR96645] The recent change to reject __is_constructible for nested classes with DMI is, unsurprisingly, breaking some code. Let's allow simple cases by immediately parsing DMI that do no name lookup; then being in complete class scope makes no difference. PR c++/96645 gcc/cp/ChangeLog: * parser.cc (cp_parser_early_parsing_nsdmi): New. (cp_parser_member_declaration): Call it. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/nsdmi10.C: Now OK. * g++.dg/ext/is_constructible3.C: Likewise. * g++.dg/ext/is_constructible7.C: Likewise. --- gcc/cp/parser.cc | 28 +++++++++++++++++++- gcc/testsuite/g++.dg/cpp0x/nsdmi10.C | 4 +-- gcc/testsuite/g++.dg/ext/is_constructible3.C | 2 +- gcc/testsuite/g++.dg/ext/is_constructible7.C | 3 +-- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 7e1c777364e..63c8af1c722 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -2701,6 +2701,8 @@ static tree cp_parser_late_parse_one_default_arg (cp_parser *, tree, tree, tree); static void cp_parser_late_parsing_nsdmi (cp_parser *, tree); +static bool cp_parser_early_parsing_nsdmi + (cp_parser *, tree); static void cp_parser_late_parsing_default_args (cp_parser *, tree); static tree cp_parser_sizeof_operand @@ -27478,7 +27480,8 @@ cp_parser_member_declaration (cp_parser* parser) if (DECL_DECLARES_FUNCTION_P (decl)) cp_parser_save_default_args (parser, STRIP_TEMPLATE (decl)); else if (TREE_CODE (decl) == FIELD_DECL - && DECL_INITIAL (decl)) + && DECL_INITIAL (decl) + && !cp_parser_early_parsing_nsdmi (parser, decl)) /* Add DECL to the queue of NSDMI to be parsed later. */ vec_safe_push (unparsed_nsdmis, decl); } @@ -32292,6 +32295,29 @@ cp_parser_late_parsing_nsdmi (cp_parser *parser, tree field) DECL_INITIAL (field) = def; } +/* If the DEFERRED_PARSE for FIELD is safe to parse immediately, do so. + Returns true if deferred parsing is no longer needed. */ + +static bool +cp_parser_early_parsing_nsdmi (cp_parser *parser, tree field) +{ + tree init = DECL_INITIAL (field); + if (TREE_CODE (init) != DEFERRED_PARSE) + return true; + + cp_token_cache *tokens = DEFPARSE_TOKENS (init); + for (cp_token *p = tokens->first; p != tokens->last; ++p) + if (p->type == CPP_NAME + || p->keyword == RID_THIS + || p->keyword == RID_OPERATOR) + /* There's a name to look up or 'this', give up. */ + return false; + + /* It's trivial, parse now. */ + cp_parser_late_parsing_nsdmi (parser, field); + return true; +} + /* FN is a FUNCTION_DECL which may contains a parameter with an unparsed DEFERRED_PARSE. Parse the default args now. This function assumes that the current scope is the scope in which the default diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi10.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi10.C index d8588b7f29e..a965f7bc333 100644 --- a/gcc/testsuite/g++.dg/cpp0x/nsdmi10.C +++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi10.C @@ -6,7 +6,7 @@ struct A1 { int y1 = 1; }; - A1(const B1& opts = B1()) {} // { dg-error "default member initializer" } + A1(const B1& opts = B1()) {} }; struct A2 { @@ -14,5 +14,5 @@ struct A2 { int x2, y2 = 1; }; - A2(const B2& opts = B2()) {} // { dg-error "default member initializer" } + A2(const B2& opts = B2()) {} }; diff --git a/gcc/testsuite/g++.dg/ext/is_constructible3.C b/gcc/testsuite/g++.dg/ext/is_constructible3.C index 305751d28e2..c7c58746cd0 100644 --- a/gcc/testsuite/g++.dg/ext/is_constructible3.C +++ b/gcc/testsuite/g++.dg/ext/is_constructible3.C @@ -8,7 +8,7 @@ struct A { B() = default; }; - static constexpr bool v = __is_constructible (B); // { dg-error "member initializer" } + static constexpr bool v = __is_constructible (B); }; diff --git a/gcc/testsuite/g++.dg/ext/is_constructible7.C b/gcc/testsuite/g++.dg/ext/is_constructible7.C index 76a63bba5d0..013a1df03c6 100644 --- a/gcc/testsuite/g++.dg/ext/is_constructible7.C +++ b/gcc/testsuite/g++.dg/ext/is_constructible7.C @@ -12,7 +12,7 @@ using true_type = bool_constant; template struct is_default_constructible - : bool_constant<__is_constructible(T)> // { dg-error "default member init" } + : bool_constant<__is_constructible(T)> { }; void testVarStruct() @@ -22,7 +22,6 @@ void testVarStruct() int number = 5; // compiles, if remove initialization }; - // { dg-prune-output "could not convert" } is_default_constructible::type t = true_type{}; }; } From 63cd7cef7e0f49fa557c5f694dbbd2e68de1f822 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 31 Mar 2022 08:10:37 +0200 Subject: [PATCH 128/157] gcov: Reword comment for gcov_read_string() gcc/ * gcov-io.cc (gcov_read_string): Reword documentation comment. --- gcc/gcov-io.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/gcov-io.cc b/gcc/gcov-io.cc index c2e9e2b6d64..72c40f8eaa0 100644 --- a/gcc/gcov-io.cc +++ b/gcc/gcov-io.cc @@ -473,9 +473,9 @@ mangle_path (char const *base) /* We need to expose the below function when compiling for gcov-tool. */ #if !IN_LIBGCOV || defined (IN_GCOV_TOOL) -/* Read string from coverage file. Returns a pointer to a static - buffer, or NULL on empty string. You must copy the string before - calling another gcov function. */ +/* Read string from coverage file. Allocate the buffer for the string + from the heap or die. Return a pointer to the string, or NULL on + empty string. */ GCOV_LINKAGE const char * gcov_read_string (void) From b8207ad367174df5f2e2fdf3305c97ed227d8f78 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 30 Mar 2022 15:18:55 +0200 Subject: [PATCH 129/157] Revert "gimple: allow more folding of memcpy [PR102125]" This reverts commit 5f6a6c91d7c592cb49f7c519f289777eac09bb74. --- gcc/gimple-fold.cc | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc index e73bc6a7137..270a9a249d3 100644 --- a/gcc/gimple-fold.cc +++ b/gcc/gimple-fold.cc @@ -67,8 +67,6 @@ along with GCC; see the file COPYING3. If not see #include "tree-vector-builder.h" #include "tree-ssa-strlen.h" #include "varasm.h" -#include "memmodel.h" -#include "optabs.h" #include "internal-fn.h" enum strlen_range_kind { @@ -962,17 +960,14 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi, = build_int_cst (build_pointer_type_for_mode (char_type_node, ptr_mode, true), 0); - /* If we can perform the copy efficiently with first doing all loads and - then all stores inline it that way. Currently efficiently means that - we can load all the memory with a single set operation and that the - total size is less than MOVE_MAX * MOVE_RATIO. */ + /* If we can perform the copy efficiently with first doing all loads + and then all stores inline it that way. Currently efficiently + means that we can load all the memory into a single integer + register which is what MOVE_MAX gives us. */ src_align = get_pointer_alignment (src); dest_align = get_pointer_alignment (dest); if (tree_fits_uhwi_p (len) - && (compare_tree_int - (len, (MOVE_MAX - * MOVE_RATIO (optimize_function_for_size_p (cfun)))) - <= 0) + && compare_tree_int (len, MOVE_MAX) <= 0 /* FIXME: Don't transform copies from strings with known length. Until GCC 9 this prevented a case in gcc.dg/strlenopt-8.c from being handled, and the case was XFAILed for that reason. @@ -1006,7 +1001,6 @@ gimple_fold_builtin_memory_op (gimple_stmt_iterator *gsi, scalar_int_mode mode; if (int_mode_for_size (ilen * 8, 0).exists (&mode) && GET_MODE_SIZE (mode) * BITS_PER_UNIT == ilen * 8 - && have_insn_for (SET, mode) /* If the destination pointer is not aligned we must be able to emit an unaligned store. */ && (dest_align >= GET_MODE_ALIGNMENT (mode) From b75f996e846d079251f3a6134617f0405c3ed535 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 31 Mar 2022 08:20:43 +0200 Subject: [PATCH 130/157] rtl-optimization/105091 - wrong DSE with missed TREE_ADDRESSABLE When expanding an aggregate copy into a memcpy call RTL expansion uses mark_addressable to ensure the base object is addressable but that function doesn't handle TARGET_MEM_REF bases. Fixed as follows. 2022-03-31 Richard Biener PR rtl-optimization/105091 * gimple-expr.cc (mark_addressable): Handle TARGET_MEM_REF bases. --- gcc/gimple-expr.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/gimple-expr.cc b/gcc/gimple-expr.cc index f9a650b5daf..5faaf43eaf5 100644 --- a/gcc/gimple-expr.cc +++ b/gcc/gimple-expr.cc @@ -910,7 +910,8 @@ mark_addressable (tree x) x = TREE_OPERAND (x, 0); while (handled_component_p (x)) x = TREE_OPERAND (x, 0); - if (TREE_CODE (x) == MEM_REF + if ((TREE_CODE (x) == MEM_REF + || TREE_CODE (x) == TARGET_MEM_REF) && TREE_CODE (TREE_OPERAND (x, 0)) == ADDR_EXPR) x = TREE_OPERAND (TREE_OPERAND (x, 0), 0); if (!VAR_P (x) From bf4832d6fa817f66009f100a9cd68953062add7d Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Wed, 30 Mar 2022 13:26:52 +0200 Subject: [PATCH 131/157] [nvptx] Fix ASM_SPEC workaround for sm_30 Newer versions of CUDA no longer support sm_30, and nvptx-tools as currently doesn't handle that gracefully when verifying ( https://github.com/MentorEmbedded/nvptx-tools/issues/30 ). There's a --no-verify work-around in place in ASM_SPEC, but that one doesn't work when using -Wa,--verify on the command line. Use a more robust workaround: verify using sm_35 when misa=sm_30 is specified (either implicitly or explicitly). Tested on nvptx. gcc/ChangeLog: 2022-03-30 Tom de Vries * config/nvptx/nvptx.h (ASM_SPEC): Use "-m sm_35" for -misa=sm_30. --- gcc/config/nvptx/nvptx.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h index 75ac7a666b1..3b06f33032f 100644 --- a/gcc/config/nvptx/nvptx.h +++ b/gcc/config/nvptx/nvptx.h @@ -29,10 +29,24 @@ #define STARTFILE_SPEC "%{mmainkernel:crt0.o}" -/* Default needs to be in sync with default for misa in nvptx.opt. - We add a default here to work around a hard-coded sm_30 default in - nvptx-as. */ -#define ASM_SPEC "%{misa=*:-m %*; :-m sm_35}%{misa=sm_30:--no-verify}" +/* Newer versions of CUDA no longer support sm_30, and nvptx-tools as + currently doesn't handle that gracefully when verifying + ( https://github.com/MentorEmbedded/nvptx-tools/issues/30 ). Work around + this by verifying with sm_35 when having misa=sm_30 (either implicitly + or explicitly). */ +#define ASM_SPEC \ + "%{" \ + /* Explict misa=sm_30. */ \ + "misa=sm_30:-m sm_35" \ + /* Separator. */ \ + "; " \ + /* Catch-all. */ \ + "misa=*:-m %*" \ + /* Separator. */ \ + "; " \ + /* Implicit misa=sm_30. */ \ + ":-m sm_35" \ + "}" #define TARGET_CPU_CPP_BUILTINS() nvptx_cpu_cpp_builtins () From 97ad0b831386e56ecb125a25fff00b2cb0b1a2b9 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 31 Mar 2022 09:21:27 +0200 Subject: [PATCH 132/157] tree-optimization/105109 - bogus uninit diagnostic with _Complex When update_address_taken rewrites a _Complex into SSA it changes stores to real/imaginary parts to loads of the other component and a COMPLEX_EXPR. That matches what gimplification does but it misses suppression of diagnostics for the load of the other component. The following patch adds that, syncing up gimplification and update_address_taken behavior. 2022-03-31 Richard Biener PR tree-optimization/105109 * tree-ssa.cc (execute_update_addresses_taken): Suppress diagnostics on the load of the other complex component. * gcc.dg/uninit-pr105109.c: New testcase. --- gcc/testsuite/gcc.dg/uninit-pr105109.c | 15 +++++++++++++++ gcc/tree-ssa.cc | 1 + 2 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/uninit-pr105109.c diff --git a/gcc/testsuite/gcc.dg/uninit-pr105109.c b/gcc/testsuite/gcc.dg/uninit-pr105109.c new file mode 100644 index 00000000000..001003ca261 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pr105109.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized" } */ + +static void foo(int dim,float _Complex f0[]) +{ + int d; + f0[0] -= 3.14; /* { dg-bogus "uninitialized" } */ + for (d = 0; d < dim; ++d) f0[0] += 3.14; +} +void bar(int dim, const float _Complex u_t[], float _Complex f0[]) +{ + float _Complex exp[1] = {0.}; + foo(dim, exp); + f0[0] = u_t[0] - exp[0]; +} diff --git a/gcc/tree-ssa.cc b/gcc/tree-ssa.cc index 6dcb3142869..a362a0a9ea6 100644 --- a/gcc/tree-ssa.cc +++ b/gcc/tree-ssa.cc @@ -1905,6 +1905,7 @@ execute_update_addresses_taken (void) ? REALPART_EXPR : IMAGPART_EXPR, TREE_TYPE (other), TREE_OPERAND (lhs, 0)); + suppress_warning (lrhs); gimple *load = gimple_build_assign (other, lrhs); location_t loc = gimple_location (stmt); gimple_set_location (load, loc); From 90533de067d12159b3fbc847e5397033384f7484 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 31 Mar 2022 09:28:32 +0200 Subject: [PATCH 133/157] [nvptx, testsuite] Fix typo in gcc.target/nvptx/march.c The dg-options line in gcc.target/nvptx/march.c: ... /* { dg-options "-march=sm_30"} */ ... currently doesn't have any effect because it's missing a space between '"' and '}'. Fix this by adding the missing space. Tested on nvptx. gcc/testsuite/ChangeLog: 2022-03-31 Tom de Vries * gcc.target/nvptx/march.c: Add missing space in dg-options line. --- gcc/testsuite/gcc.target/nvptx/march.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/nvptx/march.c b/gcc/testsuite/gcc.target/nvptx/march.c index ec91f21c903..d1dd715798c 100644 --- a/gcc/testsuite/gcc.target/nvptx/march.c +++ b/gcc/testsuite/gcc.target/nvptx/march.c @@ -1,4 +1,4 @@ -/* { dg-options "-march=sm_30"} */ +/* { dg-options "-march=sm_30" } */ #include "main.c" From f6d65e803623c7ba6c8eb92ce5975fc1b90cd91e Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Thu, 31 Mar 2022 16:50:24 +0200 Subject: [PATCH 134/157] ipa: Create LOAD references when necessary during inlining (PR 103171) in r12-2523-g13586172d0b70c ipa-prop tracking of jump functions during inlining got the ability to remove ADDR references when inlining discovered that they were not necessary or turn them into LOAD references when we know that what was a function call argument passed by reference will end up as a load (one or more). Unfortunately, the code only creates the LOAD references when replacing removed ADDR references and PR 103171 showed that with some ordering of inlining, we need to add the LOAD reference before we know we can remove the ADDR one - or the reference will be lost, leading to link errors or even ICEs. Specifically in testcase gcc.dg/lto/pr103171_1.c added in this patch, if foo() is inlined to entry(), we need to create the LOAD reference so that when later bar() is inlined into foo() and we discover that the paameter is unused, we can remove the ADDR reference and still keep the varaible around for the load. Martin gcc/ChangeLog: 2022-01-28 Martin Jambor PR ipa/103171 * ipa-prop.cc (propagate_controlled_uses): Add a LOAD reference always when an ADDR_EXPR constant is known to reach a load because of inlining, not just when removing an ADDR reference. gcc/testsuite/ChangeLog: 2022-01-28 Martin Jambor PR ipa/103171 * gcc.dg/ipa/remref-6.c: Adjust dump scan string. * gcc.dg/ipa/remref-7.c: New test. * gcc.dg/lto/pr103171_0.c: New test. * gcc.dg/lto/pr103171_1.c: Likewise. --- gcc/ipa-prop.cc | 30 ++++++++++++----------- gcc/testsuite/gcc.dg/ipa/remref-6.c | 2 +- gcc/testsuite/gcc.dg/ipa/remref-7.c | 33 +++++++++++++++++++++++++ gcc/testsuite/gcc.dg/lto/pr103171_0.c | 11 +++++++++ gcc/testsuite/gcc.dg/lto/pr103171_1.c | 35 +++++++++++++++++++++++++++ 5 files changed, 96 insertions(+), 15 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/ipa/remref-7.c create mode 100644 gcc/testsuite/gcc.dg/lto/pr103171_0.c create mode 100644 gcc/testsuite/gcc.dg/lto/pr103171_1.c diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc index e55fe2776f2..72aa3e2f60d 100644 --- a/gcc/ipa-prop.cc +++ b/gcc/ipa-prop.cc @@ -4181,6 +4181,20 @@ propagate_controlled_uses (struct cgraph_edge *cs) int d = ipa_get_controlled_uses (old_root_info, i); int c = rdesc->refcount; rdesc->refcount = combine_controlled_uses_counters (c, d); + if (rdesc->refcount != IPA_UNDESCRIBED_USE + && ipa_get_param_load_dereferenced (old_root_info, i)) + { + tree cst = ipa_get_jf_constant (jf); + gcc_checking_assert (TREE_CODE (cst) == ADDR_EXPR + && (TREE_CODE (TREE_OPERAND (cst, 0)) + == VAR_DECL)); + symtab_node *n = symtab_node::get (TREE_OPERAND (cst, 0)); + new_root->create_reference (n, IPA_REF_LOAD, NULL); + if (dump_file) + fprintf (dump_file, "ipa-prop: Address IPA constant will reach " + "a load so adding LOAD reference from %s to %s.\n", + new_root->dump_name (), n->dump_name ()); + } if (rdesc->refcount == 0) { tree cst = ipa_get_jf_constant (jf); @@ -4193,20 +4207,8 @@ propagate_controlled_uses (struct cgraph_edge *cs) symtab_node *n = symtab_node::get (TREE_OPERAND (cst, 0)); if (n) { - struct cgraph_node *clone; - bool removed = remove_described_reference (n, rdesc); - /* The reference might have been removed by IPA-CP. */ - if (removed - && ipa_get_param_load_dereferenced (old_root_info, i)) - { - new_root->create_reference (n, IPA_REF_LOAD, NULL); - if (dump_file) - fprintf (dump_file, "ipa-prop: ...replaced it with " - "LOAD one from %s to %s.\n", - new_root->dump_name (), n->dump_name ()); - } - - clone = cs->caller; + remove_described_reference (n, rdesc); + cgraph_node *clone = cs->caller; while (clone->inlined_to && clone->ipcp_clone && clone != rdesc->cs->caller) diff --git a/gcc/testsuite/gcc.dg/ipa/remref-6.c b/gcc/testsuite/gcc.dg/ipa/remref-6.c index 7deae3114a4..f31f4c14319 100644 --- a/gcc/testsuite/gcc.dg/ipa/remref-6.c +++ b/gcc/testsuite/gcc.dg/ipa/remref-6.c @@ -20,5 +20,5 @@ void entry() } /* { dg-final { scan-ipa-dump "Removed a reference" "inline" } } */ -/* { dg-final { scan-ipa-dump "replaced it with LOAD" "inline" } } */ +/* { dg-final { scan-ipa-dump "adding LOAD reference" "inline" } } */ /* { dg-final { scan-tree-dump-not "builtin_exp" "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/remref-7.c b/gcc/testsuite/gcc.dg/ipa/remref-7.c new file mode 100644 index 00000000000..b2c26ab7fd5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/remref-7.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-early-inlining -fno-ipa-sra -fdump-ipa-inline" } */ + +int rglobal = 0; +int g; + +int c; +double *array; + +/* unused parameter */ +static void bar(int *p) +{ + int i; + for (i = 0; i < c; i++) + { + /* something big so that it is inlined second. */ + array[i] = __builtin_exp(array[i]+1)*2; + } +} + +void foo(int *p) { + g = *p; + bar(p); +} + +void entry() +{ + foo(&rglobal); +} + +/* { dg-final { scan-ipa-dump "Removed a reference" "inline" } } */ +/* { dg-final { scan-ipa-dump "adding LOAD reference" "inline" } } */ + diff --git a/gcc/testsuite/gcc.dg/lto/pr103171_0.c b/gcc/testsuite/gcc.dg/lto/pr103171_0.c new file mode 100644 index 00000000000..5dc17d6c6c8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr103171_0.c @@ -0,0 +1,11 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options { { -O2 -flto -flto-partition=1to1 -fno-early-inlining -fno-ipa-sra -w } } } */ + +extern void __attribute__((noinline)) entry(void); + +int +main (int argc, char **argv) +{ + entry(); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/lto/pr103171_1.c b/gcc/testsuite/gcc.dg/lto/pr103171_1.c new file mode 100644 index 00000000000..39aed25daf7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr103171_1.c @@ -0,0 +1,35 @@ +int rglobal = 0; + +volatile int g; +volatile int c; +volatile double *array; + +/* unused parameter */ +static void +bar(int *p) +{ + int i; + for (i = 0; i < c; i++) + { + /* something big so that it is inlined second. */ + array[i] = (array[i+1]+array[i]+1)*2; + } +} + +void foo(int *p) { + g = *p; + bar(p); +} + +void __attribute__((noinline)) +entry(void) +{ + foo(&rglobal); +} + +void __attribute__((used)) +blah(int *p) +{ + bar(p); +} + From cf68f5a6d20db2aee2f3e674ad3f10e1c458edf9 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Thu, 31 Mar 2022 17:14:42 +0200 Subject: [PATCH 135/157] ipa-cp: Do not create clones for values outside known value range (PR 102513) PR 102513 shows we emit bogus array access warnings when IPA-CP creates clones specialized for values which it deduces from arithmetic jump functions describing self-recursive calls. Those can however be avoided if we consult the IPA-VR information that the same pass also has. The patch below does that at the stage when normally values are only examined for profitability. It would be better not to create lattices describing such bogus values in the first place, however that presents an ordering problem, the pass currently propagates all information, and so both constants and VR, in no particular order when processing SCCs, and so this approach seemed much simpler. I plan to rearrange the pass so that it clones in multiple passes over the call graph (or rather the lattice dependence graph) and it feels natural to only do propagation for these kinds of recursion in the second or later passes, which would fix the issue more elegantly. gcc/ChangeLog: 2022-02-14 Martin Jambor PR ipa/102513 * ipa-cp.cc (decide_whether_version_node): Skip scalar values which do not fit the known value_range. gcc/testsuite/ChangeLog: 2022-02-14 Martin Jambor PR ipa/102513 * gcc.dg/ipa/pr102513.c: New test. --- gcc/ipa-cp.cc | 28 ++++++++++++++++++++++-- gcc/testsuite/gcc.dg/ipa/pr102513.c | 33 +++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/ipa/pr102513.c diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc index 18047c209a8..8628140d6d9 100644 --- a/gcc/ipa-cp.cc +++ b/gcc/ipa-cp.cc @@ -6154,8 +6154,32 @@ decide_whether_version_node (struct cgraph_node *node) { ipcp_value *val; for (val = lat->values; val; val = val->next) - ret |= decide_about_value (node, i, -1, val, &avals, - &self_gen_clones); + { + /* If some values generated for self-recursive calls with + arithmetic jump functions fall outside of the known + value_range for the parameter, we can skip them. VR interface + supports this only for integers now. */ + if (TREE_CODE (val->value) == INTEGER_CST + && !plats->m_value_range.bottom_p () + && !plats->m_value_range.m_vr.contains_p (val->value)) + { + /* This can happen also if a constant present in the source + code falls outside of the range of parameter's type, so we + cannot assert. */ + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, " - skipping%s value ", + val->self_recursion_generated_p () + ? " self_recursion_generated" : ""); + print_ipcp_constant_value (dump_file, val->value); + fprintf (dump_file, " because it is outside known " + "value range.\n"); + } + continue; + } + ret |= decide_about_value (node, i, -1, val, &avals, + &self_gen_clones); + } } if (!plats->aggs_bottom) diff --git a/gcc/testsuite/gcc.dg/ipa/pr102513.c b/gcc/testsuite/gcc.dg/ipa/pr102513.c new file mode 100644 index 00000000000..9ee5431b730 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr102513.c @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -Warray-bounds" } */ + +extern int block2[7][256]; + +static int encode_block(int block2[7][256], unsigned level) +{ + int best_score = 0; + + for (unsigned x = 0; x < level; x++) { + int v = block2[1][x]; + block2[level][x] = 0; + best_score += v * v; + } + + if (level > 0 && best_score > 64) { + int score = 0; + + score += encode_block(block2, level - 1); + score += encode_block(block2, level - 1); + + if (score < best_score) { + best_score = score; + } + } + + return best_score; +} + +int foo(void) +{ + return encode_block(block2, 5); +} From 7f016919fc8a042b83812ae5f34946ef23b7adb3 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 30 Mar 2022 16:57:27 +0100 Subject: [PATCH 136/157] libstdc++: Add comment about memalign requirements The memalign man page on Solaris and QNX lists an additional requirement for the alignment value that is not present in all implementation of that non-standard function. For both those targets we should actually be using posix_memalign anyway, so it doesn't matter. This just adds a comment making note of that fact. libstdc++-v3/ChangeLog: * libsupc++/new_opa.cc (aligned_alloc): Add comment. --- libstdc++-v3/libsupc++/new_opa.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/libsupc++/new_opa.cc b/libstdc++-v3/libsupc++/new_opa.cc index 5f24737de1c..411cd8d98b2 100644 --- a/libstdc++-v3/libsupc++/new_opa.cc +++ b/libstdc++-v3/libsupc++/new_opa.cc @@ -87,6 +87,8 @@ aligned_alloc (std::size_t al, std::size_t sz) static inline void* aligned_alloc (std::size_t al, std::size_t sz) { + // Solaris requires al >= sizeof a word and QNX requires >= sizeof(void*) + // but they both provide posix_memalign, so will use the definition above. return memalign (al, sz); } #else // !HAVE__ALIGNED_MALLOC && !HAVE_POSIX_MEMALIGN && !HAVE_MEMALIGN From 7ea3a73c195a79e6740ae594ee1a14c8bf7a938d Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Thu, 31 Mar 2022 17:22:34 +0200 Subject: [PATCH 137/157] ipa: Careful processing ANCESTOR jump functions and NULL pointers (PR 103083) IPA_JF_ANCESTOR jump functions are constructed also when the formal parameter of the caller is first checked whether it is NULL and left as it is if it is NULL, to accommodate C++ casts to an ancestor class. The jump function type was invented for devirtualization and IPA-CP propagation of tree constants is also careful to apply it only to existing DECLs(*) but as PR 103083 shows, the part propagating "known bits" was not careful about this, which can lead to miscompilations. This patch introduces a flag to the ancestor jump functions which tells whether a NULL-check was elided when creating it and makes the bits propagation behave accordingly, masking any bits otherwise would be known to be one. This should safely preserve alignment info, which is the primary ifnormation that we keep in bits for pointers. (*) There still may remain problems when a DECL resides on address zero (with -fno-delete-null-pointer-checks ...I hope it cannot happen otherwise). I am looking into that now but I think it will be easier for everyone if I do so in a follow-up patch. gcc/ChangeLog: 2022-02-11 Martin Jambor PR ipa/103083 * ipa-prop.h (ipa_ancestor_jf_data): New flag keep_null; (ipa_get_jf_ancestor_keep_null): New function. * ipa-prop.cc (ipa_set_ancestor_jf): Initialize keep_null field of the ancestor function. (compute_complex_assign_jump_func): Pass false to keep_null parameter of ipa_set_ancestor_jf. (compute_complex_ancestor_jump_func): Pass true to keep_null parameter of ipa_set_ancestor_jf. (update_jump_functions_after_inlining): Carry over keep_null from the original ancestor jump-function or merge them. (ipa_write_jump_function): Stream keep_null flag. (ipa_read_jump_function): Likewise. (ipa_print_node_jump_functions_for_edge): Print the new flag. * ipa-cp.cc (class ipcp_bits_lattice): Make various getters const. New member function known_nonzero_p. (ipcp_bits_lattice::known_nonzero_p): New. (ipcp_bits_lattice::meet_with_1): New parameter drop_all_ones, observe it. (ipcp_bits_lattice::meet_with): Likewise. (propagate_bits_across_jump_function): Simplify. Pass true in drop_all_ones when it is necessary. (propagate_aggs_across_jump_function): Take care of keep_null flag. (ipa_get_jf_ancestor_result): Propagate NULL accross keep_null jump functions. gcc/testsuite/ChangeLog: 2021-11-25 Martin Jambor * gcc.dg/ipa/pr103083-1.c: New test. * gcc.dg/ipa/pr103083-2.c: Likewise. --- gcc/ipa-cp.cc | 75 ++++++++++++++++++--------- gcc/ipa-prop.cc | 20 +++++-- gcc/ipa-prop.h | 13 +++++ gcc/testsuite/gcc.dg/ipa/pr103083-1.c | 28 ++++++++++ gcc/testsuite/gcc.dg/ipa/pr103083-2.c | 30 +++++++++++ 5 files changed, 137 insertions(+), 29 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/ipa/pr103083-1.c create mode 100644 gcc/testsuite/gcc.dg/ipa/pr103083-2.c diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc index 8628140d6d9..dc3f0e94b17 100644 --- a/gcc/ipa-cp.cc +++ b/gcc/ipa-cp.cc @@ -306,17 +306,18 @@ public: class ipcp_bits_lattice { public: - bool bottom_p () { return m_lattice_val == IPA_BITS_VARYING; } - bool top_p () { return m_lattice_val == IPA_BITS_UNDEFINED; } - bool constant_p () { return m_lattice_val == IPA_BITS_CONSTANT; } + bool bottom_p () const { return m_lattice_val == IPA_BITS_VARYING; } + bool top_p () const { return m_lattice_val == IPA_BITS_UNDEFINED; } + bool constant_p () const { return m_lattice_val == IPA_BITS_CONSTANT; } bool set_to_bottom (); bool set_to_constant (widest_int, widest_int); + bool known_nonzero_p () const; - widest_int get_value () { return m_value; } - widest_int get_mask () { return m_mask; } + widest_int get_value () const { return m_value; } + widest_int get_mask () const { return m_mask; } bool meet_with (ipcp_bits_lattice& other, unsigned, signop, - enum tree_code, tree); + enum tree_code, tree, bool); bool meet_with (widest_int, widest_int, unsigned); @@ -330,7 +331,7 @@ private: value is known to be constant. */ widest_int m_value, m_mask; - bool meet_with_1 (widest_int, widest_int, unsigned); + bool meet_with_1 (widest_int, widest_int, unsigned, bool); void get_value_and_mask (tree, widest_int *, widest_int *); }; @@ -1081,6 +1082,16 @@ ipcp_bits_lattice::set_to_constant (widest_int value, widest_int mask) return true; } +/* Return true if any of the known bits are non-zero. */ + +bool +ipcp_bits_lattice::known_nonzero_p () const +{ + if (!constant_p ()) + return false; + return wi::ne_p (wi::bit_and (wi::bit_not (m_mask), m_value), 0); +} + /* Convert operand to value, mask form. */ void @@ -1103,16 +1114,19 @@ ipcp_bits_lattice::get_value_and_mask (tree operand, widest_int *valuep, widest_ /* Meet operation, similar to ccp_lattice_meet, we xor values if this->value, value have different values at same bit positions, we want to drop that bit to varying. Return true if mask is changed. - This function assumes that the lattice value is in CONSTANT state */ + This function assumes that the lattice value is in CONSTANT state. If + DROP_ALL_ONES, mask out any known bits with value one afterwards. */ bool ipcp_bits_lattice::meet_with_1 (widest_int value, widest_int mask, - unsigned precision) + unsigned precision, bool drop_all_ones) { gcc_assert (constant_p ()); widest_int old_mask = m_mask; m_mask = (m_mask | mask) | (m_value ^ value); + if (drop_all_ones) + m_mask |= m_value; m_value &= ~m_mask; if (wi::sext (m_mask, precision) == -1) @@ -1138,16 +1152,18 @@ ipcp_bits_lattice::meet_with (widest_int value, widest_int mask, return set_to_constant (value, mask); } - return meet_with_1 (value, mask, precision); + return meet_with_1 (value, mask, precision, false); } /* Meet bits lattice with the result of bit_value_binop (other, operand) if code is binary operation or bit_value_unop (other) if code is unary op. - In the case when code is nop_expr, no adjustment is required. */ + In the case when code is nop_expr, no adjustment is required. If + DROP_ALL_ONES, mask out any known bits with value one afterwards. */ bool ipcp_bits_lattice::meet_with (ipcp_bits_lattice& other, unsigned precision, - signop sgn, enum tree_code code, tree operand) + signop sgn, enum tree_code code, tree operand, + bool drop_all_ones) { if (other.bottom_p ()) return set_to_bottom (); @@ -1186,12 +1202,18 @@ ipcp_bits_lattice::meet_with (ipcp_bits_lattice& other, unsigned precision, if (top_p ()) { + if (drop_all_ones) + { + adjusted_mask |= adjusted_value; + adjusted_value &= ~adjusted_mask; + } if (wi::sext (adjusted_mask, precision) == -1) return set_to_bottom (); return set_to_constant (adjusted_value, adjusted_mask); } else - return meet_with_1 (adjusted_value, adjusted_mask, precision); + return meet_with_1 (adjusted_value, adjusted_mask, precision, + drop_all_ones); } /* Mark bot aggregate and scalar lattices as containing an unknown variable, @@ -1477,6 +1499,9 @@ ipa_get_jf_ancestor_result (struct ipa_jump_func *jfunc, tree input) fold_build2 (MEM_REF, TREE_TYPE (TREE_TYPE (input)), input, build_int_cst (ptr_type_node, byte_offset))); } + else if (ipa_get_jf_ancestor_keep_null (jfunc) + && zerop (input)) + return input; else return NULL_TREE; } @@ -2373,6 +2398,7 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx, tree operand = NULL_TREE; enum tree_code code; unsigned src_idx; + bool keep_null = false; if (jfunc->type == IPA_JF_PASS_THROUGH) { @@ -2385,7 +2411,9 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx, { code = POINTER_PLUS_EXPR; src_idx = ipa_get_jf_ancestor_formal_id (jfunc); - unsigned HOST_WIDE_INT offset = ipa_get_jf_ancestor_offset (jfunc) / BITS_PER_UNIT; + unsigned HOST_WIDE_INT offset + = ipa_get_jf_ancestor_offset (jfunc) / BITS_PER_UNIT; + keep_null = (ipa_get_jf_ancestor_keep_null (jfunc) || !offset); operand = build_int_cstu (size_type_node, offset); } @@ -2402,18 +2430,17 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx, result of x & 0xff == 0xff, which gets computed during ccp1 pass and we store it in jump function during analysis stage. */ - if (src_lats->bits_lattice.bottom_p () - && jfunc->bits) - return dest_lattice->meet_with (jfunc->bits->value, jfunc->bits->mask, - precision); - else - return dest_lattice->meet_with (src_lats->bits_lattice, precision, sgn, - code, operand); + if (!src_lats->bits_lattice.bottom_p ()) + { + bool drop_all_ones + = keep_null && !src_lats->bits_lattice.known_nonzero_p (); + + return dest_lattice->meet_with (src_lats->bits_lattice, precision, + sgn, code, operand, drop_all_ones); + } } - else if (jfunc->type == IPA_JF_ANCESTOR) - return dest_lattice->set_to_bottom (); - else if (jfunc->bits) + if (jfunc->bits) return dest_lattice->meet_with (jfunc->bits->value, jfunc->bits->mask, precision); else diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc index 72aa3e2f60d..0e5966332eb 100644 --- a/gcc/ipa-prop.cc +++ b/gcc/ipa-prop.cc @@ -357,6 +357,8 @@ ipa_print_node_jump_functions_for_edge (FILE *f, struct cgraph_edge *cs) jump_func->value.ancestor.offset); if (jump_func->value.ancestor.agg_preserved) fprintf (f, ", agg_preserved"); + if (jump_func->value.ancestor.keep_null) + fprintf (f, ", keep_null"); fprintf (f, "\n"); } @@ -601,12 +603,13 @@ ipa_set_jf_arith_pass_through (struct ipa_jump_func *jfunc, int formal_id, static void ipa_set_ancestor_jf (struct ipa_jump_func *jfunc, HOST_WIDE_INT offset, - int formal_id, bool agg_preserved) + int formal_id, bool agg_preserved, bool keep_null) { jfunc->type = IPA_JF_ANCESTOR; jfunc->value.ancestor.formal_id = formal_id; jfunc->value.ancestor.offset = offset; jfunc->value.ancestor.agg_preserved = agg_preserved; + jfunc->value.ancestor.keep_null = keep_null; } /* Get IPA BB information about the given BB. FBI is the context of analyzis @@ -1438,7 +1441,8 @@ compute_complex_assign_jump_func (struct ipa_func_body_info *fbi, index = ipa_get_param_decl_index (info, SSA_NAME_VAR (ssa)); if (index >= 0 && param_type && POINTER_TYPE_P (param_type)) ipa_set_ancestor_jf (jfunc, offset, index, - parm_ref_data_pass_through_p (fbi, index, call, ssa)); + parm_ref_data_pass_through_p (fbi, index, call, ssa), + false); } /* Extract the base, offset and MEM_REF expression from a statement ASSIGN if @@ -1564,7 +1568,8 @@ compute_complex_ancestor_jump_func (struct ipa_func_body_info *fbi, } ipa_set_ancestor_jf (jfunc, offset, index, - parm_ref_data_pass_through_p (fbi, index, call, parm)); + parm_ref_data_pass_through_p (fbi, index, call, parm), + true); } /* Inspect the given TYPE and return true iff it has the same structure (the @@ -3250,6 +3255,7 @@ update_jump_functions_after_inlining (struct cgraph_edge *cs, dst->value.ancestor.offset += src->value.ancestor.offset; dst->value.ancestor.agg_preserved &= src->value.ancestor.agg_preserved; + dst->value.ancestor.keep_null |= src->value.ancestor.keep_null; } else ipa_set_jf_unknown (dst); @@ -3327,7 +3333,8 @@ update_jump_functions_after_inlining (struct cgraph_edge *cs, ipa_set_ancestor_jf (dst, ipa_get_jf_ancestor_offset (src), ipa_get_jf_ancestor_formal_id (src), - agg_p); + agg_p, + ipa_get_jf_ancestor_keep_null (src)); break; } default: @@ -4760,6 +4767,7 @@ ipa_write_jump_function (struct output_block *ob, streamer_write_uhwi (ob, jump_func->value.ancestor.formal_id); bp = bitpack_create (ob->main_stream); bp_pack_value (&bp, jump_func->value.ancestor.agg_preserved, 1); + bp_pack_value (&bp, jump_func->value.ancestor.keep_null, 1); streamer_write_bitpack (&bp); break; default: @@ -4885,7 +4893,9 @@ ipa_read_jump_function (class lto_input_block *ib, int formal_id = streamer_read_uhwi (ib); struct bitpack_d bp = streamer_read_bitpack (ib); bool agg_preserved = bp_unpack_value (&bp, 1); - ipa_set_ancestor_jf (jump_func, offset, formal_id, agg_preserved); + bool keep_null = bp_unpack_value (&bp, 1); + ipa_set_ancestor_jf (jump_func, offset, formal_id, agg_preserved, + keep_null); break; } default: diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h index 553adfc9f35..b22dfb5315c 100644 --- a/gcc/ipa-prop.h +++ b/gcc/ipa-prop.h @@ -143,6 +143,8 @@ struct GTY(()) ipa_ancestor_jf_data int formal_id; /* Flag with the same meaning like agg_preserve in ipa_pass_through_data. */ unsigned agg_preserved : 1; + /* When set, the operation should not have any effect on NULL pointers. */ + unsigned keep_null : 1; }; /* A jump function for an aggregate part at a given offset, which describes how @@ -438,6 +440,17 @@ ipa_get_jf_ancestor_type_preserved (struct ipa_jump_func *jfunc) return jfunc->value.ancestor.agg_preserved; } +/* Return if jfunc represents an operation whether we first check the formal + parameter for non-NULLness unless it does not matter because the offset is + zero anyway. */ + +static inline bool +ipa_get_jf_ancestor_keep_null (struct ipa_jump_func *jfunc) +{ + gcc_checking_assert (jfunc->type == IPA_JF_ANCESTOR); + return jfunc->value.ancestor.keep_null; +} + /* Class for allocating a bundle of various potentially known properties about actual arguments of a particular call on stack for the usual case and on heap only if there are unusually many arguments. The data is deallocated diff --git a/gcc/testsuite/gcc.dg/ipa/pr103083-1.c b/gcc/testsuite/gcc.dg/ipa/pr103083-1.c new file mode 100644 index 00000000000..e2fbb45d3cc --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr103083-1.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -Wno-pointer-to-int-cast" } */ + +struct b {int b;}; +struct a {int a; struct b b;}; + +long i; + +__attribute__ ((noinline)) +static void test2 (struct b *b) +{ + if (((int)b)&4) + __builtin_abort (); +} + +__attribute__ ((noinline)) +static void +test (struct a *a) +{ + test2(a? &a->b : 0); +} + +int +main() +{ + test(0); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/ipa/pr103083-2.c b/gcc/testsuite/gcc.dg/ipa/pr103083-2.c new file mode 100644 index 00000000000..ae1b905af81 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr103083-2.c @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-ipa-bit-cp -fdump-tree-optimized" } */ + +struct b {int b;}; +struct a {int a; struct b b;}; + +void remove_any_mention (void); + +__attribute__ ((noinline)) +static void test2 (struct b *b) +{ + if (b) + remove_any_mention (); +} + +__attribute__ ((noinline)) +static void +test (struct a *a) +{ + test2(a? &a->b : 0); +} + +int +foo() +{ + test(0); + return 0; +} + +/* { dg-final { scan-tree-dump-not "remove_any_mention" "optimized" } } */ From 40d643d8de7bb0b7bd75e35f4274beb9793bb0df Mon Sep 17 00:00:00 2001 From: Andre Vieira Date: Thu, 31 Mar 2022 17:08:59 +0100 Subject: [PATCH 138/157] aarch64: Implement determine_suggested_unroll_factor This patch implements the costing function determine_suggested_unroll_factor for aarch64. It determines the unrolling factor by dividing the number of X operations we can do per cycle by the number of X operations, taking this information from the vec_ops analysis during vector costing and the available issue_info information. We multiply the dividend by a potential reduction_latency, to improve our pipeline utilization if we are stalled waiting on a particular reduction operation. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_vector_costs): Define determine_suggested_unroll_factor and m_has_avg. (determine_suggested_unroll_factor): New function. (aarch64_vector_costs::add_stmt_cost): Check for a qualifying pattern to set m_nosve_pattern. (aarch64_vector_costs::finish_costs): Use determine_suggested_unroll_factor. * config/aarch64/aarch64.opt (aarch64-vect-unroll-limit): New. * doc/invoke.texi: (aarch64-vect-unroll-limit): Document new option. --- gcc/config/aarch64/aarch64.cc | 89 +++++++++++++++++++++++++++++++++- gcc/config/aarch64/aarch64.opt | 4 ++ gcc/doc/invoke.texi | 6 +++ 3 files changed, 97 insertions(+), 2 deletions(-) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index ab78b11b158..18f80499079 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -15637,11 +15637,16 @@ private: unsigned int adjust_body_cost (loop_vec_info, const aarch64_vector_costs *, unsigned int); bool prefer_unrolled_loop () const; + unsigned int determine_suggested_unroll_factor (); /* True if we have performed one-time initialization based on the vec_info. */ bool m_analyzed_vinfo = false; + /* This loop uses an average operation that is not supported by SVE, but is + supported by Advanced SIMD and SVE2. */ + bool m_has_avg = false; + /* - If M_VEC_FLAGS is zero then we're costing the original scalar code. - If M_VEC_FLAGS & VEC_ADVSIMD is nonzero then we're costing Advanced SIMD code. @@ -16642,6 +16647,21 @@ aarch64_vector_costs::add_stmt_cost (int count, vect_cost_for_stmt kind, as one iteration of the SVE loop. */ if (where == vect_body && m_unrolled_advsimd_niters) m_unrolled_advsimd_stmts += count * m_unrolled_advsimd_niters; + + /* Detect the use of an averaging operation. */ + gimple *stmt = stmt_info->stmt; + if (is_gimple_call (stmt) + && gimple_call_internal_p (stmt)) + { + switch (gimple_call_internal_fn (stmt)) + { + case IFN_AVG_FLOOR: + case IFN_AVG_CEIL: + m_has_avg = true; + default: + break; + } + } } return record_stmt_cost (stmt_info, where, (count * stmt_cost).ceil ()); } @@ -16725,6 +16745,68 @@ adjust_body_cost_sve (const aarch64_vec_op_count *ops, return sve_cycles_per_iter; } +unsigned int +aarch64_vector_costs::determine_suggested_unroll_factor () +{ + bool sve = m_vec_flags & VEC_ANY_SVE; + /* If we are trying to unroll an Advanced SIMD main loop that contains + an averaging operation that we do not support with SVE and we might use a + predicated epilogue, we need to be conservative and block unrolling as + this might lead to a less optimal loop for the first and only epilogue + using the original loop's vectorization factor. + TODO: Remove this constraint when we add support for multiple epilogue + vectorization. */ + if (!sve && !TARGET_SVE2 && m_has_avg) + return 1; + + unsigned int max_unroll_factor = 1; + for (auto vec_ops : m_ops) + { + aarch64_simd_vec_issue_info const *vec_issue + = vec_ops.simd_issue_info (); + if (!vec_issue) + return 1; + /* Limit unroll factor to a value adjustable by the user, the default + value is 4. */ + unsigned int unroll_factor = aarch64_vect_unroll_limit; + unsigned int factor + = vec_ops.reduction_latency > 1 ? vec_ops.reduction_latency : 1; + unsigned int temp; + + /* Sanity check, this should never happen. */ + if ((vec_ops.stores + vec_ops.loads + vec_ops.general_ops) == 0) + return 1; + + /* Check stores. */ + if (vec_ops.stores > 0) + { + temp = CEIL (factor * vec_issue->stores_per_cycle, + vec_ops.stores); + unroll_factor = MIN (unroll_factor, temp); + } + + /* Check loads + stores. */ + if (vec_ops.loads > 0) + { + temp = CEIL (factor * vec_issue->loads_stores_per_cycle, + vec_ops.loads + vec_ops.stores); + unroll_factor = MIN (unroll_factor, temp); + } + + /* Check general ops. */ + if (vec_ops.general_ops > 0) + { + temp = CEIL (factor * vec_issue->general_ops_per_cycle, + vec_ops.general_ops); + unroll_factor = MIN (unroll_factor, temp); + } + max_unroll_factor = MAX (max_unroll_factor, unroll_factor); + } + + /* Make sure unroll factor is power of 2. */ + return 1 << ceil_log2 (max_unroll_factor); +} + /* BODY_COST is the cost of a vector loop body. Adjust the cost as necessary and return the new cost. */ unsigned int @@ -16861,8 +16943,11 @@ aarch64_vector_costs::finish_cost (const vector_costs *uncast_scalar_costs) if (loop_vinfo && m_vec_flags && aarch64_use_new_vector_costs_p ()) - m_costs[vect_body] = adjust_body_cost (loop_vinfo, scalar_costs, - m_costs[vect_body]); + { + m_costs[vect_body] = adjust_body_cost (loop_vinfo, scalar_costs, + m_costs[vect_body]); + m_suggested_unroll_factor = determine_suggested_unroll_factor (); + } /* Apply the heuristic described above m_stp_sequence_cost. Prefer the scalar code in the event of a tie, since there is more chance diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt index 98ce9c0ab61..92220b26ee2 100644 --- a/gcc/config/aarch64/aarch64.opt +++ b/gcc/config/aarch64/aarch64.opt @@ -292,3 +292,7 @@ Constant memmove size in bytes above which to start using MOPS sequence. -param=aarch64-mops-memset-size-threshold= Target Joined UInteger Var(aarch64_mops_memset_size_threshold) Init(256) Param Constant memset size in bytes from which to start using MOPS sequence. + +-param=aarch64-vect-unroll-limit= +Target Joined UInteger Var(aarch64_vect_unroll_limit) Init(4) Param +Limit how much the autovectorizer may unroll a loop. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 09715a510b4..3936aef69d0 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -15239,6 +15239,12 @@ If this parameter is set to @var{n}, GCC will not use this heuristic for loops that are known to execute in fewer than @var{n} Advanced SIMD iterations. +@item aarch64-vect-unroll-limit +The vectorizer will use available tuning information to determine whether it +would be beneficial to unroll the main vectorized loop and by how much. This +parameter set's the upper bound of how much the vectorizer will unroll the main +loop. The default value is four. + @end table @end table From 562d014efadfef6628ae670049c2d92ff6b166f0 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 31 Mar 2022 19:21:00 +0200 Subject: [PATCH 139/157] contrib: Fix up spelling of loongarch-str.h dependency [PR105114] As found by Joseph, the dependency of gcc/config/loongarch/loongarch-str.h is spelled incorrectly, it should be gcc/config/loongarch/genopts/loongarch-strings but was using gcc/config/loongarch/genopts/loongarch-string 2022-03-31 Jakub Jelinek Joseph Myers PR other/105114 * gcc_update: Fix up spelling of gcc/config/loongarch/genopts/loongarch-strings dependency. --- contrib/gcc_update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/gcc_update b/contrib/gcc_update index 641ce164775..620504e3856 100755 --- a/contrib/gcc_update +++ b/contrib/gcc_update @@ -86,7 +86,7 @@ gcc/config/arm/arm-tables.opt: gcc/config/arm/arm-cpus.in gcc/config/arm/parsecp gcc/config/c6x/c6x-tables.opt: gcc/config/c6x/c6x-isas.def gcc/config/c6x/genopt.sh gcc/config/c6x/c6x-sched.md: gcc/config/c6x/c6x-sched.md.in gcc/config/c6x/gensched.sh gcc/config/c6x/c6x-mult.md: gcc/config/c6x/c6x-mult.md.in gcc/config/c6x/genmult.sh -gcc/config/loongarch/loongarch-str.h: gcc/config/loongarch/genopts/genstr.sh gcc/config/loongarch/genopts/loongarch-string +gcc/config/loongarch/loongarch-str.h: gcc/config/loongarch/genopts/genstr.sh gcc/config/loongarch/genopts/loongarch-strings gcc/config/loongarch/loongarch.opt: gcc/config/loongarch/genopts/genstr.sh gcc/config/loongarch/genopts/loongarch.opt.in gcc/config/m68k/m68k-tables.opt: gcc/config/m68k/m68k-devices.def gcc/config/m68k/m68k-isas.def gcc/config/m68k/m68k-microarchs.def gcc/config/m68k/genopt.sh gcc/config/mips/mips-tables.opt: gcc/config/mips/mips-cpus.def gcc/config/mips/genopt.sh From 6c0e2645933449461d44fd2dce4fedf94199838c Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 30 Mar 2022 22:22:49 +0200 Subject: [PATCH 140/157] options: Fix "Multiple different help strings" error diagnostic This currently causes a confusing litany, for example: options.cc:3245:2: error: #error Multiple different help strings for Wunused-result: #error Multiple different help strings for Wunused-result: ^ options.cc:3246:2: error: 'Warn' was not declared in this scope Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value. ^ options.cc:3246:7: error: expected '}' before 'if' Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value. ^ options.cc:3246:7: error: expected ',' or ';' before 'if' options.cc:3256:54: error: expected unqualified-id before ',' token (unsigned short) -1, 0, CLVC_INTEGER, 0, -1, -1 }, ^ [going on for several thousands of lines] Fixed: options.cc:3245:2: error: #error Multiple different help strings for Wunused-result: #error Multiple different help strings for Wunused-result: ^ options.cc:3246:2: error: #error Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value. #error Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value. ^ options.cc:3247:2: error: #error TEST. #error TEST. ^ Fix-up for r187437/commit 71caddc5568f59a5990f39226f60979a7fe953ef "optc-gen.awk: Error instead of warning for conflicting help". gcc/ * optc-gen.awk : Fix "Multiple different help strings" error diagnostic. --- gcc/optc-gen.awk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index f2198b253ad..b51688d284f 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -316,9 +316,12 @@ for (i = 0; i < n_opts; i++) { flags[i + 1] = flags[i] " " flags[i + 1]; if (help[i + 1] == "") help[i + 1] = help[i] - else if (help[i] != "" && help[i + 1] != help[i]) + else if (help[i] != "" && help[i + 1] != help[i]) { print "#error Multiple different help strings for " \ - opts[i] ":\n\t" help[i] "\n\t" help[i + 1] + opts[i] ":" + print "#error " help[i] + print "#error " help[i + 1] + } i++; back_chain[i] = "N_OPTS"; From 58d78650da3c6e4830b8350f4e6cbe87dc893c9f Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 30 Mar 2022 23:00:28 +0200 Subject: [PATCH 141/157] options: Clarifications around option definition records' help texts gcc/ * doc/options.texi (Option file format): Clarifications around option definition records' help texts. --- gcc/doc/options.texi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gcc/doc/options.texi b/gcc/doc/options.texi index 50674938e3d..17ba923890e 100644 --- a/gcc/doc/options.texi +++ b/gcc/doc/options.texi @@ -175,6 +175,17 @@ used instead of the option's name and the text to the right of the tab forms the help text. This allows you to elaborate on what type of argument the option takes. +There is no support for different help texts for different languages. +If an option is supported for multiple languages, use a generic +description that is correct for all of them. + +If an option has multiple option definition records (in different +front ends' @file{*.opt} files, and/or @file{gcc/common.opt}, for +example), convention is to not duplicate the help text for each of +them, but instead put a comment like @code{; documented in common.opt} +in place of the help text for all but one of the multiple option +definition records. + @item A target mask record. These records have one field of the form @samp{Mask(@var{x})}. The options-processing script will automatically From 0abc1cbad1687a887d754917927b6023e4dba3ce Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 31 Mar 2022 13:05:37 -0700 Subject: [PATCH 142/157] runtime: support PPC32 MUSL register access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on patch by Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/397394 --- gcc/go/gofrontend/MERGE | 2 +- libgo/runtime/go-signal.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index afaccb0e9e6..f93eaf48e28 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -7f33baa09a8172bb2c5f1ca0435d9efe3e194c9b +45108f37070afb696b069768700e39a269f1fecb The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c index 0cb90304730..9c919e1568a 100644 --- a/libgo/runtime/go-signal.c +++ b/libgo/runtime/go-signal.c @@ -231,7 +231,14 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused))) #elif defined(__alpha__) && defined(__linux__) ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.sc_pc; #elif defined(__PPC__) && defined(__linux__) + // For some reason different libc implementations use + // different names. +#if defined(__PPC64__) || defined(__GLIBC__) ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip; +#else + // Assumed to be ppc32 musl. + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32]; +#endif #elif defined(__PPC__) && defined(_AIX) ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar; #elif defined(__aarch64__) && defined(__linux__) @@ -347,6 +354,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext; int i; +#if defined(__PPC64__) || defined(__GLIBC__) for (i = 0; i < 32; i++) runtime_printf("r%d %X\n", i, m->regs->gpr[i]); runtime_printf("pc %X\n", m->regs->nip); @@ -355,6 +363,16 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u runtime_printf("lr %X\n", m->regs->link); runtime_printf("ctr %X\n", m->regs->ctr); runtime_printf("xer %X\n", m->regs->xer); +#else + for (i = 0; i < 32; i++) + runtime_printf("r%d %X\n", i, m->gregs[i]); + runtime_printf("pc %X\n", m->gregs[32]); + runtime_printf("msr %X\n", m->gregs[33]); + runtime_printf("cr %X\n", m->gregs[38]); + runtime_printf("lr %X\n", m->gregs[36]); + runtime_printf("ctr %X\n", m->gregs[35]); + runtime_printf("xer %X\n", m->gregs[37]); +#endif } #elif defined(__PPC__) && defined(_AIX) { From aaf3a5993ae49f1ae6792800e5161a1d51436ed3 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Fri, 28 Jan 2022 11:50:26 -0600 Subject: [PATCH 143/157] rs6000: Fix some missing built-in attributes [PR104004] PR104004 caught some misses on my part in converting to the new built-in function infrastructure. In particular, I forgot to mark all of the "nosoft" built-ins, and one of those should also have been marked "no32bit". 2022-01-27 Bill Schmidt gcc/ PR target/104004 * config/rs6000/rs6000-builtins.def (MFFSL): Mark nosoft. (MTFSB0): Likewise. (MTFSB1): Likewise. (SET_FPSCR_RN): Likewise. (SET_FPSCR_DRN): Mark nosoft and no32bit. --- gcc/config/rs6000/rs6000-builtins.def | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def index 296f36e0f9b..0f527c5d78f 100644 --- a/gcc/config/rs6000/rs6000-builtins.def +++ b/gcc/config/rs6000/rs6000-builtins.def @@ -215,7 +215,7 @@ ; processors, this builtin automatically falls back to mffs on older ; platforms. Thus it appears here in the [always] stanza. double __builtin_mffsl (); - MFFSL rs6000_mffsl {} + MFFSL rs6000_mffsl {nosoft} ; This is redundant with __builtin_pack_ibm128, as it requires long ; double to be __ibm128. Should probably be deprecated. @@ -226,10 +226,10 @@ MFTB rs6000_mftb_di {32bit} void __builtin_mtfsb0 (const int<5>); - MTFSB0 rs6000_mtfsb0 {} + MTFSB0 rs6000_mtfsb0 {nosoft} void __builtin_mtfsb1 (const int<5>); - MTFSB1 rs6000_mtfsb1 {} + MTFSB1 rs6000_mtfsb1 {nosoft} void __builtin_mtfsf (const int<8>, double); MTFSF rs6000_mtfsf {} @@ -238,7 +238,7 @@ PACK_IF packif {ibm128} void __builtin_set_fpscr_rn (const int[0,3]); - SET_FPSCR_RN rs6000_set_fpscr_rn {} + SET_FPSCR_RN rs6000_set_fpscr_rn {nosoft} const double __builtin_unpack_ibm128 (__ibm128, const int<1>); UNPACK_IF unpackif {ibm128} @@ -2969,7 +2969,7 @@ PACK_TD packtd {} void __builtin_set_fpscr_drn (const int[0,7]); - SET_FPSCR_DRN rs6000_set_fpscr_drn {} + SET_FPSCR_DRN rs6000_set_fpscr_drn {nosoft,no32bit} const unsigned long long __builtin_unpack_dec128 (_Decimal128, const int<1>); UNPACK_TD unpacktd {} From 57ad4462decf18d2548d4a813698ee8fcfb24b2f Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Fri, 1 Apr 2022 00:16:41 +0000 Subject: [PATCH 144/157] Daily bump. --- contrib/ChangeLog | 7 +++ gcc/ChangeLog | 102 ++++++++++++++++++++++++++++++++++++++++ gcc/DATESTAMP | 2 +- gcc/cp/ChangeLog | 6 +++ gcc/testsuite/ChangeLog | 34 ++++++++++++++ libstdc++-v3/ChangeLog | 4 ++ 6 files changed, 154 insertions(+), 1 deletion(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 8820ec9a3bb..4408336aa88 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,10 @@ +2022-03-31 Jakub Jelinek + Joseph Myers + + PR other/105114 + * gcc_update: Fix up spelling of + gcc/config/loongarch/genopts/loongarch-strings dependency. + 2022-03-29 Chenghua Xu Lulu Cheng diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 63f0ff626f4..7bfed69f862 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,105 @@ +2022-03-31 Bill Schmidt + + PR target/104004 + * config/rs6000/rs6000-builtins.def (MFFSL): Mark nosoft. + (MTFSB0): Likewise. + (MTFSB1): Likewise. + (SET_FPSCR_RN): Likewise. + (SET_FPSCR_DRN): Mark nosoft and no32bit. + +2022-03-31 Thomas Schwinge + + * doc/options.texi (Option file format): Clarifications around + option definition records' help texts. + +2022-03-31 Thomas Schwinge + + * optc-gen.awk : Fix "Multiple different help strings" error + diagnostic. + +2022-03-31 Andre Vieira + + * config/aarch64/aarch64.cc (aarch64_vector_costs): Define + determine_suggested_unroll_factor and m_has_avg. + (determine_suggested_unroll_factor): New function. + (aarch64_vector_costs::add_stmt_cost): Check for a qualifying pattern + to set m_nosve_pattern. + (aarch64_vector_costs::finish_costs): Use + determine_suggested_unroll_factor. + * config/aarch64/aarch64.opt (aarch64-vect-unroll-limit): New. + * doc/invoke.texi: (aarch64-vect-unroll-limit): Document new option. + +2022-03-31 Martin Jambor + + PR ipa/103083 + * ipa-prop.h (ipa_ancestor_jf_data): New flag keep_null; + (ipa_get_jf_ancestor_keep_null): New function. + * ipa-prop.cc (ipa_set_ancestor_jf): Initialize keep_null field of the + ancestor function. + (compute_complex_assign_jump_func): Pass false to keep_null + parameter of ipa_set_ancestor_jf. + (compute_complex_ancestor_jump_func): Pass true to keep_null + parameter of ipa_set_ancestor_jf. + (update_jump_functions_after_inlining): Carry over keep_null from the + original ancestor jump-function or merge them. + (ipa_write_jump_function): Stream keep_null flag. + (ipa_read_jump_function): Likewise. + (ipa_print_node_jump_functions_for_edge): Print the new flag. + * ipa-cp.cc (class ipcp_bits_lattice): Make various getters const. New + member function known_nonzero_p. + (ipcp_bits_lattice::known_nonzero_p): New. + (ipcp_bits_lattice::meet_with_1): New parameter drop_all_ones, + observe it. + (ipcp_bits_lattice::meet_with): Likewise. + (propagate_bits_across_jump_function): Simplify. Pass true in + drop_all_ones when it is necessary. + (propagate_aggs_across_jump_function): Take care of keep_null + flag. + (ipa_get_jf_ancestor_result): Propagate NULL accross keep_null + jump functions. + +2022-03-31 Martin Jambor + + PR ipa/102513 + * ipa-cp.cc (decide_whether_version_node): Skip scalar values + which do not fit the known value_range. + +2022-03-31 Martin Jambor + + PR ipa/103171 + * ipa-prop.cc (propagate_controlled_uses): Add a LOAD reference + always when an ADDR_EXPR constant is known to reach a load because + of inlining, not just when removing an ADDR reference. + +2022-03-31 Richard Biener + + PR tree-optimization/105109 + * tree-ssa.cc (execute_update_addresses_taken): Suppress + diagnostics on the load of the other complex component. + +2022-03-31 Tom de Vries + + * config/nvptx/nvptx.h (ASM_SPEC): Use "-m sm_35" for -misa=sm_30. + +2022-03-31 Richard Biener + + PR rtl-optimization/105091 + * gimple-expr.cc (mark_addressable): Handle TARGET_MEM_REF + bases. + +2022-03-31 Richard Biener + + Revert: + 2021-09-13 Richard Earnshaw + + PR target/102125 + * gimple-fold.c (gimple_fold_builtin_memory_op): Allow folding + memcpy if the size is not more than MOVE_MAX * MOVE_RATIO. + +2022-03-31 Sebastian Huber + + * gcov-io.cc (gcov_read_string): Reword documentation comment. + 2022-03-30 Bill Schmidt * config/rs6000/rs6000-builtins.def (NEG_V16QI): Move to [altivec] diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 30d76ef0a80..cdf1b0ea123 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20220331 +20220401 diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 766e76c06fd..9c6b7826c2c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2022-03-31 Jason Merrill + + PR c++/96645 + * parser.cc (cp_parser_early_parsing_nsdmi): New. + (cp_parser_member_declaration): Call it. + 2022-03-30 Patrick Palka PR c++/100474 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b6721c24e82..b3ea4f3917b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,37 @@ +2022-03-31 Martin Jambor + + * gcc.dg/ipa/pr103083-1.c: New test. + * gcc.dg/ipa/pr103083-2.c: Likewise. + +2022-03-31 Martin Jambor + + PR ipa/102513 + * gcc.dg/ipa/pr102513.c: New test. + +2022-03-31 Martin Jambor + + PR ipa/103171 + * gcc.dg/ipa/remref-6.c: Adjust dump scan string. + * gcc.dg/ipa/remref-7.c: New test. + * gcc.dg/lto/pr103171_0.c: New test. + * gcc.dg/lto/pr103171_1.c: Likewise. + +2022-03-31 Tom de Vries + + * gcc.target/nvptx/march.c: Add missing space in dg-options line. + +2022-03-31 Richard Biener + + PR tree-optimization/105109 + * gcc.dg/uninit-pr105109.c: New testcase. + +2022-03-31 Jason Merrill + + PR c++/96645 + * g++.dg/cpp0x/nsdmi10.C: Now OK. + * g++.dg/ext/is_constructible3.C: Likewise. + * g++.dg/ext/is_constructible7.C: Likewise. + 2022-03-30 Harald Anlauf PR fortran/100892 diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e40b4f334a9..92dc05f0e4f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2022-03-31 Jonathan Wakely + + * libsupc++/new_opa.cc (aligned_alloc): Add comment. + 2022-03-29 Jonathan Wakely * testsuite/18_support/exception/38732.cc: Disable for C++23. From fa79cc4a4332f948317b016e92d88aa616302e1b Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Fri, 1 Apr 2022 00:34:57 -0300 Subject: [PATCH 145/157] Test for linking for arm/size-optimization-ieee-[123].c These tests require a target that supports arm soft-float. The problem is that the test checks for compile-time soft-float support, but they may hit a problem when the linker complains that it can't combine the testcase's object file with hard-float init files and target system libraries. I don't see that the tests actually require linking, and they could be simplified to dg-do assemble, but I figured a link test for soft-float support could be useful, so I added that, and adjusted the tests to require it instead. for gcc/testsuite/ChangeLog * lib/target-supports.exp (check_effective_target_arm_soft_ok_link): New. * gcc.target/arm/size-optimization-ieee-1.c: Use it. * gcc.target/arm/size-optimization-ieee-2.c: Likewise. * gcc.target/arm/size-optimization-ieee-3.c: Likewise. --- .../gcc.target/arm/size-optimization-ieee-1.c | 2 +- .../gcc.target/arm/size-optimization-ieee-2.c | 2 +- .../gcc.target/arm/size-optimization-ieee-3.c | 2 +- gcc/testsuite/lib/target-supports.exp | 12 ++++++++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.target/arm/size-optimization-ieee-1.c b/gcc/testsuite/gcc.target/arm/size-optimization-ieee-1.c index 61475eb4c67..9af2c6e1020 100644 --- a/gcc/testsuite/gcc.target/arm/size-optimization-ieee-1.c +++ b/gcc/testsuite/gcc.target/arm/size-optimization-ieee-1.c @@ -1,4 +1,4 @@ -/* { dg-do link { target arm_soft_ok } } */ +/* { dg-do link { target arm_soft_ok_link } } */ /* { dg-skip-if "Feature is -mfloat-abi=soft only" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ /* { dg-options "-mfloat-abi=soft" } */ diff --git a/gcc/testsuite/gcc.target/arm/size-optimization-ieee-2.c b/gcc/testsuite/gcc.target/arm/size-optimization-ieee-2.c index b4699271cea..e78a7ada62e 100644 --- a/gcc/testsuite/gcc.target/arm/size-optimization-ieee-2.c +++ b/gcc/testsuite/gcc.target/arm/size-optimization-ieee-2.c @@ -1,4 +1,4 @@ -/* { dg-do link { target arm_soft_ok } } */ +/* { dg-do link { target arm_soft_ok_link } } */ /* { dg-skip-if "Feature is -mfloat-abi=soft only" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ /* { dg-options "-mfloat-abi=soft" } */ diff --git a/gcc/testsuite/gcc.target/arm/size-optimization-ieee-3.c b/gcc/testsuite/gcc.target/arm/size-optimization-ieee-3.c index 34b1ebe7afd..bb9ccefda5e 100644 --- a/gcc/testsuite/gcc.target/arm/size-optimization-ieee-3.c +++ b/gcc/testsuite/gcc.target/arm/size-optimization-ieee-3.c @@ -1,4 +1,4 @@ -/* { dg-do link { target arm_soft_ok } } */ +/* { dg-do link { target arm_soft_ok_link } } */ /* { dg-skip-if "Feature is -mfloat-abi=soft only" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ /* { dg-options "-mfloat-abi=soft" } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index a1aef0e0a16..ff8edbd3e17 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3935,6 +3935,18 @@ proc check_effective_target_arm_soft_ok { } { } "-mfloat-abi=soft"] } +# Return 1 if this is an ARM target supporting -mfloat-abi=soft even +# for linking. Some multilibs may be incompatible with this option, +# and some linkers may reject incompatible options. + +proc check_effective_target_arm_soft_ok_link { } { + return [check_no_compiler_messages arm_soft_ok_link executable { + #include + int dummy; + int main (void) { return 0; } + } "-mfloat-abi=soft"] +} + # Return 1 if this is an ARM target supporting -mfpu=vfp with an # appropriate abi. From 5901a10bdf7a872697894f2e0990bff8b2e48c39 Mon Sep 17 00:00:00 2001 From: Qian Jianhua Date: Fri, 1 Apr 2022 11:33:36 +0800 Subject: [PATCH 146/157] MAINTAINERS: Update my email address Update my email address in the MAINTAINERS file. 2022-04-01 Qian Jianhua ChangeLog: * MAINTAINERS: Update my email address. --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index f388bdaf4f1..30f81b3dd52 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -463,7 +463,7 @@ Daniel Jacobowitz Andreas Jaeger Harsha Jagasia Fariborz Jahanian -Qian Jianhua +Qian Jianhua Janis Johnson Teresa Johnson Kean Johnston From 15d683d4f0b390b27c54a7c92c6e4f33195bdc93 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Wed, 26 Jan 2022 03:21:20 +0000 Subject: [PATCH 147/157] MIPS: IPL is 8bit in Cause and Status registers if TARGET_MCU If MIPS MCU extension is enable, the IPL section in Cause and Status registers has been expand to 8bit instead of 6bit. In Cause: the bits are 10-17. In Status: the bits are 10-16 and 18. MD00834-2B-MUCON-AFP-01.03.pdf: P49 and P61. gcc/ChangeLog: * config/mips/mips.cc (mips_expand_prologue): IPL is 8bit for MCU ASE. --- gcc/config/mips/mips.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc index a1c4b437cd4..91e1e964f94 100644 --- a/gcc/config/mips/mips.cc +++ b/gcc/config/mips/mips.cc @@ -12254,10 +12254,22 @@ mips_expand_prologue (void) /* Insert the RIPL into our copy of SR (k1) as the new IPL. */ if (!cfun->machine->keep_interrupts_masked_p && cfun->machine->int_mask == INT_MASK_EIC) - emit_insn (gen_insvsi (gen_rtx_REG (SImode, K1_REG_NUM), - GEN_INT (6), + { + emit_insn (gen_insvsi (gen_rtx_REG (SImode, K1_REG_NUM), + TARGET_MCU ? GEN_INT (7) : GEN_INT (6), GEN_INT (SR_IPL), gen_rtx_REG (SImode, K0_REG_NUM))); + if (TARGET_MCU) + { + emit_insn (gen_lshrsi3 (gen_rtx_REG (SImode, K0_REG_NUM), + gen_rtx_REG (SImode, K0_REG_NUM), + GEN_INT (7))); + emit_insn (gen_insvsi (gen_rtx_REG (SImode, K1_REG_NUM), + GEN_INT (1), + GEN_INT (SR_IPL+8), + gen_rtx_REG (SImode, K0_REG_NUM))); + } + } /* Clear all interrupt mask bits up to and including the handler's interrupt line. */ From 215c8c5826c688eaebce4d9cd0d52e9da7bc208f Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 1 Apr 2022 11:09:53 +0200 Subject: [PATCH 148/157] [nvptx, testsuite] Fix gcc.target/nvptx/alias-*.c on sm_80 When running test-cases gcc.target/nvptx/alias-*.c on target board nvptx-none-run/-misa=sm_80 we run into fails because the test-cases add -mptx=6.3, which doesn't support sm_80. Fix this by only adding -mptx=6.3 if necessary, and simplify the test-cases by using ptx_alias feature abstractions: ... /* { dg-do run { target runtime_ptx_alias } } */ /* { dg-add-options ptx_alias } */ ... Tested on nvptx. gcc/testsuite/ChangeLog: 2022-04-01 Tom de Vries * gcc.target/nvptx/nvptx.exp (check_effective_target_runtime_ptx_isa_version_6_3): Rename and generalize to ... (check_effective_target_runtime_ptx_isa_version_at_least): .. this. (check_effective_target_default_ptx_isa_version_at_least) (check_effective_target_runtime_ptx_alias, add_options_for_ptx_alias): New proc. * gcc.target/nvptx/alias-1.c: Use "target runtime_ptx_alias" and "dg-add-options ptx_alias". * gcc.target/nvptx/alias-2.c: Same. * gcc.target/nvptx/alias-3.c: Same. * gcc.target/nvptx/alias-4.c: Same. --- gcc/testsuite/gcc.target/nvptx/alias-1.c | 5 +- gcc/testsuite/gcc.target/nvptx/alias-2.c | 5 +- gcc/testsuite/gcc.target/nvptx/alias-3.c | 5 +- gcc/testsuite/gcc.target/nvptx/alias-4.c | 5 +- gcc/testsuite/gcc.target/nvptx/nvptx.exp | 62 ++++++++++++++++++++++-- 5 files changed, 70 insertions(+), 12 deletions(-) diff --git a/gcc/testsuite/gcc.target/nvptx/alias-1.c b/gcc/testsuite/gcc.target/nvptx/alias-1.c index f68716e77dd..d251eee6e42 100644 --- a/gcc/testsuite/gcc.target/nvptx/alias-1.c +++ b/gcc/testsuite/gcc.target/nvptx/alias-1.c @@ -1,6 +1,7 @@ /* { dg-do link } */ -/* { dg-do run { target runtime_ptx_isa_version_6_3 } } */ -/* { dg-options "-save-temps -malias -mptx=6.3" } */ +/* { dg-do run { target runtime_ptx_alias } } */ +/* { dg-options "-save-temps" } */ +/* { dg-add-options ptx_alias } */ int v; diff --git a/gcc/testsuite/gcc.target/nvptx/alias-2.c b/gcc/testsuite/gcc.target/nvptx/alias-2.c index e2dc9b1f5ac..96cb7e2c1ef 100644 --- a/gcc/testsuite/gcc.target/nvptx/alias-2.c +++ b/gcc/testsuite/gcc.target/nvptx/alias-2.c @@ -1,6 +1,7 @@ /* { dg-do link } */ -/* { dg-do run { target runtime_ptx_isa_version_6_3 } } */ -/* { dg-options "-save-temps -malias -mptx=6.3 -O2" } */ +/* { dg-do run { target runtime_ptx_alias } } */ +/* { dg-options "-save-temps -O2" } */ +/* { dg-add-options ptx_alias } */ #include "alias-1.c" diff --git a/gcc/testsuite/gcc.target/nvptx/alias-3.c b/gcc/testsuite/gcc.target/nvptx/alias-3.c index 60486e50826..39649e30b91 100644 --- a/gcc/testsuite/gcc.target/nvptx/alias-3.c +++ b/gcc/testsuite/gcc.target/nvptx/alias-3.c @@ -1,6 +1,7 @@ /* { dg-do link } */ -/* { dg-do run { target runtime_ptx_isa_version_6_3 } } */ -/* { dg-options "-save-temps -malias -mptx=6.3" } */ +/* { dg-do run { target runtime_ptx_alias } } */ +/* { dg-options "-save-temps" } */ +/* { dg-add-options ptx_alias } */ /* Copy of alias-1.c, with static __f and f. */ diff --git a/gcc/testsuite/gcc.target/nvptx/alias-4.c b/gcc/testsuite/gcc.target/nvptx/alias-4.c index 956150a6b3f..28163c0faa0 100644 --- a/gcc/testsuite/gcc.target/nvptx/alias-4.c +++ b/gcc/testsuite/gcc.target/nvptx/alias-4.c @@ -1,6 +1,7 @@ /* { dg-do link } */ -/* { dg-do run { target runtime_ptx_isa_version_6_3 } } */ -/* { dg-options "-save-temps -malias -mptx=6.3 -O2" } */ +/* { dg-do run { target runtime_ptx_alias } } */ +/* { dg-options "-save-temps -O2" } */ +/* { dg-add-options ptx_alias } */ #include "alias-3.c" diff --git a/gcc/testsuite/gcc.target/nvptx/nvptx.exp b/gcc/testsuite/gcc.target/nvptx/nvptx.exp index e69b6d35fed..e9622ae7aaa 100644 --- a/gcc/testsuite/gcc.target/nvptx/nvptx.exp +++ b/gcc/testsuite/gcc.target/nvptx/nvptx.exp @@ -25,11 +25,65 @@ if ![istarget nvptx*-*-*] then { # Load support procs. load_lib gcc-dg.exp -# Return 1 if code with -mptx=6.3 can be run. -proc check_effective_target_runtime_ptx_isa_version_6_3 { args } { - return [check_runtime run_ptx_isa_6_3 { +# Return 1 if code by default compiles for at least PTX ISA version +# major.minor. +proc check_effective_target_default_ptx_isa_version_at_least { major minor } { + set name default_ptx_isa_version_at_least_${major}_${minor} + + set supported_p \ + [concat \ + "((__PTX_ISA_VERSION_MAJOR__ == $major" \ + " && __PTX_ISA_VERSION_MINOR__ >= $minor)" \ + " || (__PTX_ISA_VERSION_MAJOR__ > $major))"] + + set src \ + [list \ + "#if $supported_p" \ + "#else" \ + "#error unsupported" \ + "#endif"] + set src [join $src "\n"] + + set res [check_no_compiler_messages $name assembly $src ""] + + return $res +} + +# Return 1 if code with PTX ISA version major.minor or higher can be run. +proc check_effective_target_runtime_ptx_isa_version_at_least { major minor } { + set name runtime_ptx_isa_version_${major}_${minor} + + set default \ + [check_effective_target_default_ptx_isa_version_at_least \ + ${major} ${minor}] + + if { $default } { + set flag "" + } else { + set flag "-mptx=$major.$minor" + } + + set res [check_runtime $name { int main (void) { return 0; } - } "-mptx=6.3"] + } $flag] + + return $res +} + +# Return 1 if runtime environment support the PTX ISA directive .alias. +proc check_effective_target_runtime_ptx_alias { } { + return [check_effective_target_runtime_ptx_isa_version_at_least 6 3] +} + +# Add options to enable using PTX ISA directive .alias. +proc add_options_for_ptx_alias { flags } { + append flags " -malias" + + if { ![check_effective_target_default_ptx_isa_version_at_least 6 3] } { + append flags " -mptx=6.3" + } + + return $flags } # If a testcase doesn't have special options, use these. From e0ce885851dfd926c0cfe6f23a2debc87ea2bb9d Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 1 Apr 2022 11:49:40 +0200 Subject: [PATCH 149/157] testsuite: Add further zero size elt passing tests [PR102024] As discussed in PR102024, zero width bitfields might not be the only ones causing ABI issues at least on mips, zero size arrays or (in C only) zero sized (empty) structures can be problematic too. The following patch adds some coverage for it too. Tested on x86_64-linux with make check-gcc check-g++ RUNTESTFLAGS='ALT_CC_UNDER_TEST=gcc ALT_CXX_UNDER_TEST=g++ --target_board=unix\{-m32,-m64\} compat.exp=pr102024*' make check-gcc check-g++ RUNTESTFLAGS='ALT_CC_UNDER_TEST=clang ALT_CXX_UNDER_TEST=clang++ --target_board=unix\{-m32,-m64\} compat.exp=pr102024*' with gcc/g++ 10.3 and clang 11. Everything but (expectedly) FAIL: gcc.dg/compat/pr102024 c_compat_x_tst.o-c_compat_y_alt.o execute FAIL: gcc.dg/compat/pr102024 c_compat_x_alt.o-c_compat_y_tst.o execute for -m64 ALT_CC_UNDER_TEST=gcc passes. 2022-04-01 Jakub Jelinek PR target/102024 * gcc.dg/compat/pr102024_test.h: Add further tests with zero sized structures and arrays. * g++.dg/compat/pr102024_test.h: Add further tests with zero sized arrays. --- gcc/testsuite/g++.dg/compat/pr102024_test.h | 6 ++++++ gcc/testsuite/gcc.dg/compat/pr102024_test.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/testsuite/g++.dg/compat/pr102024_test.h b/gcc/testsuite/g++.dg/compat/pr102024_test.h index d8f4103f63c..488a8ea188a 100644 --- a/gcc/testsuite/g++.dg/compat/pr102024_test.h +++ b/gcc/testsuite/g++.dg/compat/pr102024_test.h @@ -4,3 +4,9 @@ T(2,int:0;float a;,F(2,a,2.25f,16.5f)) T(3,double a;long long:0;double b;,F(3,a,42.0,43.125)F(3,b,-17.5,35.75)) T(4,double a;long long:0;,F(4,a,1.0,17.125)) T(5,long long:0;double a;,F(5,a,2.25,16.5)) +T(6,float a;struct{}b[0];float c;,F(6,a,42.0f,43.125f)F(6,c,-17.5f,35.75f)) +T(7,float a;struct{}b[0];;,F(7,a,1.0f,17.125f)) +T(8,int a[0];float b;,F(8,b,2.25f,16.5f)) +T(9,double a;long long b[0];double c;,F(9,a,42.0,43.125)F(9,c,-17.5,35.75)) +T(10,double a;struct{}b[0];,F(10,a,1.0,17.125)) +T(11,struct{}a[0];double b;,F(11,b,2.25,16.5)) diff --git a/gcc/testsuite/gcc.dg/compat/pr102024_test.h b/gcc/testsuite/gcc.dg/compat/pr102024_test.h index d8f4103f63c..d610dbdf54f 100644 --- a/gcc/testsuite/gcc.dg/compat/pr102024_test.h +++ b/gcc/testsuite/gcc.dg/compat/pr102024_test.h @@ -4,3 +4,9 @@ T(2,int:0;float a;,F(2,a,2.25f,16.5f)) T(3,double a;long long:0;double b;,F(3,a,42.0,43.125)F(3,b,-17.5,35.75)) T(4,double a;long long:0;,F(4,a,1.0,17.125)) T(5,long long:0;double a;,F(5,a,2.25,16.5)) +T(6,float a;struct{}b;float c;,F(6,a,42.0f,43.125f)F(6,c,-17.5f,35.75f)) +T(7,float a;struct{}b[0];;,F(7,a,1.0f,17.125f)) +T(8,int a[0];float b;,F(8,b,2.25f,16.5f)) +T(9,double a;long long b[0];double c;,F(9,a,42.0,43.125)F(9,c,-17.5,35.75)) +T(10,double a;struct{}b;,F(10,a,1.0,17.125)) +T(11,struct{}a[0];double b;,F(11,b,2.25,16.5)) From d9c03fc27d8147a9401a29739694b214df48a9a2 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 1 Apr 2022 11:50:41 +0200 Subject: [PATCH 150/157] phiopt: Improve value_replacement [PR104645] The following patch fixes the P1 regression by reusing existing value_replacement code. That function already has code to handle simple preparation statements (casts, and +,&,|,^ binary assignments) before a final binary assignment (which can be much wider range of ops). When we have e.g. if (y_3(D) == 0) goto ; else goto ; : y_4 = y_3(D) & 31; _1 = (int) y_4; _6 = x_5(D) r<< _1; : # _2 = PHI the preparation statements y_4 = y_3(D) & 31; and _1 = (int) y_4; are handled by constant evaluation, passing through y_3(D) = 0 initially and propagating that through the assignments with checking that UB isn't invoked. But the final _6 = x_5(D) r<< _1; assign is handled differently, either through neutral_element_p or absorbing_element_p. In the first function below we now have: [local count: 1073741824]: if (i_2(D) != 0) goto ; [50.00%] else goto ; [50.00%] [local count: 536870913]: _3 = i_2(D) & 1; iftmp.0_4 = (int) _3; [local count: 1073741824]: # iftmp.0_1 = PHI where in GCC 11 we had: : if (i_3(D) != 0) goto ; [INV] else goto ; [INV] : i.1_1 = (int) i_3(D); iftmp.0_5 = i.1_1 & 1; : # iftmp.0_2 = PHI Current value_replacement can handle the latter as the last stmt of middle_bb is a binary op that in this case satisfies absorbing_element_p. But the former we can't handle, as the last stmt in middle_bb is a cast. The patch makes it work in that case by pretending all of middle_bb are the preparation statements and there is no binary assign at the end, so everything is handled through the constant evaluation. We simply set at the start of middle_bb the lhs of comparison virtually to the rhs, propagate it through and at the end see if virtually the arg0 of the PHI is equal to arg1 of it. For GCC 13, I think we just should throw away all the neutral/absorbing element stuff and do the constant evaluation of the whole middle_bb and handle that way all the ops we currently handle in neutral/absorbing element. 2022-04-01 Jakub Jelinek PR tree-optimization/104645 * tree-ssa-phiopt.cc (value_replacement): If assign has CONVERT_EXPR_CODE_P rhs_code, treat it like a preparation statement with constant evaluation. * gcc.dg/tree-ssa/pr104645.c: New test. --- gcc/testsuite/gcc.dg/tree-ssa/pr104645.c | 28 +++++++++++ gcc/tree-ssa-phiopt.cc | 63 ++++++++++++++++++------ 2 files changed, 77 insertions(+), 14 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr104645.c diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr104645.c b/gcc/testsuite/gcc.dg/tree-ssa/pr104645.c new file mode 100644 index 00000000000..83c1dd451f1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr104645.c @@ -0,0 +1,28 @@ +/* PR tree-optimization/104645 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-final { scan-tree-dump-not " = PHI <" "optimized" } } */ + +int +foo (unsigned i) +{ + return i ? i % 2 : 0; +} + +int +bar (unsigned i) +{ + int b = 0; + if (i) + { + unsigned a = i & 1; + b = a; + } + return b; +} + +int +baz (unsigned i) +{ + return i ? i + 4 : 4; +} diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc index 562468b7f02..4a0c9dd656d 100644 --- a/gcc/tree-ssa-phiopt.cc +++ b/gcc/tree-ssa-phiopt.cc @@ -1395,11 +1395,22 @@ value_replacement (basic_block cond_bb, basic_block middle_bb, gimple *assign = gsi_stmt (gsi); if (!is_gimple_assign (assign) - || gimple_assign_rhs_class (assign) != GIMPLE_BINARY_RHS || (!INTEGRAL_TYPE_P (TREE_TYPE (arg0)) && !POINTER_TYPE_P (TREE_TYPE (arg0)))) return 0; + if (gimple_assign_rhs_class (assign) != GIMPLE_BINARY_RHS) + { + /* If last stmt of the middle_bb is a conversion, handle it like + a preparation statement through constant evaluation with + checking for UB. */ + enum tree_code sc = gimple_assign_rhs_code (assign); + if (CONVERT_EXPR_CODE_P (sc)) + assign = NULL; + else + return 0; + } + /* Punt if there are (degenerate) PHIs in middle_bb, there should not be. */ if (!gimple_seq_empty_p (phi_nodes (middle_bb))) return 0; @@ -1430,7 +1441,8 @@ value_replacement (basic_block cond_bb, basic_block middle_bb, int prep_cnt; for (prep_cnt = 0; ; prep_cnt++) { - gsi_prev_nondebug (&gsi); + if (prep_cnt || assign) + gsi_prev_nondebug (&gsi); if (gsi_end_p (gsi)) break; @@ -1450,7 +1462,8 @@ value_replacement (basic_block cond_bb, basic_block middle_bb, || !INTEGRAL_TYPE_P (TREE_TYPE (lhs)) || !INTEGRAL_TYPE_P (TREE_TYPE (rhs1)) || !single_imm_use (lhs, &use_p, &use_stmt) - || use_stmt != (prep_cnt ? prep_stmt[prep_cnt - 1] : assign)) + || ((prep_cnt || assign) + && use_stmt != (prep_cnt ? prep_stmt[prep_cnt - 1] : assign))) return 0; switch (gimple_assign_rhs_code (g)) { @@ -1483,10 +1496,6 @@ value_replacement (basic_block cond_bb, basic_block middle_bb, >= 3 * estimate_num_insns (cond, &eni_time_weights)) return 0; - tree lhs = gimple_assign_lhs (assign); - tree rhs1 = gimple_assign_rhs1 (assign); - tree rhs2 = gimple_assign_rhs2 (assign); - enum tree_code code_def = gimple_assign_rhs_code (assign); tree cond_lhs = gimple_cond_lhs (cond); tree cond_rhs = gimple_cond_rhs (cond); @@ -1516,16 +1525,39 @@ value_replacement (basic_block cond_bb, basic_block middle_bb, return 0; } + tree lhs, rhs1, rhs2; + enum tree_code code_def; + if (assign) + { + lhs = gimple_assign_lhs (assign); + rhs1 = gimple_assign_rhs1 (assign); + rhs2 = gimple_assign_rhs2 (assign); + code_def = gimple_assign_rhs_code (assign); + } + else + { + gcc_assert (prep_cnt > 0); + lhs = cond_lhs; + rhs1 = NULL_TREE; + rhs2 = NULL_TREE; + code_def = ERROR_MARK; + } + if (((code == NE_EXPR && e1 == false_edge) || (code == EQ_EXPR && e1 == true_edge)) && arg0 == lhs - && ((arg1 == rhs1 - && operand_equal_for_phi_arg_p (rhs2, cond_lhs) - && neutral_element_p (code_def, cond_rhs, true)) - || (arg1 == rhs2 + && ((assign == NULL + && operand_equal_for_phi_arg_p (arg1, cond_rhs)) + || (assign + && arg1 == rhs1 + && operand_equal_for_phi_arg_p (rhs2, cond_lhs) + && neutral_element_p (code_def, cond_rhs, true)) + || (assign + && arg1 == rhs2 && operand_equal_for_phi_arg_p (rhs1, cond_lhs) && neutral_element_p (code_def, cond_rhs, false)) - || (operand_equal_for_phi_arg_p (arg1, cond_rhs) + || (assign + && operand_equal_for_phi_arg_p (arg1, cond_rhs) && ((operand_equal_for_phi_arg_p (rhs2, cond_lhs) && absorbing_element_p (code_def, cond_rhs, true, rhs2)) || (operand_equal_for_phi_arg_p (rhs1, cond_lhs) @@ -1555,8 +1587,11 @@ value_replacement (basic_block cond_bb, basic_block middle_bb, gsi_from = gsi_for_stmt (prep_stmt[i]); gsi_move_before (&gsi_from, &gsi); } - gsi_from = gsi_for_stmt (assign); - gsi_move_before (&gsi_from, &gsi); + if (assign) + { + gsi_from = gsi_for_stmt (assign); + gsi_move_before (&gsi_from, &gsi); + } replace_phi_edge_with_variable (cond_bb, e1, phi, lhs); return 2; } From 1e9c026848dd871266305d7e52292e0e10897f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 1 Apr 2022 11:03:45 +0100 Subject: [PATCH 151/157] libstdc++: Fix filenames in Doxygen @file comments Reviewed-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/fs_ops.h: Fix filename in Doxygen comment. * include/experimental/bits/fs_ops.h: Likewise. --- libstdc++-v3/include/bits/fs_ops.h | 2 +- libstdc++-v3/include/experimental/bits/fs_ops.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/fs_ops.h b/libstdc++-v3/include/bits/fs_ops.h index c894cae8aa3..0281c6540d0 100644 --- a/libstdc++-v3/include/bits/fs_ops.h +++ b/libstdc++-v3/include/bits/fs_ops.h @@ -22,7 +22,7 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -/** @file include/bits/fs_fwd.h +/** @file include/bits/fs_ops.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{filesystem} */ diff --git a/libstdc++-v3/include/experimental/bits/fs_ops.h b/libstdc++-v3/include/experimental/bits/fs_ops.h index dafd1ec79a0..773f27c6687 100644 --- a/libstdc++-v3/include/experimental/bits/fs_ops.h +++ b/libstdc++-v3/include/experimental/bits/fs_ops.h @@ -22,7 +22,7 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -/** @file experimental/bits/fs_fwd.h +/** @file experimental/bits/fs_ops.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{experimental/filesystem} */ From 065e25f6331c130bc3cd2ce78036f2328adb3d71 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 1 Apr 2022 12:14:47 +0200 Subject: [PATCH 152/157] [libgomp, testsuite, nvptx] Fix dg-output test in vector-length-128-7.c When running test-case libgomp.oacc-c-c++-common/vector-length-128-7.c on an RTX A2000 (sm_86) with driver 510.60.02 I run into: ... FAIL: libgomp.oacc-c/../libgomp.oacc-c-c++-common/vector-length-128-7.c \ -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O0 \ output pattern test ... The failing check verifies the launch dimensions: ... /* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: \ launch gangs=1, workers=8, vectors=128" } */ ... which fails because (as we can see with GOMP_DEBUG=1) the actual num_workers is 6: ... nvptx_exec: kernel main$_omp_fn$0: launch gangs=1, workers=6, vectors=128 ... This is due to the result of cuOccupancyMaxPotentialBlockSize (which suggests 'a launch configuration with reasonable occupancy') printed just before: ... cuOccupancyMaxPotentialBlockSize: grid = 52, block = 768 ... [ Note: 6 * 128 == 768. ] Fix this by updating the check to allow num_workers in the range 1 to 8. Tested on x86_64 with nvptx accelerator. libgomp/ChangeLog: 2022-04-01 Tom de Vries * testsuite/libgomp.oacc-c-c++-common/vector-length-128-7.c: Fix num_workers check. --- .../testsuite/libgomp.oacc-c-c++-common/vector-length-128-7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-7.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-7.c index 4a8c1bf549e..92b3de03636 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-7.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-7.c @@ -37,4 +37,4 @@ main (void) } /* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 0, 128\\)" "oaccloops" } } */ -/* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=8, vectors=128" } */ +/* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=\[1-8\], vectors=128" } */ From bfa9f660d25aef1513b1289d01c80b52090ef72a Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 1 Apr 2022 13:08:54 +0200 Subject: [PATCH 153/157] [libgomp, testsuite, nvptx] Limit recursion in declare_target-{1,2}.f90 When running testcases libgomp.fortran/examples-4/declare_target-{1,2}.f90 on an RTX A2000 (sm_86) with driver 510.60.02 and with GOMP_NVPTX_JIT=-O0 I run into: ... FAIL: libgomp.fortran/examples-4/declare_target-1.f90 -O0 \ -DGOMP_NVPTX_JIT=-O0 execution test FAIL: libgomp.fortran/examples-4/declare_target-2.f90 -O0 \ -DGOMP_NVPTX_JIT=-O0 execution test ... Fix this by further limiting recursion depth in the test-cases for nvptx. Furthermore, make the recursion depth limiting nvptx-specific. Tested on x86_64 with nvptx accelerator. libgomp/ChangeLog: 2022-04-01 Tom de Vries * testsuite/libgomp.fortran/examples-4/declare_target-1.f90: Define and use REC_DEPTH. * testsuite/libgomp.fortran/examples-4/declare_target-2.f90: Same. --- .../examples-4/declare_target-1.f90 | 18 ++++++++++++----- .../examples-4/declare_target-2.f90 | 20 +++++++++++++------ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-1.f90 b/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-1.f90 index b761979ecde..03c5c53ed67 100644 --- a/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-1.f90 +++ b/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-1.f90 @@ -1,4 +1,16 @@ ! { dg-do run } +! { dg-additional-options "-cpp" } +! Reduced from 25 to 23, otherwise execution runs out of thread stack on +! Nvidia Titan V. +! Reduced from 23 to 22, otherwise execution runs out of thread stack on +! Nvidia T400 (2GB variant), when run with GOMP_NVPTX_JIT=-O0. +! Reduced from 22 to 20, otherwise execution runs out of thread stack on +! Nvidia RTX A2000 (6GB variant), when run with GOMP_NVPTX_JIT=-O0. +! { dg-additional-options "-DREC_DEPTH=20" { target { offload_target_nvptx } } } */ + +#ifndef REC_DEPTH +#define REC_DEPTH 25 +#endif module e_53_1_mod integer :: THRESHOLD = 20 @@ -27,9 +39,5 @@ end module program e_53_1 use e_53_1_mod, only : fib, fib_wrapper if (fib (15) /= fib_wrapper (15)) stop 1 - ! Reduced from 25 to 23, otherwise execution runs out of thread stack on - ! Nvidia Titan V. - ! Reduced from 23 to 22, otherwise execution runs out of thread stack on - ! Nvidia T400 (2GB variant), when run with GOMP_NVPTX_JIT=-O0. - if (fib (22) /= fib_wrapper (22)) stop 2 + if (fib (REC_DEPTH) /= fib_wrapper (REC_DEPTH)) stop 2 end program diff --git a/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-2.f90 b/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-2.f90 index f576c25ba39..0e8bea578a8 100644 --- a/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-2.f90 +++ b/libgomp/testsuite/libgomp.fortran/examples-4/declare_target-2.f90 @@ -1,16 +1,24 @@ ! { dg-do run } +! { dg-additional-options "-cpp" } +! Reduced from 25 to 23, otherwise execution runs out of thread stack on +! Nvidia Titan V. +! Reduced from 23 to 22, otherwise execution runs out of thread stack on +! Nvidia T400 (2GB variant), when run with GOMP_NVPTX_JIT=-O0. +! Reduced from 22 to 18, otherwise execution runs out of thread stack on +! Nvidia RTX A2000 (6GB variant), when run with GOMP_NVPTX_JIT=-O0. +! { dg-additional-options "-DREC_DEPTH=18" { target { offload_target_nvptx } } } */ + +#ifndef REC_DEPTH +#define REC_DEPTH 25 +#endif program e_53_2 !$omp declare target (fib) integer :: x, fib !$omp target map(from: x) - ! Reduced from 25 to 23, otherwise execution runs out of thread stack on - ! Nvidia Titan V. - ! Reduced from 23 to 22, otherwise execution runs out of thread stack on - ! Nvidia T400 (2GB variant), when run with GOMP_NVPTX_JIT=-O0. - x = fib (22) + x = fib (REC_DEPTH) !$omp end target - if (x /= fib (22)) stop 1 + if (x /= fib (REC_DEPTH)) stop 1 end program integer recursive function fib (n) result (f) From 944da70a5d1cdc5bd4327b2d32420f57b6883985 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 27 Sep 2021 22:07:12 +0100 Subject: [PATCH 154/157] libstdc++: Fix mismatched noexcept-specifiers in Filesystem TS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The copy_file fix should have been part of r12-7063-gda72e0fd20f87b. The path::begin() fix should have been part of r12-3930-gf2b7f56a15d9cb. Thanks to Timm Bäder for reporting this one. libstdc++-v3/ChangeLog: * include/experimental/bits/fs_fwd.h (copy_file): Remove incorrect noexcept from declaration. * include/experimental/bits/fs_path.h (path::begin, path::end): Add noexcept to declarations, to match definitions. --- libstdc++-v3/include/experimental/bits/fs_fwd.h | 2 +- libstdc++-v3/include/experimental/bits/fs_path.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/fs_fwd.h b/libstdc++-v3/include/experimental/bits/fs_fwd.h index d568e9e3a73..c8fbcbc1679 100644 --- a/libstdc++-v3/include/experimental/bits/fs_fwd.h +++ b/libstdc++-v3/include/experimental/bits/fs_fwd.h @@ -280,7 +280,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 bool copy_file(const path& __from, const path& __to, copy_options __option); bool copy_file(const path& __from, const path& __to, copy_options __option, - error_code&) noexcept; + error_code&); path current_path(); diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h index a050749676d..803df424664 100644 --- a/libstdc++-v3/include/experimental/bits/fs_path.h +++ b/libstdc++-v3/include/experimental/bits/fs_path.h @@ -425,8 +425,8 @@ namespace __detail class iterator; typedef iterator const_iterator; - iterator begin() const; - iterator end() const; + iterator begin() const noexcept; + iterator end() const noexcept; /// @cond undocumented // Create a basic_string by reading until a null character. From babaabbcc8346758be0051b32272da18d54f5eea Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 1 Apr 2022 12:25:02 +0100 Subject: [PATCH 155/157] libstdc++: Implement std::unreachable() for C++23 (P0627R6) This defines std::unreachable as an assertion for debug mode, a trap when _GLIBCXX_ASSERTIONS is defined, and __builtin_unreachable() otherwise. The reason for only using __builtin_trap() in the second case is to avoid the overhead of setting up a call to __glibcxx_assert_fail that should never happen. UBsan can detect if __builtin_unreachable() is executed, so if a feature test macro for that sanitizer is added, we could change just use __builtin_unreachable() when the sanitizer is enabled. While thinking about what the debug assertion failure should print, I noticed that the __glibcxx_assert_fail function doesn't check for null pointers. This adds a check so we don't try to print them if null. libstdc++-v3/ChangeLog: * include/std/utility (unreachable): Define for C++23. * include/std/version (__cpp_lib_unreachable): Define. * src/c++11/debug.cc (__glibcxx_assert_fail): Check for valid arguments. Handle only the function being given. * testsuite/20_util/unreachable/1.cc: New test. * testsuite/20_util/unreachable/version.cc: New test. --- libstdc++-v3/include/std/utility | 26 +++++++++++++++++++ libstdc++-v3/include/std/version | 1 + libstdc++-v3/src/c++11/debug.cc | 7 +++-- .../testsuite/20_util/unreachable/1.cc | 17 ++++++++++++ .../testsuite/20_util/unreachable/version.cc | 10 +++++++ 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 libstdc++-v3/testsuite/20_util/unreachable/1.cc create mode 100644 libstdc++-v3/testsuite/20_util/unreachable/version.cc diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility index 0d7f8954c5a..ad5faa50f57 100644 --- a/libstdc++-v3/include/std/utility +++ b/libstdc++-v3/include/std/utility @@ -186,6 +186,32 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr underlying_type_t<_Tp> to_underlying(_Tp __value) noexcept { return static_cast>(__value); } + +#define __cpp_lib_unreachable 202202L + /// Informs the compiler that program control flow never reaches this point. + /** + * Evaluating a call to this function results in undefined behaviour. + * This can be used as an assertion informing the compiler that certain + * conditions are impossible, for when the compiler is unable to determine + * that by itself. + * + * For example, it can be used to prevent warnings about reaching the + * end of a non-void function without returning. + * + * @since C++23 + */ + [[noreturn,__gnu__::__always_inline__]] + inline void + unreachable() + { +#ifdef _GLIBCXX_DEBUG + std::__glibcxx_assert_fail(nullptr, 0, "std::unreachable()", nullptr); +#elif defined _GLIBCXX_ASSERTIONS + __builtin_trap(); +#else + __builtin_unreachable(); +#endif + } #endif // C++23 #endif // C++20 #endif // C++17 diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index 44b8a9f88b5..51f2110b68e 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -326,6 +326,7 @@ # define __cpp_lib_string_resize_and_overwrite 202110L #endif #define __cpp_lib_to_underlying 202102L +#define __cpp_lib_unreachable 202202L #endif #endif // C++2b #endif // C++20 diff --git a/libstdc++-v3/src/c++11/debug.cc b/libstdc++-v3/src/c++11/debug.cc index 98fe2dcc153..4706defedf1 100644 --- a/libstdc++-v3/src/c++11/debug.cc +++ b/libstdc++-v3/src/c++11/debug.cc @@ -52,8 +52,11 @@ namespace std __glibcxx_assert_fail(const char* file, int line, const char* function, const char* condition) noexcept { - fprintf(stderr, "%s:%d: %s: Assertion '%s' failed.\n", - file, line, function, condition); + if (file && function && condition) + fprintf(stderr, "%s:%d: %s: Assertion '%s' failed.\n", + file, line, function, condition); + else if (function) + fprintf(stderr, "%s: Undefined behavior detected.\n", function); abort(); } } diff --git a/libstdc++-v3/testsuite/20_util/unreachable/1.cc b/libstdc++-v3/testsuite/20_util/unreachable/1.cc new file mode 100644 index 00000000000..0c463d52a48 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/unreachable/1.cc @@ -0,0 +1,17 @@ +// { dg-options "-std=gnu++23" } +// { dg-do compile { target c++23 } } + +#include + +#ifndef __cpp_lib_unreachable +# error "Feature-test macro for unreachable missing in " +#elif __cpp_lib_unreachable != 202202L +# error "Feature-test macro for unreachable has wrong value in " +#endif + +bool test01(int i) +{ + if (i == 4) + return true; + std::unreachable(); +} // { dg-bogus "control reaches end of non-void function" } diff --git a/libstdc++-v3/testsuite/20_util/unreachable/version.cc b/libstdc++-v3/testsuite/20_util/unreachable/version.cc new file mode 100644 index 00000000000..c7795900c30 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/unreachable/version.cc @@ -0,0 +1,10 @@ +// { dg-options "-std=gnu++23" } +// { dg-do preprocess { target c++23 } } + +#include + +#ifndef __cpp_lib_unreachable +# error "Feature-test macro for unreachable missing in " +#elif __cpp_lib_unreachable != 202202L +# error "Feature-test macro for unreachable has wrong value in " +#endif From aed0f014781ee334921030d4b86e295bd1080b96 Mon Sep 17 00:00:00 2001 From: Petter Tomner Date: Sat, 19 Feb 2022 15:34:12 +0000 Subject: [PATCH 156/157] jit: Update docs Update docs concerning linking and fix formatting errors. gcc/jit/ChangeLog: * docs/topics/compatibility.rst: Add 19 tag * docs/topics/compilation.rst: Linking * docs/topics/contexts.rst: Linking example * docs/topics/expressions.rst: Fix formatting and dropped 's' Signed-off-by: Petter Tomner 2022-02-19 --- gcc/jit/docs/topics/compatibility.rst | 12 ++++++++++++ gcc/jit/docs/topics/compilation.rst | 8 ++------ gcc/jit/docs/topics/contexts.rst | 5 +++++ gcc/jit/docs/topics/expressions.rst | 15 ++++++++++----- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/gcc/jit/docs/topics/compatibility.rst b/gcc/jit/docs/topics/compatibility.rst index 16cebe31a10..03e3f3402a1 100644 --- a/gcc/jit/docs/topics/compatibility.rst +++ b/gcc/jit/docs/topics/compatibility.rst @@ -302,3 +302,15 @@ thread-local storage model of a variable: section of a variable: * :func:`gcc_jit_lvalue_set_link_section` + +.. _LIBGCCJIT_ABI_19: + +``LIBGCCJIT_ABI_19`` +----------------------- +``LIBGCCJIT_ABI_19`` covers the addition of API entrypoints to set the initial value +of a global with an rvalue and to use constructors: + + * :func:`gcc_jit_context_new_array_constructor` + * :func:`gcc_jit_context_new_struct_constructor` + * :func:`gcc_jit_context_new_union_constructor` + * :func:`gcc_jit_global_set_initializer_rvalue` diff --git a/gcc/jit/docs/topics/compilation.rst b/gcc/jit/docs/topics/compilation.rst index 0f90db3b70e..9b1eed2dede 100644 --- a/gcc/jit/docs/topics/compilation.rst +++ b/gcc/jit/docs/topics/compilation.rst @@ -146,6 +146,8 @@ can also be used for implementing more traditional ahead-of-time compilers, via the :c:func:`gcc_jit_context_compile_to_file` API entrypoint. +For linking in object files, use :c:func:`gcc_jit_context_add_driver_option`. + .. function:: void \ gcc_jit_context_compile_to_file (gcc_jit_context *ctxt, \ enum gcc_jit_output_kind output_kind,\ @@ -188,12 +190,6 @@ Output kind Typical suffix Compile the context to a dynamic library. - There is currently no support for specifying other libraries to link - against. - .. c:macro:: GCC_JIT_OUTPUT_KIND_EXECUTABLE Compile the context to an executable. - - There is currently no support for specifying libraries to link - against. diff --git a/gcc/jit/docs/topics/contexts.rst b/gcc/jit/docs/topics/contexts.rst index 68ab7ab1321..14ee57e2e54 100644 --- a/gcc/jit/docs/topics/contexts.rst +++ b/gcc/jit/docs/topics/contexts.rst @@ -569,6 +569,11 @@ Additional command-line options gcc_jit_context_add_driver_option (ctxt, "-lm"); gcc_jit_context_add_driver_option (ctxt, "-fuse-linker-plugin"); + gcc_jit_context_add_driver_option (ctxt, "obj.o"); + + gcc_jit_context_add_driver_option (ctxt, "-L."); + gcc_jit_context_add_driver_option (ctxt, "-lwhatever"); + Note that only some options are likely to be meaningful; there is no "frontend" within libgccjit, so typically only those affecting assembler and linker are likely to be useful. diff --git a/gcc/jit/docs/topics/expressions.rst b/gcc/jit/docs/topics/expressions.rst index 791a20398ca..9267b6d2ad6 100644 --- a/gcc/jit/docs/topics/expressions.rst +++ b/gcc/jit/docs/topics/expressions.rst @@ -152,6 +152,7 @@ Constructor expressions their presence using: .. code-block:: c + #ifdef LIBGCCJIT_HAVE_CTORS .. function:: gcc_jit_rvalue *\ @@ -186,6 +187,7 @@ Constructor expressions presence using: .. code-block:: c + #ifdef LIBGCCJIT_HAVE_CTORS .. function:: gcc_jit_rvalue *\ @@ -194,7 +196,7 @@ Constructor expressions gcc_jit_type *type,\ size_t num_values,\ gcc_jit_field **fields,\ - gcc_jit_rvalue **value) + gcc_jit_rvalue **values) Create a constructor for a struct as an rvalue. @@ -235,6 +237,7 @@ Constructor expressions presence using: .. code-block:: c + #ifdef LIBGCCJIT_HAVE_CTORS .. function:: gcc_jit_rvalue *\ @@ -265,6 +268,7 @@ Constructor expressions presence using: .. code-block:: c + #ifdef LIBGCCJIT_HAVE_CTORS Vector expressions @@ -803,14 +807,14 @@ Global variables #ifdef LIBGCCJIT_HAVE_gcc_jit_global_set_initializer .. function:: gcc_jit_lvalue *\ - gcc_jit_global_set_initializer_rvalue (gcc_jit_lvalue *global, + gcc_jit_global_set_initializer_rvalue (gcc_jit_lvalue *global,\ gcc_jit_rvalue *init_value) Set the initial value of a global with an rvalue. The rvalue needs to be a constant expression, e.g. no function calls. - The global can't have the ``kind`` :ref:`GCC_JIT_GLOBAL_IMPORTED`. + The global can't have the ``kind`` :c:macro:`GCC_JIT_GLOBAL_IMPORTED`. As a non-comprehensive example it is OK to do the equivalent of: @@ -822,8 +826,9 @@ Global variables const int baz = 3; /* rvalue from gcc_jit_context_rvalue_from_int. */ int boz = baz; /* rvalue from gcc_jit_lvalue_as_rvalue. */ - Use together with :ref:`gcc_jit_context_new_constructor` to - initialize structs, unions and arrays. + Use together with :c:func:`gcc_jit_context_new_struct_constructor`, + :c:func:`gcc_jit_context_new_union_constructor`, :c:func:`gcc_jit_context_new_array_constructor` + to initialize structs, unions and arrays. On success, returns the ``global`` parameter unchanged. Otherwise, ``NULL``. From 1a172da8a3f3625d6d35675e604678ab0154bef7 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 1 Apr 2022 09:18:26 -0400 Subject: [PATCH 157/157] jit: further doc fixes Further jit doc fixes, which fix links to gcc_jit_function_type_get_param_type and gcc_jit_struct_get_field. gcc/jit/ChangeLog: * docs/topics/expressions.rst: Fix formatting. * docs/topics/types.rst: Likewise. * docs/_build/texinfo/libgccjit.texi: Regenerate Signed-off-by: David Malcolm --- gcc/jit/docs/_build/texinfo/libgccjit.texi | 2008 +++++++++++++------- gcc/jit/docs/topics/expressions.rst | 8 +- gcc/jit/docs/topics/types.rst | 6 +- 3 files changed, 1320 insertions(+), 702 deletions(-) diff --git a/gcc/jit/docs/_build/texinfo/libgccjit.texi b/gcc/jit/docs/_build/texinfo/libgccjit.texi index 603de63fa2b..c1ca5aaf7f6 100644 --- a/gcc/jit/docs/_build/texinfo/libgccjit.texi +++ b/gcc/jit/docs/_build/texinfo/libgccjit.texi @@ -21,7 +21,7 @@ @copying @quotation -libgccjit 11.0.0 (experimental 20210114), Jan 14, 2021 +libgccjit 12.0.1 (experimental 20220331), Mar 31, 2022 David Malcolm @@ -193,6 +193,7 @@ Types * Vector types:: * Structures and unions:: * Function pointer types:: +* Reflection API:: Expressions @@ -203,6 +204,7 @@ Expressions Rvalues * Simple expressions:: +* Constructor expressions:: * Vector expressions:: * Unary Operations:: * Binary Operations:: @@ -254,6 +256,10 @@ ABI symbol tags * LIBGCCJIT_ABI_13:: * LIBGCCJIT_ABI_14:: * LIBGCCJIT_ABI_15:: +* LIBGCCJIT_ABI_16:: +* LIBGCCJIT_ABI_17:: +* LIBGCCJIT_ABI_18:: +* LIBGCCJIT_ABI_19:: Performance @@ -463,7 +469,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see -. */ +. */ #include @@ -1001,7 +1007,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see -. */ +. */ #include @@ -1560,7 +1566,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see -. */ +. */ #include @@ -2445,7 +2451,7 @@ be consolidated into larger blocks when the optimizer runs. @example for (pc = 0; pc < fn->fn_num_ops; pc++) @{ - char buf[16]; + char buf[100]; sprintf (buf, "instr%i", pc); state.op_blocks[pc] = gcc_jit_function_new_block (state.fn, buf); @} @@ -5108,6 +5114,11 @@ For example: @example gcc_jit_context_add_driver_option (ctxt, "-lm"); gcc_jit_context_add_driver_option (ctxt, "-fuse-linker-plugin"); + +gcc_jit_context_add_driver_option (ctxt, "obj.o"); + +gcc_jit_context_add_driver_option (ctxt, "-L."); +gcc_jit_context_add_driver_option (ctxt, "-lwhatever"); @end example Note that only some options are likely to be meaningful; there is no @@ -5302,6 +5313,7 @@ by creating structures (see below). * Vector types:: * Structures and unions:: * Function pointer types:: +* Reflection API:: @end menu @@ -5636,7 +5648,7 @@ A compound type analagous to a C @cite{struct}. A field within a @ref{89,,gcc_jit_struct}. -You can model C @cite{struct} types by creating @ref{89,,gcc_jit_struct *} and +You can model C @cite{struct} types by creating @ref{89,,gcc_jit_struct} and @ref{8a,,gcc_jit_field} instances, in either order: @@ -5860,7 +5872,7 @@ create_code (gcc_jit_context *ctxt, void *user_data) @end example @end deffn -@node Function pointer types,,Structures and unions,Types +@node Function pointer types,Reflection API,Structures and unions,Types @anchor{topics/types function-pointer-types}@anchor{94} @subsection Function pointer types @@ -5868,6 +5880,186 @@ create_code (gcc_jit_context *ctxt, void *user_data) Function pointer types can be created using @ref{95,,gcc_jit_context_new_function_ptr_type()}. +@node Reflection API,,Function pointer types,Types +@anchor{topics/types reflection-api}@anchor{96} +@subsection Reflection API + + +@geindex gcc_jit_type_dyncast_array (C function) +@anchor{topics/types c gcc_jit_type_dyncast_array}@anchor{97} +@deffn {C Function} gcc_jit_type * gcc_jit_type_dyncast_array (gcc_jit_type@w{ }*type) + +Get the element type of an array type or NULL if it’s not an array. +@end deffn + +@geindex gcc_jit_type_is_bool (C function) +@anchor{topics/types c gcc_jit_type_is_bool}@anchor{98} +@deffn {C Function} int gcc_jit_type_is_bool (gcc_jit_type@w{ }*type) + +Return non-zero if the type is a bool. +@end deffn + +@geindex gcc_jit_type_dyncast_function_ptr_type (C function) +@anchor{topics/types c gcc_jit_type_dyncast_function_ptr_type}@anchor{99} +@deffn {C Function} gcc_jit_function_type * gcc_jit_type_dyncast_function_ptr_type (gcc_jit_type@w{ }*type) + +Return the function type if it is one or NULL. +@end deffn + +@geindex gcc_jit_function_type_get_return_type (C function) +@anchor{topics/types c gcc_jit_function_type_get_return_type}@anchor{9a} +@deffn {C Function} gcc_jit_type * gcc_jit_function_type_get_return_type (gcc_jit_function_type@w{ }*function_type) + +Given a function type, return its return type. +@end deffn + +@geindex gcc_jit_function_type_get_param_count (C function) +@anchor{topics/types c gcc_jit_function_type_get_param_count}@anchor{9b} +@deffn {C Function} size_t gcc_jit_function_type_get_param_count (gcc_jit_function_type@w{ }*function_type) + +Given a function type, return its number of parameters. +@end deffn + +@geindex gcc_jit_function_type_get_param_type (C function) +@anchor{topics/types c gcc_jit_function_type_get_param_type}@anchor{9c} +@deffn {C Function} gcc_jit_type * gcc_jit_function_type_get_param_type (gcc_jit_function_type@w{ }*function_type, size_t@w{ }index) + +Given a function type, return the type of the specified parameter. +@end deffn + +@geindex gcc_jit_type_is_integral (C function) +@anchor{topics/types c gcc_jit_type_is_integral}@anchor{9d} +@deffn {C Function} int gcc_jit_type_is_integral (gcc_jit_type@w{ }*type) + +Return non-zero if the type is an integral. +@end deffn + +@geindex gcc_jit_type_is_pointer (C function) +@anchor{topics/types c gcc_jit_type_is_pointer}@anchor{9e} +@deffn {C Function} gcc_jit_type * gcc_jit_type_is_pointer (gcc_jit_type@w{ }*type) + +Return the type pointed by the pointer type or NULL if it’s not a pointer. +@end deffn + +@geindex gcc_jit_type_dyncast_vector (C function) +@anchor{topics/types c gcc_jit_type_dyncast_vector}@anchor{9f} +@deffn {C Function} gcc_jit_vector_type * gcc_jit_type_dyncast_vector (gcc_jit_type@w{ }*type) + +Given a type, return a dynamic cast to a vector type or NULL. +@end deffn + +@geindex gcc_jit_type_is_struct (C function) +@anchor{topics/types c gcc_jit_type_is_struct}@anchor{a0} +@deffn {C Function} gcc_jit_struct * gcc_jit_type_is_struct (gcc_jit_type@w{ }*type) + +Given a type, return a dynamic cast to a struct type or NULL. +@end deffn + +@geindex gcc_jit_vector_type_get_num_units (C function) +@anchor{topics/types c gcc_jit_vector_type_get_num_units}@anchor{a1} +@deffn {C Function} size_t gcc_jit_vector_type_get_num_units (gcc_jit_vector_type@w{ }*vector_type) + +Given a vector type, return the number of units it contains. +@end deffn + +@geindex gcc_jit_vector_type_get_element_type (C function) +@anchor{topics/types c gcc_jit_vector_type_get_element_type}@anchor{a2} +@deffn {C Function} gcc_jit_type * gcc_jit_vector_type_get_element_type (gcc_jit_vector_type *@w{ }vector_type) + +Given a vector type, return the type of its elements. +@end deffn + +@geindex gcc_jit_type_unqualified (C function) +@anchor{topics/types c gcc_jit_type_unqualified}@anchor{a3} +@deffn {C Function} gcc_jit_type * gcc_jit_type_unqualified (gcc_jit_type@w{ }*type) + +Given a type, return the unqualified type, removing “const”, “volatile” and +alignment qualifiers. +@end deffn + +@geindex gcc_jit_struct_get_field (C function) +@anchor{topics/types c gcc_jit_struct_get_field}@anchor{a4} +@deffn {C Function} gcc_jit_field * gcc_jit_struct_get_field (gcc_jit_struct@w{ }*struct_type, size_t@w{ }index) + +Get a struct field by index. +@end deffn + +@geindex gcc_jit_struct_get_field_count (C function) +@anchor{topics/types c gcc_jit_struct_get_field_count}@anchor{a5} +@deffn {C Function} size_t gcc_jit_struct_get_field_count (gcc_jit_struct@w{ }*struct_type) + +@quotation + +Get the number of fields in the struct. +@end quotation + +The API entrypoints related to the reflection API: + +@quotation + + +@itemize * + +@item +@ref{9a,,gcc_jit_function_type_get_return_type()} + +@item +@ref{9b,,gcc_jit_function_type_get_param_count()} + +@item +@ref{9c,,gcc_jit_function_type_get_param_type()} + +@item +@ref{a3,,gcc_jit_type_unqualified()} + +@item +@ref{97,,gcc_jit_type_dyncast_array()} + +@item +@ref{98,,gcc_jit_type_is_bool()} + +@item +@ref{99,,gcc_jit_type_dyncast_function_ptr_type()} + +@item +@ref{9d,,gcc_jit_type_is_integral()} + +@item +@ref{9e,,gcc_jit_type_is_pointer()} + +@item +@ref{9f,,gcc_jit_type_dyncast_vector()} + +@item +@ref{a2,,gcc_jit_vector_type_get_element_type()} + +@item +@ref{a1,,gcc_jit_vector_type_get_num_units()} + +@item +@ref{a4,,gcc_jit_struct_get_field()} + +@item +@ref{a0,,gcc_jit_type_is_struct()} + +@item +@ref{a5,,gcc_jit_struct_get_field_count()} +@end itemize +@end quotation + +were added in @ref{a6,,LIBGCCJIT_ABI_16}; you can test for their presence +using + +@example +#ifdef LIBGCCJIT_HAVE_REFLECTION +@end example + +@geindex gcc_jit_case (C type) +@anchor{topics/types c gcc_jit_case}@anchor{a7} +@deffn {C Type} gcc_jit_case +@end deffn +@end deffn + @c Copyright (C) 2014-2022 Free Software Foundation, Inc. @c Originally contributed by David Malcolm @c @@ -5886,7 +6078,7 @@ Function pointer types can be created using @c . @node Expressions,Creating and using functions,Types,Topic Reference -@anchor{topics/expressions doc}@anchor{96}@anchor{topics/expressions expressions}@anchor{97} +@anchor{topics/expressions doc}@anchor{a8}@anchor{topics/expressions expressions}@anchor{a9} @section Expressions @@ -5898,7 +6090,7 @@ Function pointer types can be created using @end menu @node Rvalues,Lvalues,,Expressions -@anchor{topics/expressions rvalues}@anchor{98} +@anchor{topics/expressions rvalues}@anchor{aa} @subsection Rvalues @@ -5907,7 +6099,7 @@ Function pointer types can be created using @deffn {C Type} gcc_jit_rvalue @end deffn -A @ref{13,,gcc_jit_rvalue *} is an expression that can be computed. +A @ref{13,,gcc_jit_rvalue} is an expression that can be computed. It can be simple, e.g.: @@ -5952,7 +6144,7 @@ Every rvalue has an associated type, and the API will check to ensure that types match up correctly (otherwise the context will emit an error). @geindex gcc_jit_rvalue_get_type (C function) -@anchor{topics/expressions c gcc_jit_rvalue_get_type}@anchor{99} +@anchor{topics/expressions c gcc_jit_rvalue_get_type}@anchor{ab} @deffn {C Function} gcc_jit_type *gcc_jit_rvalue_get_type (gcc_jit_rvalue@w{ }*rvalue) Get the type of this rvalue. @@ -5967,6 +6159,7 @@ Upcast the given rvalue to be an object. @menu * Simple expressions:: +* Constructor expressions:: * Vector expressions:: * Unary Operations:: * Binary Operations:: @@ -5977,8 +6170,8 @@ Upcast the given rvalue to be an object. @end menu -@node Simple expressions,Vector expressions,,Rvalues -@anchor{topics/expressions simple-expressions}@anchor{9a} +@node Simple expressions,Constructor expressions,,Rvalues +@anchor{topics/expressions simple-expressions}@anchor{ac} @subsubsection Simple expressions @@ -5991,7 +6184,7 @@ the given constant @code{int} value. @end deffn @geindex gcc_jit_context_new_rvalue_from_long (C function) -@anchor{topics/expressions c gcc_jit_context_new_rvalue_from_long}@anchor{9b} +@anchor{topics/expressions c gcc_jit_context_new_rvalue_from_long}@anchor{ad} @deffn {C Function} gcc_jit_rvalue * gcc_jit_context_new_rvalue_from_long (gcc_jit_context@w{ }*ctxt, gcc_jit_type@w{ }*numeric_type, long@w{ }value) Given a numeric type (integer or floating point), build an rvalue for @@ -6031,14 +6224,14 @@ the given constant @code{double} value. @end deffn @geindex gcc_jit_context_new_rvalue_from_ptr (C function) -@anchor{topics/expressions c gcc_jit_context_new_rvalue_from_ptr}@anchor{9c} +@anchor{topics/expressions c gcc_jit_context_new_rvalue_from_ptr}@anchor{ae} @deffn {C Function} gcc_jit_rvalue * gcc_jit_context_new_rvalue_from_ptr (gcc_jit_context@w{ }*ctxt, gcc_jit_type@w{ }*pointer_type, void@w{ }*value) Given a pointer type, build an rvalue for the given address. @end deffn @geindex gcc_jit_context_null (C function) -@anchor{topics/expressions c gcc_jit_context_null}@anchor{9d} +@anchor{topics/expressions c gcc_jit_context_null}@anchor{af} @deffn {C Function} gcc_jit_rvalue *gcc_jit_context_null (gcc_jit_context@w{ }*ctxt, gcc_jit_type@w{ }*pointer_type) Given a pointer type, build an rvalue for @code{NULL}. Essentially this @@ -6050,7 +6243,7 @@ gcc_jit_context_new_rvalue_from_ptr (ctxt, pointer_type, NULL) @end deffn @geindex gcc_jit_context_new_string_literal (C function) -@anchor{topics/expressions c gcc_jit_context_new_string_literal}@anchor{9e} +@anchor{topics/expressions c gcc_jit_context_new_string_literal}@anchor{b0} @deffn {C Function} gcc_jit_rvalue * gcc_jit_context_new_string_literal (gcc_jit_context@w{ }*ctxt, const char@w{ }*value) Generate an rvalue for the given NIL-terminated string, of type @@ -6061,8 +6254,150 @@ underlying string, so it is valid to pass in a pointer to an on-stack buffer. @end deffn -@node Vector expressions,Unary Operations,Simple expressions,Rvalues -@anchor{topics/expressions vector-expressions}@anchor{9f} +@node Constructor expressions,Vector expressions,Simple expressions,Rvalues +@anchor{topics/expressions constructor-expressions}@anchor{b1} +@subsubsection Constructor expressions + + +@quotation + +The following functions make constructors for array, struct and union +types. + +The constructor rvalue can be used for assignment to locals. +It can be used to initialize global variables with +@ref{b2,,gcc_jit_global_set_initializer_rvalue()}. It can also be used as a +temporary value for function calls and return values, but its address +can’t be taken. + +Note that arrays in libgccjit do not collapse to pointers like in +C. I.e. if an array constructor is used as e.g. a return value, the whole +array would be returned by value - array constructors can be assigned to +array variables. + +The constructor can contain nested constructors. + +Note that a string literal rvalue can’t be used to construct a char array; +the latter needs one rvalue for each char. + +These entrypoints were added in @ref{b3,,LIBGCCJIT_ABI_19}; you can test for +their presence using: + +@example +#ifdef LIBGCCJIT_HAVE_CTORS +@end example +@end quotation + +@geindex gcc_jit_context_new_array_constructor (C function) +@anchor{topics/expressions c gcc_jit_context_new_array_constructor}@anchor{b4} +@deffn {C Function} gcc_jit_rvalue * gcc_jit_context_new_array_constructor (gcc_jit_context@w{ }*ctxt, gcc_jit_location@w{ }*loc, gcc_jit_type@w{ }*type, size_t@w{ }num_values, gcc_jit_rvalue@w{ }**values) + +Create a constructor for an array as an rvalue. + +Returns NULL on error. @code{values} are copied and +do not have to outlive the context. + +@code{type} specifies what the constructor will build and has to be +an array. + +@code{num_values} specifies the number of elements in @code{values} and +it can’t have more elements than the array type. + +Each value in @code{values} sets the corresponding value in the array. +If the array type itself has more elements than @code{values}, the +left-over elements will be zeroed. + +Each value in @code{values} need to be the same unqualified type as the +array type’s element type. + +If @code{num_values} is 0, the @code{values} parameter will be +ignored and zero initialization will be used. + +This entrypoint was added in @ref{b3,,LIBGCCJIT_ABI_19}; you can test for its +presence using: + +@example +#ifdef LIBGCCJIT_HAVE_CTORS +@end example +@end deffn + +@geindex gcc_jit_context_new_struct_constructor (C function) +@anchor{topics/expressions c gcc_jit_context_new_struct_constructor}@anchor{b5} +@deffn {C Function} gcc_jit_rvalue * gcc_jit_context_new_struct_constructor (gcc_jit_context@w{ }*ctxt, gcc_jit_location@w{ }*loc, gcc_jit_type@w{ }*type, size_t@w{ }num_values, gcc_jit_field@w{ }**fields, gcc_jit_rvalue@w{ }**values) + +Create a constructor for a struct as an rvalue. + +Returns NULL on error. The two parameter arrays are copied and +do not have to outlive the context. + +@code{type} specifies what the constructor will build and has to be +a struct. + +@code{num_values} specifies the number of elements in @code{values}. + +@code{fields} need to have the same length as @code{values}, or be NULL. + +If @code{fields} is null, the values are applied in definition order. + +Otherwise, each field in @code{fields} specifies which field in the struct to +set to the corresponding value in @code{values}. @code{fields} and @code{values} +are paired by index. + +The fields in @code{fields} have to be in definition order, but there +can be gaps. Any field in the struct that is not specified in +@code{fields} will be zeroed. + +The fields in @code{fields} need to be the same objects that were used +to create the struct. + +Each value has to have have the same unqualified type as the field +it is applied to. + +A NULL value element in @code{values} is a shorthand for zero initialization +of the corresponding field. + +If @code{num_values} is 0, the array parameters will be +ignored and zero initialization will be used. + +This entrypoint was added in @ref{b3,,LIBGCCJIT_ABI_19}; you can test for its +presence using: + +@example +#ifdef LIBGCCJIT_HAVE_CTORS +@end example +@end deffn + +@geindex gcc_jit_context_new_union_constructor (C function) +@anchor{topics/expressions c gcc_jit_context_new_union_constructor}@anchor{b6} +@deffn {C Function} gcc_jit_rvalue * gcc_jit_context_new_union_constructor (gcc_jit_context@w{ }*ctxt, gcc_jit_location@w{ }*loc, gcc_jit_type@w{ }*type, gcc_jit_field@w{ }*field, gcc_jit_rvalue@w{ }*value) + +Create a constructor for a union as an rvalue. + +Returns NULL on error. + +@code{type} specifies what the constructor will build and has to be +an union. + +@code{field} specifies which field to set. If it is NULL, the first +field in the union will be set.`@w{`}field`@w{`} need to be the same object +that were used to create the union. + +@code{value} specifies what value to set the corresponding field to. +If @code{value} is NULL, zero initialization will be used. + +Each value has to have have the same unqualified type as the field +it is applied to. + +This entrypoint was added in @ref{b3,,LIBGCCJIT_ABI_19}; you can test for its +presence using: + +@example +#ifdef LIBGCCJIT_HAVE_CTORS +@end example +@end deffn + +@node Vector expressions,Unary Operations,Constructor expressions,Rvalues +@anchor{topics/expressions vector-expressions}@anchor{b7} @subsubsection Vector expressions @@ -6077,7 +6412,7 @@ Build a vector rvalue from an array of elements. “num_elements” should match that of the vector type. -This entrypoint was added in @ref{a0,,LIBGCCJIT_ABI_10}; you can test for +This entrypoint was added in @ref{b8,,LIBGCCJIT_ABI_10}; you can test for its presence using @example @@ -6086,12 +6421,12 @@ its presence using @end deffn @node Unary Operations,Binary Operations,Vector expressions,Rvalues -@anchor{topics/expressions unary-operations}@anchor{a1} +@anchor{topics/expressions unary-operations}@anchor{b9} @subsubsection Unary Operations @geindex gcc_jit_context_new_unary_op (C function) -@anchor{topics/expressions c gcc_jit_context_new_unary_op}@anchor{a2} +@anchor{topics/expressions c gcc_jit_context_new_unary_op}@anchor{ba} @deffn {C Function} gcc_jit_rvalue * gcc_jit_context_new_unary_op (gcc_jit_context@w{ }*ctxt, gcc_jit_location@w{ }*loc, enum gcc_jit_unary_op@w{ }op, gcc_jit_type@w{ }*result_type, gcc_jit_rvalue@w{ }*rvalue) Build a unary operation out of an input rvalue. @@ -6100,7 +6435,7 @@ The parameter @code{result_type} must be a numeric type. @end deffn @geindex gcc_jit_unary_op (C type) -@anchor{topics/expressions c gcc_jit_unary_op}@anchor{a3} +@anchor{topics/expressions c gcc_jit_unary_op}@anchor{bb} @deffn {C Type} enum gcc_jit_unary_op @end deffn @@ -6118,7 +6453,7 @@ C equivalent @item -@ref{a4,,GCC_JIT_UNARY_OP_MINUS} +@ref{bc,,GCC_JIT_UNARY_OP_MINUS} @tab @@ -6126,7 +6461,7 @@ C equivalent @item -@ref{a5,,GCC_JIT_UNARY_OP_BITWISE_NEGATE} +@ref{bd,,GCC_JIT_UNARY_OP_BITWISE_NEGATE} @tab @@ -6134,7 +6469,7 @@ C equivalent @item -@ref{a6,,GCC_JIT_UNARY_OP_LOGICAL_NEGATE} +@ref{be,,GCC_JIT_UNARY_OP_LOGICAL_NEGATE} @tab @@ -6142,7 +6477,7 @@ C equivalent @item -@ref{a7,,GCC_JIT_UNARY_OP_ABS} +@ref{bf,,GCC_JIT_UNARY_OP_ABS} @tab @@ -6152,7 +6487,7 @@ C equivalent @geindex GCC_JIT_UNARY_OP_MINUS (C macro) -@anchor{topics/expressions c GCC_JIT_UNARY_OP_MINUS}@anchor{a4} +@anchor{topics/expressions c GCC_JIT_UNARY_OP_MINUS}@anchor{bc} @deffn {C Macro} GCC_JIT_UNARY_OP_MINUS Negate an arithmetic value; analogous to: @@ -6165,7 +6500,7 @@ in C. @end deffn @geindex GCC_JIT_UNARY_OP_BITWISE_NEGATE (C macro) -@anchor{topics/expressions c GCC_JIT_UNARY_OP_BITWISE_NEGATE}@anchor{a5} +@anchor{topics/expressions c GCC_JIT_UNARY_OP_BITWISE_NEGATE}@anchor{bd} @deffn {C Macro} GCC_JIT_UNARY_OP_BITWISE_NEGATE Bitwise negation of an integer value (one’s complement); analogous @@ -6179,7 +6514,7 @@ in C. @end deffn @geindex GCC_JIT_UNARY_OP_LOGICAL_NEGATE (C macro) -@anchor{topics/expressions c GCC_JIT_UNARY_OP_LOGICAL_NEGATE}@anchor{a6} +@anchor{topics/expressions c GCC_JIT_UNARY_OP_LOGICAL_NEGATE}@anchor{be} @deffn {C Macro} GCC_JIT_UNARY_OP_LOGICAL_NEGATE Logical negation of an arithmetic or pointer value; analogous to: @@ -6192,7 +6527,7 @@ in C. @end deffn @geindex GCC_JIT_UNARY_OP_ABS (C macro) -@anchor{topics/expressions c GCC_JIT_UNARY_OP_ABS}@anchor{a7} +@anchor{topics/expressions c GCC_JIT_UNARY_OP_ABS}@anchor{bf} @deffn {C Macro} GCC_JIT_UNARY_OP_ABS Absolute value of an arithmetic expression; analogous to: @@ -6205,7 +6540,7 @@ in C. @end deffn @node Binary Operations,Comparisons,Unary Operations,Rvalues -@anchor{topics/expressions binary-operations}@anchor{a8} +@anchor{topics/expressions binary-operations}@anchor{c0} @subsubsection Binary Operations @@ -6219,7 +6554,7 @@ The parameter @code{result_type} must be a numeric type. @end deffn @geindex gcc_jit_binary_op (C type) -@anchor{topics/expressions c gcc_jit_binary_op}@anchor{a9} +@anchor{topics/expressions c gcc_jit_binary_op}@anchor{c1} @deffn {C Type} enum gcc_jit_binary_op @end deffn @@ -6237,7 +6572,7 @@ C equivalent @item -@ref{aa,,GCC_JIT_BINARY_OP_PLUS} +@ref{c2,,GCC_JIT_BINARY_OP_PLUS} @tab @@ -6245,7 +6580,7 @@ C equivalent @item -@ref{ab,,GCC_JIT_BINARY_OP_MINUS} +@ref{c3,,GCC_JIT_BINARY_OP_MINUS} @tab @@ -6253,7 +6588,7 @@ C equivalent @item -@ref{ac,,GCC_JIT_BINARY_OP_MULT} +@ref{c4,,GCC_JIT_BINARY_OP_MULT} @tab @@ -6261,7 +6596,7 @@ C equivalent @item -@ref{ad,,GCC_JIT_BINARY_OP_DIVIDE} +@ref{c5,,GCC_JIT_BINARY_OP_DIVIDE} @tab @@ -6269,7 +6604,7 @@ C equivalent @item -@ref{ae,,GCC_JIT_BINARY_OP_MODULO} +@ref{c6,,GCC_JIT_BINARY_OP_MODULO} @tab @@ -6277,7 +6612,7 @@ C equivalent @item -@ref{af,,GCC_JIT_BINARY_OP_BITWISE_AND} +@ref{c7,,GCC_JIT_BINARY_OP_BITWISE_AND} @tab @@ -6285,7 +6620,7 @@ C equivalent @item -@ref{b0,,GCC_JIT_BINARY_OP_BITWISE_XOR} +@ref{c8,,GCC_JIT_BINARY_OP_BITWISE_XOR} @tab @@ -6293,7 +6628,7 @@ C equivalent @item -@ref{b1,,GCC_JIT_BINARY_OP_BITWISE_OR} +@ref{c9,,GCC_JIT_BINARY_OP_BITWISE_OR} @tab @@ -6301,7 +6636,7 @@ C equivalent @item -@ref{b2,,GCC_JIT_BINARY_OP_LOGICAL_AND} +@ref{ca,,GCC_JIT_BINARY_OP_LOGICAL_AND} @tab @@ -6309,7 +6644,7 @@ C equivalent @item -@ref{b3,,GCC_JIT_BINARY_OP_LOGICAL_OR} +@ref{cb,,GCC_JIT_BINARY_OP_LOGICAL_OR} @tab @@ -6317,7 +6652,7 @@ C equivalent @item -@ref{b4,,GCC_JIT_BINARY_OP_LSHIFT} +@ref{cc,,GCC_JIT_BINARY_OP_LSHIFT} @tab @@ -6325,7 +6660,7 @@ C equivalent @item -@ref{b5,,GCC_JIT_BINARY_OP_RSHIFT} +@ref{cd,,GCC_JIT_BINARY_OP_RSHIFT} @tab @@ -6335,7 +6670,7 @@ C equivalent @geindex GCC_JIT_BINARY_OP_PLUS (C macro) -@anchor{topics/expressions c GCC_JIT_BINARY_OP_PLUS}@anchor{aa} +@anchor{topics/expressions c GCC_JIT_BINARY_OP_PLUS}@anchor{c2} @deffn {C Macro} GCC_JIT_BINARY_OP_PLUS Addition of arithmetic values; analogous to: @@ -6346,11 +6681,11 @@ Addition of arithmetic values; analogous to: in C. -For pointer addition, use @ref{b6,,gcc_jit_context_new_array_access()}. +For pointer addition, use @ref{ce,,gcc_jit_context_new_array_access()}. @end deffn @geindex GCC_JIT_BINARY_OP_MINUS (C macro) -@anchor{topics/expressions c GCC_JIT_BINARY_OP_MINUS}@anchor{ab} +@anchor{topics/expressions c GCC_JIT_BINARY_OP_MINUS}@anchor{c3} @deffn {C Macro} GCC_JIT_BINARY_OP_MINUS Subtraction of arithmetic values; analogous to: @@ -6363,7 +6698,7 @@ in C. @end deffn @geindex GCC_JIT_BINARY_OP_MULT (C macro) -@anchor{topics/expressions c GCC_JIT_BINARY_OP_MULT}@anchor{ac} +@anchor{topics/expressions c GCC_JIT_BINARY_OP_MULT}@anchor{c4} @deffn {C Macro} GCC_JIT_BINARY_OP_MULT Multiplication of a pair of arithmetic values; analogous to: @@ -6376,7 +6711,7 @@ in C. @end deffn @geindex GCC_JIT_BINARY_OP_DIVIDE (C macro) -@anchor{topics/expressions c GCC_JIT_BINARY_OP_DIVIDE}@anchor{ad} +@anchor{topics/expressions c GCC_JIT_BINARY_OP_DIVIDE}@anchor{c5} @deffn {C Macro} GCC_JIT_BINARY_OP_DIVIDE Quotient of division of arithmetic values; analogous to: @@ -6393,7 +6728,7 @@ a floating-point result type indicates floating-point division. @end deffn @geindex GCC_JIT_BINARY_OP_MODULO (C macro) -@anchor{topics/expressions c GCC_JIT_BINARY_OP_MODULO}@anchor{ae} +@anchor{topics/expressions c GCC_JIT_BINARY_OP_MODULO}@anchor{c6} @deffn {C Macro} GCC_JIT_BINARY_OP_MODULO Remainder of division of arithmetic values; analogous to: @@ -6406,7 +6741,7 @@ in C. @end deffn @geindex GCC_JIT_BINARY_OP_BITWISE_AND (C macro) -@anchor{topics/expressions c GCC_JIT_BINARY_OP_BITWISE_AND}@anchor{af} +@anchor{topics/expressions c GCC_JIT_BINARY_OP_BITWISE_AND}@anchor{c7} @deffn {C Macro} GCC_JIT_BINARY_OP_BITWISE_AND Bitwise AND; analogous to: @@ -6419,7 +6754,7 @@ in C. @end deffn @geindex GCC_JIT_BINARY_OP_BITWISE_XOR (C macro) -@anchor{topics/expressions c GCC_JIT_BINARY_OP_BITWISE_XOR}@anchor{b0} +@anchor{topics/expressions c GCC_JIT_BINARY_OP_BITWISE_XOR}@anchor{c8} @deffn {C Macro} GCC_JIT_BINARY_OP_BITWISE_XOR Bitwise exclusive OR; analogous to: @@ -6432,7 +6767,7 @@ in C. @end deffn @geindex GCC_JIT_BINARY_OP_BITWISE_OR (C macro) -@anchor{topics/expressions c GCC_JIT_BINARY_OP_BITWISE_OR}@anchor{b1} +@anchor{topics/expressions c GCC_JIT_BINARY_OP_BITWISE_OR}@anchor{c9} @deffn {C Macro} GCC_JIT_BINARY_OP_BITWISE_OR Bitwise inclusive OR; analogous to: @@ -6445,7 +6780,7 @@ in C. @end deffn @geindex GCC_JIT_BINARY_OP_LOGICAL_AND (C macro) -@anchor{topics/expressions c GCC_JIT_BINARY_OP_LOGICAL_AND}@anchor{b2} +@anchor{topics/expressions c GCC_JIT_BINARY_OP_LOGICAL_AND}@anchor{ca} @deffn {C Macro} GCC_JIT_BINARY_OP_LOGICAL_AND Logical AND; analogous to: @@ -6458,7 +6793,7 @@ in C. @end deffn @geindex GCC_JIT_BINARY_OP_LOGICAL_OR (C macro) -@anchor{topics/expressions c GCC_JIT_BINARY_OP_LOGICAL_OR}@anchor{b3} +@anchor{topics/expressions c GCC_JIT_BINARY_OP_LOGICAL_OR}@anchor{cb} @deffn {C Macro} GCC_JIT_BINARY_OP_LOGICAL_OR Logical OR; analogous to: @@ -6471,7 +6806,7 @@ in C. @end deffn @geindex GCC_JIT_BINARY_OP_LSHIFT (C macro) -@anchor{topics/expressions c GCC_JIT_BINARY_OP_LSHIFT}@anchor{b4} +@anchor{topics/expressions c GCC_JIT_BINARY_OP_LSHIFT}@anchor{cc} @deffn {C Macro} GCC_JIT_BINARY_OP_LSHIFT Left shift; analogous to: @@ -6484,7 +6819,7 @@ in C. @end deffn @geindex GCC_JIT_BINARY_OP_RSHIFT (C macro) -@anchor{topics/expressions c GCC_JIT_BINARY_OP_RSHIFT}@anchor{b5} +@anchor{topics/expressions c GCC_JIT_BINARY_OP_RSHIFT}@anchor{cd} @deffn {C Macro} GCC_JIT_BINARY_OP_RSHIFT Right shift; analogous to: @@ -6497,7 +6832,7 @@ in C. @end deffn @node Comparisons,Function calls,Binary Operations,Rvalues -@anchor{topics/expressions comparisons}@anchor{b7} +@anchor{topics/expressions comparisons}@anchor{cf} @subsubsection Comparisons @@ -6509,7 +6844,7 @@ Build a boolean rvalue out of the comparison of two other rvalues. @end deffn @geindex gcc_jit_comparison (C type) -@anchor{topics/expressions c gcc_jit_comparison}@anchor{b8} +@anchor{topics/expressions c gcc_jit_comparison}@anchor{d0} @deffn {C Type} enum gcc_jit_comparison @end deffn @@ -6575,12 +6910,12 @@ C equivalent @node Function calls,Function pointers,Comparisons,Rvalues -@anchor{topics/expressions function-calls}@anchor{b9} +@anchor{topics/expressions function-calls}@anchor{d1} @subsubsection Function calls @geindex gcc_jit_context_new_call (C function) -@anchor{topics/expressions c gcc_jit_context_new_call}@anchor{ba} +@anchor{topics/expressions c gcc_jit_context_new_call}@anchor{d2} @deffn {C Function} gcc_jit_rvalue * gcc_jit_context_new_call (gcc_jit_context@w{ }*ctxt, gcc_jit_location@w{ }*loc, gcc_jit_function@w{ }*func, int@w{ }numargs, gcc_jit_rvalue@w{ }**args) Given a function and the given table of argument rvalues, construct a @@ -6588,7 +6923,7 @@ call to the function, with the result as an rvalue. @cartouche @quotation Note -@ref{ba,,gcc_jit_context_new_call()} merely builds a +@ref{d2,,gcc_jit_context_new_call()} merely builds a @ref{13,,gcc_jit_rvalue} i.e. an expression that can be evaluated, perhaps as part of a more complicated expression. The call @emph{won’t} happen unless you add a statement to a function @@ -6596,7 +6931,7 @@ that evaluates the expression. For example, if you want to call a function and discard the result (or to call a function with @code{void} return type), use -@ref{bb,,gcc_jit_block_add_eval()}: +@ref{d3,,gcc_jit_block_add_eval()}: @example /* Add "(void)printf (arg0, arg1);". */ @@ -6613,7 +6948,7 @@ gcc_jit_block_add_eval ( @end deffn @geindex gcc_jit_context_new_call_through_ptr (C function) -@anchor{topics/expressions c gcc_jit_context_new_call_through_ptr}@anchor{bc} +@anchor{topics/expressions c gcc_jit_context_new_call_through_ptr}@anchor{d4} @deffn {C Function} gcc_jit_rvalue * gcc_jit_context_new_call_through_ptr (gcc_jit_context@w{ }*ctxt, gcc_jit_location@w{ }*loc, gcc_jit_rvalue@w{ }*fn_ptr, int@w{ }numargs, gcc_jit_rvalue@w{ }**args) Given an rvalue of function pointer type (e.g. from @@ -6623,18 +6958,18 @@ result as an rvalue. @cartouche @quotation Note -The same caveat as for @ref{ba,,gcc_jit_context_new_call()} applies. +The same caveat as for @ref{d2,,gcc_jit_context_new_call()} applies. @end quotation @end cartouche @end deffn @geindex gcc_jit_rvalue_set_bool_require_tail_call (C function) -@anchor{topics/expressions c gcc_jit_rvalue_set_bool_require_tail_call}@anchor{bd} +@anchor{topics/expressions c gcc_jit_rvalue_set_bool_require_tail_call}@anchor{d5} @deffn {C Function} void gcc_jit_rvalue_set_bool_require_tail_call (gcc_jit_rvalue@w{ }*call, int@w{ }require_tail_call) -Given an @ref{13,,gcc_jit_rvalue *} for a call created through -@ref{ba,,gcc_jit_context_new_call()} or -@ref{bc,,gcc_jit_context_new_call_through_ptr()}, mark/clear the +Given an @ref{13,,gcc_jit_rvalue} for a call created through +@ref{d2,,gcc_jit_context_new_call()} or +@ref{d4,,gcc_jit_context_new_call_through_ptr()}, mark/clear the call as needing tail-call optimization. The optimizer will attempt to optimize the call into a jump instruction; if it is unable to do do, an error will be emitted. @@ -6646,7 +6981,7 @@ languages), in which every function “returns” by calling a guaranteed to be implemented as a jump, otherwise the program could consume an arbitrary amount of stack space as it executed. -This entrypoint was added in @ref{be,,LIBGCCJIT_ABI_6}; you can test for +This entrypoint was added in @ref{d6,,LIBGCCJIT_ABI_6}; you can test for its presence using @example @@ -6655,7 +6990,7 @@ its presence using @end deffn @node Function pointers,Type-coercion,Function calls,Rvalues -@anchor{topics/expressions function-pointers}@anchor{bf} +@anchor{topics/expressions function-pointers}@anchor{d7} @subsubsection Function pointers @@ -6668,23 +7003,23 @@ Function pointers can be obtained: @item from a @ref{29,,gcc_jit_function} using -@ref{c0,,gcc_jit_function_get_address()}, or +@ref{d8,,gcc_jit_function_get_address()}, or @item from an existing function using -@ref{9c,,gcc_jit_context_new_rvalue_from_ptr()}, +@ref{ae,,gcc_jit_context_new_rvalue_from_ptr()}, using a function pointer type obtained using @ref{95,,gcc_jit_context_new_function_ptr_type()}. @end itemize @end quotation @node Type-coercion,,Function pointers,Rvalues -@anchor{topics/expressions type-coercion}@anchor{c1} +@anchor{topics/expressions type-coercion}@anchor{d9} @subsubsection Type-coercion @geindex gcc_jit_context_new_cast (C function) -@anchor{topics/expressions c gcc_jit_context_new_cast}@anchor{c2} +@anchor{topics/expressions c gcc_jit_context_new_cast}@anchor{da} @deffn {C Function} gcc_jit_rvalue * gcc_jit_context_new_cast (gcc_jit_context@w{ }*ctxt, gcc_jit_location@w{ }*loc, gcc_jit_rvalue@w{ }*rvalue, gcc_jit_type@w{ }*type) Given an rvalue of T, construct another rvalue of another type. @@ -6709,7 +7044,7 @@ P* <-> Q*, for pointer types P and Q @end deffn @node Lvalues,Working with pointers structs and unions,Rvalues,Expressions -@anchor{topics/expressions lvalues}@anchor{c3} +@anchor{topics/expressions lvalues}@anchor{db} @subsection Lvalues @@ -6723,21 +7058,21 @@ a storage area (such as a variable). It is also usable as an rvalue, where the rvalue is computed by reading from the storage area. @geindex gcc_jit_lvalue_as_object (C function) -@anchor{topics/expressions c gcc_jit_lvalue_as_object}@anchor{c4} +@anchor{topics/expressions c gcc_jit_lvalue_as_object}@anchor{dc} @deffn {C Function} gcc_jit_object * gcc_jit_lvalue_as_object (gcc_jit_lvalue@w{ }*lvalue) Upcast an lvalue to be an object. @end deffn @geindex gcc_jit_lvalue_as_rvalue (C function) -@anchor{topics/expressions c gcc_jit_lvalue_as_rvalue}@anchor{c5} +@anchor{topics/expressions c gcc_jit_lvalue_as_rvalue}@anchor{dd} @deffn {C Function} gcc_jit_rvalue * gcc_jit_lvalue_as_rvalue (gcc_jit_lvalue@w{ }*lvalue) Upcast an lvalue to be an rvalue. @end deffn @geindex gcc_jit_lvalue_get_address (C function) -@anchor{topics/expressions c gcc_jit_lvalue_get_address}@anchor{c6} +@anchor{topics/expressions c gcc_jit_lvalue_get_address}@anchor{de} @deffn {C Function} gcc_jit_rvalue * gcc_jit_lvalue_get_address (gcc_jit_lvalue@w{ }*lvalue, gcc_jit_location@w{ }*loc) Take the address of an lvalue; analogous to: @@ -6749,18 +7084,96 @@ Take the address of an lvalue; analogous to: in C. @end deffn +@geindex gcc_jit_lvalue_set_tls_model (C function) +@anchor{topics/expressions c gcc_jit_lvalue_set_tls_model}@anchor{df} +@deffn {C Function} void gcc_jit_lvalue_set_tls_model (gcc_jit_lvalue@w{ }*lvalue, enum gcc_jit_tls_model@w{ }model) + +Make a variable a thread-local variable. + +The “model” parameter determines the thread-local storage model of the “lvalue”: + +@geindex gcc_jit_tls_model (C type) +@anchor{topics/expressions c gcc_jit_tls_model}@anchor{e0} +@deffn {C Type} enum gcc_jit_tls_model +@end deffn + +@geindex GCC_JIT_TLS_MODEL_NONE (C macro) +@anchor{topics/expressions c GCC_JIT_TLS_MODEL_NONE}@anchor{e1} +@deffn {C Macro} GCC_JIT_TLS_MODEL_NONE + +Don’t set the TLS model. +@end deffn + +@geindex GCC_JIT_TLS_MODEL_GLOBAL_DYNAMIC (C macro) +@anchor{topics/expressions c GCC_JIT_TLS_MODEL_GLOBAL_DYNAMIC}@anchor{e2} +@deffn {C Macro} GCC_JIT_TLS_MODEL_GLOBAL_DYNAMIC +@end deffn + +@geindex GCC_JIT_TLS_MODEL_LOCAL_DYNAMIC (C macro) +@anchor{topics/expressions c GCC_JIT_TLS_MODEL_LOCAL_DYNAMIC}@anchor{e3} +@deffn {C Macro} GCC_JIT_TLS_MODEL_LOCAL_DYNAMIC +@end deffn + +@geindex GCC_JIT_TLS_MODEL_INITIAL_EXEC (C macro) +@anchor{topics/expressions c GCC_JIT_TLS_MODEL_INITIAL_EXEC}@anchor{e4} +@deffn {C Macro} GCC_JIT_TLS_MODEL_INITIAL_EXEC +@end deffn + +@geindex GCC_JIT_TLS_MODEL_LOCAL_EXEC (C macro) +@anchor{topics/expressions c GCC_JIT_TLS_MODEL_LOCAL_EXEC}@anchor{e5} +@deffn {C Macro} GCC_JIT_TLS_MODEL_LOCAL_EXEC +@end deffn + +This is analogous to: + +@example +_Thread_local int foo __attribute__ ((tls_model("MODEL"))); +@end example + +in C. + +This entrypoint was added in @ref{e6,,LIBGCCJIT_ABI_17}; you can test for +its presence using + +@example +#ifdef LIBGCCJIT_HAVE_gcc_jit_lvalue_set_tls_model +@end example +@end deffn + +@geindex gcc_jit_lvalue_set_link_section (C function) +@anchor{topics/expressions c gcc_jit_lvalue_set_link_section}@anchor{e7} +@deffn {C Function} void gcc_jit_lvalue_set_link_section (gcc_jit_lvalue@w{ }*lvalue, const char@w{ }*section_name) + +Set the link section of a variable. +The parameter @code{section_name} must be non-NULL and must contain the +leading dot. Analogous to: + +@example +int variable __attribute__((section(".section"))); +@end example + +in C. + +This entrypoint was added in @ref{e8,,LIBGCCJIT_ABI_18}; you can test for +its presence using + +@example +#ifdef LIBGCCJIT_HAVE_gcc_jit_lvalue_set_link_section +@end example +@end deffn + @menu * Global variables:: @end menu @node Global variables,,,Lvalues -@anchor{topics/expressions global-variables}@anchor{c7} +@anchor{topics/expressions global-variables}@anchor{e9} @subsubsection Global variables @geindex gcc_jit_context_new_global (C function) -@anchor{topics/expressions c gcc_jit_context_new_global}@anchor{c8} +@anchor{topics/expressions c gcc_jit_context_new_global}@anchor{ea} @deffn {C Function} gcc_jit_lvalue * gcc_jit_context_new_global (gcc_jit_context@w{ }*ctxt, gcc_jit_location@w{ }*loc, enum gcc_jit_global_kind@w{ }kind, gcc_jit_type@w{ }*type, const char@w{ }*name) Add a new global variable of the given type and name to the context. @@ -6775,22 +7188,22 @@ The “kind” parameter determines the visibility of the “global” outside of the @ref{16,,gcc_jit_result}: @geindex gcc_jit_global_kind (C type) -@anchor{topics/expressions c gcc_jit_global_kind}@anchor{c9} +@anchor{topics/expressions c gcc_jit_global_kind}@anchor{eb} @deffn {C Type} enum gcc_jit_global_kind @end deffn @geindex GCC_JIT_GLOBAL_EXPORTED (C macro) -@anchor{topics/expressions c GCC_JIT_GLOBAL_EXPORTED}@anchor{ca} +@anchor{topics/expressions c GCC_JIT_GLOBAL_EXPORTED}@anchor{ec} @deffn {C Macro} GCC_JIT_GLOBAL_EXPORTED Global is defined by the client code and is visible by name outside of this JIT context via -@ref{cb,,gcc_jit_result_get_global()} (and this value is required for +@ref{ed,,gcc_jit_result_get_global()} (and this value is required for the global to be accessible via that entrypoint). @end deffn @geindex GCC_JIT_GLOBAL_INTERNAL (C macro) -@anchor{topics/expressions c GCC_JIT_GLOBAL_INTERNAL}@anchor{cc} +@anchor{topics/expressions c GCC_JIT_GLOBAL_INTERNAL}@anchor{ee} @deffn {C Macro} GCC_JIT_GLOBAL_INTERNAL Global is defined by the client code, but is invisible @@ -6800,7 +7213,7 @@ context and within child contexts. @end deffn @geindex GCC_JIT_GLOBAL_IMPORTED (C macro) -@anchor{topics/expressions c GCC_JIT_GLOBAL_IMPORTED}@anchor{cd} +@anchor{topics/expressions c GCC_JIT_GLOBAL_IMPORTED}@anchor{ef} @deffn {C Macro} GCC_JIT_GLOBAL_IMPORTED Global is not defined by the client code; we’re merely @@ -6810,7 +7223,7 @@ header file. @end deffn @geindex gcc_jit_global_set_initializer (C function) -@anchor{topics/expressions c gcc_jit_global_set_initializer}@anchor{ce} +@anchor{topics/expressions c gcc_jit_global_set_initializer}@anchor{f0} @deffn {C Function} gcc_jit_lvalue * gcc_jit_global_set_initializer (gcc_jit_lvalue@w{ }*global, const void@w{ }*blob, size_t@w{ }num_bytes) Set an initializer for @code{global} using the memory content pointed @@ -6822,7 +7235,7 @@ pointed by @code{blob} for @code{num_bytes} bytes, so it is valid to pass in a pointer to an on-stack buffer. The content will be stored in the compilation unit and used as initialization value of the array. -This entrypoint was added in @ref{cf,,LIBGCCJIT_ABI_14}; you can test for +This entrypoint was added in @ref{f1,,LIBGCCJIT_ABI_14}; you can test for its presence using @example @@ -6830,13 +7243,47 @@ its presence using @end example @end deffn +@geindex gcc_jit_global_set_initializer_rvalue (C function) +@anchor{topics/expressions c gcc_jit_global_set_initializer_rvalue}@anchor{b2} +@deffn {C Function} gcc_jit_lvalue * gcc_jit_global_set_initializer_rvalue (gcc_jit_lvalue@w{ }*global, gcc_jit_rvalue@w{ }*init_value) + +Set the initial value of a global with an rvalue. + +The rvalue needs to be a constant expression, e.g. no function calls. + +The global can’t have the @code{kind} @ref{ef,,GCC_JIT_GLOBAL_IMPORTED}. + +As a non-comprehensive example it is OK to do the equivalent of: + +@example +int foo = 3 * 2; /* rvalue from gcc_jit_context_new_binary_op. */ +int arr[] = @{1,2,3,4@}; /* rvalue from gcc_jit_context_new_constructor. */ +int *bar = &arr[2] + 1; /* rvalue from nested "get address" of "array access". */ +const int baz = 3; /* rvalue from gcc_jit_context_rvalue_from_int. */ +int boz = baz; /* rvalue from gcc_jit_lvalue_as_rvalue. */ +@end example + +Use together with @ref{b5,,gcc_jit_context_new_struct_constructor()}, +@ref{b6,,gcc_jit_context_new_union_constructor()}, @ref{b4,,gcc_jit_context_new_array_constructor()} +to initialize structs, unions and arrays. + +On success, returns the @code{global} parameter unchanged. Otherwise, @code{NULL}. + +This entrypoint was added in @ref{b3,,LIBGCCJIT_ABI_19}; you can test for its +presence using: + +@example +#ifdef LIBGCCJIT_HAVE_CTORS +@end example +@end deffn + @node Working with pointers structs and unions,,Lvalues,Expressions -@anchor{topics/expressions working-with-pointers-structs-and-unions}@anchor{d0} +@anchor{topics/expressions working-with-pointers-structs-and-unions}@anchor{f2} @subsection Working with pointers, structs and unions @geindex gcc_jit_rvalue_dereference (C function) -@anchor{topics/expressions c gcc_jit_rvalue_dereference}@anchor{d1} +@anchor{topics/expressions c gcc_jit_rvalue_dereference}@anchor{f3} @deffn {C Function} gcc_jit_lvalue * gcc_jit_rvalue_dereference (gcc_jit_rvalue@w{ }*rvalue, gcc_jit_location@w{ }*loc) Given an rvalue of pointer type @code{T *}, dereferencing the pointer, @@ -6852,7 +7299,7 @@ in C. Field access is provided separately for both lvalues and rvalues. @geindex gcc_jit_lvalue_access_field (C function) -@anchor{topics/expressions c gcc_jit_lvalue_access_field}@anchor{d2} +@anchor{topics/expressions c gcc_jit_lvalue_access_field}@anchor{f4} @deffn {C Function} gcc_jit_lvalue * gcc_jit_lvalue_access_field (gcc_jit_lvalue@w{ }*struct_, gcc_jit_location@w{ }*loc, gcc_jit_field@w{ }*field) Given an lvalue of struct or union type, access the given field, @@ -6866,7 +7313,7 @@ in C. @end deffn @geindex gcc_jit_rvalue_access_field (C function) -@anchor{topics/expressions c gcc_jit_rvalue_access_field}@anchor{d3} +@anchor{topics/expressions c gcc_jit_rvalue_access_field}@anchor{f5} @deffn {C Function} gcc_jit_rvalue * gcc_jit_rvalue_access_field (gcc_jit_rvalue@w{ }*struct_, gcc_jit_location@w{ }*loc, gcc_jit_field@w{ }*field) Given an rvalue of struct or union type, access the given field @@ -6880,7 +7327,7 @@ in C. @end deffn @geindex gcc_jit_rvalue_dereference_field (C function) -@anchor{topics/expressions c gcc_jit_rvalue_dereference_field}@anchor{d4} +@anchor{topics/expressions c gcc_jit_rvalue_dereference_field}@anchor{f6} @deffn {C Function} gcc_jit_lvalue * gcc_jit_rvalue_dereference_field (gcc_jit_rvalue@w{ }*ptr, gcc_jit_location@w{ }*loc, gcc_jit_field@w{ }*field) Given an rvalue of pointer type @code{T *} where T is of struct or union @@ -6894,7 +7341,7 @@ in C, itself equivalent to @code{(*EXPR).FIELD}. @end deffn @geindex gcc_jit_context_new_array_access (C function) -@anchor{topics/expressions c gcc_jit_context_new_array_access}@anchor{b6} +@anchor{topics/expressions c gcc_jit_context_new_array_access}@anchor{ce} @deffn {C Function} gcc_jit_lvalue * gcc_jit_context_new_array_access (gcc_jit_context@w{ }*ctxt, gcc_jit_location@w{ }*loc, gcc_jit_rvalue@w{ }*ptr, gcc_jit_rvalue@w{ }*index) Given an rvalue of pointer type @code{T *}, get at the element @cite{T} at @@ -6927,7 +7374,7 @@ in C (or, indeed, to @code{PTR + INDEX}). @c . @node Creating and using functions,Function pointers<2>,Expressions,Topic Reference -@anchor{topics/functions doc}@anchor{d5}@anchor{topics/functions creating-and-using-functions}@anchor{d6} +@anchor{topics/functions doc}@anchor{f7}@anchor{topics/functions creating-and-using-functions}@anchor{f8} @section Creating and using functions @@ -6940,7 +7387,7 @@ in C (or, indeed, to @code{PTR + INDEX}). @end menu @node Params,Functions,,Creating and using functions -@anchor{topics/functions params}@anchor{d7} +@anchor{topics/functions params}@anchor{f9} @subsection Params @@ -6969,28 +7416,28 @@ Parameters are lvalues, and thus are also rvalues (and objects), so the following upcasts are available: @geindex gcc_jit_param_as_lvalue (C function) -@anchor{topics/functions c gcc_jit_param_as_lvalue}@anchor{d8} +@anchor{topics/functions c gcc_jit_param_as_lvalue}@anchor{fa} @deffn {C Function} gcc_jit_lvalue * gcc_jit_param_as_lvalue (gcc_jit_param@w{ }*param) Upcasting from param to lvalue. @end deffn @geindex gcc_jit_param_as_rvalue (C function) -@anchor{topics/functions c gcc_jit_param_as_rvalue}@anchor{d9} +@anchor{topics/functions c gcc_jit_param_as_rvalue}@anchor{fb} @deffn {C Function} gcc_jit_rvalue * gcc_jit_param_as_rvalue (gcc_jit_param@w{ }*param) Upcasting from param to rvalue. @end deffn @geindex gcc_jit_param_as_object (C function) -@anchor{topics/functions c gcc_jit_param_as_object}@anchor{da} +@anchor{topics/functions c gcc_jit_param_as_object}@anchor{fc} @deffn {C Function} gcc_jit_object * gcc_jit_param_as_object (gcc_jit_param@w{ }*param) Upcasting from param to object. @end deffn @node Functions,Blocks,Params,Creating and using functions -@anchor{topics/functions functions}@anchor{db} +@anchor{topics/functions functions}@anchor{fd} @subsection Functions @@ -7009,7 +7456,7 @@ creating ourselves, or one that we’re referencing. Create a gcc_jit_function with the given name and parameters. @geindex gcc_jit_function_kind (C type) -@anchor{topics/functions c gcc_jit_function_kind}@anchor{dc} +@anchor{topics/functions c gcc_jit_function_kind}@anchor{fe} @deffn {C Type} enum gcc_jit_function_kind @end deffn @@ -7019,7 +7466,7 @@ values: @quotation @geindex GCC_JIT_FUNCTION_EXPORTED (C macro) -@anchor{topics/functions c GCC_JIT_FUNCTION_EXPORTED}@anchor{dd} +@anchor{topics/functions c GCC_JIT_FUNCTION_EXPORTED}@anchor{ff} @deffn {C Macro} GCC_JIT_FUNCTION_EXPORTED Function is defined by the client code and visible @@ -7031,7 +7478,7 @@ for this function from a @ref{16,,gcc_jit_result} via @end deffn @geindex GCC_JIT_FUNCTION_INTERNAL (C macro) -@anchor{topics/functions c GCC_JIT_FUNCTION_INTERNAL}@anchor{de} +@anchor{topics/functions c GCC_JIT_FUNCTION_INTERNAL}@anchor{100} @deffn {C Macro} GCC_JIT_FUNCTION_INTERNAL Function is defined by the client code, but is invisible @@ -7039,7 +7486,7 @@ outside of the JIT. Analogous to a “static” function. @end deffn @geindex GCC_JIT_FUNCTION_IMPORTED (C macro) -@anchor{topics/functions c GCC_JIT_FUNCTION_IMPORTED}@anchor{df} +@anchor{topics/functions c GCC_JIT_FUNCTION_IMPORTED}@anchor{101} @deffn {C Macro} GCC_JIT_FUNCTION_IMPORTED Function is not defined by the client code; we’re merely @@ -7048,7 +7495,7 @@ header file. @end deffn @geindex GCC_JIT_FUNCTION_ALWAYS_INLINE (C macro) -@anchor{topics/functions c GCC_JIT_FUNCTION_ALWAYS_INLINE}@anchor{e0} +@anchor{topics/functions c GCC_JIT_FUNCTION_ALWAYS_INLINE}@anchor{102} @deffn {C Macro} GCC_JIT_FUNCTION_ALWAYS_INLINE Function is only ever inlined into other functions, and is @@ -7069,7 +7516,7 @@ buffer. @end deffn @geindex gcc_jit_context_get_builtin_function (C function) -@anchor{topics/functions c gcc_jit_context_get_builtin_function}@anchor{e1} +@anchor{topics/functions c gcc_jit_context_get_builtin_function}@anchor{103} @deffn {C Function} gcc_jit_function * gcc_jit_context_get_builtin_function (gcc_jit_context@w{ }*ctxt, const char@w{ }*name) Get the @ref{29,,gcc_jit_function} for the built-in function with the @@ -7093,14 +7540,14 @@ the context. @end deffn @geindex gcc_jit_function_as_object (C function) -@anchor{topics/functions c gcc_jit_function_as_object}@anchor{e2} +@anchor{topics/functions c gcc_jit_function_as_object}@anchor{104} @deffn {C Function} gcc_jit_object * gcc_jit_function_as_object (gcc_jit_function@w{ }*func) Upcasting from function to object. @end deffn @geindex gcc_jit_function_get_param (C function) -@anchor{topics/functions c gcc_jit_function_get_param}@anchor{e3} +@anchor{topics/functions c gcc_jit_function_get_param}@anchor{105} @deffn {C Function} gcc_jit_param * gcc_jit_function_get_param (gcc_jit_function@w{ }*func, int@w{ }index) Get the param of the given index (0-based). @@ -7127,8 +7574,50 @@ underlying string, so it is valid to pass in a pointer to an on-stack buffer. @end deffn +@geindex gcc_jit_function_get_param_count (C function) +@anchor{topics/functions c gcc_jit_function_get_param_count}@anchor{106} +@deffn {C Function} size_t gcc_jit_function_get_param_count (gcc_jit_function@w{ }*func) + +Get the number of parameters of the function. +@end deffn + +@geindex gcc_jit_function_get_return_type (C function) +@anchor{topics/functions c gcc_jit_function_get_return_type}@anchor{107} +@deffn {C Function} gcc_jit_type * gcc_jit_function_get_return_type (gcc_jit_function@w{ }*func) + +Get the return type of the function. + +The API entrypoints relating to getting info about parameters and return +types: + +@quotation + + +@itemize * + +@item +@ref{107,,gcc_jit_function_get_return_type()} + +@item +@ref{106,,gcc_jit_function_get_param_count()} +@end itemize +@end quotation + +were added in @ref{a6,,LIBGCCJIT_ABI_16}; you can test for their presence +using + +@example +#ifdef LIBGCCJIT_HAVE_REFLECTION +@end example + +@geindex gcc_jit_case (C type) +@anchor{topics/functions c gcc_jit_case}@anchor{108} +@deffn {C Type} gcc_jit_case +@end deffn +@end deffn + @node Blocks,Statements,Functions,Creating and using functions -@anchor{topics/functions blocks}@anchor{e4} +@anchor{topics/functions blocks}@anchor{109} @subsection Blocks @@ -7152,7 +7641,7 @@ one function. @end deffn @geindex gcc_jit_function_new_block (C function) -@anchor{topics/functions c gcc_jit_function_new_block}@anchor{e5} +@anchor{topics/functions c gcc_jit_function_new_block}@anchor{10a} @deffn {C Function} gcc_jit_block * gcc_jit_function_new_block (gcc_jit_function@w{ }*func, const char@w{ }*name) Create a basic block of the given name. The name may be NULL, but @@ -7172,26 +7661,26 @@ for (pc = 0; pc < fn->fn_num_ops; pc++) @end deffn @geindex gcc_jit_block_as_object (C function) -@anchor{topics/functions c gcc_jit_block_as_object}@anchor{e6} +@anchor{topics/functions c gcc_jit_block_as_object}@anchor{10b} @deffn {C Function} gcc_jit_object * gcc_jit_block_as_object (gcc_jit_block@w{ }*block) Upcast from block to object. @end deffn @geindex gcc_jit_block_get_function (C function) -@anchor{topics/functions c gcc_jit_block_get_function}@anchor{e7} +@anchor{topics/functions c gcc_jit_block_get_function}@anchor{10c} @deffn {C Function} gcc_jit_function * gcc_jit_block_get_function (gcc_jit_block@w{ }*block) Which function is this block within? @end deffn @node Statements,,Blocks,Creating and using functions -@anchor{topics/functions statements}@anchor{e8} +@anchor{topics/functions statements}@anchor{10d} @subsection Statements @geindex gcc_jit_block_add_eval (C function) -@anchor{topics/functions c gcc_jit_block_add_eval}@anchor{bb} +@anchor{topics/functions c gcc_jit_block_add_eval}@anchor{d3} @deffn {C Function} void gcc_jit_block_add_eval (gcc_jit_block@w{ }*block, gcc_jit_location@w{ }*loc, gcc_jit_rvalue@w{ }*rvalue) Add evaluation of an rvalue, discarding the result @@ -7288,7 +7777,7 @@ block, boolval, on_true, and on_false must be non-NULL. @end deffn @geindex gcc_jit_block_end_with_jump (C function) -@anchor{topics/functions c gcc_jit_block_end_with_jump}@anchor{e9} +@anchor{topics/functions c gcc_jit_block_end_with_jump}@anchor{10e} @deffn {C Function} void gcc_jit_block_end_with_jump (gcc_jit_block@w{ }*block, gcc_jit_location@w{ }*loc, gcc_jit_block@w{ }*target) Terminate a block by adding a jump to the given target block. @@ -7301,7 +7790,7 @@ goto target; @end deffn @geindex gcc_jit_block_end_with_return (C function) -@anchor{topics/functions c gcc_jit_block_end_with_return}@anchor{ea} +@anchor{topics/functions c gcc_jit_block_end_with_return}@anchor{10f} @deffn {C Function} void gcc_jit_block_end_with_return (gcc_jit_block@w{ }*block, gcc_jit_location@w{ }*loc, gcc_jit_rvalue@w{ }*rvalue) Terminate a block by adding evaluation of an rvalue, returning the value. @@ -7314,7 +7803,7 @@ return expression; @end deffn @geindex gcc_jit_block_end_with_void_return (C function) -@anchor{topics/functions c gcc_jit_block_end_with_void_return}@anchor{eb} +@anchor{topics/functions c gcc_jit_block_end_with_void_return}@anchor{110} @deffn {C Function} void gcc_jit_block_end_with_void_return (gcc_jit_block@w{ }*block, gcc_jit_location@w{ }*loc) Terminate a block by adding a valueless return, for use within a function @@ -7328,7 +7817,7 @@ return; @end deffn @geindex gcc_jit_block_end_with_switch (C function) -@anchor{topics/functions c gcc_jit_block_end_with_switch}@anchor{ec} +@anchor{topics/functions c gcc_jit_block_end_with_switch}@anchor{111} @deffn {C Function} void gcc_jit_block_end_with_switch (gcc_jit_block@w{ }*block, gcc_jit_location@w{ }*loc, gcc_jit_rvalue@w{ }*expr, gcc_jit_block@w{ }*default_block, int@w{ }num_cases, gcc_jit_case@w{ }**cases) Terminate a block by adding evalation of an rvalue, then performing @@ -7374,17 +7863,17 @@ The API entrypoints relating to switch statements and cases: @itemize * @item -@ref{ec,,gcc_jit_block_end_with_switch()} +@ref{111,,gcc_jit_block_end_with_switch()} @item -@ref{ed,,gcc_jit_case_as_object()} +@ref{112,,gcc_jit_case_as_object()} @item -@ref{ee,,gcc_jit_context_new_case()} +@ref{113,,gcc_jit_context_new_case()} @end itemize @end quotation -were added in @ref{ef,,LIBGCCJIT_ABI_3}; you can test for their presence +were added in @ref{114,,LIBGCCJIT_ABI_3}; you can test for their presence using @example @@ -7392,20 +7881,20 @@ using @end example @geindex gcc_jit_case (C type) -@anchor{topics/functions c gcc_jit_case}@anchor{f0} + @deffn {C Type} gcc_jit_case @end deffn A @cite{gcc_jit_case} represents a case within a switch statement, and is created within a particular @ref{8,,gcc_jit_context} using -@ref{ee,,gcc_jit_context_new_case()}. +@ref{113,,gcc_jit_context_new_case()}. Each case expresses a multivalued range of integer values. You can express single-valued cases by passing in the same value for both @cite{min_value} and @cite{max_value}. @geindex gcc_jit_context_new_case (C function) -@anchor{topics/functions c gcc_jit_context_new_case}@anchor{ee} +@anchor{topics/functions c gcc_jit_context_new_case}@anchor{113} @deffn {C Function} gcc_jit_case * gcc_jit_context_new_case (gcc_jit_context@w{ }*ctxt, gcc_jit_rvalue@w{ }*min_value, gcc_jit_rvalue@w{ }*max_value, gcc_jit_block@w{ }*dest_block) Create a new gcc_jit_case instance for use in a switch statement. @@ -7417,7 +7906,7 @@ statement. @end deffn @geindex gcc_jit_case_as_object (C function) -@anchor{topics/functions c gcc_jit_case_as_object}@anchor{ed} +@anchor{topics/functions c gcc_jit_case_as_object}@anchor{112} @deffn {C Function} gcc_jit_object * gcc_jit_case_as_object (gcc_jit_case@w{ }*case_) Upcast from a case to an object. @@ -7531,7 +8020,7 @@ create_code (gcc_jit_context *ctxt, void *user_data) @end quotation @end deffn -See also @ref{f1,,gcc_jit_extended_asm} for entrypoints for adding inline +See also @ref{115,,gcc_jit_extended_asm} for entrypoints for adding inline assembler statements to a function. @c Copyright (C) 2017-2022 Free Software Foundation, Inc. @@ -7552,26 +8041,26 @@ assembler statements to a function. @c . @node Function pointers<2>,Source Locations,Creating and using functions,Topic Reference -@anchor{topics/function-pointers doc}@anchor{f2}@anchor{topics/function-pointers function-pointers}@anchor{f3} +@anchor{topics/function-pointers doc}@anchor{116}@anchor{topics/function-pointers function-pointers}@anchor{117} @section Function pointers You can generate calls that use a function pointer via -@ref{bc,,gcc_jit_context_new_call_through_ptr()}. +@ref{d4,,gcc_jit_context_new_call_through_ptr()}. To do requires a @ref{13,,gcc_jit_rvalue} of the correct function pointer type. Function pointers for a @ref{29,,gcc_jit_function} can be obtained -via @ref{c0,,gcc_jit_function_get_address()}. +via @ref{d8,,gcc_jit_function_get_address()}. @geindex gcc_jit_function_get_address (C function) -@anchor{topics/function-pointers c gcc_jit_function_get_address}@anchor{c0} +@anchor{topics/function-pointers c gcc_jit_function_get_address}@anchor{d8} @deffn {C Function} gcc_jit_rvalue * gcc_jit_function_get_address (gcc_jit_function@w{ }*fn, gcc_jit_location@w{ }*loc) Get the address of a function as an rvalue, of function pointer type. -This entrypoint was added in @ref{f4,,LIBGCCJIT_ABI_9}; you can test +This entrypoint was added in @ref{118,,LIBGCCJIT_ABI_9}; you can test for its presence using @example @@ -7581,7 +8070,7 @@ for its presence using Alternatively, given an existing function, you can obtain a pointer to it in @ref{13,,gcc_jit_rvalue} form using -@ref{9c,,gcc_jit_context_new_rvalue_from_ptr()}, using a function pointer +@ref{ae,,gcc_jit_context_new_rvalue_from_ptr()}, using a function pointer type obtained using @ref{95,,gcc_jit_context_new_function_ptr_type()}. Here’s an example of creating a function pointer type corresponding to C’s @@ -7633,7 +8122,7 @@ Each of @cite{param_types} must be non-@cite{void}; @cite{return_type} may be @c @c . @node Source Locations,Compiling a context,Function pointers<2>,Topic Reference -@anchor{topics/locations doc}@anchor{f5}@anchor{topics/locations source-locations}@anchor{f6} +@anchor{topics/locations doc}@anchor{119}@anchor{topics/locations source-locations}@anchor{11a} @section Source Locations @@ -7681,7 +8170,7 @@ on-stack buffer. @end menu @node Faking it,,,Source Locations -@anchor{topics/locations faking-it}@anchor{f7} +@anchor{topics/locations faking-it}@anchor{11b} @subsection Faking it @@ -7717,7 +8206,7 @@ file, giving you @emph{something} you can step through in the debugger. @c . @node Compiling a context,ABI and API compatibility,Source Locations,Topic Reference -@anchor{topics/compilation doc}@anchor{f8}@anchor{topics/compilation compiling-a-context}@anchor{f9} +@anchor{topics/compilation doc}@anchor{11c}@anchor{topics/compilation compiling-a-context}@anchor{11d} @section Compiling a context @@ -7736,7 +8225,7 @@ prevent any future compilation of that context. @end menu @node In-memory compilation,Ahead-of-time compilation,,Compiling a context -@anchor{topics/compilation in-memory-compilation}@anchor{fa} +@anchor{topics/compilation in-memory-compilation}@anchor{11e} @subsection In-memory compilation @@ -7771,7 +8260,7 @@ Functions are looked up by name. For this to succeed, a function with a name matching @cite{funcname} must have been created on @cite{result}’s context (or a parent context) via a call to @ref{11,,gcc_jit_context_new_function()} with @cite{kind} -@ref{dd,,GCC_JIT_FUNCTION_EXPORTED}: +@ref{ff,,GCC_JIT_FUNCTION_EXPORTED}: @example gcc_jit_context_new_function (ctxt, @@ -7799,7 +8288,7 @@ to a segmentation fault. @end deffn @geindex gcc_jit_result_get_global (C function) -@anchor{topics/compilation c gcc_jit_result_get_global}@anchor{cb} +@anchor{topics/compilation c gcc_jit_result_get_global}@anchor{ed} @deffn {C Function} void * gcc_jit_result_get_global (gcc_jit_result@w{ }*result, const char@w{ }*name) Locate a given global within the built machine code. @@ -7807,8 +8296,8 @@ Locate a given global within the built machine code. Globals are looked up by name. For this to succeed, a global with a name matching @cite{name} must have been created on @cite{result}’s context (or a parent context) via a call to -@ref{c8,,gcc_jit_context_new_global()} with @cite{kind} -@ref{ca,,GCC_JIT_GLOBAL_EXPORTED}. +@ref{ea,,gcc_jit_context_new_global()} with @cite{kind} +@ref{ec,,GCC_JIT_GLOBAL_EXPORTED}. If the global is found, the result will need to be cast to a pointer of the correct type before it can be called. @@ -7852,11 +8341,11 @@ Once we’re done with the code, this unloads the built .so file. This cleans up the result; after calling this, it’s no longer valid to use the result, or any code or globals that were obtained by calling @ref{17,,gcc_jit_result_get_code()} or -@ref{cb,,gcc_jit_result_get_global()} on it. +@ref{ed,,gcc_jit_result_get_global()} on it. @end deffn @node Ahead-of-time compilation,,In-memory compilation,Compiling a context -@anchor{topics/compilation ahead-of-time-compilation}@anchor{fb} +@anchor{topics/compilation ahead-of-time-compilation}@anchor{11f} @subsection Ahead-of-time compilation @@ -7865,6 +8354,8 @@ can also be used for implementing more traditional ahead-of-time compilers, via the @ref{4a,,gcc_jit_context_compile_to_file()} API entrypoint. +For linking in object files, use @ref{74,,gcc_jit_context_add_driver_option()}. + @geindex gcc_jit_context_compile_to_file (C function) @anchor{topics/compilation c gcc_jit_context_compile_to_file}@anchor{4a} @deffn {C Function} void gcc_jit_context_compile_to_file (gcc_jit_context@w{ }*ctxt, enum gcc_jit_output_kind@w{ }output_kind, const char@w{ }*output_path) @@ -7885,7 +8376,7 @@ suffix of the output file when determining what to do. @end cartouche @geindex gcc_jit_output_kind (C type) -@anchor{topics/compilation c gcc_jit_output_kind}@anchor{fc} +@anchor{topics/compilation c gcc_jit_output_kind}@anchor{120} @deffn {C Type} enum gcc_jit_output_kind @end deffn @@ -7903,7 +8394,7 @@ Typical suffix @item -@ref{fd,,GCC_JIT_OUTPUT_KIND_ASSEMBLER} +@ref{121,,GCC_JIT_OUTPUT_KIND_ASSEMBLER} @tab @@ -7911,7 +8402,7 @@ Typical suffix @item -@ref{fe,,GCC_JIT_OUTPUT_KIND_OBJECT_FILE} +@ref{122,,GCC_JIT_OUTPUT_KIND_OBJECT_FILE} @tab @@ -7919,7 +8410,7 @@ Typical suffix @item -@ref{ff,,GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY} +@ref{123,,GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY} @tab @@ -7927,7 +8418,7 @@ Typical suffix @item -@ref{100,,GCC_JIT_OUTPUT_KIND_EXECUTABLE} +@ref{124,,GCC_JIT_OUTPUT_KIND_EXECUTABLE} @tab @@ -7937,37 +8428,31 @@ None, or .exe @geindex GCC_JIT_OUTPUT_KIND_ASSEMBLER (C macro) -@anchor{topics/compilation c GCC_JIT_OUTPUT_KIND_ASSEMBLER}@anchor{fd} +@anchor{topics/compilation c GCC_JIT_OUTPUT_KIND_ASSEMBLER}@anchor{121} @deffn {C Macro} GCC_JIT_OUTPUT_KIND_ASSEMBLER Compile the context to an assembler file. @end deffn @geindex GCC_JIT_OUTPUT_KIND_OBJECT_FILE (C macro) -@anchor{topics/compilation c GCC_JIT_OUTPUT_KIND_OBJECT_FILE}@anchor{fe} +@anchor{topics/compilation c GCC_JIT_OUTPUT_KIND_OBJECT_FILE}@anchor{122} @deffn {C Macro} GCC_JIT_OUTPUT_KIND_OBJECT_FILE Compile the context to an object file. @end deffn @geindex GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY (C macro) -@anchor{topics/compilation c GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY}@anchor{ff} +@anchor{topics/compilation c GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY}@anchor{123} @deffn {C Macro} GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY Compile the context to a dynamic library. - -There is currently no support for specifying other libraries to link -against. @end deffn @geindex GCC_JIT_OUTPUT_KIND_EXECUTABLE (C macro) -@anchor{topics/compilation c GCC_JIT_OUTPUT_KIND_EXECUTABLE}@anchor{100} +@anchor{topics/compilation c GCC_JIT_OUTPUT_KIND_EXECUTABLE}@anchor{124} @deffn {C Macro} GCC_JIT_OUTPUT_KIND_EXECUTABLE Compile the context to an executable. - -There is currently no support for specifying libraries to link -against. @end deffn @c Copyright (C) 2015-2022 Free Software Foundation, Inc. @@ -7988,7 +8473,7 @@ against. @c . @node ABI and API compatibility,Performance,Compiling a context,Topic Reference -@anchor{topics/compatibility doc}@anchor{101}@anchor{topics/compatibility abi-and-api-compatibility}@anchor{102} +@anchor{topics/compatibility doc}@anchor{125}@anchor{topics/compatibility abi-and-api-compatibility}@anchor{126} @section ABI and API compatibility @@ -8044,21 +8529,21 @@ Version definitions: @end menu @node Programmatically checking version,ABI symbol tags,,ABI and API compatibility -@anchor{topics/compatibility programmatically-checking-version}@anchor{103} +@anchor{topics/compatibility programmatically-checking-version}@anchor{127} @subsection Programmatically checking version Client code can programmatically check libgccjit version using: @geindex gcc_jit_version_major (C function) -@anchor{topics/compatibility c gcc_jit_version_major}@anchor{104} +@anchor{topics/compatibility c gcc_jit_version_major}@anchor{128} @deffn {C Function} int gcc_jit_version_major (void) Return libgccjit major version. This is analogous to __GNUC__ in C code. @end deffn @geindex gcc_jit_version_minor (C function) -@anchor{topics/compatibility c gcc_jit_version_minor}@anchor{105} +@anchor{topics/compatibility c gcc_jit_version_minor}@anchor{129} @deffn {C Function} int gcc_jit_version_minor (void) Return libgccjit minor version. This is analogous to @@ -8066,7 +8551,7 @@ __GNUC_MINOR__ in C code. @end deffn @geindex gcc_jit_version_patchlevel (C function) -@anchor{topics/compatibility c gcc_jit_version_patchlevel}@anchor{106} +@anchor{topics/compatibility c gcc_jit_version_patchlevel}@anchor{12a} @deffn {C Function} int gcc_jit_version_patchlevel (void) Return libgccjit patchlevel version. This is analogous to @@ -8081,7 +8566,7 @@ These entry points has been added with @code{LIBGCCJIT_ABI_13} @end cartouche @node ABI symbol tags,,Programmatically checking version,ABI and API compatibility -@anchor{topics/compatibility abi-symbol-tags}@anchor{107} +@anchor{topics/compatibility abi-symbol-tags}@anchor{12b} @subsection ABI symbol tags @@ -8106,11 +8591,15 @@ Newer releases use the following tags. * LIBGCCJIT_ABI_13:: * LIBGCCJIT_ABI_14:: * LIBGCCJIT_ABI_15:: +* LIBGCCJIT_ABI_16:: +* LIBGCCJIT_ABI_17:: +* LIBGCCJIT_ABI_18:: +* LIBGCCJIT_ABI_19:: @end menu @node LIBGCCJIT_ABI_0,LIBGCCJIT_ABI_1,,ABI symbol tags -@anchor{topics/compatibility id1}@anchor{108}@anchor{topics/compatibility libgccjit-abi-0}@anchor{109} +@anchor{topics/compatibility id1}@anchor{12c}@anchor{topics/compatibility libgccjit-abi-0}@anchor{12d} @subsubsection @code{LIBGCCJIT_ABI_0} @@ -8122,7 +8611,7 @@ continue to work, with this being handled transparently by the linker (see this post@footnote{https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02126.html}) @node LIBGCCJIT_ABI_1,LIBGCCJIT_ABI_2,LIBGCCJIT_ABI_0,ABI symbol tags -@anchor{topics/compatibility id2}@anchor{10a}@anchor{topics/compatibility libgccjit-abi-1}@anchor{73} +@anchor{topics/compatibility id2}@anchor{12e}@anchor{topics/compatibility libgccjit-abi-1}@anchor{73} @subsubsection @code{LIBGCCJIT_ABI_1} @@ -8130,7 +8619,7 @@ continue to work, with this being handled transparently by the linker @ref{72,,gcc_jit_context_add_command_line_option()} @node LIBGCCJIT_ABI_2,LIBGCCJIT_ABI_3,LIBGCCJIT_ABI_1,ABI symbol tags -@anchor{topics/compatibility id3}@anchor{10b}@anchor{topics/compatibility libgccjit-abi-2}@anchor{6c} +@anchor{topics/compatibility id3}@anchor{12f}@anchor{topics/compatibility libgccjit-abi-2}@anchor{6c} @subsubsection @code{LIBGCCJIT_ABI_2} @@ -8138,7 +8627,7 @@ continue to work, with this being handled transparently by the linker @ref{6b,,gcc_jit_context_set_bool_allow_unreachable_blocks()} @node LIBGCCJIT_ABI_3,LIBGCCJIT_ABI_4,LIBGCCJIT_ABI_2,ABI symbol tags -@anchor{topics/compatibility id4}@anchor{10c}@anchor{topics/compatibility libgccjit-abi-3}@anchor{ef} +@anchor{topics/compatibility id4}@anchor{130}@anchor{topics/compatibility libgccjit-abi-3}@anchor{114} @subsubsection @code{LIBGCCJIT_ABI_3} @@ -8151,18 +8640,18 @@ entrypoints: @itemize * @item -@ref{ec,,gcc_jit_block_end_with_switch()} +@ref{111,,gcc_jit_block_end_with_switch()} @item -@ref{ed,,gcc_jit_case_as_object()} +@ref{112,,gcc_jit_case_as_object()} @item -@ref{ee,,gcc_jit_context_new_case()} +@ref{113,,gcc_jit_context_new_case()} @end itemize @end quotation @node LIBGCCJIT_ABI_4,LIBGCCJIT_ABI_5,LIBGCCJIT_ABI_3,ABI symbol tags -@anchor{topics/compatibility id5}@anchor{10d}@anchor{topics/compatibility libgccjit-abi-4}@anchor{10e} +@anchor{topics/compatibility id5}@anchor{131}@anchor{topics/compatibility libgccjit-abi-4}@anchor{132} @subsubsection @code{LIBGCCJIT_ABI_4} @@ -8175,30 +8664,30 @@ entrypoints: @itemize * @item -@ref{10f,,gcc_jit_context_get_timer()} +@ref{133,,gcc_jit_context_get_timer()} @item -@ref{110,,gcc_jit_context_set_timer()} +@ref{134,,gcc_jit_context_set_timer()} @item -@ref{111,,gcc_jit_timer_new()} +@ref{135,,gcc_jit_timer_new()} @item -@ref{112,,gcc_jit_timer_release()} +@ref{136,,gcc_jit_timer_release()} @item -@ref{113,,gcc_jit_timer_push()} +@ref{137,,gcc_jit_timer_push()} @item -@ref{114,,gcc_jit_timer_pop()} +@ref{138,,gcc_jit_timer_pop()} @item -@ref{115,,gcc_jit_timer_print()} +@ref{139,,gcc_jit_timer_print()} @end itemize @end quotation @node LIBGCCJIT_ABI_5,LIBGCCJIT_ABI_6,LIBGCCJIT_ABI_4,ABI symbol tags -@anchor{topics/compatibility id6}@anchor{116}@anchor{topics/compatibility libgccjit-abi-5}@anchor{6e} +@anchor{topics/compatibility id6}@anchor{13a}@anchor{topics/compatibility libgccjit-abi-5}@anchor{6e} @subsubsection @code{LIBGCCJIT_ABI_5} @@ -8206,15 +8695,15 @@ entrypoints: @ref{6d,,gcc_jit_context_set_bool_use_external_driver()} @node LIBGCCJIT_ABI_6,LIBGCCJIT_ABI_7,LIBGCCJIT_ABI_5,ABI symbol tags -@anchor{topics/compatibility id7}@anchor{117}@anchor{topics/compatibility libgccjit-abi-6}@anchor{be} +@anchor{topics/compatibility id7}@anchor{13b}@anchor{topics/compatibility libgccjit-abi-6}@anchor{d6} @subsubsection @code{LIBGCCJIT_ABI_6} @code{LIBGCCJIT_ABI_6} covers the addition of -@ref{bd,,gcc_jit_rvalue_set_bool_require_tail_call()} +@ref{d5,,gcc_jit_rvalue_set_bool_require_tail_call()} @node LIBGCCJIT_ABI_7,LIBGCCJIT_ABI_8,LIBGCCJIT_ABI_6,ABI symbol tags -@anchor{topics/compatibility id8}@anchor{118}@anchor{topics/compatibility libgccjit-abi-7}@anchor{83} +@anchor{topics/compatibility id8}@anchor{13c}@anchor{topics/compatibility libgccjit-abi-7}@anchor{83} @subsubsection @code{LIBGCCJIT_ABI_7} @@ -8222,7 +8711,7 @@ entrypoints: @ref{82,,gcc_jit_type_get_aligned()} @node LIBGCCJIT_ABI_8,LIBGCCJIT_ABI_9,LIBGCCJIT_ABI_7,ABI symbol tags -@anchor{topics/compatibility id9}@anchor{119}@anchor{topics/compatibility libgccjit-abi-8}@anchor{86} +@anchor{topics/compatibility id9}@anchor{13d}@anchor{topics/compatibility libgccjit-abi-8}@anchor{86} @subsubsection @code{LIBGCCJIT_ABI_8} @@ -8230,15 +8719,15 @@ entrypoints: @ref{85,,gcc_jit_type_get_vector()} @node LIBGCCJIT_ABI_9,LIBGCCJIT_ABI_10,LIBGCCJIT_ABI_8,ABI symbol tags -@anchor{topics/compatibility id10}@anchor{11a}@anchor{topics/compatibility libgccjit-abi-9}@anchor{f4} +@anchor{topics/compatibility id10}@anchor{13e}@anchor{topics/compatibility libgccjit-abi-9}@anchor{118} @subsubsection @code{LIBGCCJIT_ABI_9} @code{LIBGCCJIT_ABI_9} covers the addition of -@ref{c0,,gcc_jit_function_get_address()} +@ref{d8,,gcc_jit_function_get_address()} @node LIBGCCJIT_ABI_10,LIBGCCJIT_ABI_11,LIBGCCJIT_ABI_9,ABI symbol tags -@anchor{topics/compatibility id11}@anchor{11b}@anchor{topics/compatibility libgccjit-abi-10}@anchor{a0} +@anchor{topics/compatibility id11}@anchor{13f}@anchor{topics/compatibility libgccjit-abi-10}@anchor{b8} @subsubsection @code{LIBGCCJIT_ABI_10} @@ -8246,7 +8735,7 @@ entrypoints: @ref{87,,gcc_jit_context_new_rvalue_from_vector()} @node LIBGCCJIT_ABI_11,LIBGCCJIT_ABI_12,LIBGCCJIT_ABI_10,ABI symbol tags -@anchor{topics/compatibility id12}@anchor{11c}@anchor{topics/compatibility libgccjit-abi-11}@anchor{75} +@anchor{topics/compatibility id12}@anchor{140}@anchor{topics/compatibility libgccjit-abi-11}@anchor{75} @subsubsection @code{LIBGCCJIT_ABI_11} @@ -8254,7 +8743,7 @@ entrypoints: @ref{74,,gcc_jit_context_add_driver_option()} @node LIBGCCJIT_ABI_12,LIBGCCJIT_ABI_13,LIBGCCJIT_ABI_11,ABI symbol tags -@anchor{topics/compatibility id13}@anchor{11d}@anchor{topics/compatibility libgccjit-abi-12}@anchor{8d} +@anchor{topics/compatibility id13}@anchor{141}@anchor{topics/compatibility libgccjit-abi-12}@anchor{8d} @subsubsection @code{LIBGCCJIT_ABI_12} @@ -8262,7 +8751,7 @@ entrypoints: @ref{8c,,gcc_jit_context_new_bitfield()} @node LIBGCCJIT_ABI_13,LIBGCCJIT_ABI_14,LIBGCCJIT_ABI_12,ABI symbol tags -@anchor{topics/compatibility id14}@anchor{11e}@anchor{topics/compatibility libgccjit-abi-13}@anchor{11f} +@anchor{topics/compatibility id14}@anchor{142}@anchor{topics/compatibility libgccjit-abi-13}@anchor{143} @subsubsection @code{LIBGCCJIT_ABI_13} @@ -8275,26 +8764,26 @@ entrypoints: @itemize * @item -@ref{104,,gcc_jit_version_major()} +@ref{128,,gcc_jit_version_major()} @item -@ref{105,,gcc_jit_version_minor()} +@ref{129,,gcc_jit_version_minor()} @item -@ref{106,,gcc_jit_version_patchlevel()} +@ref{12a,,gcc_jit_version_patchlevel()} @end itemize @end quotation @node LIBGCCJIT_ABI_14,LIBGCCJIT_ABI_15,LIBGCCJIT_ABI_13,ABI symbol tags -@anchor{topics/compatibility id15}@anchor{120}@anchor{topics/compatibility libgccjit-abi-14}@anchor{cf} +@anchor{topics/compatibility id15}@anchor{144}@anchor{topics/compatibility libgccjit-abi-14}@anchor{f1} @subsubsection @code{LIBGCCJIT_ABI_14} @code{LIBGCCJIT_ABI_14} covers the addition of -@ref{ce,,gcc_jit_global_set_initializer()} +@ref{f0,,gcc_jit_global_set_initializer()} -@node LIBGCCJIT_ABI_15,,LIBGCCJIT_ABI_14,ABI symbol tags -@anchor{topics/compatibility id16}@anchor{121}@anchor{topics/compatibility libgccjit-abi-15}@anchor{122} +@node LIBGCCJIT_ABI_15,LIBGCCJIT_ABI_16,LIBGCCJIT_ABI_14,ABI symbol tags +@anchor{topics/compatibility id16}@anchor{145}@anchor{topics/compatibility libgccjit-abi-15}@anchor{146} @subsubsection @code{LIBGCCJIT_ABI_15} @@ -8307,31 +8796,160 @@ embedding assembler instructions: @itemize * @item -@ref{123,,gcc_jit_block_add_extended_asm()} +@ref{147,,gcc_jit_block_add_extended_asm()} @item -@ref{124,,gcc_jit_block_end_with_extended_asm_goto()} +@ref{148,,gcc_jit_block_end_with_extended_asm_goto()} @item -@ref{125,,gcc_jit_extended_asm_as_object()} +@ref{149,,gcc_jit_extended_asm_as_object()} @item -@ref{126,,gcc_jit_extended_asm_set_volatile_flag()} +@ref{14a,,gcc_jit_extended_asm_set_volatile_flag()} @item -@ref{127,,gcc_jit_extended_asm_set_inline_flag()} +@ref{14b,,gcc_jit_extended_asm_set_inline_flag()} @item -@ref{128,,gcc_jit_extended_asm_add_output_operand()} +@ref{14c,,gcc_jit_extended_asm_add_output_operand()} @item -@ref{129,,gcc_jit_extended_asm_add_input_operand()} +@ref{14d,,gcc_jit_extended_asm_add_input_operand()} @item -@ref{12a,,gcc_jit_extended_asm_add_clobber()} +@ref{14e,,gcc_jit_extended_asm_add_clobber()} @item -@ref{12b,,gcc_jit_context_add_top_level_asm()} +@ref{14f,,gcc_jit_context_add_top_level_asm()} +@end itemize +@end quotation + +@node LIBGCCJIT_ABI_16,LIBGCCJIT_ABI_17,LIBGCCJIT_ABI_15,ABI symbol tags +@anchor{topics/compatibility id17}@anchor{150}@anchor{topics/compatibility libgccjit-abi-16}@anchor{a6} +@subsubsection @code{LIBGCCJIT_ABI_16} + + +@code{LIBGCCJIT_ABI_16} covers the addition of reflection functions via API +entrypoints: + +@quotation + + +@itemize * + +@item +@ref{107,,gcc_jit_function_get_return_type()} + +@item +@ref{106,,gcc_jit_function_get_param_count()} + +@item +@ref{97,,gcc_jit_type_dyncast_array()} + +@item +@ref{98,,gcc_jit_type_is_bool()} + +@item +@ref{9d,,gcc_jit_type_is_integral()} + +@item +@ref{9e,,gcc_jit_type_is_pointer()} + +@item +@ref{a0,,gcc_jit_type_is_struct()} + +@item +@ref{9f,,gcc_jit_type_dyncast_vector()} + +@item +@ref{a3,,gcc_jit_type_unqualified()} + +@item +@ref{99,,gcc_jit_type_dyncast_function_ptr_type()} + +@item +@ref{9a,,gcc_jit_function_type_get_return_type()} + +@item +@ref{9b,,gcc_jit_function_type_get_param_count()} + +@item +@ref{9c,,gcc_jit_function_type_get_param_type()} + +@item +@ref{a1,,gcc_jit_vector_type_get_num_units()} + +@item +@ref{a2,,gcc_jit_vector_type_get_element_type()} + +@item +@ref{a4,,gcc_jit_struct_get_field()} + +@item +@ref{a5,,gcc_jit_struct_get_field_count()} +@end itemize +@end quotation + +@node LIBGCCJIT_ABI_17,LIBGCCJIT_ABI_18,LIBGCCJIT_ABI_16,ABI symbol tags +@anchor{topics/compatibility id18}@anchor{151}@anchor{topics/compatibility libgccjit-abi-17}@anchor{e6} +@subsubsection @code{LIBGCCJIT_ABI_17} + + +@code{LIBGCCJIT_ABI_17} covers the addition of an API entrypoint to set the +thread-local storage model of a variable: + +@quotation + + +@itemize * + +@item +@ref{df,,gcc_jit_lvalue_set_tls_model()} +@end itemize +@end quotation + +@node LIBGCCJIT_ABI_18,LIBGCCJIT_ABI_19,LIBGCCJIT_ABI_17,ABI symbol tags +@anchor{topics/compatibility id19}@anchor{152}@anchor{topics/compatibility libgccjit-abi-18}@anchor{e8} +@subsubsection @code{LIBGCCJIT_ABI_18} + + +@code{LIBGCCJIT_ABI_18} covers the addition of an API entrypoint to set the link +section of a variable: + +@quotation + + +@itemize * + +@item +@ref{e7,,gcc_jit_lvalue_set_link_section()} +@end itemize +@end quotation + +@node LIBGCCJIT_ABI_19,,LIBGCCJIT_ABI_18,ABI symbol tags +@anchor{topics/compatibility id20}@anchor{153}@anchor{topics/compatibility libgccjit-abi-19}@anchor{b3} +@subsubsection @code{LIBGCCJIT_ABI_19} + + +@code{LIBGCCJIT_ABI_19} covers the addition of API entrypoints to set the initial value +of a global with an rvalue and to use constructors: + +@quotation + + +@itemize * + +@item +@ref{b4,,gcc_jit_context_new_array_constructor()} + +@item +@ref{b5,,gcc_jit_context_new_struct_constructor()} + +@item +@ref{b6,,gcc_jit_context_new_union_constructor()} + +@item +@ref{b2,,gcc_jit_global_set_initializer_rvalue()} @end itemize @end quotation @@ -8353,7 +8971,7 @@ embedding assembler instructions: @c . @node Performance,Using Assembly Language with libgccjit,ABI and API compatibility,Topic Reference -@anchor{topics/performance doc}@anchor{12c}@anchor{topics/performance performance}@anchor{12d} +@anchor{topics/performance doc}@anchor{154}@anchor{topics/performance performance}@anchor{155} @section Performance @@ -8363,14 +8981,14 @@ embedding assembler instructions: @end menu @node The timing API,,,Performance -@anchor{topics/performance the-timing-api}@anchor{12e} +@anchor{topics/performance the-timing-api}@anchor{156} @subsection The timing API As of GCC 6, libgccjit exposes a timing API, for printing reports on how long was spent in different parts of code. -You can create a @ref{12f,,gcc_jit_timer} instance, which will +You can create a @ref{157,,gcc_jit_timer} instance, which will measure time spent since its creation. The timer maintains a stack of “timer items”: as control flow moves through your code, you can push and pop named items relating to your code onto the stack, and the timer @@ -8468,7 +9086,7 @@ Client items: The exact format is intended to be human-readable, and is subject to change. @geindex LIBGCCJIT_HAVE_TIMING_API (C macro) -@anchor{topics/performance c LIBGCCJIT_HAVE_TIMING_API}@anchor{130} +@anchor{topics/performance c LIBGCCJIT_HAVE_TIMING_API}@anchor{158} @deffn {C Macro} LIBGCCJIT_HAVE_TIMING_API The timer API was added to libgccjit in GCC 6. @@ -8485,21 +9103,21 @@ gcc_jit_context_set_timer (ctxt, t); @end deffn @geindex gcc_jit_timer (C type) -@anchor{topics/performance c gcc_jit_timer}@anchor{12f} +@anchor{topics/performance c gcc_jit_timer}@anchor{157} @deffn {C Type} gcc_jit_timer @end deffn @geindex gcc_jit_timer_new (C function) -@anchor{topics/performance c gcc_jit_timer_new}@anchor{111} +@anchor{topics/performance c gcc_jit_timer_new}@anchor{135} @deffn {C Function} gcc_jit_timer * gcc_jit_timer_new (void) -Create a @ref{12f,,gcc_jit_timer} instance, and start timing: +Create a @ref{157,,gcc_jit_timer} instance, and start timing: @example gcc_jit_timer *t = gcc_jit_timer_new (); @end example -This API entrypoint was added in @ref{10e,,LIBGCCJIT_ABI_4}; you can test +This API entrypoint was added in @ref{132,,LIBGCCJIT_ABI_4}; you can test for its presence using @example @@ -8508,10 +9126,10 @@ for its presence using @end deffn @geindex gcc_jit_timer_release (C function) -@anchor{topics/performance c gcc_jit_timer_release}@anchor{112} +@anchor{topics/performance c gcc_jit_timer_release}@anchor{136} @deffn {C Function} void gcc_jit_timer_release (gcc_jit_timer@w{ }*timer) -Release a @ref{12f,,gcc_jit_timer} instance: +Release a @ref{157,,gcc_jit_timer} instance: @example gcc_jit_timer_release (t); @@ -8519,7 +9137,7 @@ gcc_jit_timer_release (t); This should be called exactly once on a timer. -This API entrypoint was added in @ref{10e,,LIBGCCJIT_ABI_4}; you can test +This API entrypoint was added in @ref{132,,LIBGCCJIT_ABI_4}; you can test for its presence using @example @@ -8528,10 +9146,10 @@ for its presence using @end deffn @geindex gcc_jit_context_set_timer (C function) -@anchor{topics/performance c gcc_jit_context_set_timer}@anchor{110} +@anchor{topics/performance c gcc_jit_context_set_timer}@anchor{134} @deffn {C Function} void gcc_jit_context_set_timer (gcc_jit_context@w{ }*ctxt, gcc_jit_timer@w{ }*timer) -Associate a @ref{12f,,gcc_jit_timer} instance with a context: +Associate a @ref{157,,gcc_jit_timer} instance with a context: @example gcc_jit_context_set_timer (ctxt, t); @@ -8544,7 +9162,7 @@ Timers have no locking, so if you have a multithreaded program, you must provide your own locks if more than one thread could be working with the same timer via timer-associated contexts. -This API entrypoint was added in @ref{10e,,LIBGCCJIT_ABI_4}; you can test +This API entrypoint was added in @ref{132,,LIBGCCJIT_ABI_4}; you can test for its presence using @example @@ -8553,12 +9171,12 @@ for its presence using @end deffn @geindex gcc_jit_context_get_timer (C function) -@anchor{topics/performance c gcc_jit_context_get_timer}@anchor{10f} +@anchor{topics/performance c gcc_jit_context_get_timer}@anchor{133} @deffn {C Function} gcc_jit_timer *gcc_jit_context_get_timer (gcc_jit_context@w{ }*ctxt) Get the timer associated with a context (if any). -This API entrypoint was added in @ref{10e,,LIBGCCJIT_ABI_4}; you can test +This API entrypoint was added in @ref{132,,LIBGCCJIT_ABI_4}; you can test for its presence using @example @@ -8567,7 +9185,7 @@ for its presence using @end deffn @geindex gcc_jit_timer_push (C function) -@anchor{topics/performance c gcc_jit_timer_push}@anchor{113} +@anchor{topics/performance c gcc_jit_timer_push}@anchor{137} @deffn {C Function} void gcc_jit_timer_push (gcc_jit_timer@w{ }*timer, const char@w{ }*item_name) Push the given item onto the timer’s stack: @@ -8578,7 +9196,7 @@ run_the_code (ctxt, result); gcc_jit_timer_pop (t, "running code"); @end example -This API entrypoint was added in @ref{10e,,LIBGCCJIT_ABI_4}; you can test +This API entrypoint was added in @ref{132,,LIBGCCJIT_ABI_4}; you can test for its presence using @example @@ -8587,7 +9205,7 @@ for its presence using @end deffn @geindex gcc_jit_timer_pop (C function) -@anchor{topics/performance c gcc_jit_timer_pop}@anchor{114} +@anchor{topics/performance c gcc_jit_timer_pop}@anchor{138} @deffn {C Function} void gcc_jit_timer_pop (gcc_jit_timer@w{ }*timer, const char@w{ }*item_name) Pop the top item from the timer’s stack. @@ -8595,7 +9213,7 @@ Pop the top item from the timer’s stack. If “item_name” is provided, it must match that of the top item. Alternatively, @code{NULL} can be passed in, to suppress checking. -This API entrypoint was added in @ref{10e,,LIBGCCJIT_ABI_4}; you can test +This API entrypoint was added in @ref{132,,LIBGCCJIT_ABI_4}; you can test for its presence using @example @@ -8604,13 +9222,13 @@ for its presence using @end deffn @geindex gcc_jit_timer_print (C function) -@anchor{topics/performance c gcc_jit_timer_print}@anchor{115} +@anchor{topics/performance c gcc_jit_timer_print}@anchor{139} @deffn {C Function} void gcc_jit_timer_print (gcc_jit_timer@w{ }*timer, FILE@w{ }*f_out) Print timing information to the given stream about activity since the timer was started. -This API entrypoint was added in @ref{10e,,LIBGCCJIT_ABI_4}; you can test +This API entrypoint was added in @ref{132,,LIBGCCJIT_ABI_4}; you can test for its presence using @example @@ -8636,7 +9254,7 @@ for its presence using @c . @node Using Assembly Language with libgccjit,,Performance,Topic Reference -@anchor{topics/asm doc}@anchor{131}@anchor{topics/asm using-assembly-language-with-libgccjit}@anchor{132} +@anchor{topics/asm doc}@anchor{159}@anchor{topics/asm using-assembly-language-with-libgccjit}@anchor{15a} @section Using Assembly Language with libgccjit @@ -8646,7 +9264,7 @@ following assumes a familiarity with that functionality. See How to Use Inline Assembly Language in C Code@footnote{https://gcc.gnu.org/onlinedocs/gcc/Using-Assembly-Language-with-C.html} in GCC’s documentation, the “Extended Asm” section in particular. -These entrypoints were added in @ref{122,,LIBGCCJIT_ABI_15}; you can test +These entrypoints were added in @ref{146,,LIBGCCJIT_ABI_15}; you can test for their presence using @quotation @@ -8663,12 +9281,12 @@ for their presence using @end menu @node Adding assembler instructions within a function,Adding top-level assembler statements,,Using Assembly Language with libgccjit -@anchor{topics/asm adding-assembler-instructions-within-a-function}@anchor{133} +@anchor{topics/asm adding-assembler-instructions-within-a-function}@anchor{15b} @subsection Adding assembler instructions within a function @geindex gcc_jit_extended_asm (C type) -@anchor{topics/asm c gcc_jit_extended_asm}@anchor{f1} +@anchor{topics/asm c gcc_jit_extended_asm}@anchor{115} @deffn {C Type} gcc_jit_extended_asm A @cite{gcc_jit_extended_asm} represents an extended @code{asm} statement: a @@ -8677,21 +9295,21 @@ to outputs. To avoid having an API entrypoint with a very large number of parameters, an extended @code{asm} statement is made in stages: -an initial call to create the @ref{f1,,gcc_jit_extended_asm}, +an initial call to create the @ref{115,,gcc_jit_extended_asm}, followed by calls to add operands and set other properties of the statement. -There are two API entrypoints for creating a @ref{f1,,gcc_jit_extended_asm}: +There are two API entrypoints for creating a @ref{115,,gcc_jit_extended_asm}: @itemize * @item -@ref{123,,gcc_jit_block_add_extended_asm()} for an @code{asm} statement with +@ref{147,,gcc_jit_block_add_extended_asm()} for an @code{asm} statement with no control flow, and @item -@ref{124,,gcc_jit_block_end_with_extended_asm_goto()} for an @code{asm goto}. +@ref{148,,gcc_jit_block_end_with_extended_asm_goto()} for an @code{asm goto}. @end itemize For example, to create the equivalent of: @@ -8722,8 +9340,8 @@ extended @code{asm} statement (e.g. the @code{%0} and @code{%1} above), the equivalent to the C syntax is followed i.e. all output operands, then all input operands, regardless of what order the calls to -@ref{128,,gcc_jit_extended_asm_add_output_operand()} and -@ref{129,,gcc_jit_extended_asm_add_input_operand()} were made in. +@ref{14c,,gcc_jit_extended_asm_add_output_operand()} and +@ref{14d,,gcc_jit_extended_asm_add_input_operand()} were made in. @end quotation @end cartouche @@ -8751,10 +9369,10 @@ the following API calls could be used: @end deffn @geindex gcc_jit_block_add_extended_asm (C function) -@anchor{topics/asm c gcc_jit_block_add_extended_asm}@anchor{123} +@anchor{topics/asm c gcc_jit_block_add_extended_asm}@anchor{147} @deffn {C Function} gcc_jit_extended_asm * gcc_jit_block_add_extended_asm (gcc_jit_block@w{ }*block, gcc_jit_location@w{ }*loc, const char@w{ }*asm_template) -Create a @ref{f1,,gcc_jit_extended_asm} for an extended @code{asm} statement +Create a @ref{115,,gcc_jit_extended_asm} for an extended @code{asm} statement with no control flow (i.e. without the @code{goto} qualifier). The parameter @code{asm_template} corresponds to the @cite{AssemblerTemplate} @@ -8764,10 +9382,10 @@ an on-stack buffer. @end deffn @geindex gcc_jit_block_end_with_extended_asm_goto (C function) -@anchor{topics/asm c gcc_jit_block_end_with_extended_asm_goto}@anchor{124} +@anchor{topics/asm c gcc_jit_block_end_with_extended_asm_goto}@anchor{148} @deffn {C Function} gcc_jit_extended_asm * gcc_jit_block_end_with_extended_asm_goto (gcc_jit_block@w{ }*block, gcc_jit_location@w{ }*loc, const char@w{ }*asm_template, int@w{ }num_goto_blocks, gcc_jit_block@w{ }**goto_blocks, gcc_jit_block@w{ }*fallthrough_block) -Create a @ref{f1,,gcc_jit_extended_asm} for an extended @code{asm} statement +Create a @ref{115,,gcc_jit_extended_asm} for an extended @code{asm} statement that may perform jumps, and use it to terminate the given block. This is equivalent to the @code{goto} qualifier in C’s extended @code{asm} syntax. @@ -8830,10 +9448,10 @@ would have happened in the C case. @end deffn @geindex gcc_jit_extended_asm_set_volatile_flag (C function) -@anchor{topics/asm c gcc_jit_extended_asm_set_volatile_flag}@anchor{126} +@anchor{topics/asm c gcc_jit_extended_asm_set_volatile_flag}@anchor{14a} @deffn {C Function} void gcc_jit_extended_asm_set_volatile_flag (gcc_jit_extended_asm@w{ }*ext_asm, int@w{ }flag) -Set whether the @ref{f1,,gcc_jit_extended_asm} has side-effects, equivalent to the +Set whether the @ref{115,,gcc_jit_extended_asm} has side-effects, equivalent to the volatile@footnote{https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Volatile} qualifier in C’s extended asm syntax. @@ -8862,11 +9480,11 @@ the following API calls could be used: gcc_jit_extended_asm_add_clobber (ext_asm, "rdx"); @end example -where the @ref{f1,,gcc_jit_extended_asm} is flagged as volatile. +where the @ref{115,,gcc_jit_extended_asm} is flagged as volatile. @end deffn @geindex gcc_jit_extended_asm_set_inline_flag (C function) -@anchor{topics/asm c gcc_jit_extended_asm_set_inline_flag}@anchor{127} +@anchor{topics/asm c gcc_jit_extended_asm_set_inline_flag}@anchor{14b} @deffn {C Function} void gcc_jit_extended_asm_set_inline_flag (gcc_jit_extended_asm@w{ }*ext_asm, int@w{ }flag) Set the equivalent of the @@ -8875,7 +9493,7 @@ qualifier in C’s extended @code{asm} syntax. @end deffn @geindex gcc_jit_extended_asm_add_output_operand (C function) -@anchor{topics/asm c gcc_jit_extended_asm_add_output_operand}@anchor{128} +@anchor{topics/asm c gcc_jit_extended_asm_add_output_operand}@anchor{14c} @deffn {C Function} void gcc_jit_extended_asm_add_output_operand (gcc_jit_extended_asm@w{ }*ext_asm, const char@w{ }*asm_symbolic_name, const char@w{ }*constraint, gcc_jit_lvalue@w{ }*dest) Add an output operand to the extended @code{asm} statement. See the @@ -8909,7 +9527,7 @@ section of GCC’s “Extended Asm” documentation. @end deffn @geindex gcc_jit_extended_asm_add_input_operand (C function) -@anchor{topics/asm c gcc_jit_extended_asm_add_input_operand}@anchor{129} +@anchor{topics/asm c gcc_jit_extended_asm_add_input_operand}@anchor{14d} @deffn {C Function} void gcc_jit_extended_asm_add_input_operand (gcc_jit_extended_asm@w{ }*ext_asm, const char@w{ }*asm_symbolic_name, const char@w{ }*constraint, gcc_jit_rvalue@w{ }*src) Add an input operand to the extended @code{asm} statement. See the @@ -8940,7 +9558,7 @@ gcc_jit_extended_asm_add_input_operand (ext_asm, "aMask", "r", @end deffn @geindex gcc_jit_extended_asm_add_clobber (C function) -@anchor{topics/asm c gcc_jit_extended_asm_add_clobber}@anchor{12a} +@anchor{topics/asm c gcc_jit_extended_asm_add_clobber}@anchor{14e} @deffn {C Function} void gcc_jit_extended_asm_add_clobber (gcc_jit_extended_asm@w{ }*ext_asm, const char@w{ }*victim) Add @cite{victim} to the list of registers clobbered by the extended @code{asm} @@ -8960,18 +9578,18 @@ gcc_jit_extended_asm_add_clobber (ext_asm, "memory"); @end example @end deffn -A @ref{f1,,gcc_jit_extended_asm} is a @ref{e,,gcc_jit_object} “owned” by +A @ref{115,,gcc_jit_extended_asm} is a @ref{e,,gcc_jit_object} “owned” by the block’s context. The following upcast is available: @geindex gcc_jit_extended_asm_as_object (C function) -@anchor{topics/asm c gcc_jit_extended_asm_as_object}@anchor{125} +@anchor{topics/asm c gcc_jit_extended_asm_as_object}@anchor{149} @deffn {C Function} gcc_jit_object * gcc_jit_extended_asm_as_object (gcc_jit_extended_asm@w{ }*ext_asm) Upcast from extended @code{asm} to object. @end deffn @node Adding top-level assembler statements,,Adding assembler instructions within a function,Using Assembly Language with libgccjit -@anchor{topics/asm adding-top-level-assembler-statements}@anchor{134} +@anchor{topics/asm adding-top-level-assembler-statements}@anchor{15c} @subsection Adding top-level assembler statements @@ -8980,7 +9598,7 @@ there is support for creating “top-level” assembler statements, outside of any function. @geindex gcc_jit_context_add_top_level_asm (C function) -@anchor{topics/asm c gcc_jit_context_add_top_level_asm}@anchor{12b} +@anchor{topics/asm c gcc_jit_context_add_top_level_asm}@anchor{14f} @deffn {C Function} void gcc_jit_context_add_top_level_asm (gcc_jit_context@w{ }*ctxt, gcc_jit_location@w{ }*loc, const char@w{ }*asm_stmts) Create a set of top-level asm statements, analogous to those created @@ -9033,7 +9651,7 @@ the following API calls could be used: @c . @node C++ bindings for libgccjit,Internals,Topic Reference,Top -@anchor{cp/index doc}@anchor{135}@anchor{cp/index c-bindings-for-libgccjit}@anchor{136} +@anchor{cp/index doc}@anchor{15d}@anchor{cp/index c-bindings-for-libgccjit}@anchor{15e} @chapter C++ bindings for libgccjit @@ -9073,7 +9691,7 @@ Contents: @end menu @node Tutorial<2>,Topic Reference<2>,,C++ bindings for libgccjit -@anchor{cp/intro/index doc}@anchor{137}@anchor{cp/intro/index tutorial}@anchor{138} +@anchor{cp/intro/index doc}@anchor{15f}@anchor{cp/intro/index tutorial}@anchor{160} @section Tutorial @@ -9103,7 +9721,7 @@ Contents: @end menu @node Tutorial part 1 “Hello world”<2>,Tutorial part 2 Creating a trivial machine code function<2>,,Tutorial<2> -@anchor{cp/intro/tutorial01 doc}@anchor{139}@anchor{cp/intro/tutorial01 tutorial-part-1-hello-world}@anchor{13a} +@anchor{cp/intro/tutorial01 doc}@anchor{161}@anchor{cp/intro/tutorial01 tutorial-part-1-hello-world}@anchor{162} @subsection Tutorial part 1: “Hello world” @@ -9136,7 +9754,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see -. */ +. */ #include @@ -9266,7 +9884,7 @@ hello world @c . @node Tutorial part 2 Creating a trivial machine code function<2>,Tutorial part 3 Loops and variables<2>,Tutorial part 1 “Hello world”<2>,Tutorial<2> -@anchor{cp/intro/tutorial02 doc}@anchor{13b}@anchor{cp/intro/tutorial02 tutorial-part-2-creating-a-trivial-machine-code-function}@anchor{13c} +@anchor{cp/intro/tutorial02 doc}@anchor{163}@anchor{cp/intro/tutorial02 tutorial-part-2-creating-a-trivial-machine-code-function}@anchor{164} @subsection Tutorial part 2: Creating a trivial machine code function @@ -9288,10 +9906,10 @@ First we need to include the relevant header: @end example All state associated with compilation is associated with a -@ref{13d,,gccjit;;context}, which is a thin C++ wrapper around the C API’s +@ref{165,,gccjit;;context}, which is a thin C++ wrapper around the C API’s @ref{8,,gcc_jit_context *}. -Create one using @ref{13e,,gccjit;;context;;acquire()}: +Create one using @ref{166,,gccjit;;context;;acquire()}: @example gccjit::context ctxt; @@ -9301,19 +9919,19 @@ ctxt = gccjit::context::acquire (); The JIT library has a system of types. It is statically-typed: every expression is of a specific type, fixed at compile-time. In our example, all of the expressions are of the C @cite{int} type, so let’s obtain this from -the context, as a @ref{13f,,gccjit;;type}, using -@ref{140,,gccjit;;context;;get_type()}: +the context, as a @ref{167,,gccjit;;type}, using +@ref{168,,gccjit;;context;;get_type()}: @example gccjit::type int_type = ctxt.get_type (GCC_JIT_TYPE_INT); @end example -@ref{13f,,gccjit;;type} is an example of a “contextual” object: every -entity in the API is associated with a @ref{13d,,gccjit;;context}. +@ref{167,,gccjit;;type} is an example of a “contextual” object: every +entity in the API is associated with a @ref{165,,gccjit;;context}. Memory management is easy: all such “contextual” objects are automatically cleaned up for you when the context is released, using -@ref{141,,gccjit;;context;;release()}: +@ref{169,,gccjit;;context;;release()}: @example ctxt.release (); @@ -9340,9 +9958,9 @@ The C++ class hierarchy within the @code{gccjit} namespace looks like this: +- param @end example -One thing you can do with a @ref{142,,gccjit;;object} is +One thing you can do with a @ref{16a,,gccjit;;object} is to ask it for a human-readable description as a @code{std::string}, using -@ref{143,,gccjit;;object;;get_debug_string()}: +@ref{16b,,gccjit;;object;;get_debug_string()}: @example printf ("obj: %s\n", obj.get_debug_string ().c_str ()); @@ -9358,7 +9976,7 @@ This is invaluable when debugging. Let’s create the function. To do so, we first need to construct its single parameter, specifying its type and giving it a name, -using @ref{144,,gccjit;;context;;new_param()}: +using @ref{16c,,gccjit;;context;;new_param()}: @example gccjit::param param_i = ctxt.new_param (int_type, "i"); @@ -9399,7 +10017,7 @@ gccjit::block block = func.new_block (); Our basic block is relatively simple: it immediately terminates by returning the value of an expression. -We can build the expression using @ref{145,,gccjit;;context;;new_binary_op()}: +We can build the expression using @ref{16d,,gccjit;;context;;new_binary_op()}: @example gccjit::rvalue expr = @@ -9408,9 +10026,9 @@ gccjit::rvalue expr = param_i, param_i); @end example -A @ref{146,,gccjit;;rvalue} is another example of a -@ref{142,,gccjit;;object} subclass. As before, we can print it with -@ref{143,,gccjit;;object;;get_debug_string()}. +A @ref{16e,,gccjit;;rvalue} is another example of a +@ref{16a,,gccjit;;object} subclass. As before, we can print it with +@ref{16b,,gccjit;;object;;get_debug_string()}. @example printf ("expr: %s\n", expr.get_debug_string ().c_str ()); @@ -9422,7 +10040,7 @@ giving this output: expr: i * i @end example -Note that @ref{146,,gccjit;;rvalue} provides numerous overloaded operators +Note that @ref{16e,,gccjit;;rvalue} provides numerous overloaded operators which can be used to dramatically reduce the amount of typing needed. We can build the above binary operation more directly with this one-liner: @@ -9439,7 +10057,7 @@ block.end_with_return (expr); @end example OK, we’ve populated the context. We can now compile it using -@ref{147,,gccjit;;context;;compile()}: +@ref{16f,,gccjit;;context;;compile()}: @example gcc_jit_result *result; @@ -9481,12 +10099,12 @@ result: 25 @end menu @node Options<3>,Full example<3>,,Tutorial part 2 Creating a trivial machine code function<2> -@anchor{cp/intro/tutorial02 options}@anchor{148} +@anchor{cp/intro/tutorial02 options}@anchor{170} @subsubsection Options To get more information on what’s going on, you can set debugging flags -on the context using @ref{149,,gccjit;;context;;set_bool_option()}. +on the context using @ref{171,,gccjit;;context;;set_bool_option()}. @c (I'm deliberately not mentioning @c :c:macro:`GCC_JIT_BOOL_OPTION_DUMP_INITIAL_TREE` here since I think @@ -9550,7 +10168,7 @@ square: By default, no optimizations are performed, the equivalent of GCC’s @cite{-O0} option. We can turn things up to e.g. @cite{-O3} by calling -@ref{14a,,gccjit;;context;;set_int_option()} with +@ref{172,,gccjit;;context;;set_int_option()} with @ref{1f,,GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL}: @example @@ -9580,7 +10198,7 @@ square: Naturally this has only a small effect on such a trivial function. @node Full example<3>,,Options<3>,Tutorial part 2 Creating a trivial machine code function<2> -@anchor{cp/intro/tutorial02 full-example}@anchor{14b} +@anchor{cp/intro/tutorial02 full-example}@anchor{173} @subsubsection Full example @@ -9606,7 +10224,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see -. */ +. */ #include @@ -9718,7 +10336,7 @@ result: 25 @c . @node Tutorial part 3 Loops and variables<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>,Tutorial part 2 Creating a trivial machine code function<2>,Tutorial<2> -@anchor{cp/intro/tutorial03 doc}@anchor{14c}@anchor{cp/intro/tutorial03 tutorial-part-3-loops-and-variables}@anchor{14d} +@anchor{cp/intro/tutorial03 doc}@anchor{174}@anchor{cp/intro/tutorial03 tutorial-part-3-loops-and-variables}@anchor{175} @subsection Tutorial part 3: Loops and variables @@ -9774,7 +10392,7 @@ Here’s what the final control flow graph will look like: @end quotation As before, we include the libgccjit++ header and make a -@ref{13d,,gccjit;;context}. +@ref{165,,gccjit;;context}. @example #include @@ -9828,18 +10446,18 @@ gccjit::function func = @end menu @node Expressions lvalues and rvalues<2>,Control flow<2>,,Tutorial part 3 Loops and variables<2> -@anchor{cp/intro/tutorial03 expressions-lvalues-and-rvalues}@anchor{14e} +@anchor{cp/intro/tutorial03 expressions-lvalues-and-rvalues}@anchor{176} @subsubsection Expressions: lvalues and rvalues -The base class of expression is the @ref{146,,gccjit;;rvalue}, +The base class of expression is the @ref{16e,,gccjit;;rvalue}, representing an expression that can be on the @emph{right}-hand side of an assignment: a value that can be computed somehow, and assigned @emph{to} a storage area (such as a variable). It has a specific -@ref{13f,,gccjit;;type}. +@ref{167,,gccjit;;type}. -Anothe important class is @ref{14f,,gccjit;;lvalue}. -A @ref{14f,,gccjit;;lvalue}. is something that can of the @emph{left}-hand +Anothe important class is @ref{177,,gccjit;;lvalue}. +A @ref{177,,gccjit;;lvalue}. is something that can of the @emph{left}-hand side of an assignment: a storage area (such as a variable). In other words, every assignment can be thought of as: @@ -9848,8 +10466,8 @@ In other words, every assignment can be thought of as: LVALUE = RVALUE; @end example -Note that @ref{14f,,gccjit;;lvalue} is a subclass of -@ref{146,,gccjit;;rvalue}, where in an assignment of the form: +Note that @ref{177,,gccjit;;lvalue} is a subclass of +@ref{16e,,gccjit;;rvalue}, where in an assignment of the form: @example LVALUE_A = LVALUE_B; @@ -9879,7 +10497,7 @@ gccjit::rvalue expr = gccjit::rvalue expr = param_i * param_i; @end example -which is a @ref{146,,gccjit;;rvalue}, and +which is a @ref{16e,,gccjit;;rvalue}, and @end quotation @@ -9887,15 +10505,15 @@ which is a @ref{146,,gccjit;;rvalue}, and @item the various function parameters: @cite{param_i} and @cite{param_n}, instances of -@ref{150,,gccjit;;param}, which is a subclass of @ref{14f,,gccjit;;lvalue} -(and, in turn, of @ref{146,,gccjit;;rvalue}): +@ref{178,,gccjit;;param}, which is a subclass of @ref{177,,gccjit;;lvalue} +(and, in turn, of @ref{16e,,gccjit;;rvalue}): we can both read from and write to function parameters within the body of a function. @end enumerate Our new example has a new kind of expression: we have two local variables. We create them by calling -@ref{151,,gccjit;;function;;new_local()}, supplying a type and a name: +@ref{179,,gccjit;;function;;new_local()}, supplying a type and a name: @example /* Build locals: */ @@ -9903,7 +10521,7 @@ gccjit::lvalue i = func.new_local (the_type, "i"); gccjit::lvalue sum = func.new_local (the_type, "sum"); @end example -These are instances of @ref{14f,,gccjit;;lvalue} - they can be read from +These are instances of @ref{177,,gccjit;;lvalue} - they can be read from and written to. Note that there is no precanned way to create @emph{and} initialize a variable @@ -9917,7 +10535,7 @@ Instead, having added the local to the function, we have to separately add an assignment of @cite{0} to @cite{local_i} at the beginning of the function. @node Control flow<2>,Visualizing the control flow graph<2>,Expressions lvalues and rvalues<2>,Tutorial part 3 Loops and variables<2> -@anchor{cp/intro/tutorial03 control-flow}@anchor{152} +@anchor{cp/intro/tutorial03 control-flow}@anchor{17a} @subsubsection Control flow @@ -9940,8 +10558,8 @@ the body of the loop after the loop terminates (@cite{return sum}) @end enumerate -so we create these as @ref{153,,gccjit;;block} instances within the -@ref{154,,gccjit;;function}: +so we create these as @ref{17b,,gccjit;;block} instances within the +@ref{17c,,gccjit;;function}: @example gccjit::block b_initial = func.new_block ("initial"); @@ -9954,8 +10572,8 @@ We now populate each block with statements. The entry block @cite{b_initial} consists of initializations followed by a jump to the conditional. We assign @cite{0} to @cite{i} and to @cite{sum}, using -@ref{155,,gccjit;;block;;add_assignment()} to add -an assignment statement, and using @ref{156,,gccjit;;context;;zero()} to get +@ref{17d,,gccjit;;block;;add_assignment()} to add +an assignment statement, and using @ref{17e,,gccjit;;context;;zero()} to get the constant value @cite{0} for the relevant type for the right-hand side of the assignment: @@ -9976,9 +10594,9 @@ b_initial.end_with_jump (b_loop_cond); The conditional block is equivalent to the line @cite{while (i < n)} from our C example. It contains a single statement: a conditional, which jumps to one of two destination blocks depending on a boolean -@ref{146,,gccjit;;rvalue}, in this case the comparison of @cite{i} and @cite{n}. +@ref{16e,,gccjit;;rvalue}, in this case the comparison of @cite{i} and @cite{n}. -We could build the comparison using @ref{157,,gccjit;;context;;new_comparison()}: +We could build the comparison using @ref{17f,,gccjit;;context;;new_comparison()}: @example gccjit::rvalue guard = @@ -9987,7 +10605,7 @@ gccjit::rvalue guard = @end example and can then use this to add @cite{b_loop_cond}’s sole statement, via -@ref{158,,gccjit;;block;;end_with_conditional()}: +@ref{180,,gccjit;;block;;end_with_conditional()}: @example b_loop_cond.end_with_conditional (guard, @@ -9995,7 +10613,7 @@ b_loop_cond.end_with_conditional (guard, b_loop_body); // on_false @end example -However @ref{146,,gccjit;;rvalue} has overloaded operators for this, so we +However @ref{16e,,gccjit;;rvalue} has overloaded operators for this, so we express the conditional as @example @@ -10015,7 +10633,7 @@ Next, we populate the body of the loop. The C statement @cite{sum += i * i;} is an assignment operation, where an lvalue is modified “in-place”. We use -@ref{159,,gccjit;;block;;add_assignment_op()} to handle these operations: +@ref{181,,gccjit;;block;;add_assignment_op()} to handle these operations: @example /* sum += i * i */ @@ -10039,7 +10657,7 @@ b_loop_body.add_assignment_op (i, @cartouche @quotation Note For numeric constants other than 0 or 1, we could use -@ref{15a,,gccjit;;context;;new_rvalue()}, which has overloads +@ref{182,,gccjit;;context;;new_rvalue()}, which has overloads for both @code{int} and @code{double}. @end quotation @end cartouche @@ -10105,12 +10723,12 @@ result: 285 @end example @node Visualizing the control flow graph<2>,Full example<4>,Control flow<2>,Tutorial part 3 Loops and variables<2> -@anchor{cp/intro/tutorial03 visualizing-the-control-flow-graph}@anchor{15b} +@anchor{cp/intro/tutorial03 visualizing-the-control-flow-graph}@anchor{183} @subsubsection Visualizing the control flow graph You can see the control flow graph of a function using -@ref{15c,,gccjit;;function;;dump_to_dot()}: +@ref{184,,gccjit;;function;;dump_to_dot()}: @example func.dump_to_dot ("/tmp/sum-of-squares.dot"); @@ -10140,7 +10758,7 @@ install it with @cite{yum install python-xdot}): @end quotation @node Full example<4>,,Visualizing the control flow graph<2>,Tutorial part 3 Loops and variables<2> -@anchor{cp/intro/tutorial03 full-example}@anchor{15d} +@anchor{cp/intro/tutorial03 full-example}@anchor{185} @subsubsection Full example @@ -10164,7 +10782,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see -. */ +. */ #include @@ -10318,7 +10936,7 @@ loop_test returned: 285 @c . @node Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>,,Tutorial part 3 Loops and variables<2>,Tutorial<2> -@anchor{cp/intro/tutorial04 doc}@anchor{15e}@anchor{cp/intro/tutorial04 tutorial-part-4-adding-jit-compilation-to-a-toy-interpreter}@anchor{15f} +@anchor{cp/intro/tutorial04 doc}@anchor{186}@anchor{cp/intro/tutorial04 tutorial-part-4-adding-jit-compilation-to-a-toy-interpreter}@anchor{187} @subsection Tutorial part 4: Adding JIT-compilation to a toy interpreter @@ -10340,7 +10958,7 @@ to it. @end menu @node Our toy interpreter<2>,Compiling to machine code<2>,,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2> -@anchor{cp/intro/tutorial04 our-toy-interpreter}@anchor{160} +@anchor{cp/intro/tutorial04 our-toy-interpreter}@anchor{188} @subsubsection Our toy interpreter @@ -10742,7 +11360,7 @@ toyvm_function::interpret (int arg, FILE *trace) @end quotation @node Compiling to machine code<2>,Setting things up<2>,Our toy interpreter<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2> -@anchor{cp/intro/tutorial04 compiling-to-machine-code}@anchor{161} +@anchor{cp/intro/tutorial04 compiling-to-machine-code}@anchor{189} @subsubsection Compiling to machine code @@ -10812,7 +11430,7 @@ This means our compiler has the following state: @end quotation @node Setting things up<2>,Populating the function<2>,Compiling to machine code<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2> -@anchor{cp/intro/tutorial04 setting-things-up}@anchor{162} +@anchor{cp/intro/tutorial04 setting-things-up}@anchor{18a} @subsubsection Setting things up @@ -10902,7 +11520,7 @@ compilation_state::add_pop (gccjit::block block, @end quotation We will support single-stepping through the generated code in the -debugger, so we need to create @ref{163,,gccjit;;location} instances, one +debugger, so we need to create @ref{18b,,gccjit;;location} instances, one per operation in the source code. These will reference the lines of e.g. @code{factorial.toy}. @@ -10962,7 +11580,7 @@ We create the locals within the function. @end quotation @node Populating the function<2>,Verifying the control flow graph<2>,Setting things up<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2> -@anchor{cp/intro/tutorial04 populating-the-function}@anchor{164} +@anchor{cp/intro/tutorial04 populating-the-function}@anchor{18c} @subsubsection Populating the function @@ -10986,7 +11604,7 @@ be consolidated into larger blocks when the optimizer runs. @example for (int pc = 0; pc < toyvmfn.fn_num_ops; pc++) @{ - char buf[16]; + char buf[100]; sprintf (buf, "instr%i", pc); op_blocks[pc] = fn.new_block (buf); @} @@ -11075,7 +11693,7 @@ stack into @code{y} instead erroneously assigned it to @code{x}, leaving @code{y uninitialized. To track this kind of thing down, we can use -@ref{165,,gccjit;;block;;add_comment()} to add descriptive comments +@ref{18d,,gccjit;;block;;add_comment()} to add descriptive comments to the internal representation. This is invaluable when looking through the generated IR for, say @code{factorial}: @@ -11215,14 +11833,14 @@ to the next block. This is analogous to simply incrementing the program counter. @node Verifying the control flow graph<2>,Compiling the context<2>,Populating the function<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2> -@anchor{cp/intro/tutorial04 verifying-the-control-flow-graph}@anchor{166} +@anchor{cp/intro/tutorial04 verifying-the-control-flow-graph}@anchor{18e} @subsubsection Verifying the control flow graph Having finished looping over the blocks, the context is complete. As before, we can verify that the control flow and statements are sane by -using @ref{15c,,gccjit;;function;;dump_to_dot()}: +using @ref{184,,gccjit;;function;;dump_to_dot()}: @example fn.dump_to_dot ("/tmp/factorial.dot"); @@ -11244,7 +11862,7 @@ errors in our compiler. @end quotation @node Compiling the context<2>,Single-stepping through the generated code<2>,Verifying the control flow graph<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2> -@anchor{cp/intro/tutorial04 compiling-the-context}@anchor{167} +@anchor{cp/intro/tutorial04 compiling-the-context}@anchor{18f} @subsubsection Compiling the context @@ -11295,7 +11913,7 @@ private: @end quotation @node Single-stepping through the generated code<2>,Examining the generated code<2>,Compiling the context<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2> -@anchor{cp/intro/tutorial04 single-stepping-through-the-generated-code}@anchor{168} +@anchor{cp/intro/tutorial04 single-stepping-through-the-generated-code}@anchor{190} @subsubsection Single-stepping through the generated code @@ -11309,14 +11927,14 @@ It’s possible to debug the generated code. To do this we need to both: @item Set up source code locations for our statements, so that we can meaningfully step through the code. We did this above by -calling @ref{169,,gccjit;;context;;new_location()} and using the +calling @ref{191,,gccjit;;context;;new_location()} and using the results. @item Enable the generation of debugging information, by setting @ref{42,,GCC_JIT_BOOL_OPTION_DEBUGINFO} on the -@ref{13d,,gccjit;;context} via -@ref{149,,gccjit;;context;;set_bool_option()}: +@ref{165,,gccjit;;context} via +@ref{171,,gccjit;;context;;set_bool_option()}: @example ctxt.set_bool_option (GCC_JIT_BOOL_OPTION_DEBUGINFO, 1); @@ -11380,14 +11998,14 @@ optimization level in a regular compiler. @end cartouche @node Examining the generated code<2>,Putting it all together<2>,Single-stepping through the generated code<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2> -@anchor{cp/intro/tutorial04 examining-the-generated-code}@anchor{16a} +@anchor{cp/intro/tutorial04 examining-the-generated-code}@anchor{192} @subsubsection Examining the generated code How good is the optimized code? We can turn up optimizations, by calling -@ref{14a,,gccjit;;context;;set_int_option()} with +@ref{172,,gccjit;;context;;set_int_option()} with @ref{1f,,GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL}: @example @@ -11555,7 +12173,7 @@ Note that the stack pushing and popping have been eliminated, as has the recursive call (in favor of an iteration). @node Putting it all together<2>,Behind the curtain How does our code get optimized?<2>,Examining the generated code<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2> -@anchor{cp/intro/tutorial04 putting-it-all-together}@anchor{16b} +@anchor{cp/intro/tutorial04 putting-it-all-together}@anchor{193} @subsubsection Putting it all together @@ -11586,7 +12204,7 @@ compiler result: 55 @end example @node Behind the curtain How does our code get optimized?<2>,,Putting it all together<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2> -@anchor{cp/intro/tutorial04 behind-the-curtain-how-does-our-code-get-optimized}@anchor{16c} +@anchor{cp/intro/tutorial04 behind-the-curtain-how-does-our-code-get-optimized}@anchor{194} @subsubsection Behind the curtain: How does our code get optimized? @@ -11764,7 +12382,7 @@ instr9: @} @end example -Note in the above how all the @ref{153,,gccjit;;block} instances we +Note in the above how all the @ref{17b,,gccjit;;block} instances we created have been consolidated into just 3 blocks in GCC’s internal representation: @code{initial}, @code{instr4} and @code{instr9}. @@ -11775,7 +12393,7 @@ representation: @code{initial}, @code{instr4} and @code{instr9}. @end menu @node Optimizing away stack manipulation<2>,Elimination of tail recursion<2>,,Behind the curtain How does our code get optimized?<2> -@anchor{cp/intro/tutorial04 optimizing-away-stack-manipulation}@anchor{16d} +@anchor{cp/intro/tutorial04 optimizing-away-stack-manipulation}@anchor{195} @subsubsection Optimizing away stack manipulation @@ -12039,7 +12657,7 @@ instr9: @end example @node Elimination of tail recursion<2>,,Optimizing away stack manipulation<2>,Behind the curtain How does our code get optimized?<2> -@anchor{cp/intro/tutorial04 elimination-of-tail-recursion}@anchor{16e} +@anchor{cp/intro/tutorial04 elimination-of-tail-recursion}@anchor{196} @subsubsection Elimination of tail recursion @@ -12122,7 +12740,7 @@ instr9: @c . @node Topic Reference<2>,,Tutorial<2>,C++ bindings for libgccjit -@anchor{cp/topics/index doc}@anchor{16f}@anchor{cp/topics/index topic-reference}@anchor{170} +@anchor{cp/topics/index doc}@anchor{197}@anchor{cp/topics/index topic-reference}@anchor{198} @section Topic Reference @@ -12156,22 +12774,22 @@ instr9: @end menu @node Compilation contexts<2>,Objects<2>,,Topic Reference<2> -@anchor{cp/topics/contexts doc}@anchor{171}@anchor{cp/topics/contexts compilation-contexts}@anchor{172} +@anchor{cp/topics/contexts doc}@anchor{199}@anchor{cp/topics/contexts compilation-contexts}@anchor{19a} @subsection Compilation contexts @geindex gccjit;;context (C++ class) -@anchor{cp/topics/contexts _CPPv4N6gccjit7contextE}@anchor{13d}@anchor{cp/topics/contexts _CPPv3N6gccjit7contextE}@anchor{173}@anchor{cp/topics/contexts _CPPv2N6gccjit7contextE}@anchor{174}@anchor{cp/topics/contexts gccjit context}@anchor{175} +@anchor{cp/topics/contexts _CPPv4N6gccjit7contextE}@anchor{165}@anchor{cp/topics/contexts _CPPv3N6gccjit7contextE}@anchor{19b}@anchor{cp/topics/contexts _CPPv2N6gccjit7contextE}@anchor{19c}@anchor{cp/topics/contexts gccjit context}@anchor{19d} @deffn {C++ Class} gccjit::context @end deffn -The top-level of the C++ API is the @ref{13d,,gccjit;;context} type. +The top-level of the C++ API is the @ref{165,,gccjit;;context} type. -A @ref{13d,,gccjit;;context} instance encapsulates the state of a +A @ref{165,,gccjit;;context} instance encapsulates the state of a compilation. You can set up options on it, and add types, functions and code. -Invoking @ref{147,,gccjit;;context;;compile()} on it gives you a +Invoking @ref{16f,,gccjit;;context;;compile()} on it gives you a @ref{16,,gcc_jit_result *}. It is a thin wrapper around the C API’s @ref{8,,gcc_jit_context *}. @@ -12186,7 +12804,7 @@ It is a thin wrapper around the C API’s @ref{8,,gcc_jit_context *}. @end menu @node Lifetime-management<2>,Thread-safety<2>,,Compilation contexts<2> -@anchor{cp/topics/contexts lifetime-management}@anchor{176} +@anchor{cp/topics/contexts lifetime-management}@anchor{19e} @subsubsection Lifetime-management @@ -12195,17 +12813,17 @@ have their lifetime bounded by the context they are created within, and cleanup of such objects is done for you when the context is released. @geindex gccjit;;context;;acquire (C++ function) -@anchor{cp/topics/contexts _CPPv4N6gccjit7context7acquireEv}@anchor{13e}@anchor{cp/topics/contexts _CPPv3N6gccjit7context7acquireEv}@anchor{177}@anchor{cp/topics/contexts _CPPv2N6gccjit7context7acquireEv}@anchor{178}@anchor{cp/topics/contexts gccjit context acquire}@anchor{179} -@deffn {C++ Function} gccjit::@ref{13d,,context} gccjit::@ref{13d,,context}::acquire () +@anchor{cp/topics/contexts _CPPv4N6gccjit7context7acquireEv}@anchor{166}@anchor{cp/topics/contexts _CPPv3N6gccjit7context7acquireEv}@anchor{19f}@anchor{cp/topics/contexts _CPPv2N6gccjit7context7acquireEv}@anchor{1a0}@anchor{cp/topics/contexts gccjit context acquire}@anchor{1a1} +@deffn {C++ Function} gccjit::@ref{165,,context} gccjit::@ref{165,,context}::acquire () -This function acquires a new @ref{13d,,gccjit;;context} instance, +This function acquires a new @ref{165,,gccjit;;context} instance, which is independent of any others that may be present within this process. @end deffn @geindex gccjit;;context;;release (C++ function) -@anchor{cp/topics/contexts _CPPv4N6gccjit7context7releaseEv}@anchor{141}@anchor{cp/topics/contexts _CPPv3N6gccjit7context7releaseEv}@anchor{17a}@anchor{cp/topics/contexts _CPPv2N6gccjit7context7releaseEv}@anchor{17b}@anchor{cp/topics/contexts gccjit context release}@anchor{17c} -@deffn {C++ Function} void gccjit::@ref{13d,,context}::release () +@anchor{cp/topics/contexts _CPPv4N6gccjit7context7releaseEv}@anchor{169}@anchor{cp/topics/contexts _CPPv3N6gccjit7context7releaseEv}@anchor{1a2}@anchor{cp/topics/contexts _CPPv2N6gccjit7context7releaseEv}@anchor{1a3}@anchor{cp/topics/contexts gccjit context release}@anchor{1a4} +@deffn {C++ Function} void gccjit::@ref{165,,context}::release () This function releases all resources associated with the given context. Both the context itself and all of its @code{gccjit::object *} @@ -12221,8 +12839,8 @@ ctxt.release (); @end deffn @geindex gccjit;;context;;new_child_context (C++ function) -@anchor{cp/topics/contexts _CPPv4N6gccjit7context17new_child_contextEv}@anchor{17d}@anchor{cp/topics/contexts _CPPv3N6gccjit7context17new_child_contextEv}@anchor{17e}@anchor{cp/topics/contexts _CPPv2N6gccjit7context17new_child_contextEv}@anchor{17f}@anchor{cp/topics/contexts gccjit context new_child_context}@anchor{180} -@deffn {C++ Function} gccjit::@ref{13d,,context} gccjit::@ref{13d,,context}::new_child_context () +@anchor{cp/topics/contexts _CPPv4N6gccjit7context17new_child_contextEv}@anchor{1a5}@anchor{cp/topics/contexts _CPPv3N6gccjit7context17new_child_contextEv}@anchor{1a6}@anchor{cp/topics/contexts _CPPv2N6gccjit7context17new_child_contextEv}@anchor{1a7}@anchor{cp/topics/contexts gccjit context new_child_context}@anchor{1a8} +@deffn {C++ Function} gccjit::@ref{165,,context} gccjit::@ref{165,,context}::new_child_context () Given an existing JIT context, create a child context. @@ -12253,16 +12871,16 @@ there will likely be a performance hit for such nesting. @end deffn @node Thread-safety<2>,Error-handling<3>,Lifetime-management<2>,Compilation contexts<2> -@anchor{cp/topics/contexts thread-safety}@anchor{181} +@anchor{cp/topics/contexts thread-safety}@anchor{1a9} @subsubsection Thread-safety -Instances of @ref{13d,,gccjit;;context} created via -@ref{13e,,gccjit;;context;;acquire()} are independent from each other: +Instances of @ref{165,,gccjit;;context} created via +@ref{166,,gccjit;;context;;acquire()} are independent from each other: only one thread may use a given context at once, but multiple threads could each have their own contexts without needing locks. -Contexts created via @ref{17d,,gccjit;;context;;new_child_context()} are +Contexts created via @ref{1a5,,gccjit;;context;;new_child_context()} are related to their parent context. They can be partitioned by their ultimate ancestor into independent “family trees”. Only one thread within a process may use a given “family tree” of such contexts at once, @@ -12270,7 +12888,7 @@ and if you’re using multiple threads you should provide your own locking around entire such context partitions. @node Error-handling<3>,Debugging<2>,Thread-safety<2>,Compilation contexts<2> -@anchor{cp/topics/contexts error-handling}@anchor{182} +@anchor{cp/topics/contexts error-handling}@anchor{1aa} @subsubsection Error-handling @@ -12283,11 +12901,11 @@ NULL. You don’t have to check everywhere for NULL results, since the API gracefully handles a NULL being passed in for any argument. Errors are printed on stderr and can be queried using -@ref{183,,gccjit;;context;;get_first_error()}. +@ref{1ab,,gccjit;;context;;get_first_error()}. @geindex gccjit;;context;;get_first_error (C++ function) -@anchor{cp/topics/contexts _CPPv4N6gccjit7context15get_first_errorEPN6gccjit7contextE}@anchor{183}@anchor{cp/topics/contexts _CPPv3N6gccjit7context15get_first_errorEPN6gccjit7contextE}@anchor{184}@anchor{cp/topics/contexts _CPPv2N6gccjit7context15get_first_errorEPN6gccjit7contextE}@anchor{185}@anchor{cp/topics/contexts gccjit context get_first_error__gccjit contextP}@anchor{186} -@deffn {C++ Function} const char *gccjit::@ref{13d,,context}::get_first_error (gccjit::context *ctxt) +@anchor{cp/topics/contexts _CPPv4N6gccjit7context15get_first_errorEPN6gccjit7contextE}@anchor{1ab}@anchor{cp/topics/contexts _CPPv3N6gccjit7context15get_first_errorEPN6gccjit7contextE}@anchor{1ac}@anchor{cp/topics/contexts _CPPv2N6gccjit7context15get_first_errorEPN6gccjit7contextE}@anchor{1ad}@anchor{cp/topics/contexts gccjit context get_first_error__gccjit contextP}@anchor{1ae} +@deffn {C++ Function} const char *gccjit::@ref{165,,context}::get_first_error (gccjit::context *ctxt) Returns the first error message that occurred on the context. @@ -12298,18 +12916,18 @@ If no errors occurred, this will be NULL. @end deffn @node Debugging<2>,Options<4>,Error-handling<3>,Compilation contexts<2> -@anchor{cp/topics/contexts debugging}@anchor{187} +@anchor{cp/topics/contexts debugging}@anchor{1af} @subsubsection Debugging @geindex gccjit;;context;;dump_to_file (C++ function) -@anchor{cp/topics/contexts _CPPv4N6gccjit7context12dump_to_fileERKNSt6stringEi}@anchor{188}@anchor{cp/topics/contexts _CPPv3N6gccjit7context12dump_to_fileERKNSt6stringEi}@anchor{189}@anchor{cp/topics/contexts _CPPv2N6gccjit7context12dump_to_fileERKNSt6stringEi}@anchor{18a}@anchor{cp/topics/contexts gccjit context dump_to_file__ssCR i}@anchor{18b} -@deffn {C++ Function} void gccjit::@ref{13d,,context}::dump_to_file (const std::string &path, int update_locations) +@anchor{cp/topics/contexts _CPPv4N6gccjit7context12dump_to_fileERKNSt6stringEi}@anchor{1b0}@anchor{cp/topics/contexts _CPPv3N6gccjit7context12dump_to_fileERKNSt6stringEi}@anchor{1b1}@anchor{cp/topics/contexts _CPPv2N6gccjit7context12dump_to_fileERKNSt6stringEi}@anchor{1b2}@anchor{cp/topics/contexts gccjit context dump_to_file__ssCR i}@anchor{1b3} +@deffn {C++ Function} void gccjit::@ref{165,,context}::dump_to_file (const std::string &path, int update_locations) To help with debugging: dump a C-like representation to the given path, describing what’s been set up on the context. -If “update_locations” is true, then also set up @ref{163,,gccjit;;location} +If “update_locations” is true, then also set up @ref{18b,,gccjit;;location} information throughout the context, pointing at the dump file as if it were a source file. This may be of use in conjunction with @code{GCCJIT::BOOL_OPTION_DEBUGINFO} to allow stepping through the @@ -12317,8 +12935,8 @@ code in a debugger. @end deffn @geindex gccjit;;context;;dump_reproducer_to_file (C++ function) -@anchor{cp/topics/contexts _CPPv4N6gccjit7context23dump_reproducer_to_fileEP15gcc_jit_contextPKc}@anchor{18c}@anchor{cp/topics/contexts _CPPv3N6gccjit7context23dump_reproducer_to_fileEP15gcc_jit_contextPKc}@anchor{18d}@anchor{cp/topics/contexts _CPPv2N6gccjit7context23dump_reproducer_to_fileEP15gcc_jit_contextPKc}@anchor{18e}@anchor{cp/topics/contexts gccjit context dump_reproducer_to_file__gcc_jit_contextP cCP}@anchor{18f} -@deffn {C++ Function} void gccjit::@ref{13d,,context}::dump_reproducer_to_file (gcc_jit_context *ctxt, const char *path) +@anchor{cp/topics/contexts _CPPv4N6gccjit7context23dump_reproducer_to_fileEP15gcc_jit_contextPKc}@anchor{1b4}@anchor{cp/topics/contexts _CPPv3N6gccjit7context23dump_reproducer_to_fileEP15gcc_jit_contextPKc}@anchor{1b5}@anchor{cp/topics/contexts _CPPv2N6gccjit7context23dump_reproducer_to_fileEP15gcc_jit_contextPKc}@anchor{1b6}@anchor{cp/topics/contexts gccjit context dump_reproducer_to_file__gcc_jit_contextP cCP}@anchor{1b7} +@deffn {C++ Function} void gccjit::@ref{165,,context}::dump_reproducer_to_file (gcc_jit_context *ctxt, const char *path) This is a thin wrapper around the C API @ref{5d,,gcc_jit_context_dump_reproducer_to_file()}, and hence works the @@ -12329,7 +12947,7 @@ for seeing what the C++ bindings are doing at the C level. @end deffn @node Options<4>,,Debugging<2>,Compilation contexts<2> -@anchor{cp/topics/contexts options}@anchor{190} +@anchor{cp/topics/contexts options}@anchor{1b8} @subsubsection Options @@ -12342,13 +12960,13 @@ for seeing what the C++ bindings are doing at the C level. @end menu @node String Options<2>,Boolean options<2>,,Options<4> -@anchor{cp/topics/contexts string-options}@anchor{191} +@anchor{cp/topics/contexts string-options}@anchor{1b9} @subsubsection String Options @geindex gccjit;;context;;set_str_option (C++ function) -@anchor{cp/topics/contexts _CPPv4N6gccjit7context14set_str_optionE18gcc_jit_str_optionPKc}@anchor{192}@anchor{cp/topics/contexts _CPPv3N6gccjit7context14set_str_optionE18gcc_jit_str_optionPKc}@anchor{193}@anchor{cp/topics/contexts _CPPv2N6gccjit7context14set_str_optionE18gcc_jit_str_optionPKc}@anchor{194}@anchor{cp/topics/contexts gccjit context set_str_option__gcc_jit_str_option cCP}@anchor{195} -@deffn {C++ Function} void gccjit::@ref{13d,,context}::set_str_option (enum gcc_jit_str_option, const char *value) +@anchor{cp/topics/contexts _CPPv4N6gccjit7context14set_str_optionE18gcc_jit_str_optionPKc}@anchor{1ba}@anchor{cp/topics/contexts _CPPv3N6gccjit7context14set_str_optionE18gcc_jit_str_optionPKc}@anchor{1bb}@anchor{cp/topics/contexts _CPPv2N6gccjit7context14set_str_optionE18gcc_jit_str_optionPKc}@anchor{1bc}@anchor{cp/topics/contexts gccjit context set_str_option__gcc_jit_str_option cCP}@anchor{1bd} +@deffn {C++ Function} void gccjit::@ref{165,,context}::set_str_option (enum gcc_jit_str_option, const char *value) Set a string option of the context. @@ -12358,13 +12976,13 @@ meaning. @end deffn @node Boolean options<2>,Integer options<2>,String Options<2>,Options<4> -@anchor{cp/topics/contexts boolean-options}@anchor{196} +@anchor{cp/topics/contexts boolean-options}@anchor{1be} @subsubsection Boolean options @geindex gccjit;;context;;set_bool_option (C++ function) -@anchor{cp/topics/contexts _CPPv4N6gccjit7context15set_bool_optionE19gcc_jit_bool_optioni}@anchor{149}@anchor{cp/topics/contexts _CPPv3N6gccjit7context15set_bool_optionE19gcc_jit_bool_optioni}@anchor{197}@anchor{cp/topics/contexts _CPPv2N6gccjit7context15set_bool_optionE19gcc_jit_bool_optioni}@anchor{198}@anchor{cp/topics/contexts gccjit context set_bool_option__gcc_jit_bool_option i}@anchor{199} -@deffn {C++ Function} void gccjit::@ref{13d,,context}::set_bool_option (enum gcc_jit_bool_option, int value) +@anchor{cp/topics/contexts _CPPv4N6gccjit7context15set_bool_optionE19gcc_jit_bool_optioni}@anchor{171}@anchor{cp/topics/contexts _CPPv3N6gccjit7context15set_bool_optionE19gcc_jit_bool_optioni}@anchor{1bf}@anchor{cp/topics/contexts _CPPv2N6gccjit7context15set_bool_optionE19gcc_jit_bool_optioni}@anchor{1c0}@anchor{cp/topics/contexts gccjit context set_bool_option__gcc_jit_bool_option i}@anchor{1c1} +@deffn {C++ Function} void gccjit::@ref{165,,context}::set_bool_option (enum gcc_jit_bool_option, int value) Set a boolean option of the context. @@ -12374,8 +12992,8 @@ meaning. @end deffn @geindex gccjit;;context;;set_bool_allow_unreachable_blocks (C++ function) -@anchor{cp/topics/contexts _CPPv4N6gccjit7context33set_bool_allow_unreachable_blocksEi}@anchor{19a}@anchor{cp/topics/contexts _CPPv3N6gccjit7context33set_bool_allow_unreachable_blocksEi}@anchor{19b}@anchor{cp/topics/contexts _CPPv2N6gccjit7context33set_bool_allow_unreachable_blocksEi}@anchor{19c}@anchor{cp/topics/contexts gccjit context set_bool_allow_unreachable_blocks__i}@anchor{19d} -@deffn {C++ Function} void gccjit::@ref{13d,,context}::set_bool_allow_unreachable_blocks (int bool_value) +@anchor{cp/topics/contexts _CPPv4N6gccjit7context33set_bool_allow_unreachable_blocksEi}@anchor{1c2}@anchor{cp/topics/contexts _CPPv3N6gccjit7context33set_bool_allow_unreachable_blocksEi}@anchor{1c3}@anchor{cp/topics/contexts _CPPv2N6gccjit7context33set_bool_allow_unreachable_blocksEi}@anchor{1c4}@anchor{cp/topics/contexts gccjit context set_bool_allow_unreachable_blocks__i}@anchor{1c5} +@deffn {C++ Function} void gccjit::@ref{165,,context}::set_bool_allow_unreachable_blocks (int bool_value) By default, libgccjit will issue an error about unreachable blocks within a function. @@ -12393,8 +13011,8 @@ its presence using @end deffn @geindex gccjit;;context;;set_bool_use_external_driver (C++ function) -@anchor{cp/topics/contexts _CPPv4N6gccjit7context28set_bool_use_external_driverEi}@anchor{19e}@anchor{cp/topics/contexts _CPPv3N6gccjit7context28set_bool_use_external_driverEi}@anchor{19f}@anchor{cp/topics/contexts _CPPv2N6gccjit7context28set_bool_use_external_driverEi}@anchor{1a0}@anchor{cp/topics/contexts gccjit context set_bool_use_external_driver__i}@anchor{1a1} -@deffn {C++ Function} void gccjit::@ref{13d,,context}::set_bool_use_external_driver (int bool_value) +@anchor{cp/topics/contexts _CPPv4N6gccjit7context28set_bool_use_external_driverEi}@anchor{1c6}@anchor{cp/topics/contexts _CPPv3N6gccjit7context28set_bool_use_external_driverEi}@anchor{1c7}@anchor{cp/topics/contexts _CPPv2N6gccjit7context28set_bool_use_external_driverEi}@anchor{1c8}@anchor{cp/topics/contexts gccjit context set_bool_use_external_driver__i}@anchor{1c9} +@deffn {C++ Function} void gccjit::@ref{165,,context}::set_bool_use_external_driver (int bool_value) libgccjit internally generates assembler, and uses “driver” code for converting it to other formats (e.g. shared libraries). @@ -12415,13 +13033,13 @@ its presence using @end deffn @node Integer options<2>,Additional command-line options<2>,Boolean options<2>,Options<4> -@anchor{cp/topics/contexts integer-options}@anchor{1a2} +@anchor{cp/topics/contexts integer-options}@anchor{1ca} @subsubsection Integer options @geindex gccjit;;context;;set_int_option (C++ function) -@anchor{cp/topics/contexts _CPPv4N6gccjit7context14set_int_optionE18gcc_jit_int_optioni}@anchor{14a}@anchor{cp/topics/contexts _CPPv3N6gccjit7context14set_int_optionE18gcc_jit_int_optioni}@anchor{1a3}@anchor{cp/topics/contexts _CPPv2N6gccjit7context14set_int_optionE18gcc_jit_int_optioni}@anchor{1a4}@anchor{cp/topics/contexts gccjit context set_int_option__gcc_jit_int_option i}@anchor{1a5} -@deffn {C++ Function} void gccjit::@ref{13d,,context}::set_int_option (enum gcc_jit_int_option, int value) +@anchor{cp/topics/contexts _CPPv4N6gccjit7context14set_int_optionE18gcc_jit_int_optioni}@anchor{172}@anchor{cp/topics/contexts _CPPv3N6gccjit7context14set_int_optionE18gcc_jit_int_optioni}@anchor{1cb}@anchor{cp/topics/contexts _CPPv2N6gccjit7context14set_int_optionE18gcc_jit_int_optioni}@anchor{1cc}@anchor{cp/topics/contexts gccjit context set_int_option__gcc_jit_int_option i}@anchor{1cd} +@deffn {C++ Function} void gccjit::@ref{165,,context}::set_int_option (enum gcc_jit_int_option, int value) Set an integer option of the context. @@ -12431,13 +13049,13 @@ meaning. @end deffn @node Additional command-line options<2>,,Integer options<2>,Options<4> -@anchor{cp/topics/contexts additional-command-line-options}@anchor{1a6} +@anchor{cp/topics/contexts additional-command-line-options}@anchor{1ce} @subsubsection Additional command-line options @geindex gccjit;;context;;add_command_line_option (C++ function) -@anchor{cp/topics/contexts _CPPv4N6gccjit7context23add_command_line_optionEPKc}@anchor{1a7}@anchor{cp/topics/contexts _CPPv3N6gccjit7context23add_command_line_optionEPKc}@anchor{1a8}@anchor{cp/topics/contexts _CPPv2N6gccjit7context23add_command_line_optionEPKc}@anchor{1a9}@anchor{cp/topics/contexts gccjit context add_command_line_option__cCP}@anchor{1aa} -@deffn {C++ Function} void gccjit::@ref{13d,,context}::add_command_line_option (const char *optname) +@anchor{cp/topics/contexts _CPPv4N6gccjit7context23add_command_line_optionEPKc}@anchor{1cf}@anchor{cp/topics/contexts _CPPv3N6gccjit7context23add_command_line_optionEPKc}@anchor{1d0}@anchor{cp/topics/contexts _CPPv2N6gccjit7context23add_command_line_optionEPKc}@anchor{1d1}@anchor{cp/topics/contexts gccjit context add_command_line_option__cCP}@anchor{1d2} +@deffn {C++ Function} void gccjit::@ref{165,,context}::add_command_line_option (const char *optname) Add an arbitrary gcc command-line option to the context for use when compiling. @@ -12471,18 +13089,18 @@ its presence using @c . @node Objects<2>,Types<2>,Compilation contexts<2>,Topic Reference<2> -@anchor{cp/topics/objects doc}@anchor{1ab}@anchor{cp/topics/objects objects}@anchor{1ac} +@anchor{cp/topics/objects doc}@anchor{1d3}@anchor{cp/topics/objects objects}@anchor{1d4} @subsection Objects @geindex gccjit;;object (C++ class) -@anchor{cp/topics/objects _CPPv4N6gccjit6objectE}@anchor{142}@anchor{cp/topics/objects _CPPv3N6gccjit6objectE}@anchor{1ad}@anchor{cp/topics/objects _CPPv2N6gccjit6objectE}@anchor{1ae}@anchor{cp/topics/objects gccjit object}@anchor{1af} +@anchor{cp/topics/objects _CPPv4N6gccjit6objectE}@anchor{16a}@anchor{cp/topics/objects _CPPv3N6gccjit6objectE}@anchor{1d5}@anchor{cp/topics/objects _CPPv2N6gccjit6objectE}@anchor{1d6}@anchor{cp/topics/objects gccjit object}@anchor{1d7} @deffn {C++ Class} gccjit::object @end deffn Almost every entity in the API (with the exception of -@ref{13d,,gccjit;;context} and @ref{16,,gcc_jit_result *}) is a -“contextual” object, a @ref{142,,gccjit;;object}. +@ref{165,,gccjit;;context} and @ref{16,,gcc_jit_result *}) is a +“contextual” object, a @ref{16a,,gccjit;;object}. A JIT object: @@ -12492,7 +13110,7 @@ A JIT object: @itemize * @item -is associated with a @ref{13d,,gccjit;;context}. +is associated with a @ref{165,,gccjit;;context}. @item is automatically cleaned up for you when its context is released so @@ -12517,18 +13135,18 @@ The C++ class hierarchy within the @code{gccjit} namespace looks like this: +- case_ @end example -The @ref{142,,gccjit;;object} base class has the following operations: +The @ref{16a,,gccjit;;object} base class has the following operations: @geindex gccjit;;object;;get_context (C++ function) -@anchor{cp/topics/objects _CPPv4NK6gccjit6object11get_contextEv}@anchor{1b0}@anchor{cp/topics/objects _CPPv3NK6gccjit6object11get_contextEv}@anchor{1b1}@anchor{cp/topics/objects _CPPv2NK6gccjit6object11get_contextEv}@anchor{1b2}@anchor{cp/topics/objects gccjit object get_contextC}@anchor{1b3} -@deffn {C++ Function} gccjit::@ref{13d,,context} gccjit::@ref{142,,object}::get_context () const +@anchor{cp/topics/objects _CPPv4NK6gccjit6object11get_contextEv}@anchor{1d8}@anchor{cp/topics/objects _CPPv3NK6gccjit6object11get_contextEv}@anchor{1d9}@anchor{cp/topics/objects _CPPv2NK6gccjit6object11get_contextEv}@anchor{1da}@anchor{cp/topics/objects gccjit object get_contextC}@anchor{1db} +@deffn {C++ Function} gccjit::@ref{165,,context} gccjit::@ref{16a,,object}::get_context () const Which context is the obj within? @end deffn @geindex gccjit;;object;;get_debug_string (C++ function) -@anchor{cp/topics/objects _CPPv4NK6gccjit6object16get_debug_stringEv}@anchor{143}@anchor{cp/topics/objects _CPPv3NK6gccjit6object16get_debug_stringEv}@anchor{1b4}@anchor{cp/topics/objects _CPPv2NK6gccjit6object16get_debug_stringEv}@anchor{1b5}@anchor{cp/topics/objects gccjit object get_debug_stringC}@anchor{1b6} -@deffn {C++ Function} std::string gccjit::@ref{142,,object}::get_debug_string () const +@anchor{cp/topics/objects _CPPv4NK6gccjit6object16get_debug_stringEv}@anchor{16b}@anchor{cp/topics/objects _CPPv3NK6gccjit6object16get_debug_stringEv}@anchor{1dc}@anchor{cp/topics/objects _CPPv2NK6gccjit6object16get_debug_stringEv}@anchor{1dd}@anchor{cp/topics/objects gccjit object get_debug_stringC}@anchor{1de} +@deffn {C++ Function} std::string gccjit::@ref{16a,,object}::get_debug_string () const Generate a human-readable description for the given object. @@ -12563,16 +13181,16 @@ obj: 4.0 * (float)i @c . @node Types<2>,Expressions<2>,Objects<2>,Topic Reference<2> -@anchor{cp/topics/types doc}@anchor{1b7}@anchor{cp/topics/types types}@anchor{1b8} +@anchor{cp/topics/types doc}@anchor{1df}@anchor{cp/topics/types types}@anchor{1e0} @subsection Types @geindex gccjit;;type (C++ class) -@anchor{cp/topics/types _CPPv4N6gccjit4typeE}@anchor{13f}@anchor{cp/topics/types _CPPv3N6gccjit4typeE}@anchor{1b9}@anchor{cp/topics/types _CPPv2N6gccjit4typeE}@anchor{1ba}@anchor{cp/topics/types gccjit type}@anchor{1bb} +@anchor{cp/topics/types _CPPv4N6gccjit4typeE}@anchor{167}@anchor{cp/topics/types _CPPv3N6gccjit4typeE}@anchor{1e1}@anchor{cp/topics/types _CPPv2N6gccjit4typeE}@anchor{1e2}@anchor{cp/topics/types gccjit type}@anchor{1e3} @deffn {C++ Class} gccjit::type gccjit::type represents a type within the library. It is a subclass -of @ref{142,,gccjit;;object}. +of @ref{16a,,gccjit;;object}. @end deffn Types can be created in several ways: @@ -12582,7 +13200,7 @@ Types can be created in several ways: @item fundamental types can be accessed using -@ref{140,,gccjit;;context;;get_type()}: +@ref{168,,gccjit;;context;;get_type()}: @example gccjit::type int_type = ctxt.get_type (GCC_JIT_TYPE_INT); @@ -12598,7 +13216,7 @@ See @ref{b,,gcc_jit_context_get_type()} for the available types. @item derived types can be accessed by using functions such as -@ref{1bc,,gccjit;;type;;get_pointer()} and @ref{1bd,,gccjit;;type;;get_const()}: +@ref{1e4,,gccjit;;type;;get_pointer()} and @ref{1e5,,gccjit;;type;;get_const()}: @example gccjit::type const_int_star = int_type.get_const ().get_pointer (); @@ -12618,28 +13236,28 @@ by creating structures (see below). @end menu @node Standard types<2>,Pointers const and volatile<2>,,Types<2> -@anchor{cp/topics/types standard-types}@anchor{1be} +@anchor{cp/topics/types standard-types}@anchor{1e6} @subsubsection Standard types @geindex gccjit;;context;;get_type (C++ function) -@anchor{cp/topics/types _CPPv4N6gccjit7context8get_typeE13gcc_jit_types}@anchor{140}@anchor{cp/topics/types _CPPv3N6gccjit7context8get_typeE13gcc_jit_types}@anchor{1bf}@anchor{cp/topics/types _CPPv2N6gccjit7context8get_typeE13gcc_jit_types}@anchor{1c0}@anchor{cp/topics/types gccjit context get_type__gcc_jit_types}@anchor{1c1} -@deffn {C++ Function} gccjit::@ref{13f,,type} gccjit::@ref{13d,,context}::get_type (enum gcc_jit_types) +@anchor{cp/topics/types _CPPv4N6gccjit7context8get_typeE13gcc_jit_types}@anchor{168}@anchor{cp/topics/types _CPPv3N6gccjit7context8get_typeE13gcc_jit_types}@anchor{1e7}@anchor{cp/topics/types _CPPv2N6gccjit7context8get_typeE13gcc_jit_types}@anchor{1e8}@anchor{cp/topics/types gccjit context get_type__gcc_jit_types}@anchor{1e9} +@deffn {C++ Function} gccjit::@ref{167,,type} gccjit::@ref{165,,context}::get_type (enum gcc_jit_types) Access a specific type. This is a thin wrapper around @ref{b,,gcc_jit_context_get_type()}; the parameter has the same meaning. @end deffn @geindex gccjit;;context;;get_int_type (C++ function) -@anchor{cp/topics/types _CPPv4N6gccjit7context12get_int_typeE6size_ti}@anchor{1c2}@anchor{cp/topics/types _CPPv3N6gccjit7context12get_int_typeE6size_ti}@anchor{1c3}@anchor{cp/topics/types _CPPv2N6gccjit7context12get_int_typeE6size_ti}@anchor{1c4}@anchor{cp/topics/types gccjit context get_int_type__s i}@anchor{1c5} -@deffn {C++ Function} gccjit::@ref{13f,,type} gccjit::@ref{13d,,context}::get_int_type (size_t num_bytes, int is_signed) +@anchor{cp/topics/types _CPPv4N6gccjit7context12get_int_typeE6size_ti}@anchor{1ea}@anchor{cp/topics/types _CPPv3N6gccjit7context12get_int_typeE6size_ti}@anchor{1eb}@anchor{cp/topics/types _CPPv2N6gccjit7context12get_int_typeE6size_ti}@anchor{1ec}@anchor{cp/topics/types gccjit context get_int_type__s i}@anchor{1ed} +@deffn {C++ Function} gccjit::@ref{167,,type} gccjit::@ref{165,,context}::get_int_type (size_t num_bytes, int is_signed) Access the integer type of the given size. @end deffn @geindex gccjit;;context;;get_int_type (C++ function) -@anchor{cp/topics/types _CPPv4IEN6gccjit7context12get_int_typeI1TEEN6gccjit4typeEv}@anchor{1c6}@anchor{cp/topics/types _CPPv3IEN6gccjit7context12get_int_typeI1TEEv}@anchor{1c7}@anchor{cp/topics/types _CPPv2IEN6gccjit7context12get_int_typeI1TEEv}@anchor{1c8} -@deffn {C++ Function} template<>gccjit::@ref{13f,,type} gccjit::@ref{13d,,context}::get_int_type () +@anchor{cp/topics/types _CPPv4IEN6gccjit7context12get_int_typeI1TEEN6gccjit4typeEv}@anchor{1ee}@anchor{cp/topics/types _CPPv3IEN6gccjit7context12get_int_typeI1TEEv}@anchor{1ef}@anchor{cp/topics/types _CPPv2IEN6gccjit7context12get_int_typeI1TEEv}@anchor{1f0} +@deffn {C++ Function} template<>gccjit::@ref{167,,type} gccjit::@ref{165,,context}::get_int_type () Access the given integer type. For example, you could map the @code{unsigned short} type into a gccjit::type via: @@ -12650,34 +13268,34 @@ gccjit::type t = ctxt.get_int_type (); @end deffn @node Pointers const and volatile<2>,Vector types<2>,Standard types<2>,Types<2> -@anchor{cp/topics/types pointers-const-and-volatile}@anchor{1c9} +@anchor{cp/topics/types pointers-const-and-volatile}@anchor{1f1} @subsubsection Pointers, @cite{const}, and @cite{volatile} @geindex gccjit;;type;;get_pointer (C++ function) -@anchor{cp/topics/types _CPPv4N6gccjit4type11get_pointerEv}@anchor{1bc}@anchor{cp/topics/types _CPPv3N6gccjit4type11get_pointerEv}@anchor{1ca}@anchor{cp/topics/types _CPPv2N6gccjit4type11get_pointerEv}@anchor{1cb}@anchor{cp/topics/types gccjit type get_pointer}@anchor{1cc} -@deffn {C++ Function} gccjit::@ref{13f,,type} gccjit::@ref{13f,,type}::get_pointer () +@anchor{cp/topics/types _CPPv4N6gccjit4type11get_pointerEv}@anchor{1e4}@anchor{cp/topics/types _CPPv3N6gccjit4type11get_pointerEv}@anchor{1f2}@anchor{cp/topics/types _CPPv2N6gccjit4type11get_pointerEv}@anchor{1f3}@anchor{cp/topics/types gccjit type get_pointer}@anchor{1f4} +@deffn {C++ Function} gccjit::@ref{167,,type} gccjit::@ref{167,,type}::get_pointer () Given type “T”, get type “T*”. @end deffn @geindex gccjit;;type;;get_const (C++ function) -@anchor{cp/topics/types _CPPv4N6gccjit4type9get_constEv}@anchor{1bd}@anchor{cp/topics/types _CPPv3N6gccjit4type9get_constEv}@anchor{1cd}@anchor{cp/topics/types _CPPv2N6gccjit4type9get_constEv}@anchor{1ce}@anchor{cp/topics/types gccjit type get_const}@anchor{1cf} -@deffn {C++ Function} gccjit::@ref{13f,,type} gccjit::@ref{13f,,type}::get_const () +@anchor{cp/topics/types _CPPv4N6gccjit4type9get_constEv}@anchor{1e5}@anchor{cp/topics/types _CPPv3N6gccjit4type9get_constEv}@anchor{1f5}@anchor{cp/topics/types _CPPv2N6gccjit4type9get_constEv}@anchor{1f6}@anchor{cp/topics/types gccjit type get_const}@anchor{1f7} +@deffn {C++ Function} gccjit::@ref{167,,type} gccjit::@ref{167,,type}::get_const () Given type “T”, get type “const T”. @end deffn @geindex gccjit;;type;;get_volatile (C++ function) -@anchor{cp/topics/types _CPPv4N6gccjit4type12get_volatileEv}@anchor{1d0}@anchor{cp/topics/types _CPPv3N6gccjit4type12get_volatileEv}@anchor{1d1}@anchor{cp/topics/types _CPPv2N6gccjit4type12get_volatileEv}@anchor{1d2}@anchor{cp/topics/types gccjit type get_volatile}@anchor{1d3} -@deffn {C++ Function} gccjit::@ref{13f,,type} gccjit::@ref{13f,,type}::get_volatile () +@anchor{cp/topics/types _CPPv4N6gccjit4type12get_volatileEv}@anchor{1f8}@anchor{cp/topics/types _CPPv3N6gccjit4type12get_volatileEv}@anchor{1f9}@anchor{cp/topics/types _CPPv2N6gccjit4type12get_volatileEv}@anchor{1fa}@anchor{cp/topics/types gccjit type get_volatile}@anchor{1fb} +@deffn {C++ Function} gccjit::@ref{167,,type} gccjit::@ref{167,,type}::get_volatile () Given type “T”, get type “volatile T”. @end deffn @geindex gccjit;;type;;get_aligned (C++ function) -@anchor{cp/topics/types _CPPv4N6gccjit4type11get_alignedE6size_t}@anchor{1d4}@anchor{cp/topics/types _CPPv3N6gccjit4type11get_alignedE6size_t}@anchor{1d5}@anchor{cp/topics/types _CPPv2N6gccjit4type11get_alignedE6size_t}@anchor{1d6}@anchor{cp/topics/types gccjit type get_aligned__s}@anchor{1d7} -@deffn {C++ Function} gccjit::@ref{13f,,type} gccjit::@ref{13f,,type}::get_aligned (size_t alignment_in_bytes) +@anchor{cp/topics/types _CPPv4N6gccjit4type11get_alignedE6size_t}@anchor{1fc}@anchor{cp/topics/types _CPPv3N6gccjit4type11get_alignedE6size_t}@anchor{1fd}@anchor{cp/topics/types _CPPv2N6gccjit4type11get_alignedE6size_t}@anchor{1fe}@anchor{cp/topics/types gccjit type get_aligned__s}@anchor{1ff} +@deffn {C++ Function} gccjit::@ref{167,,type} gccjit::@ref{167,,type}::get_aligned (size_t alignment_in_bytes) Given type “T”, get type: @@ -12689,21 +13307,21 @@ The alignment must be a power of two. @end deffn @geindex gccjit;;context;;new_array_type (C++ function) -@anchor{cp/topics/types _CPPv4N6gccjit7context14new_array_typeEN6gccjit4typeEiN6gccjit8locationE}@anchor{1d8}@anchor{cp/topics/types _CPPv3N6gccjit7context14new_array_typeEN6gccjit4typeEiN6gccjit8locationE}@anchor{1d9}@anchor{cp/topics/types _CPPv2N6gccjit7context14new_array_typeEN6gccjit4typeEiN6gccjit8locationE}@anchor{1da}@anchor{cp/topics/types gccjit context new_array_type__gccjit type i gccjit location}@anchor{1db} -@deffn {C++ Function} gccjit::@ref{13f,,type} gccjit::@ref{13d,,context}::new_array_type (gccjit::type element_type, int num_elements, gccjit::location loc) +@anchor{cp/topics/types _CPPv4N6gccjit7context14new_array_typeEN6gccjit4typeEiN6gccjit8locationE}@anchor{200}@anchor{cp/topics/types _CPPv3N6gccjit7context14new_array_typeEN6gccjit4typeEiN6gccjit8locationE}@anchor{201}@anchor{cp/topics/types _CPPv2N6gccjit7context14new_array_typeEN6gccjit4typeEiN6gccjit8locationE}@anchor{202}@anchor{cp/topics/types gccjit context new_array_type__gccjit type i gccjit location}@anchor{203} +@deffn {C++ Function} gccjit::@ref{167,,type} gccjit::@ref{165,,context}::new_array_type (gccjit::type element_type, int num_elements, gccjit::location loc) Given type “T”, get type “T[N]” (for a constant N). Param “loc” is optional. @end deffn @node Vector types<2>,Structures and unions<2>,Pointers const and volatile<2>,Types<2> -@anchor{cp/topics/types vector-types}@anchor{1dc} +@anchor{cp/topics/types vector-types}@anchor{204} @subsubsection Vector types @geindex gccjit;;type;;get_vector (C++ function) -@anchor{cp/topics/types _CPPv4N6gccjit4type10get_vectorE6size_t}@anchor{1dd}@anchor{cp/topics/types _CPPv3N6gccjit4type10get_vectorE6size_t}@anchor{1de}@anchor{cp/topics/types _CPPv2N6gccjit4type10get_vectorE6size_t}@anchor{1df}@anchor{cp/topics/types gccjit type get_vector__s}@anchor{1e0} -@deffn {C++ Function} gccjit::@ref{13f,,type} gccjit::@ref{13f,,type}::get_vector (size_t num_units) +@anchor{cp/topics/types _CPPv4N6gccjit4type10get_vectorE6size_t}@anchor{205}@anchor{cp/topics/types _CPPv3N6gccjit4type10get_vectorE6size_t}@anchor{206}@anchor{cp/topics/types _CPPv2N6gccjit4type10get_vectorE6size_t}@anchor{207}@anchor{cp/topics/types gccjit type get_vector__s}@anchor{208} +@deffn {C++ Function} gccjit::@ref{167,,type} gccjit::@ref{167,,type}::get_vector (size_t num_units) Given type “T”, get type: @@ -12715,31 +13333,31 @@ T must be integral or floating point; num_units must be a power of two. @end deffn @node Structures and unions<2>,,Vector types<2>,Types<2> -@anchor{cp/topics/types structures-and-unions}@anchor{1e1} +@anchor{cp/topics/types structures-and-unions}@anchor{209} @subsubsection Structures and unions @geindex gccjit;;struct_ (C++ class) -@anchor{cp/topics/types _CPPv4N6gccjit7struct_E}@anchor{1e2}@anchor{cp/topics/types _CPPv3N6gccjit7struct_E}@anchor{1e3}@anchor{cp/topics/types _CPPv2N6gccjit7struct_E}@anchor{1e4}@anchor{cp/topics/types gccjit struct_}@anchor{1e5} +@anchor{cp/topics/types _CPPv4N6gccjit7struct_E}@anchor{20a}@anchor{cp/topics/types _CPPv3N6gccjit7struct_E}@anchor{20b}@anchor{cp/topics/types _CPPv2N6gccjit7struct_E}@anchor{20c}@anchor{cp/topics/types gccjit struct_}@anchor{20d} @deffn {C++ Class} gccjit::struct_ @end deffn A compound type analagous to a C @cite{struct}. -@ref{1e2,,gccjit;;struct_} is a subclass of @ref{13f,,gccjit;;type} (and thus -of @ref{142,,gccjit;;object} in turn). +@ref{20a,,gccjit;;struct_} is a subclass of @ref{167,,gccjit;;type} (and thus +of @ref{16a,,gccjit;;object} in turn). @geindex gccjit;;field (C++ class) -@anchor{cp/topics/types _CPPv4N6gccjit5fieldE}@anchor{1e6}@anchor{cp/topics/types _CPPv3N6gccjit5fieldE}@anchor{1e7}@anchor{cp/topics/types _CPPv2N6gccjit5fieldE}@anchor{1e8}@anchor{cp/topics/types gccjit field}@anchor{1e9} +@anchor{cp/topics/types _CPPv4N6gccjit5fieldE}@anchor{20e}@anchor{cp/topics/types _CPPv3N6gccjit5fieldE}@anchor{20f}@anchor{cp/topics/types _CPPv2N6gccjit5fieldE}@anchor{210}@anchor{cp/topics/types gccjit field}@anchor{211} @deffn {C++ Class} gccjit::field @end deffn -A field within a @ref{1e2,,gccjit;;struct_}. +A field within a @ref{20a,,gccjit;;struct_}. -@ref{1e6,,gccjit;;field} is a subclass of @ref{142,,gccjit;;object}. +@ref{20e,,gccjit;;field} is a subclass of @ref{16a,,gccjit;;object}. -You can model C @cite{struct} types by creating @ref{1e2,,gccjit;;struct_} and -@ref{1e6,,gccjit;;field} instances, in either order: +You can model C @cite{struct} types by creating @ref{20a,,gccjit;;struct_} and +@ref{20e,,gccjit;;field} instances, in either order: @itemize * @@ -12787,15 +13405,15 @@ node.set_fields (fields); @c FIXME: the above API doesn't seem to exist yet @geindex gccjit;;context;;new_field (C++ function) -@anchor{cp/topics/types _CPPv4N6gccjit7context9new_fieldEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{1ea}@anchor{cp/topics/types _CPPv3N6gccjit7context9new_fieldEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{1eb}@anchor{cp/topics/types _CPPv2N6gccjit7context9new_fieldEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{1ec}@anchor{cp/topics/types gccjit context new_field__gccjit type cCP gccjit location}@anchor{1ed} -@deffn {C++ Function} gccjit::@ref{1e6,,field} gccjit::@ref{13d,,context}::new_field (gccjit::type type, const char *name, gccjit::location loc) +@anchor{cp/topics/types _CPPv4N6gccjit7context9new_fieldEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{212}@anchor{cp/topics/types _CPPv3N6gccjit7context9new_fieldEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{213}@anchor{cp/topics/types _CPPv2N6gccjit7context9new_fieldEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{214}@anchor{cp/topics/types gccjit context new_field__gccjit type cCP gccjit location}@anchor{215} +@deffn {C++ Function} gccjit::@ref{20e,,field} gccjit::@ref{165,,context}::new_field (gccjit::type type, const char *name, gccjit::location loc) Construct a new field, with the given type and name. @end deffn @geindex gccjit;;context;;new_struct_type (C++ function) -@anchor{cp/topics/types _CPPv4N6gccjit7context15new_struct_typeERKNSt6stringERNSt6vectorI5fieldEEN6gccjit8locationE}@anchor{1ee}@anchor{cp/topics/types _CPPv3N6gccjit7context15new_struct_typeERKNSt6stringERNSt6vectorI5fieldEEN6gccjit8locationE}@anchor{1ef}@anchor{cp/topics/types _CPPv2N6gccjit7context15new_struct_typeERKNSt6stringERNSt6vectorI5fieldEEN6gccjit8locationE}@anchor{1f0}@anchor{cp/topics/types gccjit context new_struct_type__ssCR std vector field R gccjit location}@anchor{1f1} -@deffn {C++ Function} gccjit::@ref{1e2,,struct_} gccjit::@ref{13d,,context}::new_struct_type (const std::string &name, std::vector &fields, gccjit::location loc) +@anchor{cp/topics/types _CPPv4N6gccjit7context15new_struct_typeERKNSt6stringERNSt6vectorI5fieldEEN6gccjit8locationE}@anchor{216}@anchor{cp/topics/types _CPPv3N6gccjit7context15new_struct_typeERKNSt6stringERNSt6vectorI5fieldEEN6gccjit8locationE}@anchor{217}@anchor{cp/topics/types _CPPv2N6gccjit7context15new_struct_typeERKNSt6stringERNSt6vectorI5fieldEEN6gccjit8locationE}@anchor{218}@anchor{cp/topics/types gccjit context new_struct_type__ssCR std vector field R gccjit location}@anchor{219} +@deffn {C++ Function} gccjit::@ref{20a,,struct_} gccjit::@ref{165,,context}::new_struct_type (const std::string &name, std::vector &fields, gccjit::location loc) @quotation @@ -12804,8 +13422,8 @@ Construct a new struct type, with the given name and fields. @end deffn @geindex gccjit;;context;;new_opaque_struct (C++ function) -@anchor{cp/topics/types _CPPv4N6gccjit7context17new_opaque_structERKNSt6stringEN6gccjit8locationE}@anchor{1f2}@anchor{cp/topics/types _CPPv3N6gccjit7context17new_opaque_structERKNSt6stringEN6gccjit8locationE}@anchor{1f3}@anchor{cp/topics/types _CPPv2N6gccjit7context17new_opaque_structERKNSt6stringEN6gccjit8locationE}@anchor{1f4}@anchor{cp/topics/types gccjit context new_opaque_struct__ssCR gccjit location}@anchor{1f5} -@deffn {C++ Function} gccjit::@ref{1e2,,struct_} gccjit::@ref{13d,,context}::new_opaque_struct (const std::string &name, gccjit::location loc) +@anchor{cp/topics/types _CPPv4N6gccjit7context17new_opaque_structERKNSt6stringEN6gccjit8locationE}@anchor{21a}@anchor{cp/topics/types _CPPv3N6gccjit7context17new_opaque_structERKNSt6stringEN6gccjit8locationE}@anchor{21b}@anchor{cp/topics/types _CPPv2N6gccjit7context17new_opaque_structERKNSt6stringEN6gccjit8locationE}@anchor{21c}@anchor{cp/topics/types gccjit context new_opaque_struct__ssCR gccjit location}@anchor{21d} +@deffn {C++ Function} gccjit::@ref{20a,,struct_} gccjit::@ref{165,,context}::new_opaque_struct (const std::string &name, gccjit::location loc) Construct a new struct type, with the given name, but without specifying the fields. The fields can be omitted (in which case the @@ -12831,7 +13449,7 @@ size of the struct is not known), or later specified using @c . @node Expressions<2>,Creating and using functions<2>,Types<2>,Topic Reference<2> -@anchor{cp/topics/expressions doc}@anchor{1f6}@anchor{cp/topics/expressions expressions}@anchor{1f7} +@anchor{cp/topics/expressions doc}@anchor{21e}@anchor{cp/topics/expressions expressions}@anchor{21f} @subsection Expressions @@ -12843,17 +13461,17 @@ size of the struct is not known), or later specified using @end menu @node Rvalues<2>,Lvalues<2>,,Expressions<2> -@anchor{cp/topics/expressions rvalues}@anchor{1f8} +@anchor{cp/topics/expressions rvalues}@anchor{220} @subsubsection Rvalues @geindex gccjit;;rvalue (C++ class) -@anchor{cp/topics/expressions _CPPv4N6gccjit6rvalueE}@anchor{146}@anchor{cp/topics/expressions _CPPv3N6gccjit6rvalueE}@anchor{1f9}@anchor{cp/topics/expressions _CPPv2N6gccjit6rvalueE}@anchor{1fa}@anchor{cp/topics/expressions gccjit rvalue}@anchor{1fb} +@anchor{cp/topics/expressions _CPPv4N6gccjit6rvalueE}@anchor{16e}@anchor{cp/topics/expressions _CPPv3N6gccjit6rvalueE}@anchor{221}@anchor{cp/topics/expressions _CPPv2N6gccjit6rvalueE}@anchor{222}@anchor{cp/topics/expressions gccjit rvalue}@anchor{223} @deffn {C++ Class} gccjit::rvalue @end deffn -A @ref{146,,gccjit;;rvalue} is an expression that can be computed. It is a -subclass of @ref{142,,gccjit;;object}, and is a thin wrapper around +A @ref{16e,,gccjit;;rvalue} is an expression that can be computed. It is a +subclass of @ref{16a,,gccjit;;object}, and is a thin wrapper around @ref{13,,gcc_jit_rvalue *} from the C API. It can be simple, e.g.: @@ -12899,8 +13517,8 @@ Every rvalue has an associated type, and the API will check to ensure that types match up correctly (otherwise the context will emit an error). @geindex gccjit;;rvalue;;get_type (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit6rvalue8get_typeEv}@anchor{1fc}@anchor{cp/topics/expressions _CPPv3N6gccjit6rvalue8get_typeEv}@anchor{1fd}@anchor{cp/topics/expressions _CPPv2N6gccjit6rvalue8get_typeEv}@anchor{1fe}@anchor{cp/topics/expressions gccjit rvalue get_type}@anchor{1ff} -@deffn {C++ Function} gccjit::@ref{13f,,type} gccjit::@ref{146,,rvalue}::get_type () +@anchor{cp/topics/expressions _CPPv4N6gccjit6rvalue8get_typeEv}@anchor{224}@anchor{cp/topics/expressions _CPPv3N6gccjit6rvalue8get_typeEv}@anchor{225}@anchor{cp/topics/expressions _CPPv2N6gccjit6rvalue8get_typeEv}@anchor{226}@anchor{cp/topics/expressions gccjit rvalue get_type}@anchor{227} +@deffn {C++ Function} gccjit::@ref{167,,type} gccjit::@ref{16e,,rvalue}::get_type () Get the type of this rvalue. @end deffn @@ -12918,29 +13536,29 @@ Get the type of this rvalue. @end menu @node Simple expressions<2>,Vector expressions<2>,,Rvalues<2> -@anchor{cp/topics/expressions simple-expressions}@anchor{200} +@anchor{cp/topics/expressions simple-expressions}@anchor{228} @subsubsection Simple expressions @geindex gccjit;;context;;new_rvalue (C++ function) -@anchor{cp/topics/expressions _CPPv4NK6gccjit7context10new_rvalueEN6gccjit4typeEi}@anchor{15a}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context10new_rvalueEN6gccjit4typeEi}@anchor{201}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context10new_rvalueEN6gccjit4typeEi}@anchor{202}@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type iC}@anchor{203} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_rvalue (gccjit::type numeric_type, int value) const +@anchor{cp/topics/expressions _CPPv4NK6gccjit7context10new_rvalueEN6gccjit4typeEi}@anchor{182}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context10new_rvalueEN6gccjit4typeEi}@anchor{229}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context10new_rvalueEN6gccjit4typeEi}@anchor{22a}@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type iC}@anchor{22b} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_rvalue (gccjit::type numeric_type, int value) const Given a numeric type (integer or floating point), build an rvalue for the given constant @code{int} value. @end deffn @geindex gccjit;;context;;new_rvalue (C++ function) -@anchor{cp/topics/expressions _CPPv4NK6gccjit7context10new_rvalueEN6gccjit4typeEl}@anchor{204}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context10new_rvalueEN6gccjit4typeEl}@anchor{205}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context10new_rvalueEN6gccjit4typeEl}@anchor{206}@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type lC}@anchor{207} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_rvalue (gccjit::type numeric_type, long value) const +@anchor{cp/topics/expressions _CPPv4NK6gccjit7context10new_rvalueEN6gccjit4typeEl}@anchor{22c}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context10new_rvalueEN6gccjit4typeEl}@anchor{22d}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context10new_rvalueEN6gccjit4typeEl}@anchor{22e}@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type lC}@anchor{22f} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_rvalue (gccjit::type numeric_type, long value) const Given a numeric type (integer or floating point), build an rvalue for the given constant @code{long} value. @end deffn @geindex gccjit;;context;;zero (C++ function) -@anchor{cp/topics/expressions _CPPv4NK6gccjit7context4zeroEN6gccjit4typeE}@anchor{156}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context4zeroEN6gccjit4typeE}@anchor{208}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context4zeroEN6gccjit4typeE}@anchor{209}@anchor{cp/topics/expressions gccjit context zero__gccjit typeC}@anchor{20a} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::zero (gccjit::type numeric_type) const +@anchor{cp/topics/expressions _CPPv4NK6gccjit7context4zeroEN6gccjit4typeE}@anchor{17e}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context4zeroEN6gccjit4typeE}@anchor{230}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context4zeroEN6gccjit4typeE}@anchor{231}@anchor{cp/topics/expressions gccjit context zero__gccjit typeC}@anchor{232} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::zero (gccjit::type numeric_type) const Given a numeric type (integer or floating point), get the rvalue for zero. Essentially this is just a shortcut for: @@ -12951,8 +13569,8 @@ ctxt.new_rvalue (numeric_type, 0) @end deffn @geindex gccjit;;context;;one (C++ function) -@anchor{cp/topics/expressions _CPPv4NK6gccjit7context3oneEN6gccjit4typeE}@anchor{20b}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context3oneEN6gccjit4typeE}@anchor{20c}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context3oneEN6gccjit4typeE}@anchor{20d}@anchor{cp/topics/expressions gccjit context one__gccjit typeC}@anchor{20e} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::one (gccjit::type numeric_type) const +@anchor{cp/topics/expressions _CPPv4NK6gccjit7context3oneEN6gccjit4typeE}@anchor{233}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context3oneEN6gccjit4typeE}@anchor{234}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context3oneEN6gccjit4typeE}@anchor{235}@anchor{cp/topics/expressions gccjit context one__gccjit typeC}@anchor{236} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::one (gccjit::type numeric_type) const Given a numeric type (integer or floating point), get the rvalue for one. Essentially this is just a shortcut for: @@ -12963,36 +13581,36 @@ ctxt.new_rvalue (numeric_type, 1) @end deffn @geindex gccjit;;context;;new_rvalue (C++ function) -@anchor{cp/topics/expressions _CPPv4NK6gccjit7context10new_rvalueEN6gccjit4typeEd}@anchor{20f}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context10new_rvalueEN6gccjit4typeEd}@anchor{210}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context10new_rvalueEN6gccjit4typeEd}@anchor{211}@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type doubleC}@anchor{212} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_rvalue (gccjit::type numeric_type, double value) const +@anchor{cp/topics/expressions _CPPv4NK6gccjit7context10new_rvalueEN6gccjit4typeEd}@anchor{237}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context10new_rvalueEN6gccjit4typeEd}@anchor{238}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context10new_rvalueEN6gccjit4typeEd}@anchor{239}@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type doubleC}@anchor{23a} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_rvalue (gccjit::type numeric_type, double value) const Given a numeric type (integer or floating point), build an rvalue for the given constant @code{double} value. @end deffn @geindex gccjit;;context;;new_rvalue (C++ function) -@anchor{cp/topics/expressions _CPPv4NK6gccjit7context10new_rvalueEN6gccjit4typeEPv}@anchor{213}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context10new_rvalueEN6gccjit4typeEPv}@anchor{214}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context10new_rvalueEN6gccjit4typeEPv}@anchor{215}@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type voidPC}@anchor{216} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_rvalue (gccjit::type pointer_type, void *value) const +@anchor{cp/topics/expressions _CPPv4NK6gccjit7context10new_rvalueEN6gccjit4typeEPv}@anchor{23b}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context10new_rvalueEN6gccjit4typeEPv}@anchor{23c}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context10new_rvalueEN6gccjit4typeEPv}@anchor{23d}@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type voidPC}@anchor{23e} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_rvalue (gccjit::type pointer_type, void *value) const Given a pointer type, build an rvalue for the given address. @end deffn @geindex gccjit;;context;;new_rvalue (C++ function) -@anchor{cp/topics/expressions _CPPv4NK6gccjit7context10new_rvalueERKNSt6stringE}@anchor{217}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context10new_rvalueERKNSt6stringE}@anchor{218}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context10new_rvalueERKNSt6stringE}@anchor{219}@anchor{cp/topics/expressions gccjit context new_rvalue__ssCRC}@anchor{21a} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_rvalue (const std::string &value) const +@anchor{cp/topics/expressions _CPPv4NK6gccjit7context10new_rvalueERKNSt6stringE}@anchor{23f}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context10new_rvalueERKNSt6stringE}@anchor{240}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context10new_rvalueERKNSt6stringE}@anchor{241}@anchor{cp/topics/expressions gccjit context new_rvalue__ssCRC}@anchor{242} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_rvalue (const std::string &value) const Generate an rvalue of type @code{GCC_JIT_TYPE_CONST_CHAR_PTR} for the given string. This is akin to a string literal. @end deffn @node Vector expressions<2>,Unary Operations<2>,Simple expressions<2>,Rvalues<2> -@anchor{cp/topics/expressions vector-expressions}@anchor{21b} +@anchor{cp/topics/expressions vector-expressions}@anchor{243} @subsubsection Vector expressions @geindex gccjit;;context;;new_rvalue (C++ function) -@anchor{cp/topics/expressions _CPPv4NK6gccjit7context10new_rvalueEN6gccjit4typeENSt6vectorIN6gccjit6rvalueEEE}@anchor{21c}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context10new_rvalueEN6gccjit4typeENSt6vectorIN6gccjit6rvalueEEE}@anchor{21d}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context10new_rvalueEN6gccjit4typeENSt6vectorIN6gccjit6rvalueEEE}@anchor{21e}@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type std vector gccjit rvalue C}@anchor{21f} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_rvalue (gccjit::type vector_type, std::vector elements) const +@anchor{cp/topics/expressions _CPPv4NK6gccjit7context10new_rvalueEN6gccjit4typeENSt6vectorIN6gccjit6rvalueEEE}@anchor{244}@anchor{cp/topics/expressions _CPPv3NK6gccjit7context10new_rvalueEN6gccjit4typeENSt6vectorIN6gccjit6rvalueEEE}@anchor{245}@anchor{cp/topics/expressions _CPPv2NK6gccjit7context10new_rvalueEN6gccjit4typeENSt6vectorIN6gccjit6rvalueEEE}@anchor{246}@anchor{cp/topics/expressions gccjit context new_rvalue__gccjit type std vector gccjit rvalue C}@anchor{247} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_rvalue (gccjit::type vector_type, std::vector elements) const Given a vector type, and a vector of scalar rvalue elements, generate a vector rvalue. @@ -13001,20 +13619,20 @@ The number of elements needs to match that of the vector type. @end deffn @node Unary Operations<2>,Binary Operations<2>,Vector expressions<2>,Rvalues<2> -@anchor{cp/topics/expressions unary-operations}@anchor{220} +@anchor{cp/topics/expressions unary-operations}@anchor{248} @subsubsection Unary Operations @geindex gccjit;;context;;new_unary_op (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context12new_unary_opE16gcc_jit_unary_opN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{221}@anchor{cp/topics/expressions _CPPv3N6gccjit7context12new_unary_opE16gcc_jit_unary_opN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{222}@anchor{cp/topics/expressions _CPPv2N6gccjit7context12new_unary_opE16gcc_jit_unary_opN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{223}@anchor{cp/topics/expressions gccjit context new_unary_op__gcc_jit_unary_op gccjit type gccjit rvalue gccjit location}@anchor{224} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_unary_op (enum gcc_jit_unary_op, gccjit::type result_type, gccjit::rvalue rvalue, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context12new_unary_opE16gcc_jit_unary_opN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{249}@anchor{cp/topics/expressions _CPPv3N6gccjit7context12new_unary_opE16gcc_jit_unary_opN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{24a}@anchor{cp/topics/expressions _CPPv2N6gccjit7context12new_unary_opE16gcc_jit_unary_opN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{24b}@anchor{cp/topics/expressions gccjit context new_unary_op__gcc_jit_unary_op gccjit type gccjit rvalue gccjit location}@anchor{24c} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_unary_op (enum gcc_jit_unary_op, gccjit::type result_type, gccjit::rvalue rvalue, gccjit::location loc) Build a unary operation out of an input rvalue. Parameter @code{loc} is optional. This is a thin wrapper around the C API’s -@ref{a2,,gcc_jit_context_new_unary_op()} and the available unary +@ref{ba,,gcc_jit_context_new_unary_op()} and the available unary operations are documented there. @end deffn @@ -13022,8 +13640,8 @@ There are shorter ways to spell the various specific kinds of unary operation: @geindex gccjit;;context;;new_minus (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context9new_minusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{225}@anchor{cp/topics/expressions _CPPv3N6gccjit7context9new_minusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{226}@anchor{cp/topics/expressions _CPPv2N6gccjit7context9new_minusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{227}@anchor{cp/topics/expressions gccjit context new_minus__gccjit type gccjit rvalue gccjit location}@anchor{228} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_minus (gccjit::type result_type, gccjit::rvalue a, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context9new_minusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{24d}@anchor{cp/topics/expressions _CPPv3N6gccjit7context9new_minusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{24e}@anchor{cp/topics/expressions _CPPv2N6gccjit7context9new_minusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{24f}@anchor{cp/topics/expressions gccjit context new_minus__gccjit type gccjit rvalue gccjit location}@anchor{250} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_minus (gccjit::type result_type, gccjit::rvalue a, gccjit::location loc) Negate an arithmetic value; for example: @@ -13039,8 +13657,8 @@ builds the equivalent of this C expression: @end deffn @geindex new_bitwise_negate (C++ function) -@anchor{cp/topics/expressions _CPPv418new_bitwise_negateN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{229}@anchor{cp/topics/expressions _CPPv318new_bitwise_negateN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{22a}@anchor{cp/topics/expressions _CPPv218new_bitwise_negateN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{22b}@anchor{cp/topics/expressions new_bitwise_negate__gccjit type gccjit rvalue gccjit location}@anchor{22c} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} new_bitwise_negate (gccjit::type result_type, gccjit::rvalue a, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv418new_bitwise_negateN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{251}@anchor{cp/topics/expressions _CPPv318new_bitwise_negateN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{252}@anchor{cp/topics/expressions _CPPv218new_bitwise_negateN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{253}@anchor{cp/topics/expressions new_bitwise_negate__gccjit type gccjit rvalue gccjit location}@anchor{254} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} new_bitwise_negate (gccjit::type result_type, gccjit::rvalue a, gccjit::location loc) Bitwise negation of an integer value (one’s complement); for example: @@ -13056,8 +13674,8 @@ builds the equivalent of this C expression: @end deffn @geindex new_logical_negate (C++ function) -@anchor{cp/topics/expressions _CPPv418new_logical_negateN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{22d}@anchor{cp/topics/expressions _CPPv318new_logical_negateN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{22e}@anchor{cp/topics/expressions _CPPv218new_logical_negateN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{22f}@anchor{cp/topics/expressions new_logical_negate__gccjit type gccjit rvalue gccjit location}@anchor{230} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} new_logical_negate (gccjit::type result_type, gccjit::rvalue a, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv418new_logical_negateN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{255}@anchor{cp/topics/expressions _CPPv318new_logical_negateN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{256}@anchor{cp/topics/expressions _CPPv218new_logical_negateN6gccjit4typeEN6gccjit6rvalueEN6gccjit8locationE}@anchor{257}@anchor{cp/topics/expressions new_logical_negate__gccjit type gccjit rvalue gccjit location}@anchor{258} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} new_logical_negate (gccjit::type result_type, gccjit::rvalue a, gccjit::location loc) Logical negation of an arithmetic or pointer value; for example: @@ -13075,8 +13693,8 @@ builds the equivalent of this C expression: The most concise way to spell them is with overloaded operators: @geindex operator- (C++ function) -@anchor{cp/topics/expressions _CPPv4miN6gccjit6rvalueE}@anchor{231}@anchor{cp/topics/expressions _CPPv3miN6gccjit6rvalueE}@anchor{232}@anchor{cp/topics/expressions _CPPv2miN6gccjit6rvalueE}@anchor{233}@anchor{cp/topics/expressions sub-operator__gccjit rvalue}@anchor{234} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator@w{-} (gccjit::rvalue a) +@anchor{cp/topics/expressions _CPPv4miN6gccjit6rvalueE}@anchor{259}@anchor{cp/topics/expressions _CPPv3miN6gccjit6rvalueE}@anchor{25a}@anchor{cp/topics/expressions _CPPv2miN6gccjit6rvalueE}@anchor{25b}@anchor{cp/topics/expressions sub-operator__gccjit rvalue}@anchor{25c} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator@w{-} (gccjit::rvalue a) @example gccjit::rvalue negpi = -pi; @@ -13084,8 +13702,8 @@ gccjit::rvalue negpi = -pi; @end deffn @geindex operator~ (C++ function) -@anchor{cp/topics/expressions _CPPv4coN6gccjit6rvalueE}@anchor{235}@anchor{cp/topics/expressions _CPPv3coN6gccjit6rvalueE}@anchor{236}@anchor{cp/topics/expressions _CPPv2coN6gccjit6rvalueE}@anchor{237}@anchor{cp/topics/expressions inv-operator__gccjit rvalue}@anchor{238} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator~ (gccjit::rvalue a) +@anchor{cp/topics/expressions _CPPv4coN6gccjit6rvalueE}@anchor{25d}@anchor{cp/topics/expressions _CPPv3coN6gccjit6rvalueE}@anchor{25e}@anchor{cp/topics/expressions _CPPv2coN6gccjit6rvalueE}@anchor{25f}@anchor{cp/topics/expressions inv-operator__gccjit rvalue}@anchor{260} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator~ (gccjit::rvalue a) @example gccjit::rvalue mask = ~a; @@ -13093,8 +13711,8 @@ gccjit::rvalue mask = ~a; @end deffn @geindex operator! (C++ function) -@anchor{cp/topics/expressions _CPPv4ntN6gccjit6rvalueE}@anchor{239}@anchor{cp/topics/expressions _CPPv3ntN6gccjit6rvalueE}@anchor{23a}@anchor{cp/topics/expressions _CPPv2ntN6gccjit6rvalueE}@anchor{23b}@anchor{cp/topics/expressions not-operator__gccjit rvalue}@anchor{23c} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator! (gccjit::rvalue a) +@anchor{cp/topics/expressions _CPPv4ntN6gccjit6rvalueE}@anchor{261}@anchor{cp/topics/expressions _CPPv3ntN6gccjit6rvalueE}@anchor{262}@anchor{cp/topics/expressions _CPPv2ntN6gccjit6rvalueE}@anchor{263}@anchor{cp/topics/expressions not-operator__gccjit rvalue}@anchor{264} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator! (gccjit::rvalue a) @example gccjit::rvalue guard = !cond; @@ -13102,13 +13720,13 @@ gccjit::rvalue guard = !cond; @end deffn @node Binary Operations<2>,Comparisons<2>,Unary Operations<2>,Rvalues<2> -@anchor{cp/topics/expressions binary-operations}@anchor{23d} +@anchor{cp/topics/expressions binary-operations}@anchor{265} @subsubsection Binary Operations @geindex gccjit;;context;;new_binary_op (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context13new_binary_opE17gcc_jit_binary_opN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{145}@anchor{cp/topics/expressions _CPPv3N6gccjit7context13new_binary_opE17gcc_jit_binary_opN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{23e}@anchor{cp/topics/expressions _CPPv2N6gccjit7context13new_binary_opE17gcc_jit_binary_opN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{23f}@anchor{cp/topics/expressions gccjit context new_binary_op__gcc_jit_binary_op gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{240} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_binary_op (enum gcc_jit_binary_op, gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context13new_binary_opE17gcc_jit_binary_opN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{16d}@anchor{cp/topics/expressions _CPPv3N6gccjit7context13new_binary_opE17gcc_jit_binary_opN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{266}@anchor{cp/topics/expressions _CPPv2N6gccjit7context13new_binary_opE17gcc_jit_binary_opN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{267}@anchor{cp/topics/expressions gccjit context new_binary_op__gcc_jit_binary_op gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{268} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_binary_op (enum gcc_jit_binary_op, gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) Build a binary operation out of two constituent rvalues. @@ -13123,60 +13741,60 @@ There are shorter ways to spell the various specific kinds of binary operation: @geindex gccjit;;context;;new_plus (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context8new_plusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{241}@anchor{cp/topics/expressions _CPPv3N6gccjit7context8new_plusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{242}@anchor{cp/topics/expressions _CPPv2N6gccjit7context8new_plusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{243}@anchor{cp/topics/expressions gccjit context new_plus__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{244} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_plus (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context8new_plusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{269}@anchor{cp/topics/expressions _CPPv3N6gccjit7context8new_plusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{26a}@anchor{cp/topics/expressions _CPPv2N6gccjit7context8new_plusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{26b}@anchor{cp/topics/expressions gccjit context new_plus__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{26c} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_plus (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_minus (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context9new_minusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{245}@anchor{cp/topics/expressions _CPPv3N6gccjit7context9new_minusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{246}@anchor{cp/topics/expressions _CPPv2N6gccjit7context9new_minusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{247}@anchor{cp/topics/expressions gccjit context new_minus__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{248} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_minus (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context9new_minusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{26d}@anchor{cp/topics/expressions _CPPv3N6gccjit7context9new_minusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{26e}@anchor{cp/topics/expressions _CPPv2N6gccjit7context9new_minusEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{26f}@anchor{cp/topics/expressions gccjit context new_minus__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{270} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_minus (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_mult (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context8new_multEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{249}@anchor{cp/topics/expressions _CPPv3N6gccjit7context8new_multEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{24a}@anchor{cp/topics/expressions _CPPv2N6gccjit7context8new_multEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{24b}@anchor{cp/topics/expressions gccjit context new_mult__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{24c} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_mult (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context8new_multEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{271}@anchor{cp/topics/expressions _CPPv3N6gccjit7context8new_multEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{272}@anchor{cp/topics/expressions _CPPv2N6gccjit7context8new_multEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{273}@anchor{cp/topics/expressions gccjit context new_mult__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{274} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_mult (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_divide (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context10new_divideEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{24d}@anchor{cp/topics/expressions _CPPv3N6gccjit7context10new_divideEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{24e}@anchor{cp/topics/expressions _CPPv2N6gccjit7context10new_divideEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{24f}@anchor{cp/topics/expressions gccjit context new_divide__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{250} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_divide (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context10new_divideEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{275}@anchor{cp/topics/expressions _CPPv3N6gccjit7context10new_divideEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{276}@anchor{cp/topics/expressions _CPPv2N6gccjit7context10new_divideEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{277}@anchor{cp/topics/expressions gccjit context new_divide__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{278} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_divide (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_modulo (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context10new_moduloEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{251}@anchor{cp/topics/expressions _CPPv3N6gccjit7context10new_moduloEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{252}@anchor{cp/topics/expressions _CPPv2N6gccjit7context10new_moduloEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{253}@anchor{cp/topics/expressions gccjit context new_modulo__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{254} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_modulo (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context10new_moduloEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{279}@anchor{cp/topics/expressions _CPPv3N6gccjit7context10new_moduloEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{27a}@anchor{cp/topics/expressions _CPPv2N6gccjit7context10new_moduloEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{27b}@anchor{cp/topics/expressions gccjit context new_modulo__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{27c} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_modulo (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_bitwise_and (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context15new_bitwise_andEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{255}@anchor{cp/topics/expressions _CPPv3N6gccjit7context15new_bitwise_andEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{256}@anchor{cp/topics/expressions _CPPv2N6gccjit7context15new_bitwise_andEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{257}@anchor{cp/topics/expressions gccjit context new_bitwise_and__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{258} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_bitwise_and (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context15new_bitwise_andEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{27d}@anchor{cp/topics/expressions _CPPv3N6gccjit7context15new_bitwise_andEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{27e}@anchor{cp/topics/expressions _CPPv2N6gccjit7context15new_bitwise_andEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{27f}@anchor{cp/topics/expressions gccjit context new_bitwise_and__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{280} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_bitwise_and (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_bitwise_xor (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context15new_bitwise_xorEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{259}@anchor{cp/topics/expressions _CPPv3N6gccjit7context15new_bitwise_xorEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{25a}@anchor{cp/topics/expressions _CPPv2N6gccjit7context15new_bitwise_xorEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{25b}@anchor{cp/topics/expressions gccjit context new_bitwise_xor__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{25c} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_bitwise_xor (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context15new_bitwise_xorEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{281}@anchor{cp/topics/expressions _CPPv3N6gccjit7context15new_bitwise_xorEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{282}@anchor{cp/topics/expressions _CPPv2N6gccjit7context15new_bitwise_xorEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{283}@anchor{cp/topics/expressions gccjit context new_bitwise_xor__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{284} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_bitwise_xor (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_bitwise_or (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context14new_bitwise_orEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{25d}@anchor{cp/topics/expressions _CPPv3N6gccjit7context14new_bitwise_orEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{25e}@anchor{cp/topics/expressions _CPPv2N6gccjit7context14new_bitwise_orEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{25f}@anchor{cp/topics/expressions gccjit context new_bitwise_or__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{260} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_bitwise_or (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context14new_bitwise_orEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{285}@anchor{cp/topics/expressions _CPPv3N6gccjit7context14new_bitwise_orEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{286}@anchor{cp/topics/expressions _CPPv2N6gccjit7context14new_bitwise_orEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{287}@anchor{cp/topics/expressions gccjit context new_bitwise_or__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{288} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_bitwise_or (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_logical_and (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context15new_logical_andEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{261}@anchor{cp/topics/expressions _CPPv3N6gccjit7context15new_logical_andEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{262}@anchor{cp/topics/expressions _CPPv2N6gccjit7context15new_logical_andEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{263}@anchor{cp/topics/expressions gccjit context new_logical_and__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{264} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_logical_and (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context15new_logical_andEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{289}@anchor{cp/topics/expressions _CPPv3N6gccjit7context15new_logical_andEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{28a}@anchor{cp/topics/expressions _CPPv2N6gccjit7context15new_logical_andEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{28b}@anchor{cp/topics/expressions gccjit context new_logical_and__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{28c} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_logical_and (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_logical_or (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context14new_logical_orEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{265}@anchor{cp/topics/expressions _CPPv3N6gccjit7context14new_logical_orEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{266}@anchor{cp/topics/expressions _CPPv2N6gccjit7context14new_logical_orEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{267}@anchor{cp/topics/expressions gccjit context new_logical_or__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{268} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_logical_or (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context14new_logical_orEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{28d}@anchor{cp/topics/expressions _CPPv3N6gccjit7context14new_logical_orEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{28e}@anchor{cp/topics/expressions _CPPv2N6gccjit7context14new_logical_orEN6gccjit4typeEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{28f}@anchor{cp/topics/expressions gccjit context new_logical_or__gccjit type gccjit rvalue gccjit rvalue gccjit location}@anchor{290} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_logical_or (gccjit::type result_type, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn The most concise way to spell them is with overloaded operators: @geindex operator+ (C++ function) -@anchor{cp/topics/expressions _CPPv4plN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{269}@anchor{cp/topics/expressions _CPPv3plN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{26a}@anchor{cp/topics/expressions _CPPv2plN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{26b}@anchor{cp/topics/expressions add-operator__gccjit rvalue gccjit rvalue}@anchor{26c} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator+ (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4plN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{291}@anchor{cp/topics/expressions _CPPv3plN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{292}@anchor{cp/topics/expressions _CPPv2plN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{293}@anchor{cp/topics/expressions add-operator__gccjit rvalue gccjit rvalue}@anchor{294} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator+ (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue sum = a + b; @@ -13184,8 +13802,8 @@ gccjit::rvalue sum = a + b; @end deffn @geindex operator- (C++ function) -@anchor{cp/topics/expressions _CPPv4miN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{26d}@anchor{cp/topics/expressions _CPPv3miN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{26e}@anchor{cp/topics/expressions _CPPv2miN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{26f}@anchor{cp/topics/expressions sub-operator__gccjit rvalue gccjit rvalue}@anchor{270} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator@w{-} (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4miN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{295}@anchor{cp/topics/expressions _CPPv3miN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{296}@anchor{cp/topics/expressions _CPPv2miN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{297}@anchor{cp/topics/expressions sub-operator__gccjit rvalue gccjit rvalue}@anchor{298} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator@w{-} (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue diff = a - b; @@ -13193,8 +13811,8 @@ gccjit::rvalue diff = a - b; @end deffn @geindex operator* (C++ function) -@anchor{cp/topics/expressions _CPPv4mlN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{271}@anchor{cp/topics/expressions _CPPv3mlN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{272}@anchor{cp/topics/expressions _CPPv2mlN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{273}@anchor{cp/topics/expressions mul-operator__gccjit rvalue gccjit rvalue}@anchor{274} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator* (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4mlN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{299}@anchor{cp/topics/expressions _CPPv3mlN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{29a}@anchor{cp/topics/expressions _CPPv2mlN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{29b}@anchor{cp/topics/expressions mul-operator__gccjit rvalue gccjit rvalue}@anchor{29c} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator* (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue prod = a * b; @@ -13202,8 +13820,8 @@ gccjit::rvalue prod = a * b; @end deffn @geindex operator/ (C++ function) -@anchor{cp/topics/expressions _CPPv4dvN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{275}@anchor{cp/topics/expressions _CPPv3dvN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{276}@anchor{cp/topics/expressions _CPPv2dvN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{277}@anchor{cp/topics/expressions div-operator__gccjit rvalue gccjit rvalue}@anchor{278} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator/ (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4dvN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{29d}@anchor{cp/topics/expressions _CPPv3dvN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{29e}@anchor{cp/topics/expressions _CPPv2dvN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{29f}@anchor{cp/topics/expressions div-operator__gccjit rvalue gccjit rvalue}@anchor{2a0} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator/ (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue result = a / b; @@ -13211,8 +13829,8 @@ gccjit::rvalue result = a / b; @end deffn @geindex operator% (C++ function) -@anchor{cp/topics/expressions _CPPv4rmN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{279}@anchor{cp/topics/expressions _CPPv3rmN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{27a}@anchor{cp/topics/expressions _CPPv2rmN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{27b}@anchor{cp/topics/expressions mod-operator__gccjit rvalue gccjit rvalue}@anchor{27c} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator% (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4rmN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2a1}@anchor{cp/topics/expressions _CPPv3rmN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2a2}@anchor{cp/topics/expressions _CPPv2rmN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2a3}@anchor{cp/topics/expressions mod-operator__gccjit rvalue gccjit rvalue}@anchor{2a4} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator% (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue mod = a % b; @@ -13220,8 +13838,8 @@ gccjit::rvalue mod = a % b; @end deffn @geindex operator& (C++ function) -@anchor{cp/topics/expressions _CPPv4anN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{27d}@anchor{cp/topics/expressions _CPPv3anN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{27e}@anchor{cp/topics/expressions _CPPv2anN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{27f}@anchor{cp/topics/expressions and-operator__gccjit rvalue gccjit rvalue}@anchor{280} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator& (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4anN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2a5}@anchor{cp/topics/expressions _CPPv3anN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2a6}@anchor{cp/topics/expressions _CPPv2anN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2a7}@anchor{cp/topics/expressions and-operator__gccjit rvalue gccjit rvalue}@anchor{2a8} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator& (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue x = a & b; @@ -13229,8 +13847,8 @@ gccjit::rvalue x = a & b; @end deffn @geindex operator^ (C++ function) -@anchor{cp/topics/expressions _CPPv4eoN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{281}@anchor{cp/topics/expressions _CPPv3eoN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{282}@anchor{cp/topics/expressions _CPPv2eoN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{283}@anchor{cp/topics/expressions xor-operator__gccjit rvalue gccjit rvalue}@anchor{284} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator^ (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4eoN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2a9}@anchor{cp/topics/expressions _CPPv3eoN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2aa}@anchor{cp/topics/expressions _CPPv2eoN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2ab}@anchor{cp/topics/expressions xor-operator__gccjit rvalue gccjit rvalue}@anchor{2ac} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator^ (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue x = a ^ b; @@ -13238,8 +13856,8 @@ gccjit::rvalue x = a ^ b; @end deffn @geindex operator| (C++ function) -@anchor{cp/topics/expressions _CPPv4orN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{285}@anchor{cp/topics/expressions _CPPv3orN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{286}@anchor{cp/topics/expressions _CPPv2orN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{287}@anchor{cp/topics/expressions or-operator__gccjit rvalue gccjit rvalue}@anchor{288} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator| (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4orN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2ad}@anchor{cp/topics/expressions _CPPv3orN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2ae}@anchor{cp/topics/expressions _CPPv2orN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2af}@anchor{cp/topics/expressions or-operator__gccjit rvalue gccjit rvalue}@anchor{2b0} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator| (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue x = a | b; @@ -13247,8 +13865,8 @@ gccjit::rvalue x = a | b; @end deffn @geindex operator&& (C++ function) -@anchor{cp/topics/expressions _CPPv4aaN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{289}@anchor{cp/topics/expressions _CPPv3aaN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{28a}@anchor{cp/topics/expressions _CPPv2aaN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{28b}@anchor{cp/topics/expressions sand-operator__gccjit rvalue gccjit rvalue}@anchor{28c} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator&& (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4aaN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b1}@anchor{cp/topics/expressions _CPPv3aaN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b2}@anchor{cp/topics/expressions _CPPv2aaN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b3}@anchor{cp/topics/expressions sand-operator__gccjit rvalue gccjit rvalue}@anchor{2b4} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator&& (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue cond = a && b; @@ -13256,8 +13874,8 @@ gccjit::rvalue cond = a && b; @end deffn @geindex operator|| (C++ function) -@anchor{cp/topics/expressions _CPPv4ooN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{28d}@anchor{cp/topics/expressions _CPPv3ooN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{28e}@anchor{cp/topics/expressions _CPPv2ooN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{28f}@anchor{cp/topics/expressions sor-operator__gccjit rvalue gccjit rvalue}@anchor{290} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator|| (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4ooN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b5}@anchor{cp/topics/expressions _CPPv3ooN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b6}@anchor{cp/topics/expressions _CPPv2ooN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b7}@anchor{cp/topics/expressions sor-operator__gccjit rvalue gccjit rvalue}@anchor{2b8} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator|| (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue cond = a || b; @@ -13275,13 +13893,13 @@ gccjit::rvalue discriminant = (b * b) - (four * a * c); @end quotation @node Comparisons<2>,Function calls<2>,Binary Operations<2>,Rvalues<2> -@anchor{cp/topics/expressions comparisons}@anchor{291} +@anchor{cp/topics/expressions comparisons}@anchor{2b9} @subsubsection Comparisons @geindex gccjit;;context;;new_comparison (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context14new_comparisonE18gcc_jit_comparisonN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{157}@anchor{cp/topics/expressions _CPPv3N6gccjit7context14new_comparisonE18gcc_jit_comparisonN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{292}@anchor{cp/topics/expressions _CPPv2N6gccjit7context14new_comparisonE18gcc_jit_comparisonN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{293}@anchor{cp/topics/expressions gccjit context new_comparison__gcc_jit_comparison gccjit rvalue gccjit rvalue gccjit location}@anchor{294} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_comparison (enum gcc_jit_comparison, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context14new_comparisonE18gcc_jit_comparisonN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{17f}@anchor{cp/topics/expressions _CPPv3N6gccjit7context14new_comparisonE18gcc_jit_comparisonN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2ba}@anchor{cp/topics/expressions _CPPv2N6gccjit7context14new_comparisonE18gcc_jit_comparisonN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2bb}@anchor{cp/topics/expressions gccjit context new_comparison__gcc_jit_comparison gccjit rvalue gccjit rvalue gccjit location}@anchor{2bc} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_comparison (enum gcc_jit_comparison, gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) Build a boolean rvalue out of the comparison of two other rvalues. @@ -13296,40 +13914,40 @@ There are shorter ways to spell the various specific kinds of binary operation: @geindex gccjit;;context;;new_eq (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context6new_eqEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{295}@anchor{cp/topics/expressions _CPPv3N6gccjit7context6new_eqEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{296}@anchor{cp/topics/expressions _CPPv2N6gccjit7context6new_eqEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{297}@anchor{cp/topics/expressions gccjit context new_eq__gccjit rvalue gccjit rvalue gccjit location}@anchor{298} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_eq (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context6new_eqEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2bd}@anchor{cp/topics/expressions _CPPv3N6gccjit7context6new_eqEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2be}@anchor{cp/topics/expressions _CPPv2N6gccjit7context6new_eqEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2bf}@anchor{cp/topics/expressions gccjit context new_eq__gccjit rvalue gccjit rvalue gccjit location}@anchor{2c0} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_eq (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_ne (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context6new_neEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{299}@anchor{cp/topics/expressions _CPPv3N6gccjit7context6new_neEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{29a}@anchor{cp/topics/expressions _CPPv2N6gccjit7context6new_neEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{29b}@anchor{cp/topics/expressions gccjit context new_ne__gccjit rvalue gccjit rvalue gccjit location}@anchor{29c} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_ne (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context6new_neEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2c1}@anchor{cp/topics/expressions _CPPv3N6gccjit7context6new_neEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2c2}@anchor{cp/topics/expressions _CPPv2N6gccjit7context6new_neEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2c3}@anchor{cp/topics/expressions gccjit context new_ne__gccjit rvalue gccjit rvalue gccjit location}@anchor{2c4} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_ne (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_lt (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context6new_ltEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{29d}@anchor{cp/topics/expressions _CPPv3N6gccjit7context6new_ltEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{29e}@anchor{cp/topics/expressions _CPPv2N6gccjit7context6new_ltEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{29f}@anchor{cp/topics/expressions gccjit context new_lt__gccjit rvalue gccjit rvalue gccjit location}@anchor{2a0} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_lt (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context6new_ltEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2c5}@anchor{cp/topics/expressions _CPPv3N6gccjit7context6new_ltEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2c6}@anchor{cp/topics/expressions _CPPv2N6gccjit7context6new_ltEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2c7}@anchor{cp/topics/expressions gccjit context new_lt__gccjit rvalue gccjit rvalue gccjit location}@anchor{2c8} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_lt (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_le (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context6new_leEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2a1}@anchor{cp/topics/expressions _CPPv3N6gccjit7context6new_leEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2a2}@anchor{cp/topics/expressions _CPPv2N6gccjit7context6new_leEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2a3}@anchor{cp/topics/expressions gccjit context new_le__gccjit rvalue gccjit rvalue gccjit location}@anchor{2a4} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_le (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context6new_leEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2c9}@anchor{cp/topics/expressions _CPPv3N6gccjit7context6new_leEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2ca}@anchor{cp/topics/expressions _CPPv2N6gccjit7context6new_leEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2cb}@anchor{cp/topics/expressions gccjit context new_le__gccjit rvalue gccjit rvalue gccjit location}@anchor{2cc} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_le (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_gt (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context6new_gtEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2a5}@anchor{cp/topics/expressions _CPPv3N6gccjit7context6new_gtEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2a6}@anchor{cp/topics/expressions _CPPv2N6gccjit7context6new_gtEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2a7}@anchor{cp/topics/expressions gccjit context new_gt__gccjit rvalue gccjit rvalue gccjit location}@anchor{2a8} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_gt (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context6new_gtEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2cd}@anchor{cp/topics/expressions _CPPv3N6gccjit7context6new_gtEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2ce}@anchor{cp/topics/expressions _CPPv2N6gccjit7context6new_gtEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2cf}@anchor{cp/topics/expressions gccjit context new_gt__gccjit rvalue gccjit rvalue gccjit location}@anchor{2d0} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_gt (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn @geindex gccjit;;context;;new_ge (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context6new_geEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2a9}@anchor{cp/topics/expressions _CPPv3N6gccjit7context6new_geEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2aa}@anchor{cp/topics/expressions _CPPv2N6gccjit7context6new_geEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2ab}@anchor{cp/topics/expressions gccjit context new_ge__gccjit rvalue gccjit rvalue gccjit location}@anchor{2ac} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_ge (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context6new_geEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2d1}@anchor{cp/topics/expressions _CPPv3N6gccjit7context6new_geEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2d2}@anchor{cp/topics/expressions _CPPv2N6gccjit7context6new_geEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2d3}@anchor{cp/topics/expressions gccjit context new_ge__gccjit rvalue gccjit rvalue gccjit location}@anchor{2d4} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_ge (gccjit::rvalue a, gccjit::rvalue b, gccjit::location loc) @end deffn The most concise way to spell them is with overloaded operators: @geindex operator== (C++ function) -@anchor{cp/topics/expressions _CPPv4eqN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2ad}@anchor{cp/topics/expressions _CPPv3eqN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2ae}@anchor{cp/topics/expressions _CPPv2eqN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2af}@anchor{cp/topics/expressions eq-operator__gccjit rvalue gccjit rvalue}@anchor{2b0} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator== (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4eqN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2d5}@anchor{cp/topics/expressions _CPPv3eqN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2d6}@anchor{cp/topics/expressions _CPPv2eqN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2d7}@anchor{cp/topics/expressions eq-operator__gccjit rvalue gccjit rvalue}@anchor{2d8} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator== (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue cond = (a == ctxt.zero (t_int)); @@ -13337,8 +13955,8 @@ gccjit::rvalue cond = (a == ctxt.zero (t_int)); @end deffn @geindex operator!= (C++ function) -@anchor{cp/topics/expressions _CPPv4neN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b1}@anchor{cp/topics/expressions _CPPv3neN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b2}@anchor{cp/topics/expressions _CPPv2neN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b3}@anchor{cp/topics/expressions neq-operator__gccjit rvalue gccjit rvalue}@anchor{2b4} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator!= (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4neN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2d9}@anchor{cp/topics/expressions _CPPv3neN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2da}@anchor{cp/topics/expressions _CPPv2neN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2db}@anchor{cp/topics/expressions neq-operator__gccjit rvalue gccjit rvalue}@anchor{2dc} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator!= (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue cond = (i != j); @@ -13346,8 +13964,8 @@ gccjit::rvalue cond = (i != j); @end deffn @geindex operator< (C++ function) -@anchor{cp/topics/expressions _CPPv4ltN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b5}@anchor{cp/topics/expressions _CPPv3ltN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b6}@anchor{cp/topics/expressions _CPPv2ltN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b7}@anchor{cp/topics/expressions lt-operator__gccjit rvalue gccjit rvalue}@anchor{2b8} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator< (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4ltN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2dd}@anchor{cp/topics/expressions _CPPv3ltN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2de}@anchor{cp/topics/expressions _CPPv2ltN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2df}@anchor{cp/topics/expressions lt-operator__gccjit rvalue gccjit rvalue}@anchor{2e0} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator< (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue cond = i < n; @@ -13355,8 +13973,8 @@ gccjit::rvalue cond = i < n; @end deffn @geindex operator<= (C++ function) -@anchor{cp/topics/expressions _CPPv4leN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2b9}@anchor{cp/topics/expressions _CPPv3leN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2ba}@anchor{cp/topics/expressions _CPPv2leN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2bb}@anchor{cp/topics/expressions lte-operator__gccjit rvalue gccjit rvalue}@anchor{2bc} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator<= (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4leN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2e1}@anchor{cp/topics/expressions _CPPv3leN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2e2}@anchor{cp/topics/expressions _CPPv2leN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2e3}@anchor{cp/topics/expressions lte-operator__gccjit rvalue gccjit rvalue}@anchor{2e4} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator<= (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue cond = i <= n; @@ -13364,8 +13982,8 @@ gccjit::rvalue cond = i <= n; @end deffn @geindex operator> (C++ function) -@anchor{cp/topics/expressions _CPPv4gtN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2bd}@anchor{cp/topics/expressions _CPPv3gtN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2be}@anchor{cp/topics/expressions _CPPv2gtN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2bf}@anchor{cp/topics/expressions gt-operator__gccjit rvalue gccjit rvalue}@anchor{2c0} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator> (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4gtN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2e5}@anchor{cp/topics/expressions _CPPv3gtN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2e6}@anchor{cp/topics/expressions _CPPv2gtN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2e7}@anchor{cp/topics/expressions gt-operator__gccjit rvalue gccjit rvalue}@anchor{2e8} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator> (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue cond = (ch > limit); @@ -13373,8 +13991,8 @@ gccjit::rvalue cond = (ch > limit); @end deffn @geindex operator>= (C++ function) -@anchor{cp/topics/expressions _CPPv4geN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2c1}@anchor{cp/topics/expressions _CPPv3geN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2c2}@anchor{cp/topics/expressions _CPPv2geN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2c3}@anchor{cp/topics/expressions gte-operator__gccjit rvalue gccjit rvalue}@anchor{2c4} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} operator>= (gccjit::rvalue a, gccjit::rvalue b) +@anchor{cp/topics/expressions _CPPv4geN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2e9}@anchor{cp/topics/expressions _CPPv3geN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2ea}@anchor{cp/topics/expressions _CPPv2geN6gccjit6rvalueEN6gccjit6rvalueE}@anchor{2eb}@anchor{cp/topics/expressions gte-operator__gccjit rvalue gccjit rvalue}@anchor{2ec} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} operator>= (gccjit::rvalue a, gccjit::rvalue b) @example gccjit::rvalue cond = (score >= ctxt.new_rvalue (t_int, 100)); @@ -13384,12 +14002,12 @@ gccjit::rvalue cond = (score >= ctxt.new_rvalue (t_int, 100)); @c TODO: beyond this point @node Function calls<2>,Function pointers<3>,Comparisons<2>,Rvalues<2> -@anchor{cp/topics/expressions function-calls}@anchor{2c5} +@anchor{cp/topics/expressions function-calls}@anchor{2ed} @subsubsection Function calls @geindex gcc_jit_context_new_call (C++ function) -@anchor{cp/topics/expressions _CPPv424gcc_jit_context_new_callP15gcc_jit_contextP16gcc_jit_locationP16gcc_jit_functioniPP14gcc_jit_rvalue}@anchor{2c6}@anchor{cp/topics/expressions _CPPv324gcc_jit_context_new_callP15gcc_jit_contextP16gcc_jit_locationP16gcc_jit_functioniPP14gcc_jit_rvalue}@anchor{2c7}@anchor{cp/topics/expressions _CPPv224gcc_jit_context_new_callP15gcc_jit_contextP16gcc_jit_locationP16gcc_jit_functioniPP14gcc_jit_rvalue}@anchor{2c8}@anchor{cp/topics/expressions gcc_jit_context_new_call__gcc_jit_contextP gcc_jit_locationP gcc_jit_functionP i gcc_jit_rvaluePP}@anchor{2c9} +@anchor{cp/topics/expressions _CPPv424gcc_jit_context_new_callP15gcc_jit_contextP16gcc_jit_locationP16gcc_jit_functioniPP14gcc_jit_rvalue}@anchor{2ee}@anchor{cp/topics/expressions _CPPv324gcc_jit_context_new_callP15gcc_jit_contextP16gcc_jit_locationP16gcc_jit_functioniPP14gcc_jit_rvalue}@anchor{2ef}@anchor{cp/topics/expressions _CPPv224gcc_jit_context_new_callP15gcc_jit_contextP16gcc_jit_locationP16gcc_jit_functioniPP14gcc_jit_rvalue}@anchor{2f0}@anchor{cp/topics/expressions gcc_jit_context_new_call__gcc_jit_contextP gcc_jit_locationP gcc_jit_functionP i gcc_jit_rvaluePP}@anchor{2f1} @deffn {C++ Function} gcc_jit_rvalue *gcc_jit_context_new_call (gcc_jit_context *ctxt, gcc_jit_location *loc, gcc_jit_function *func, int numargs, gcc_jit_rvalue **args) Given a function and the given table of argument rvalues, construct a @@ -13398,14 +14016,14 @@ call to the function, with the result as an rvalue. @cartouche @quotation Note @code{gccjit::context::new_call()} merely builds a -@ref{146,,gccjit;;rvalue} i.e. an expression that can be evaluated, +@ref{16e,,gccjit;;rvalue} i.e. an expression that can be evaluated, perhaps as part of a more complicated expression. The call @emph{won’t} happen unless you add a statement to a function that evaluates the expression. For example, if you want to call a function and discard the result (or to call a function with @code{void} return type), use -@ref{2ca,,gccjit;;block;;add_eval()}: +@ref{2f2,,gccjit;;block;;add_eval()}: @example /* Add "(void)printf (arg0, arg1);". */ @@ -13416,26 +14034,26 @@ block.add_eval (ctxt.new_call (printf_func, arg0, arg1)); @end deffn @node Function pointers<3>,Type-coercion<2>,Function calls<2>,Rvalues<2> -@anchor{cp/topics/expressions function-pointers}@anchor{2cb} +@anchor{cp/topics/expressions function-pointers}@anchor{2f3} @subsubsection Function pointers @geindex gccjit;;function;;get_address (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit8function11get_addressEN6gccjit8locationE}@anchor{2cc}@anchor{cp/topics/expressions _CPPv3N6gccjit8function11get_addressEN6gccjit8locationE}@anchor{2cd}@anchor{cp/topics/expressions _CPPv2N6gccjit8function11get_addressEN6gccjit8locationE}@anchor{2ce}@anchor{cp/topics/expressions gccjit function get_address__gccjit location}@anchor{2cf} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{154,,function}::get_address (gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit8function11get_addressEN6gccjit8locationE}@anchor{2f4}@anchor{cp/topics/expressions _CPPv3N6gccjit8function11get_addressEN6gccjit8locationE}@anchor{2f5}@anchor{cp/topics/expressions _CPPv2N6gccjit8function11get_addressEN6gccjit8locationE}@anchor{2f6}@anchor{cp/topics/expressions gccjit function get_address__gccjit location}@anchor{2f7} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{17c,,function}::get_address (gccjit::location loc) Get the address of a function as an rvalue, of function pointer type. @end deffn @node Type-coercion<2>,,Function pointers<3>,Rvalues<2> -@anchor{cp/topics/expressions type-coercion}@anchor{2d0} +@anchor{cp/topics/expressions type-coercion}@anchor{2f8} @subsubsection Type-coercion @geindex gccjit;;context;;new_cast (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context8new_castEN6gccjit6rvalueEN6gccjit4typeEN6gccjit8locationE}@anchor{2d1}@anchor{cp/topics/expressions _CPPv3N6gccjit7context8new_castEN6gccjit6rvalueEN6gccjit4typeEN6gccjit8locationE}@anchor{2d2}@anchor{cp/topics/expressions _CPPv2N6gccjit7context8new_castEN6gccjit6rvalueEN6gccjit4typeEN6gccjit8locationE}@anchor{2d3}@anchor{cp/topics/expressions gccjit context new_cast__gccjit rvalue gccjit type gccjit location}@anchor{2d4} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{13d,,context}::new_cast (gccjit::rvalue rvalue, gccjit::type type, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context8new_castEN6gccjit6rvalueEN6gccjit4typeEN6gccjit8locationE}@anchor{2f9}@anchor{cp/topics/expressions _CPPv3N6gccjit7context8new_castEN6gccjit6rvalueEN6gccjit4typeEN6gccjit8locationE}@anchor{2fa}@anchor{cp/topics/expressions _CPPv2N6gccjit7context8new_castEN6gccjit6rvalueEN6gccjit4typeEN6gccjit8locationE}@anchor{2fb}@anchor{cp/topics/expressions gccjit context new_cast__gccjit rvalue gccjit type gccjit location}@anchor{2fc} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{165,,context}::new_cast (gccjit::rvalue rvalue, gccjit::type type, gccjit::location loc) Given an rvalue of T, construct another rvalue of another type. @@ -13459,25 +14077,25 @@ P* <-> Q*, for pointer types P and Q @end deffn @node Lvalues<2>,Working with pointers structs and unions<2>,Rvalues<2>,Expressions<2> -@anchor{cp/topics/expressions lvalues}@anchor{2d5} +@anchor{cp/topics/expressions lvalues}@anchor{2fd} @subsubsection Lvalues @geindex gccjit;;lvalue (C++ class) -@anchor{cp/topics/expressions _CPPv4N6gccjit6lvalueE}@anchor{14f}@anchor{cp/topics/expressions _CPPv3N6gccjit6lvalueE}@anchor{2d6}@anchor{cp/topics/expressions _CPPv2N6gccjit6lvalueE}@anchor{2d7}@anchor{cp/topics/expressions gccjit lvalue}@anchor{2d8} +@anchor{cp/topics/expressions _CPPv4N6gccjit6lvalueE}@anchor{177}@anchor{cp/topics/expressions _CPPv3N6gccjit6lvalueE}@anchor{2fe}@anchor{cp/topics/expressions _CPPv2N6gccjit6lvalueE}@anchor{2ff}@anchor{cp/topics/expressions gccjit lvalue}@anchor{300} @deffn {C++ Class} gccjit::lvalue @end deffn An lvalue is something that can of the @emph{left}-hand side of an assignment: a storage area (such as a variable). It is a subclass of -@ref{146,,gccjit;;rvalue}, where the rvalue is computed by reading from the +@ref{16e,,gccjit;;rvalue}, where the rvalue is computed by reading from the storage area. It iss a thin wrapper around @ref{24,,gcc_jit_lvalue *} from the C API. @geindex gccjit;;lvalue;;get_address (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit6lvalue11get_addressEN6gccjit8locationE}@anchor{2d9}@anchor{cp/topics/expressions _CPPv3N6gccjit6lvalue11get_addressEN6gccjit8locationE}@anchor{2da}@anchor{cp/topics/expressions _CPPv2N6gccjit6lvalue11get_addressEN6gccjit8locationE}@anchor{2db}@anchor{cp/topics/expressions gccjit lvalue get_address__gccjit location}@anchor{2dc} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{14f,,lvalue}::get_address (gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit6lvalue11get_addressEN6gccjit8locationE}@anchor{301}@anchor{cp/topics/expressions _CPPv3N6gccjit6lvalue11get_addressEN6gccjit8locationE}@anchor{302}@anchor{cp/topics/expressions _CPPv2N6gccjit6lvalue11get_addressEN6gccjit8locationE}@anchor{303}@anchor{cp/topics/expressions gccjit lvalue get_address__gccjit location}@anchor{304} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{177,,lvalue}::get_address (gccjit::location loc) Take the address of an lvalue; analogous to: @@ -13496,28 +14114,28 @@ Parameter “loc” is optional. @end menu @node Global variables<2>,,,Lvalues<2> -@anchor{cp/topics/expressions global-variables}@anchor{2dd} +@anchor{cp/topics/expressions global-variables}@anchor{305} @subsubsection Global variables @geindex gccjit;;context;;new_global (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context10new_globalE19gcc_jit_global_kindN6gccjit4typeEPKcN6gccjit8locationE}@anchor{2de}@anchor{cp/topics/expressions _CPPv3N6gccjit7context10new_globalE19gcc_jit_global_kindN6gccjit4typeEPKcN6gccjit8locationE}@anchor{2df}@anchor{cp/topics/expressions _CPPv2N6gccjit7context10new_globalE19gcc_jit_global_kindN6gccjit4typeEPKcN6gccjit8locationE}@anchor{2e0}@anchor{cp/topics/expressions gccjit context new_global__gcc_jit_global_kind gccjit type cCP gccjit location}@anchor{2e1} -@deffn {C++ Function} gccjit::@ref{14f,,lvalue} gccjit::@ref{13d,,context}::new_global (enum gcc_jit_global_kind, gccjit::type type, const char *name, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context10new_globalE19gcc_jit_global_kindN6gccjit4typeEPKcN6gccjit8locationE}@anchor{306}@anchor{cp/topics/expressions _CPPv3N6gccjit7context10new_globalE19gcc_jit_global_kindN6gccjit4typeEPKcN6gccjit8locationE}@anchor{307}@anchor{cp/topics/expressions _CPPv2N6gccjit7context10new_globalE19gcc_jit_global_kindN6gccjit4typeEPKcN6gccjit8locationE}@anchor{308}@anchor{cp/topics/expressions gccjit context new_global__gcc_jit_global_kind gccjit type cCP gccjit location}@anchor{309} +@deffn {C++ Function} gccjit::@ref{177,,lvalue} gccjit::@ref{165,,context}::new_global (enum gcc_jit_global_kind, gccjit::type type, const char *name, gccjit::location loc) Add a new global variable of the given type and name to the context. -This is a thin wrapper around @ref{c8,,gcc_jit_context_new_global()} from +This is a thin wrapper around @ref{ea,,gcc_jit_context_new_global()} from the C API; the “kind” parameter has the same meaning as there. @end deffn @node Working with pointers structs and unions<2>,,Lvalues<2>,Expressions<2> -@anchor{cp/topics/expressions working-with-pointers-structs-and-unions}@anchor{2e2} +@anchor{cp/topics/expressions working-with-pointers-structs-and-unions}@anchor{30a} @subsubsection Working with pointers, structs and unions @geindex gccjit;;rvalue;;dereference (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit6rvalue11dereferenceEN6gccjit8locationE}@anchor{2e3}@anchor{cp/topics/expressions _CPPv3N6gccjit6rvalue11dereferenceEN6gccjit8locationE}@anchor{2e4}@anchor{cp/topics/expressions _CPPv2N6gccjit6rvalue11dereferenceEN6gccjit8locationE}@anchor{2e5}@anchor{cp/topics/expressions gccjit rvalue dereference__gccjit location}@anchor{2e6} -@deffn {C++ Function} gccjit::@ref{14f,,lvalue} gccjit::@ref{146,,rvalue}::dereference (gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit6rvalue11dereferenceEN6gccjit8locationE}@anchor{30b}@anchor{cp/topics/expressions _CPPv3N6gccjit6rvalue11dereferenceEN6gccjit8locationE}@anchor{30c}@anchor{cp/topics/expressions _CPPv2N6gccjit6rvalue11dereferenceEN6gccjit8locationE}@anchor{30d}@anchor{cp/topics/expressions gccjit rvalue dereference__gccjit location}@anchor{30e} +@deffn {C++ Function} gccjit::@ref{177,,lvalue} gccjit::@ref{16e,,rvalue}::dereference (gccjit::location loc) Given an rvalue of pointer type @code{T *}, dereferencing the pointer, getting an lvalue of type @code{T}. Analogous to: @@ -13535,8 +14153,8 @@ If you don’t need to specify the location, this can also be expressed using an overloaded operator: @geindex gccjit;;rvalue;;operator* (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit6rvaluemlEv}@anchor{2e7}@anchor{cp/topics/expressions _CPPv3N6gccjit6rvaluemlEv}@anchor{2e8}@anchor{cp/topics/expressions _CPPv2N6gccjit6rvaluemlEv}@anchor{2e9}@anchor{cp/topics/expressions gccjit rvalue mul-operator}@anchor{2ea} -@deffn {C++ Function} gccjit::@ref{14f,,lvalue} gccjit::@ref{146,,rvalue}::operator* () +@anchor{cp/topics/expressions _CPPv4N6gccjit6rvaluemlEv}@anchor{30f}@anchor{cp/topics/expressions _CPPv3N6gccjit6rvaluemlEv}@anchor{310}@anchor{cp/topics/expressions _CPPv2N6gccjit6rvaluemlEv}@anchor{311}@anchor{cp/topics/expressions gccjit rvalue mul-operator}@anchor{312} +@deffn {C++ Function} gccjit::@ref{177,,lvalue} gccjit::@ref{16e,,rvalue}::operator* () @example gccjit::lvalue content = *ptr; @@ -13546,8 +14164,8 @@ gccjit::lvalue content = *ptr; Field access is provided separately for both lvalues and rvalues: @geindex gccjit;;lvalue;;access_field (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit6lvalue12access_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{2eb}@anchor{cp/topics/expressions _CPPv3N6gccjit6lvalue12access_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{2ec}@anchor{cp/topics/expressions _CPPv2N6gccjit6lvalue12access_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{2ed}@anchor{cp/topics/expressions gccjit lvalue access_field__gccjit field gccjit location}@anchor{2ee} -@deffn {C++ Function} gccjit::@ref{14f,,lvalue} gccjit::@ref{14f,,lvalue}::access_field (gccjit::field field, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit6lvalue12access_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{313}@anchor{cp/topics/expressions _CPPv3N6gccjit6lvalue12access_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{314}@anchor{cp/topics/expressions _CPPv2N6gccjit6lvalue12access_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{315}@anchor{cp/topics/expressions gccjit lvalue access_field__gccjit field gccjit location}@anchor{316} +@deffn {C++ Function} gccjit::@ref{177,,lvalue} gccjit::@ref{177,,lvalue}::access_field (gccjit::field field, gccjit::location loc) Given an lvalue of struct or union type, access the given field, getting an lvalue of the field’s type. Analogous to: @@ -13560,8 +14178,8 @@ in C. @end deffn @geindex gccjit;;rvalue;;access_field (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit6rvalue12access_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{2ef}@anchor{cp/topics/expressions _CPPv3N6gccjit6rvalue12access_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{2f0}@anchor{cp/topics/expressions _CPPv2N6gccjit6rvalue12access_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{2f1}@anchor{cp/topics/expressions gccjit rvalue access_field__gccjit field gccjit location}@anchor{2f2} -@deffn {C++ Function} gccjit::@ref{146,,rvalue} gccjit::@ref{146,,rvalue}::access_field (gccjit::field field, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit6rvalue12access_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{317}@anchor{cp/topics/expressions _CPPv3N6gccjit6rvalue12access_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{318}@anchor{cp/topics/expressions _CPPv2N6gccjit6rvalue12access_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{319}@anchor{cp/topics/expressions gccjit rvalue access_field__gccjit field gccjit location}@anchor{31a} +@deffn {C++ Function} gccjit::@ref{16e,,rvalue} gccjit::@ref{16e,,rvalue}::access_field (gccjit::field field, gccjit::location loc) Given an rvalue of struct or union type, access the given field as an rvalue. Analogous to: @@ -13574,8 +14192,8 @@ in C. @end deffn @geindex gccjit;;rvalue;;dereference_field (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit6rvalue17dereference_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{2f3}@anchor{cp/topics/expressions _CPPv3N6gccjit6rvalue17dereference_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{2f4}@anchor{cp/topics/expressions _CPPv2N6gccjit6rvalue17dereference_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{2f5}@anchor{cp/topics/expressions gccjit rvalue dereference_field__gccjit field gccjit location}@anchor{2f6} -@deffn {C++ Function} gccjit::@ref{14f,,lvalue} gccjit::@ref{146,,rvalue}::dereference_field (gccjit::field field, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit6rvalue17dereference_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{31b}@anchor{cp/topics/expressions _CPPv3N6gccjit6rvalue17dereference_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{31c}@anchor{cp/topics/expressions _CPPv2N6gccjit6rvalue17dereference_fieldEN6gccjit5fieldEN6gccjit8locationE}@anchor{31d}@anchor{cp/topics/expressions gccjit rvalue dereference_field__gccjit field gccjit location}@anchor{31e} +@deffn {C++ Function} gccjit::@ref{177,,lvalue} gccjit::@ref{16e,,rvalue}::dereference_field (gccjit::field field, gccjit::location loc) Given an rvalue of pointer type @code{T *} where T is of struct or union type, access the given field as an lvalue. Analogous to: @@ -13588,8 +14206,8 @@ in C, itself equivalent to @code{(*EXPR).FIELD}. @end deffn @geindex gccjit;;context;;new_array_access (C++ function) -@anchor{cp/topics/expressions _CPPv4N6gccjit7context16new_array_accessEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2f7}@anchor{cp/topics/expressions _CPPv3N6gccjit7context16new_array_accessEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2f8}@anchor{cp/topics/expressions _CPPv2N6gccjit7context16new_array_accessEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2f9}@anchor{cp/topics/expressions gccjit context new_array_access__gccjit rvalue gccjit rvalue gccjit location}@anchor{2fa} -@deffn {C++ Function} gccjit::@ref{14f,,lvalue} gccjit::@ref{13d,,context}::new_array_access (gccjit::rvalue ptr, gccjit::rvalue index, gccjit::location loc) +@anchor{cp/topics/expressions _CPPv4N6gccjit7context16new_array_accessEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{31f}@anchor{cp/topics/expressions _CPPv3N6gccjit7context16new_array_accessEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{320}@anchor{cp/topics/expressions _CPPv2N6gccjit7context16new_array_accessEN6gccjit6rvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{321}@anchor{cp/topics/expressions gccjit context new_array_access__gccjit rvalue gccjit rvalue gccjit location}@anchor{322} +@deffn {C++ Function} gccjit::@ref{177,,lvalue} gccjit::@ref{165,,context}::new_array_access (gccjit::rvalue ptr, gccjit::rvalue index, gccjit::location loc) Given an rvalue of pointer type @code{T *}, get at the element @cite{T} at the given index, using standard C array indexing rules i.e. each @@ -13605,7 +14223,7 @@ in C (or, indeed, to @code{PTR + INDEX}). Parameter “loc” is optional. @end deffn -For array accesses where you don’t need to specify a @ref{163,,gccjit;;location}, +For array accesses where you don’t need to specify a @ref{18b,,gccjit;;location}, two overloaded operators are available: @quotation @@ -13641,7 +14259,7 @@ gccjit::lvalue element = array[0]; @c . @node Creating and using functions<2>,Source Locations<2>,Expressions<2>,Topic Reference<2> -@anchor{cp/topics/functions doc}@anchor{2fb}@anchor{cp/topics/functions creating-and-using-functions}@anchor{2fc} +@anchor{cp/topics/functions doc}@anchor{323}@anchor{cp/topics/functions creating-and-using-functions}@anchor{324} @subsection Creating and using functions @@ -13654,36 +14272,36 @@ gccjit::lvalue element = array[0]; @end menu @node Params<2>,Functions<2>,,Creating and using functions<2> -@anchor{cp/topics/functions params}@anchor{2fd} +@anchor{cp/topics/functions params}@anchor{325} @subsubsection Params @geindex gccjit;;param (C++ class) -@anchor{cp/topics/functions _CPPv4N6gccjit5paramE}@anchor{150}@anchor{cp/topics/functions _CPPv3N6gccjit5paramE}@anchor{2fe}@anchor{cp/topics/functions _CPPv2N6gccjit5paramE}@anchor{2ff}@anchor{cp/topics/functions gccjit param}@anchor{300} +@anchor{cp/topics/functions _CPPv4N6gccjit5paramE}@anchor{178}@anchor{cp/topics/functions _CPPv3N6gccjit5paramE}@anchor{326}@anchor{cp/topics/functions _CPPv2N6gccjit5paramE}@anchor{327}@anchor{cp/topics/functions gccjit param}@anchor{328} @deffn {C++ Class} gccjit::param A @cite{gccjit::param} represents a parameter to a function. @end deffn @geindex gccjit;;context;;new_param (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit7context9new_paramEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{144}@anchor{cp/topics/functions _CPPv3N6gccjit7context9new_paramEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{301}@anchor{cp/topics/functions _CPPv2N6gccjit7context9new_paramEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{302}@anchor{cp/topics/functions gccjit context new_param__gccjit type cCP gccjit location}@anchor{303} -@deffn {C++ Function} gccjit::@ref{150,,param} gccjit::@ref{13d,,context}::new_param (gccjit::type type, const char *name, gccjit::location loc) +@anchor{cp/topics/functions _CPPv4N6gccjit7context9new_paramEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{16c}@anchor{cp/topics/functions _CPPv3N6gccjit7context9new_paramEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{329}@anchor{cp/topics/functions _CPPv2N6gccjit7context9new_paramEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{32a}@anchor{cp/topics/functions gccjit context new_param__gccjit type cCP gccjit location}@anchor{32b} +@deffn {C++ Function} gccjit::@ref{178,,param} gccjit::@ref{165,,context}::new_param (gccjit::type type, const char *name, gccjit::location loc) In preparation for creating a function, create a new parameter of the given type and name. @end deffn -@ref{150,,gccjit;;param} is a subclass of @ref{14f,,gccjit;;lvalue} (and thus -of @ref{146,,gccjit;;rvalue} and @ref{142,,gccjit;;object}). It is a thin +@ref{178,,gccjit;;param} is a subclass of @ref{177,,gccjit;;lvalue} (and thus +of @ref{16e,,gccjit;;rvalue} and @ref{16a,,gccjit;;object}). It is a thin wrapper around the C API’s @ref{25,,gcc_jit_param *}. @node Functions<2>,Blocks<2>,Params<2>,Creating and using functions<2> -@anchor{cp/topics/functions functions}@anchor{304} +@anchor{cp/topics/functions functions}@anchor{32c} @subsubsection Functions @geindex gccjit;;function (C++ class) -@anchor{cp/topics/functions _CPPv4N6gccjit8functionE}@anchor{154}@anchor{cp/topics/functions _CPPv3N6gccjit8functionE}@anchor{305}@anchor{cp/topics/functions _CPPv2N6gccjit8functionE}@anchor{306}@anchor{cp/topics/functions gccjit function}@anchor{307} +@anchor{cp/topics/functions _CPPv4N6gccjit8functionE}@anchor{17c}@anchor{cp/topics/functions _CPPv3N6gccjit8functionE}@anchor{32d}@anchor{cp/topics/functions _CPPv2N6gccjit8functionE}@anchor{32e}@anchor{cp/topics/functions gccjit function}@anchor{32f} @deffn {C++ Class} gccjit::function A @cite{gccjit::function} represents a function - either one that we’re @@ -13691,8 +14309,8 @@ creating ourselves, or one that we’re referencing. @end deffn @geindex gccjit;;context;;new_function (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit7context12new_functionE21gcc_jit_function_kindN6gccjit4typeEPKcRNSt6vectorI5paramEEiN6gccjit8locationE}@anchor{308}@anchor{cp/topics/functions _CPPv3N6gccjit7context12new_functionE21gcc_jit_function_kindN6gccjit4typeEPKcRNSt6vectorI5paramEEiN6gccjit8locationE}@anchor{309}@anchor{cp/topics/functions _CPPv2N6gccjit7context12new_functionE21gcc_jit_function_kindN6gccjit4typeEPKcRNSt6vectorI5paramEEiN6gccjit8locationE}@anchor{30a}@anchor{cp/topics/functions gccjit context new_function__gcc_jit_function_kind gccjit type cCP std vector param R i gccjit location}@anchor{30b} -@deffn {C++ Function} gccjit::@ref{154,,function} gccjit::@ref{13d,,context}::new_function (enum gcc_jit_function_kind, gccjit::type return_type, const char *name, std::vector ¶ms, int is_variadic, gccjit::location loc) +@anchor{cp/topics/functions _CPPv4N6gccjit7context12new_functionE21gcc_jit_function_kindN6gccjit4typeEPKcRNSt6vectorI5paramEEiN6gccjit8locationE}@anchor{330}@anchor{cp/topics/functions _CPPv3N6gccjit7context12new_functionE21gcc_jit_function_kindN6gccjit4typeEPKcRNSt6vectorI5paramEEiN6gccjit8locationE}@anchor{331}@anchor{cp/topics/functions _CPPv2N6gccjit7context12new_functionE21gcc_jit_function_kindN6gccjit4typeEPKcRNSt6vectorI5paramEEiN6gccjit8locationE}@anchor{332}@anchor{cp/topics/functions gccjit context new_function__gcc_jit_function_kind gccjit type cCP std vector param R i gccjit location}@anchor{333} +@deffn {C++ Function} gccjit::@ref{17c,,function} gccjit::@ref{165,,context}::new_function (enum gcc_jit_function_kind, gccjit::type return_type, const char *name, std::vector ¶ms, int is_variadic, gccjit::location loc) Create a gcc_jit_function with the given name and parameters. @@ -13702,49 +14320,49 @@ This is a wrapper around the C API’s @ref{11,,gcc_jit_context_new_function()}. @end deffn @geindex gccjit;;context;;get_builtin_function (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit7context20get_builtin_functionEPKc}@anchor{30c}@anchor{cp/topics/functions _CPPv3N6gccjit7context20get_builtin_functionEPKc}@anchor{30d}@anchor{cp/topics/functions _CPPv2N6gccjit7context20get_builtin_functionEPKc}@anchor{30e}@anchor{cp/topics/functions gccjit context get_builtin_function__cCP}@anchor{30f} -@deffn {C++ Function} gccjit::@ref{154,,function} gccjit::@ref{13d,,context}::get_builtin_function (const char *name) +@anchor{cp/topics/functions _CPPv4N6gccjit7context20get_builtin_functionEPKc}@anchor{334}@anchor{cp/topics/functions _CPPv3N6gccjit7context20get_builtin_functionEPKc}@anchor{335}@anchor{cp/topics/functions _CPPv2N6gccjit7context20get_builtin_functionEPKc}@anchor{336}@anchor{cp/topics/functions gccjit context get_builtin_function__cCP}@anchor{337} +@deffn {C++ Function} gccjit::@ref{17c,,function} gccjit::@ref{165,,context}::get_builtin_function (const char *name) This is a wrapper around the C API’s -@ref{e1,,gcc_jit_context_get_builtin_function()}. +@ref{103,,gcc_jit_context_get_builtin_function()}. @end deffn @geindex gccjit;;function;;get_param (C++ function) -@anchor{cp/topics/functions _CPPv4NK6gccjit8function9get_paramEi}@anchor{310}@anchor{cp/topics/functions _CPPv3NK6gccjit8function9get_paramEi}@anchor{311}@anchor{cp/topics/functions _CPPv2NK6gccjit8function9get_paramEi}@anchor{312}@anchor{cp/topics/functions gccjit function get_param__iC}@anchor{313} -@deffn {C++ Function} gccjit::@ref{150,,param} gccjit::@ref{154,,function}::get_param (int index) const +@anchor{cp/topics/functions _CPPv4NK6gccjit8function9get_paramEi}@anchor{338}@anchor{cp/topics/functions _CPPv3NK6gccjit8function9get_paramEi}@anchor{339}@anchor{cp/topics/functions _CPPv2NK6gccjit8function9get_paramEi}@anchor{33a}@anchor{cp/topics/functions gccjit function get_param__iC}@anchor{33b} +@deffn {C++ Function} gccjit::@ref{178,,param} gccjit::@ref{17c,,function}::get_param (int index) const Get the param of the given index (0-based). @end deffn @geindex gccjit;;function;;dump_to_dot (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit8function11dump_to_dotEPKc}@anchor{15c}@anchor{cp/topics/functions _CPPv3N6gccjit8function11dump_to_dotEPKc}@anchor{314}@anchor{cp/topics/functions _CPPv2N6gccjit8function11dump_to_dotEPKc}@anchor{315}@anchor{cp/topics/functions gccjit function dump_to_dot__cCP}@anchor{316} -@deffn {C++ Function} void gccjit::@ref{154,,function}::dump_to_dot (const char *path) +@anchor{cp/topics/functions _CPPv4N6gccjit8function11dump_to_dotEPKc}@anchor{184}@anchor{cp/topics/functions _CPPv3N6gccjit8function11dump_to_dotEPKc}@anchor{33c}@anchor{cp/topics/functions _CPPv2N6gccjit8function11dump_to_dotEPKc}@anchor{33d}@anchor{cp/topics/functions gccjit function dump_to_dot__cCP}@anchor{33e} +@deffn {C++ Function} void gccjit::@ref{17c,,function}::dump_to_dot (const char *path) Emit the function in graphviz format to the given path. @end deffn @geindex gccjit;;function;;new_local (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit8function9new_localEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{151}@anchor{cp/topics/functions _CPPv3N6gccjit8function9new_localEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{317}@anchor{cp/topics/functions _CPPv2N6gccjit8function9new_localEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{318}@anchor{cp/topics/functions gccjit function new_local__gccjit type cCP gccjit location}@anchor{319} -@deffn {C++ Function} gccjit::@ref{14f,,lvalue} gccjit::@ref{154,,function}::new_local (gccjit::type type, const char *name, gccjit::location loc) +@anchor{cp/topics/functions _CPPv4N6gccjit8function9new_localEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{179}@anchor{cp/topics/functions _CPPv3N6gccjit8function9new_localEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{33f}@anchor{cp/topics/functions _CPPv2N6gccjit8function9new_localEN6gccjit4typeEPKcN6gccjit8locationE}@anchor{340}@anchor{cp/topics/functions gccjit function new_local__gccjit type cCP gccjit location}@anchor{341} +@deffn {C++ Function} gccjit::@ref{177,,lvalue} gccjit::@ref{17c,,function}::new_local (gccjit::type type, const char *name, gccjit::location loc) Create a new local variable within the function, of the given type and name. @end deffn @node Blocks<2>,Statements<2>,Functions<2>,Creating and using functions<2> -@anchor{cp/topics/functions blocks}@anchor{31a} +@anchor{cp/topics/functions blocks}@anchor{342} @subsubsection Blocks @geindex gccjit;;block (C++ class) -@anchor{cp/topics/functions _CPPv4N6gccjit5blockE}@anchor{153}@anchor{cp/topics/functions _CPPv3N6gccjit5blockE}@anchor{31b}@anchor{cp/topics/functions _CPPv2N6gccjit5blockE}@anchor{31c}@anchor{cp/topics/functions gccjit block}@anchor{31d} +@anchor{cp/topics/functions _CPPv4N6gccjit5blockE}@anchor{17b}@anchor{cp/topics/functions _CPPv3N6gccjit5blockE}@anchor{343}@anchor{cp/topics/functions _CPPv2N6gccjit5blockE}@anchor{344}@anchor{cp/topics/functions gccjit block}@anchor{345} @deffn {C++ Class} gccjit::block A @cite{gccjit::block} represents a basic block within a function i.e. a sequence of statements with a single entry point and a single exit point. -@ref{153,,gccjit;;block} is a subclass of @ref{142,,gccjit;;object}. +@ref{17b,,gccjit;;block} is a subclass of @ref{16a,,gccjit;;object}. The first basic block that you create within a function will be the entrypoint. @@ -13758,8 +14376,8 @@ one function. @end deffn @geindex gccjit;;function;;new_block (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit8function9new_blockEPKc}@anchor{31e}@anchor{cp/topics/functions _CPPv3N6gccjit8function9new_blockEPKc}@anchor{31f}@anchor{cp/topics/functions _CPPv2N6gccjit8function9new_blockEPKc}@anchor{320}@anchor{cp/topics/functions gccjit function new_block__cCP}@anchor{321} -@deffn {C++ Function} gccjit::@ref{153,,block} gccjit::@ref{154,,function}::new_block (const char *name) +@anchor{cp/topics/functions _CPPv4N6gccjit8function9new_blockEPKc}@anchor{346}@anchor{cp/topics/functions _CPPv3N6gccjit8function9new_blockEPKc}@anchor{347}@anchor{cp/topics/functions _CPPv2N6gccjit8function9new_blockEPKc}@anchor{348}@anchor{cp/topics/functions gccjit function new_block__cCP}@anchor{349} +@deffn {C++ Function} gccjit::@ref{17b,,block} gccjit::@ref{17c,,function}::new_block (const char *name) Create a basic block of the given name. The name may be NULL, but providing meaningful names is often helpful when debugging: it may @@ -13768,13 +14386,13 @@ messages. @end deffn @node Statements<2>,,Blocks<2>,Creating and using functions<2> -@anchor{cp/topics/functions statements}@anchor{322} +@anchor{cp/topics/functions statements}@anchor{34a} @subsubsection Statements @geindex gccjit;;block;;add_eval (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit5block8add_evalEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2ca}@anchor{cp/topics/functions _CPPv3N6gccjit5block8add_evalEN6gccjit6rvalueEN6gccjit8locationE}@anchor{323}@anchor{cp/topics/functions _CPPv2N6gccjit5block8add_evalEN6gccjit6rvalueEN6gccjit8locationE}@anchor{324}@anchor{cp/topics/functions gccjit block add_eval__gccjit rvalue gccjit location}@anchor{325} -@deffn {C++ Function} void gccjit::@ref{153,,block}::add_eval (gccjit::rvalue rvalue, gccjit::location loc) +@anchor{cp/topics/functions _CPPv4N6gccjit5block8add_evalEN6gccjit6rvalueEN6gccjit8locationE}@anchor{2f2}@anchor{cp/topics/functions _CPPv3N6gccjit5block8add_evalEN6gccjit6rvalueEN6gccjit8locationE}@anchor{34b}@anchor{cp/topics/functions _CPPv2N6gccjit5block8add_evalEN6gccjit6rvalueEN6gccjit8locationE}@anchor{34c}@anchor{cp/topics/functions gccjit block add_eval__gccjit rvalue gccjit location}@anchor{34d} +@deffn {C++ Function} void gccjit::@ref{17b,,block}::add_eval (gccjit::rvalue rvalue, gccjit::location loc) Add evaluation of an rvalue, discarding the result (e.g. a function call that “returns” void). @@ -13787,8 +14405,8 @@ This is equivalent to this C code: @end deffn @geindex gccjit;;block;;add_assignment (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit5block14add_assignmentEN6gccjit6lvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{155}@anchor{cp/topics/functions _CPPv3N6gccjit5block14add_assignmentEN6gccjit6lvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{326}@anchor{cp/topics/functions _CPPv2N6gccjit5block14add_assignmentEN6gccjit6lvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{327}@anchor{cp/topics/functions gccjit block add_assignment__gccjit lvalue gccjit rvalue gccjit location}@anchor{328} -@deffn {C++ Function} void gccjit::@ref{153,,block}::add_assignment (gccjit::lvalue lvalue, gccjit::rvalue rvalue, gccjit::location loc) +@anchor{cp/topics/functions _CPPv4N6gccjit5block14add_assignmentEN6gccjit6lvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{17d}@anchor{cp/topics/functions _CPPv3N6gccjit5block14add_assignmentEN6gccjit6lvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{34e}@anchor{cp/topics/functions _CPPv2N6gccjit5block14add_assignmentEN6gccjit6lvalueEN6gccjit6rvalueEN6gccjit8locationE}@anchor{34f}@anchor{cp/topics/functions gccjit block add_assignment__gccjit lvalue gccjit rvalue gccjit location}@anchor{350} +@deffn {C++ Function} void gccjit::@ref{17b,,block}::add_assignment (gccjit::lvalue lvalue, gccjit::rvalue rvalue, gccjit::location loc) Add evaluation of an rvalue, assigning the result to the given lvalue. @@ -13801,8 +14419,8 @@ lvalue = rvalue; @end deffn @geindex gccjit;;block;;add_assignment_op (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit5block17add_assignment_opEN6gccjit6lvalueE17gcc_jit_binary_opN6gccjit6rvalueEN6gccjit8locationE}@anchor{159}@anchor{cp/topics/functions _CPPv3N6gccjit5block17add_assignment_opEN6gccjit6lvalueE17gcc_jit_binary_opN6gccjit6rvalueEN6gccjit8locationE}@anchor{329}@anchor{cp/topics/functions _CPPv2N6gccjit5block17add_assignment_opEN6gccjit6lvalueE17gcc_jit_binary_opN6gccjit6rvalueEN6gccjit8locationE}@anchor{32a}@anchor{cp/topics/functions gccjit block add_assignment_op__gccjit lvalue gcc_jit_binary_op gccjit rvalue gccjit location}@anchor{32b} -@deffn {C++ Function} void gccjit::@ref{153,,block}::add_assignment_op (gccjit::lvalue lvalue, enum gcc_jit_binary_op, gccjit::rvalue rvalue, gccjit::location loc) +@anchor{cp/topics/functions _CPPv4N6gccjit5block17add_assignment_opEN6gccjit6lvalueE17gcc_jit_binary_opN6gccjit6rvalueEN6gccjit8locationE}@anchor{181}@anchor{cp/topics/functions _CPPv3N6gccjit5block17add_assignment_opEN6gccjit6lvalueE17gcc_jit_binary_opN6gccjit6rvalueEN6gccjit8locationE}@anchor{351}@anchor{cp/topics/functions _CPPv2N6gccjit5block17add_assignment_opEN6gccjit6lvalueE17gcc_jit_binary_opN6gccjit6rvalueEN6gccjit8locationE}@anchor{352}@anchor{cp/topics/functions gccjit block add_assignment_op__gccjit lvalue gcc_jit_binary_op gccjit rvalue gccjit location}@anchor{353} +@deffn {C++ Function} void gccjit::@ref{17b,,block}::add_assignment_op (gccjit::lvalue lvalue, enum gcc_jit_binary_op, gccjit::rvalue rvalue, gccjit::location loc) Add evaluation of an rvalue, using the result to modify an lvalue. @@ -13827,8 +14445,8 @@ loop_body.add_assignment_op ( @end deffn @geindex gccjit;;block;;add_comment (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit5block11add_commentEPKcN6gccjit8locationE}@anchor{165}@anchor{cp/topics/functions _CPPv3N6gccjit5block11add_commentEPKcN6gccjit8locationE}@anchor{32c}@anchor{cp/topics/functions _CPPv2N6gccjit5block11add_commentEPKcN6gccjit8locationE}@anchor{32d}@anchor{cp/topics/functions gccjit block add_comment__cCP gccjit location}@anchor{32e} -@deffn {C++ Function} void gccjit::@ref{153,,block}::add_comment (const char *text, gccjit::location loc) +@anchor{cp/topics/functions _CPPv4N6gccjit5block11add_commentEPKcN6gccjit8locationE}@anchor{18d}@anchor{cp/topics/functions _CPPv3N6gccjit5block11add_commentEPKcN6gccjit8locationE}@anchor{354}@anchor{cp/topics/functions _CPPv2N6gccjit5block11add_commentEPKcN6gccjit8locationE}@anchor{355}@anchor{cp/topics/functions gccjit block add_comment__cCP gccjit location}@anchor{356} +@deffn {C++ Function} void gccjit::@ref{17b,,block}::add_comment (const char *text, gccjit::location loc) Add a no-op textual comment to the internal representation of the code. It will be optimized away, but will be visible in the dumps @@ -13841,8 +14459,8 @@ Parameter “loc” is optional. @end deffn @geindex gccjit;;block;;end_with_conditional (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit5block20end_with_conditionalEN6gccjit6rvalueEN6gccjit5blockEN6gccjit5blockEN6gccjit8locationE}@anchor{158}@anchor{cp/topics/functions _CPPv3N6gccjit5block20end_with_conditionalEN6gccjit6rvalueEN6gccjit5blockEN6gccjit5blockEN6gccjit8locationE}@anchor{32f}@anchor{cp/topics/functions _CPPv2N6gccjit5block20end_with_conditionalEN6gccjit6rvalueEN6gccjit5blockEN6gccjit5blockEN6gccjit8locationE}@anchor{330}@anchor{cp/topics/functions gccjit block end_with_conditional__gccjit rvalue gccjit block gccjit block gccjit location}@anchor{331} -@deffn {C++ Function} void gccjit::@ref{153,,block}::end_with_conditional (gccjit::rvalue boolval, gccjit::block on_true, gccjit::block on_false, gccjit::location loc) +@anchor{cp/topics/functions _CPPv4N6gccjit5block20end_with_conditionalEN6gccjit6rvalueEN6gccjit5blockEN6gccjit5blockEN6gccjit8locationE}@anchor{180}@anchor{cp/topics/functions _CPPv3N6gccjit5block20end_with_conditionalEN6gccjit6rvalueEN6gccjit5blockEN6gccjit5blockEN6gccjit8locationE}@anchor{357}@anchor{cp/topics/functions _CPPv2N6gccjit5block20end_with_conditionalEN6gccjit6rvalueEN6gccjit5blockEN6gccjit5blockEN6gccjit8locationE}@anchor{358}@anchor{cp/topics/functions gccjit block end_with_conditional__gccjit rvalue gccjit block gccjit block gccjit location}@anchor{359} +@deffn {C++ Function} void gccjit::@ref{17b,,block}::end_with_conditional (gccjit::rvalue boolval, gccjit::block on_true, gccjit::block on_false, gccjit::location loc) Terminate a block by adding evaluation of an rvalue, branching on the result to the appropriate successor block. @@ -13860,8 +14478,8 @@ block, boolval, on_true, and on_false must be non-NULL. @end deffn @geindex gccjit;;block;;end_with_jump (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit5block13end_with_jumpEN6gccjit5blockEN6gccjit8locationE}@anchor{332}@anchor{cp/topics/functions _CPPv3N6gccjit5block13end_with_jumpEN6gccjit5blockEN6gccjit8locationE}@anchor{333}@anchor{cp/topics/functions _CPPv2N6gccjit5block13end_with_jumpEN6gccjit5blockEN6gccjit8locationE}@anchor{334}@anchor{cp/topics/functions gccjit block end_with_jump__gccjit block gccjit location}@anchor{335} -@deffn {C++ Function} void gccjit::@ref{153,,block}::end_with_jump (gccjit::block target, gccjit::location loc) +@anchor{cp/topics/functions _CPPv4N6gccjit5block13end_with_jumpEN6gccjit5blockEN6gccjit8locationE}@anchor{35a}@anchor{cp/topics/functions _CPPv3N6gccjit5block13end_with_jumpEN6gccjit5blockEN6gccjit8locationE}@anchor{35b}@anchor{cp/topics/functions _CPPv2N6gccjit5block13end_with_jumpEN6gccjit5blockEN6gccjit8locationE}@anchor{35c}@anchor{cp/topics/functions gccjit block end_with_jump__gccjit block gccjit location}@anchor{35d} +@deffn {C++ Function} void gccjit::@ref{17b,,block}::end_with_jump (gccjit::block target, gccjit::location loc) Terminate a block by adding a jump to the given target block. @@ -13873,8 +14491,8 @@ goto target; @end deffn @geindex gccjit;;block;;end_with_return (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit5block15end_with_returnEN6gccjit6rvalueEN6gccjit8locationE}@anchor{336}@anchor{cp/topics/functions _CPPv3N6gccjit5block15end_with_returnEN6gccjit6rvalueEN6gccjit8locationE}@anchor{337}@anchor{cp/topics/functions _CPPv2N6gccjit5block15end_with_returnEN6gccjit6rvalueEN6gccjit8locationE}@anchor{338}@anchor{cp/topics/functions gccjit block end_with_return__gccjit rvalue gccjit location}@anchor{339} -@deffn {C++ Function} void gccjit::@ref{153,,block}::end_with_return (gccjit::rvalue rvalue, gccjit::location loc) +@anchor{cp/topics/functions _CPPv4N6gccjit5block15end_with_returnEN6gccjit6rvalueEN6gccjit8locationE}@anchor{35e}@anchor{cp/topics/functions _CPPv3N6gccjit5block15end_with_returnEN6gccjit6rvalueEN6gccjit8locationE}@anchor{35f}@anchor{cp/topics/functions _CPPv2N6gccjit5block15end_with_returnEN6gccjit6rvalueEN6gccjit8locationE}@anchor{360}@anchor{cp/topics/functions gccjit block end_with_return__gccjit rvalue gccjit location}@anchor{361} +@deffn {C++ Function} void gccjit::@ref{17b,,block}::end_with_return (gccjit::rvalue rvalue, gccjit::location loc) Terminate a block. @@ -13903,8 +14521,8 @@ return; @end deffn @geindex gccjit;;block;;end_with_switch (C++ function) -@anchor{cp/topics/functions _CPPv4N6gccjit5block15end_with_switchEN6gccjit6rvalueEN6gccjit5blockENSt6vectorIN6gccjit5case_EEEN6gccjit8locationE}@anchor{33a}@anchor{cp/topics/functions _CPPv3N6gccjit5block15end_with_switchEN6gccjit6rvalueEN6gccjit5blockENSt6vectorIN6gccjit5case_EEEN6gccjit8locationE}@anchor{33b}@anchor{cp/topics/functions _CPPv2N6gccjit5block15end_with_switchEN6gccjit6rvalueEN6gccjit5blockENSt6vectorIN6gccjit5case_EEEN6gccjit8locationE}@anchor{33c}@anchor{cp/topics/functions gccjit block end_with_switch__gccjit rvalue gccjit block std vector gccjit case_ gccjit location}@anchor{33d} -@deffn {C++ Function} void gccjit::@ref{153,,block}::end_with_switch (gccjit::rvalue expr, gccjit::block default_block, std::vector cases, gccjit::location loc) +@anchor{cp/topics/functions _CPPv4N6gccjit5block15end_with_switchEN6gccjit6rvalueEN6gccjit5blockENSt6vectorIN6gccjit5case_EEEN6gccjit8locationE}@anchor{362}@anchor{cp/topics/functions _CPPv3N6gccjit5block15end_with_switchEN6gccjit6rvalueEN6gccjit5blockENSt6vectorIN6gccjit5case_EEEN6gccjit8locationE}@anchor{363}@anchor{cp/topics/functions _CPPv2N6gccjit5block15end_with_switchEN6gccjit6rvalueEN6gccjit5blockENSt6vectorIN6gccjit5case_EEEN6gccjit8locationE}@anchor{364}@anchor{cp/topics/functions gccjit block end_with_switch__gccjit rvalue gccjit block std vector gccjit case_ gccjit location}@anchor{365} +@deffn {C++ Function} void gccjit::@ref{17b,,block}::end_with_switch (gccjit::rvalue expr, gccjit::block default_block, std::vector cases, gccjit::location loc) Terminate a block by adding evalation of an rvalue, then performing a multiway branch. @@ -13944,14 +14562,14 @@ The API entrypoints relating to switch statements and cases: @itemize * @item -@ref{33a,,gccjit;;block;;end_with_switch()} +@ref{362,,gccjit;;block;;end_with_switch()} @item @code{gccjit::context::new_case()} @end itemize @end quotation -were added in @ref{ef,,LIBGCCJIT_ABI_3}; you can test for their presence +were added in @ref{114,,LIBGCCJIT_ABI_3}; you can test for their presence using @example @@ -13959,9 +14577,9 @@ using @end example A @cite{gccjit::case_} represents a case within a switch statement, and -is created within a particular @ref{13d,,gccjit;;context} using +is created within a particular @ref{165,,gccjit;;context} using @code{gccjit::context::new_case()}. It is a subclass of -@ref{142,,gccjit;;object}. +@ref{16a,,gccjit;;object}. Each case expresses a multivalued range of integer values. You can express single-valued cases by passing in the same value for @@ -14064,12 +14682,12 @@ create_code (gcc_jit_context *c_ctxt, void *user_data) @c . @node Source Locations<2>,Compiling a context<2>,Creating and using functions<2>,Topic Reference<2> -@anchor{cp/topics/locations doc}@anchor{33e}@anchor{cp/topics/locations source-locations}@anchor{33f} +@anchor{cp/topics/locations doc}@anchor{366}@anchor{cp/topics/locations source-locations}@anchor{367} @subsection Source Locations @geindex gccjit;;location (C++ class) -@anchor{cp/topics/locations _CPPv4N6gccjit8locationE}@anchor{163}@anchor{cp/topics/locations _CPPv3N6gccjit8locationE}@anchor{340}@anchor{cp/topics/locations _CPPv2N6gccjit8locationE}@anchor{341}@anchor{cp/topics/locations gccjit location}@anchor{342} +@anchor{cp/topics/locations _CPPv4N6gccjit8locationE}@anchor{18b}@anchor{cp/topics/locations _CPPv3N6gccjit8locationE}@anchor{368}@anchor{cp/topics/locations _CPPv2N6gccjit8locationE}@anchor{369}@anchor{cp/topics/locations gccjit location}@anchor{36a} @deffn {C++ Class} gccjit::location A @cite{gccjit::location} encapsulates a source code location, so that @@ -14080,10 +14698,10 @@ single-step through your language. @cite{gccjit::location} instances are optional: you can always omit them from any C++ API entrypoint accepting one. -You can construct them using @ref{169,,gccjit;;context;;new_location()}. +You can construct them using @ref{191,,gccjit;;context;;new_location()}. You need to enable @ref{42,,GCC_JIT_BOOL_OPTION_DEBUGINFO} on the -@ref{13d,,gccjit;;context} for these locations to actually be usable by +@ref{165,,gccjit;;context} for these locations to actually be usable by the debugger: @example @@ -14092,8 +14710,8 @@ ctxt.set_bool_option (GCC_JIT_BOOL_OPTION_DEBUGINFO, 1); @end deffn @geindex gccjit;;context;;new_location (C++ function) -@anchor{cp/topics/locations _CPPv4N6gccjit7context12new_locationEPKcii}@anchor{169}@anchor{cp/topics/locations _CPPv3N6gccjit7context12new_locationEPKcii}@anchor{343}@anchor{cp/topics/locations _CPPv2N6gccjit7context12new_locationEPKcii}@anchor{344}@anchor{cp/topics/locations gccjit context new_location__cCP i i}@anchor{345} -@deffn {C++ Function} gccjit::@ref{163,,location} gccjit::@ref{13d,,context}::new_location (const char *filename, int line, int column) +@anchor{cp/topics/locations _CPPv4N6gccjit7context12new_locationEPKcii}@anchor{191}@anchor{cp/topics/locations _CPPv3N6gccjit7context12new_locationEPKcii}@anchor{36b}@anchor{cp/topics/locations _CPPv2N6gccjit7context12new_locationEPKcii}@anchor{36c}@anchor{cp/topics/locations gccjit context new_location__cCP i i}@anchor{36d} +@deffn {C++ Function} gccjit::@ref{18b,,location} gccjit::@ref{165,,context}::new_location (const char *filename, int line, int column) Create a @cite{gccjit::location} instance representing the given source location. @@ -14105,13 +14723,13 @@ location. @end menu @node Faking it<2>,,,Source Locations<2> -@anchor{cp/topics/locations faking-it}@anchor{346} +@anchor{cp/topics/locations faking-it}@anchor{36e} @subsubsection Faking it If you don’t have source code for your internal representation, but need to debug, you can generate a C-like representation of the functions in -your context using @ref{188,,gccjit;;context;;dump_to_file()}: +your context using @ref{1b0,,gccjit;;context;;dump_to_file()}: @example ctxt.dump_to_file ("/tmp/something.c", @@ -14141,13 +14759,13 @@ file, giving you @emph{something} you can step through in the debugger. @c . @node Compiling a context<2>,Using Assembly Language with libgccjit++,Source Locations<2>,Topic Reference<2> -@anchor{cp/topics/compilation doc}@anchor{347}@anchor{cp/topics/compilation compiling-a-context}@anchor{348} +@anchor{cp/topics/compilation doc}@anchor{36f}@anchor{cp/topics/compilation compiling-a-context}@anchor{370} @subsection Compiling a context -Once populated, a @ref{13d,,gccjit;;context} can be compiled to -machine code, either in-memory via @ref{147,,gccjit;;context;;compile()} or -to disk via @ref{349,,gccjit;;context;;compile_to_file()}. +Once populated, a @ref{165,,gccjit;;context} can be compiled to +machine code, either in-memory via @ref{16f,,gccjit;;context;;compile()} or +to disk via @ref{371,,gccjit;;context;;compile_to_file()}. You can compile a context multiple times (using either form of compilation), although any errors that occur on the context will @@ -14160,13 +14778,13 @@ prevent any future compilation of that context. @end menu @node In-memory compilation<2>,Ahead-of-time compilation<2>,,Compiling a context<2> -@anchor{cp/topics/compilation in-memory-compilation}@anchor{34a} +@anchor{cp/topics/compilation in-memory-compilation}@anchor{372} @subsubsection In-memory compilation @geindex gccjit;;context;;compile (C++ function) -@anchor{cp/topics/compilation _CPPv4N6gccjit7context7compileEv}@anchor{147}@anchor{cp/topics/compilation _CPPv3N6gccjit7context7compileEv}@anchor{34b}@anchor{cp/topics/compilation _CPPv2N6gccjit7context7compileEv}@anchor{34c}@anchor{cp/topics/compilation gccjit context compile}@anchor{34d} -@deffn {C++ Function} gcc_jit_result *gccjit::@ref{13d,,context}::compile () +@anchor{cp/topics/compilation _CPPv4N6gccjit7context7compileEv}@anchor{16f}@anchor{cp/topics/compilation _CPPv3N6gccjit7context7compileEv}@anchor{373}@anchor{cp/topics/compilation _CPPv2N6gccjit7context7compileEv}@anchor{374}@anchor{cp/topics/compilation gccjit context compile}@anchor{375} +@deffn {C++ Function} gcc_jit_result *gccjit::@ref{165,,context}::compile () This calls into GCC and builds the code, returning a @cite{gcc_jit_result *}. @@ -14176,19 +14794,19 @@ This is a thin wrapper around the @end deffn @node Ahead-of-time compilation<2>,,In-memory compilation<2>,Compiling a context<2> -@anchor{cp/topics/compilation ahead-of-time-compilation}@anchor{34e} +@anchor{cp/topics/compilation ahead-of-time-compilation}@anchor{376} @subsubsection Ahead-of-time compilation Although libgccjit is primarily aimed at just-in-time compilation, it can also be used for implementing more traditional ahead-of-time -compilers, via the @ref{349,,gccjit;;context;;compile_to_file()} method. +compilers, via the @ref{371,,gccjit;;context;;compile_to_file()} method. @geindex gccjit;;context;;compile_to_file (C++ function) -@anchor{cp/topics/compilation _CPPv4N6gccjit7context15compile_to_fileE19gcc_jit_output_kindPKc}@anchor{349}@anchor{cp/topics/compilation _CPPv3N6gccjit7context15compile_to_fileE19gcc_jit_output_kindPKc}@anchor{34f}@anchor{cp/topics/compilation _CPPv2N6gccjit7context15compile_to_fileE19gcc_jit_output_kindPKc}@anchor{350}@anchor{cp/topics/compilation gccjit context compile_to_file__gcc_jit_output_kind cCP}@anchor{351} -@deffn {C++ Function} void gccjit::@ref{13d,,context}::compile_to_file (enum gcc_jit_output_kind, const char *output_path) +@anchor{cp/topics/compilation _CPPv4N6gccjit7context15compile_to_fileE19gcc_jit_output_kindPKc}@anchor{371}@anchor{cp/topics/compilation _CPPv3N6gccjit7context15compile_to_fileE19gcc_jit_output_kindPKc}@anchor{377}@anchor{cp/topics/compilation _CPPv2N6gccjit7context15compile_to_fileE19gcc_jit_output_kindPKc}@anchor{378}@anchor{cp/topics/compilation gccjit context compile_to_file__gcc_jit_output_kind cCP}@anchor{379} +@deffn {C++ Function} void gccjit::@ref{165,,context}::compile_to_file (enum gcc_jit_output_kind, const char *output_path) -Compile the @ref{13d,,gccjit;;context} to a file of the given +Compile the @ref{165,,gccjit;;context} to a file of the given kind. This is a thin wrapper around the @@ -14213,7 +14831,7 @@ This is a thin wrapper around the @c . @node Using Assembly Language with libgccjit++,,Compiling a context<2>,Topic Reference<2> -@anchor{cp/topics/asm doc}@anchor{352}@anchor{cp/topics/asm using-assembly-language-with-libgccjit}@anchor{353} +@anchor{cp/topics/asm doc}@anchor{37a}@anchor{cp/topics/asm using-assembly-language-with-libgccjit}@anchor{37b} @subsection Using Assembly Language with libgccjit++ @@ -14223,7 +14841,7 @@ following assumes a familiarity with that functionality. See How to Use Inline Assembly Language in C Code@footnote{https://gcc.gnu.org/onlinedocs/gcc/Using-Assembly-Language-with-C.html} in GCC’s documentation, the “Extended Asm” section in particular. -These entrypoints were added in @ref{122,,LIBGCCJIT_ABI_15}; you can test +These entrypoints were added in @ref{146,,LIBGCCJIT_ABI_15}; you can test for their presence using @quotation @@ -14240,38 +14858,38 @@ for their presence using @end menu @node Adding assembler instructions within a function<2>,Adding top-level assembler statements<2>,,Using Assembly Language with libgccjit++ -@anchor{cp/topics/asm adding-assembler-instructions-within-a-function}@anchor{354} +@anchor{cp/topics/asm adding-assembler-instructions-within-a-function}@anchor{37c} @subsubsection Adding assembler instructions within a function @geindex gccjit;;extended_asm (C++ class) -@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asmE}@anchor{355}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asmE}@anchor{356}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asmE}@anchor{357}@anchor{cp/topics/asm gccjit extended_asm}@anchor{358} +@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asmE}@anchor{37d}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asmE}@anchor{37e}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asmE}@anchor{37f}@anchor{cp/topics/asm gccjit extended_asm}@anchor{380} @deffn {C++ Class} gccjit::extended_asm A @cite{gccjit::extended_asm} represents an extended @code{asm} statement: a series of low-level instructions inside a function that convert inputs to outputs. -@ref{355,,gccjit;;extended_asm} is a subclass of @ref{142,,gccjit;;object}. -It is a thin wrapper around the C API’s @ref{f1,,gcc_jit_extended_asm *}. +@ref{37d,,gccjit;;extended_asm} is a subclass of @ref{16a,,gccjit;;object}. +It is a thin wrapper around the C API’s @ref{115,,gcc_jit_extended_asm *}. To avoid having an API entrypoint with a very large number of parameters, an extended @code{asm} statement is made in stages: -an initial call to create the @ref{355,,gccjit;;extended_asm}, +an initial call to create the @ref{37d,,gccjit;;extended_asm}, followed by calls to add operands and set other properties of the statement. -There are two API entrypoints for creating a @ref{355,,gccjit;;extended_asm}: +There are two API entrypoints for creating a @ref{37d,,gccjit;;extended_asm}: @itemize * @item -@ref{359,,gccjit;;block;;add_extended_asm()} for an @code{asm} statement with +@ref{381,,gccjit;;block;;add_extended_asm()} for an @code{asm} statement with no control flow, and @item -@ref{35a,,gccjit;;block;;end_with_extended_asm_goto()} for an @code{asm goto}. +@ref{382,,gccjit;;block;;end_with_extended_asm_goto()} for an @code{asm goto}. @end itemize For example, to create the equivalent of: @@ -14299,8 +14917,8 @@ extended @code{asm} statement (e.g. the @code{%0} and @code{%1} above), the equivalent to the C syntax is followed i.e. all output operands, then all input operands, regardless of what order the calls to -@ref{35b,,gccjit;;extended_asm;;add_output_operand()} and -@ref{35c,,gccjit;;extended_asm;;add_input_operand()} were made in. +@ref{383,,gccjit;;extended_asm;;add_output_operand()} and +@ref{384,,gccjit;;extended_asm;;add_input_operand()} were made in. @end quotation @end cartouche @@ -14325,10 +14943,10 @@ the following API calls could be used: @end deffn @geindex gccjit;;block;;add_extended_asm (C++ function) -@anchor{cp/topics/asm _CPPv4N6gccjit5block16add_extended_asmERKNSt6stringEN6gccjit8locationE}@anchor{359}@anchor{cp/topics/asm _CPPv3N6gccjit5block16add_extended_asmERKNSt6stringEN6gccjit8locationE}@anchor{35d}@anchor{cp/topics/asm _CPPv2N6gccjit5block16add_extended_asmERKNSt6stringEN6gccjit8locationE}@anchor{35e}@anchor{cp/topics/asm gccjit block add_extended_asm__ssCR gccjit location}@anchor{35f} -@deffn {C++ Function} @ref{355,,extended_asm} gccjit::@ref{153,,block}::add_extended_asm (const std::string &asm_template, gccjit::location loc = location()) +@anchor{cp/topics/asm _CPPv4N6gccjit5block16add_extended_asmERKNSt6stringEN6gccjit8locationE}@anchor{381}@anchor{cp/topics/asm _CPPv3N6gccjit5block16add_extended_asmERKNSt6stringEN6gccjit8locationE}@anchor{385}@anchor{cp/topics/asm _CPPv2N6gccjit5block16add_extended_asmERKNSt6stringEN6gccjit8locationE}@anchor{386}@anchor{cp/topics/asm gccjit block add_extended_asm__ssCR gccjit location}@anchor{387} +@deffn {C++ Function} @ref{37d,,extended_asm} gccjit::@ref{17b,,block}::add_extended_asm (const std::string &asm_template, gccjit::location loc = location()) -Create a @ref{355,,gccjit;;extended_asm} for an extended @code{asm} statement +Create a @ref{37d,,gccjit;;extended_asm} for an extended @code{asm} statement with no control flow (i.e. without the @code{goto} qualifier). The parameter @code{asm_template} corresponds to the @cite{AssemblerTemplate} @@ -14338,10 +14956,10 @@ an on-stack buffer. @end deffn @geindex gccjit;;block;;end_with_extended_asm_goto (C++ function) -@anchor{cp/topics/asm _CPPv4N6gccjit5block26end_with_extended_asm_gotoERKNSt6stringENSt6vectorI5blockEEP5block8location}@anchor{35a}@anchor{cp/topics/asm _CPPv3N6gccjit5block26end_with_extended_asm_gotoERKNSt6stringENSt6vectorI5blockEEP5block8location}@anchor{360}@anchor{cp/topics/asm _CPPv2N6gccjit5block26end_with_extended_asm_gotoERKNSt6stringENSt6vectorI5blockEEP5block8location}@anchor{361}@anchor{cp/topics/asm gccjit block end_with_extended_asm_goto__ssCR std vector block blockP location}@anchor{362} -@deffn {C++ Function} @ref{355,,extended_asm} gccjit::@ref{153,,block}::end_with_extended_asm_goto (const std::string &asm_template, std::vector goto_blocks, block *fallthrough_block, location loc = location()) +@anchor{cp/topics/asm _CPPv4N6gccjit5block26end_with_extended_asm_gotoERKNSt6stringENSt6vectorI5blockEEP5block8location}@anchor{382}@anchor{cp/topics/asm _CPPv3N6gccjit5block26end_with_extended_asm_gotoERKNSt6stringENSt6vectorI5blockEEP5block8location}@anchor{388}@anchor{cp/topics/asm _CPPv2N6gccjit5block26end_with_extended_asm_gotoERKNSt6stringENSt6vectorI5blockEEP5block8location}@anchor{389}@anchor{cp/topics/asm gccjit block end_with_extended_asm_goto__ssCR std vector block blockP location}@anchor{38a} +@deffn {C++ Function} @ref{37d,,extended_asm} gccjit::@ref{17b,,block}::end_with_extended_asm_goto (const std::string &asm_template, std::vector goto_blocks, block *fallthrough_block, location loc = location()) -Create a @ref{355,,gccjit;;extended_asm} for an extended @code{asm} statement +Create a @ref{37d,,gccjit;;extended_asm} for an extended @code{asm} statement that may perform jumps, and use it to terminate the given block. This is equivalent to the @code{goto} qualifier in C’s extended @code{asm} syntax. @@ -14390,7 +15008,7 @@ to fall through to after the statement. @cartouche @quotation Note -This is needed since each @ref{153,,gccjit;;block} must have a +This is needed since each @ref{17b,,gccjit;;block} must have a single exit point, as a basic block: you can’t jump from the middle of a block. A “goto” is implicitly added after the asm to handle the fallthrough case, which is equivalent to what @@ -14400,10 +15018,10 @@ would have happened in the C case. @end deffn @geindex gccjit;;extended_asm;;set_volatile_flag (C++ function) -@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm17set_volatile_flagEb}@anchor{363}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm17set_volatile_flagEb}@anchor{364}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm17set_volatile_flagEb}@anchor{365}@anchor{cp/topics/asm gccjit extended_asm set_volatile_flag__b}@anchor{366} -@deffn {C++ Function} gccjit::@ref{355,,extended_asm} &gccjit::@ref{355,,extended_asm}::set_volatile_flag (bool flag) +@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm17set_volatile_flagEb}@anchor{38b}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm17set_volatile_flagEb}@anchor{38c}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm17set_volatile_flagEb}@anchor{38d}@anchor{cp/topics/asm gccjit extended_asm set_volatile_flag__b}@anchor{38e} +@deffn {C++ Function} gccjit::@ref{37d,,extended_asm} &gccjit::@ref{37d,,extended_asm}::set_volatile_flag (bool flag) -Set whether the @ref{355,,gccjit;;extended_asm} has side-effects, equivalent to the +Set whether the @ref{37d,,gccjit;;extended_asm} has side-effects, equivalent to the volatile@footnote{https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Volatile} qualifier in C’s extended asm syntax. @@ -14431,12 +15049,12 @@ the following API calls could be used: .add_clobber ("rdx"); @end example -where the @ref{355,,gccjit;;extended_asm} is flagged as volatile. +where the @ref{37d,,gccjit;;extended_asm} is flagged as volatile. @end deffn @geindex gccjit;;extended_asm;;set_inline_flag (C++ function) -@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm15set_inline_flagEb}@anchor{367}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm15set_inline_flagEb}@anchor{368}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm15set_inline_flagEb}@anchor{369}@anchor{cp/topics/asm gccjit extended_asm set_inline_flag__b}@anchor{36a} -@deffn {C++ Function} gccjit::@ref{355,,extended_asm} &gccjit::@ref{355,,extended_asm}::set_inline_flag (bool flag) +@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm15set_inline_flagEb}@anchor{38f}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm15set_inline_flagEb}@anchor{390}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm15set_inline_flagEb}@anchor{391}@anchor{cp/topics/asm gccjit extended_asm set_inline_flag__b}@anchor{392} +@deffn {C++ Function} gccjit::@ref{37d,,extended_asm} &gccjit::@ref{37d,,extended_asm}::set_inline_flag (bool flag) Set the equivalent of the inline@footnote{https://gcc.gnu.org/onlinedocs/gcc/Size-of-an-asm.html#Size-of-an-asm} @@ -14444,8 +15062,8 @@ qualifier in C’s extended @code{asm} syntax. @end deffn @geindex gccjit;;extended_asm;;add_output_operand (C++ function) -@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm18add_output_operandERKNSt6stringERKNSt6stringEN6gccjit6lvalueE}@anchor{35b}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm18add_output_operandERKNSt6stringERKNSt6stringEN6gccjit6lvalueE}@anchor{36b}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm18add_output_operandERKNSt6stringERKNSt6stringEN6gccjit6lvalueE}@anchor{36c}@anchor{cp/topics/asm gccjit extended_asm add_output_operand__ssCR ssCR gccjit lvalue}@anchor{36d} -@deffn {C++ Function} gccjit::@ref{355,,extended_asm} &gccjit::@ref{355,,extended_asm}::add_output_operand (const std::string &asm_symbolic_name, const std::string &constraint, gccjit::lvalue dest) +@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm18add_output_operandERKNSt6stringERKNSt6stringEN6gccjit6lvalueE}@anchor{383}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm18add_output_operandERKNSt6stringERKNSt6stringEN6gccjit6lvalueE}@anchor{393}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm18add_output_operandERKNSt6stringERKNSt6stringEN6gccjit6lvalueE}@anchor{394}@anchor{cp/topics/asm gccjit extended_asm add_output_operand__ssCR ssCR gccjit lvalue}@anchor{395} +@deffn {C++ Function} gccjit::@ref{37d,,extended_asm} &gccjit::@ref{37d,,extended_asm}::add_output_operand (const std::string &asm_symbolic_name, const std::string &constraint, gccjit::lvalue dest) Add an output operand to the extended @code{asm} statement. See the Output Operands@footnote{https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#OutputOperands} @@ -14475,8 +15093,8 @@ section of GCC’s “Extended Asm” documentation. @end deffn @geindex gccjit;;extended_asm;;add_output_operand (C++ function) -@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm18add_output_operandERKNSt6stringEN6gccjit6lvalueE}@anchor{36e}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm18add_output_operandERKNSt6stringEN6gccjit6lvalueE}@anchor{36f}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm18add_output_operandERKNSt6stringEN6gccjit6lvalueE}@anchor{370}@anchor{cp/topics/asm gccjit extended_asm add_output_operand__ssCR gccjit lvalue}@anchor{371} -@deffn {C++ Function} gccjit::@ref{355,,extended_asm} &gccjit::@ref{355,,extended_asm}::add_output_operand (const std::string &constraint, gccjit::lvalue dest) +@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm18add_output_operandERKNSt6stringEN6gccjit6lvalueE}@anchor{396}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm18add_output_operandERKNSt6stringEN6gccjit6lvalueE}@anchor{397}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm18add_output_operandERKNSt6stringEN6gccjit6lvalueE}@anchor{398}@anchor{cp/topics/asm gccjit extended_asm add_output_operand__ssCR gccjit lvalue}@anchor{399} +@deffn {C++ Function} gccjit::@ref{37d,,extended_asm} &gccjit::@ref{37d,,extended_asm}::add_output_operand (const std::string &constraint, gccjit::lvalue dest) As above, but don’t supply a symbolic name for the operand. @@ -14488,8 +15106,8 @@ ext_asm.add_output_operand ("=r", dst); @end deffn @geindex gccjit;;extended_asm;;add_input_operand (C++ function) -@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm17add_input_operandERKNSt6stringERKNSt6stringEN6gccjit6rvalueE}@anchor{35c}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm17add_input_operandERKNSt6stringERKNSt6stringEN6gccjit6rvalueE}@anchor{372}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm17add_input_operandERKNSt6stringERKNSt6stringEN6gccjit6rvalueE}@anchor{373}@anchor{cp/topics/asm gccjit extended_asm add_input_operand__ssCR ssCR gccjit rvalue}@anchor{374} -@deffn {C++ Function} gccjit::@ref{355,,extended_asm} &gccjit::@ref{355,,extended_asm}::add_input_operand (const std::string &asm_symbolic_name, const std::string &constraint, gccjit::rvalue src) +@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm17add_input_operandERKNSt6stringERKNSt6stringEN6gccjit6rvalueE}@anchor{384}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm17add_input_operandERKNSt6stringERKNSt6stringEN6gccjit6rvalueE}@anchor{39a}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm17add_input_operandERKNSt6stringERKNSt6stringEN6gccjit6rvalueE}@anchor{39b}@anchor{cp/topics/asm gccjit extended_asm add_input_operand__ssCR ssCR gccjit rvalue}@anchor{39c} +@deffn {C++ Function} gccjit::@ref{37d,,extended_asm} &gccjit::@ref{37d,,extended_asm}::add_input_operand (const std::string &asm_symbolic_name, const std::string &constraint, gccjit::rvalue src) Add an input operand to the extended @code{asm} statement. See the Input Operands@footnote{https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#InputOperands} @@ -14513,8 +15131,8 @@ ext_asm.add_input_operand ("aMask", "r", mask); @end deffn @geindex gccjit;;extended_asm;;add_input_operand (C++ function) -@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm17add_input_operandERKNSt6stringEN6gccjit6rvalueE}@anchor{375}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm17add_input_operandERKNSt6stringEN6gccjit6rvalueE}@anchor{376}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm17add_input_operandERKNSt6stringEN6gccjit6rvalueE}@anchor{377}@anchor{cp/topics/asm gccjit extended_asm add_input_operand__ssCR gccjit rvalue}@anchor{378} -@deffn {C++ Function} gccjit::@ref{355,,extended_asm} &gccjit::@ref{355,,extended_asm}::add_input_operand (const std::string &constraint, gccjit::rvalue src) +@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm17add_input_operandERKNSt6stringEN6gccjit6rvalueE}@anchor{39d}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm17add_input_operandERKNSt6stringEN6gccjit6rvalueE}@anchor{39e}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm17add_input_operandERKNSt6stringEN6gccjit6rvalueE}@anchor{39f}@anchor{cp/topics/asm gccjit extended_asm add_input_operand__ssCR gccjit rvalue}@anchor{3a0} +@deffn {C++ Function} gccjit::@ref{37d,,extended_asm} &gccjit::@ref{37d,,extended_asm}::add_input_operand (const std::string &constraint, gccjit::rvalue src) As above, but don’t supply a symbolic name for the operand. @@ -14526,8 +15144,8 @@ ext_asm.add_input_operand ("r", src); @end deffn @geindex gccjit;;extended_asm;;add_clobber (C++ function) -@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm11add_clobberERKNSt6stringE}@anchor{379}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm11add_clobberERKNSt6stringE}@anchor{37a}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm11add_clobberERKNSt6stringE}@anchor{37b}@anchor{cp/topics/asm gccjit extended_asm add_clobber__ssCR}@anchor{37c} -@deffn {C++ Function} gccjit::@ref{355,,extended_asm} &gccjit::@ref{355,,extended_asm}::add_clobber (const std::string &victim) +@anchor{cp/topics/asm _CPPv4N6gccjit12extended_asm11add_clobberERKNSt6stringE}@anchor{3a1}@anchor{cp/topics/asm _CPPv3N6gccjit12extended_asm11add_clobberERKNSt6stringE}@anchor{3a2}@anchor{cp/topics/asm _CPPv2N6gccjit12extended_asm11add_clobberERKNSt6stringE}@anchor{3a3}@anchor{cp/topics/asm gccjit extended_asm add_clobber__ssCR}@anchor{3a4} +@deffn {C++ Function} gccjit::@ref{37d,,extended_asm} &gccjit::@ref{37d,,extended_asm}::add_clobber (const std::string &victim) Add @cite{victim} to the list of registers clobbered by the extended @code{asm} statement. See the @@ -14545,7 +15163,7 @@ ext_asm.add_clobber ("r0").add_clobber ("cc").add_clobber ("memory"); @end deffn @node Adding top-level assembler statements<2>,,Adding assembler instructions within a function<2>,Using Assembly Language with libgccjit++ -@anchor{cp/topics/asm adding-top-level-assembler-statements}@anchor{37d} +@anchor{cp/topics/asm adding-top-level-assembler-statements}@anchor{3a5} @subsubsection Adding top-level assembler statements @@ -14554,8 +15172,8 @@ there is support for creating “top-level” assembler statements, outside of any function. @geindex gccjit;;context;;add_top_level_asm (C++ function) -@anchor{cp/topics/asm _CPPv4N6gccjit7context17add_top_level_asmEPKcN6gccjit8locationE}@anchor{37e}@anchor{cp/topics/asm _CPPv3N6gccjit7context17add_top_level_asmEPKcN6gccjit8locationE}@anchor{37f}@anchor{cp/topics/asm _CPPv2N6gccjit7context17add_top_level_asmEPKcN6gccjit8locationE}@anchor{380}@anchor{cp/topics/asm gccjit context add_top_level_asm__cCP gccjit location}@anchor{381} -@deffn {C++ Function} void gccjit::@ref{13d,,context}::add_top_level_asm (const char *asm_stmts, gccjit::location loc = location()) +@anchor{cp/topics/asm _CPPv4N6gccjit7context17add_top_level_asmEPKcN6gccjit8locationE}@anchor{3a6}@anchor{cp/topics/asm _CPPv3N6gccjit7context17add_top_level_asmEPKcN6gccjit8locationE}@anchor{3a7}@anchor{cp/topics/asm _CPPv2N6gccjit7context17add_top_level_asmEPKcN6gccjit8locationE}@anchor{3a8}@anchor{cp/topics/asm gccjit context add_top_level_asm__cCP gccjit location}@anchor{3a9} +@deffn {C++ Function} void gccjit::@ref{165,,context}::add_top_level_asm (const char *asm_stmts, gccjit::location loc = location()) Create a set of top-level asm statements, analogous to those created by GCC’s “basic” @code{asm} syntax in C at file scope. @@ -14606,7 +15224,7 @@ the following API calls could be used: @c . @node Internals,Indices and tables,C++ bindings for libgccjit,Top -@anchor{internals/index doc}@anchor{382}@anchor{internals/index internals}@anchor{383} +@anchor{internals/index doc}@anchor{3aa}@anchor{internals/index internals}@anchor{3ab} @chapter Internals @@ -14622,7 +15240,7 @@ the following API calls could be used: @end menu @node Working on the JIT library,Running the test suite,,Internals -@anchor{internals/index working-on-the-jit-library}@anchor{384} +@anchor{internals/index working-on-the-jit-library}@anchor{3ac} @section Working on the JIT library @@ -14655,7 +15273,7 @@ gcc/libgccjit.so.0.0.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), Here’s what those configuration options mean: @geindex command line option; --enable-host-shared -@anchor{internals/index cmdoption-enable-host-shared}@anchor{385} +@anchor{internals/index cmdoption-enable-host-shared}@anchor{3ad} @deffn {Option} @w{-}@w{-}enable@w{-}host@w{-}shared Configuring with this option means that the compiler is built as @@ -14664,7 +15282,7 @@ but it necessary for a shared library. @end deffn @geindex command line option; --enable-languages=jit@comma{}c++ -@anchor{internals/index cmdoption-enable-languages}@anchor{386} +@anchor{internals/index cmdoption-enable-languages}@anchor{3ae} @deffn {Option} @w{-}@w{-}enable@w{-}languages=jit,c++ This specifies which frontends to build. The JIT library looks like @@ -14681,7 +15299,7 @@ c++: error trying to exec 'cc1plus': execvp: No such file or directory @end deffn @geindex command line option; --disable-bootstrap -@anchor{internals/index cmdoption-disable-bootstrap}@anchor{387} +@anchor{internals/index cmdoption-disable-bootstrap}@anchor{3af} @deffn {Option} @w{-}@w{-}disable@w{-}bootstrap For hacking on the “jit” subdirectory, performing a full @@ -14691,7 +15309,7 @@ the compiler can still bootstrap itself. @end deffn @geindex command line option; --enable-checking=release -@anchor{internals/index cmdoption-enable-checking}@anchor{388} +@anchor{internals/index cmdoption-enable-checking}@anchor{3b0} @deffn {Option} @w{-}@w{-}enable@w{-}checking=release The compile can perform extensive self-checking as it runs, useful when @@ -14702,7 +15320,7 @@ disable this self-checking. @end deffn @node Running the test suite,Environment variables,Working on the JIT library,Internals -@anchor{internals/index running-the-test-suite}@anchor{389} +@anchor{internals/index running-the-test-suite}@anchor{3b1} @section Running the test suite @@ -14760,7 +15378,7 @@ and once a test has been compiled, you can debug it directly: @end menu @node Running under valgrind,,,Running the test suite -@anchor{internals/index running-under-valgrind}@anchor{38a} +@anchor{internals/index running-under-valgrind}@anchor{3b2} @subsection Running under valgrind @@ -14809,7 +15427,7 @@ When running under valgrind, it’s best to have configured gcc with various known false positives. @node Environment variables,Packaging notes,Running the test suite,Internals -@anchor{internals/index environment-variables}@anchor{38b} +@anchor{internals/index environment-variables}@anchor{3b3} @section Environment variables @@ -14817,7 +15435,7 @@ When running client code against a locally-built libgccjit, three environment variables need to be set up: @geindex environment variable; LD_LIBRARY_PATH -@anchor{internals/index envvar-LD_LIBRARY_PATH}@anchor{38c} +@anchor{internals/index envvar-LD_LIBRARY_PATH}@anchor{3b4} @deffn {Environment Variable} LD_LIBRARY_PATH @quotation @@ -14837,7 +15455,7 @@ libgccjit.so.0.0.1: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), @end deffn @geindex environment variable; PATH -@anchor{internals/index envvar-PATH}@anchor{38d} +@anchor{internals/index envvar-PATH}@anchor{3b5} @deffn {Environment Variable} PATH The library uses a driver executable for converting from .s assembler @@ -14856,7 +15474,7 @@ of development. @end deffn @geindex environment variable; LIBRARY_PATH -@anchor{internals/index envvar-LIBRARY_PATH}@anchor{38e} +@anchor{internals/index envvar-LIBRARY_PATH}@anchor{3b6} @deffn {Environment Variable} LIBRARY_PATH The driver executable invokes the linker, and the latter needs to locate @@ -14888,11 +15506,11 @@ hello world @end example @node Packaging notes,Overview of code structure,Environment variables,Internals -@anchor{internals/index packaging-notes}@anchor{38f} +@anchor{internals/index packaging-notes}@anchor{3b7} @section Packaging notes -The configure-time option @ref{385,,--enable-host-shared} is needed when +The configure-time option @ref{3ad,,--enable-host-shared} is needed when building the jit in order to get position-independent code. This will slow down the regular compiler by a few percent. Hence when packaging gcc with libgccjit, please configure and build twice: @@ -14903,10 +15521,10 @@ with libgccjit, please configure and build twice: @itemize * @item -once without @ref{385,,--enable-host-shared} for most languages, and +once without @ref{3ad,,--enable-host-shared} for most languages, and @item -once with @ref{385,,--enable-host-shared} for the jit +once with @ref{3ad,,--enable-host-shared} for the jit @end itemize @end quotation @@ -14948,7 +15566,7 @@ popd @end example @node Overview of code structure,Design notes,Packaging notes,Internals -@anchor{internals/index overview-of-code-structure}@anchor{390} +@anchor{internals/index overview-of-code-structure}@anchor{3b8} @section Overview of code structure @@ -15417,7 +16035,7 @@ JIT: gcc::jit::logger::~logger() @end example @node Design notes,Submitting patches,Overview of code structure,Internals -@anchor{internals/index design-notes}@anchor{391} +@anchor{internals/index design-notes}@anchor{3b9} @section Design notes @@ -15430,7 +16048,7 @@ close as possible to the error; failing that, a good place is within @code{recording::context::validate ()} in jit-recording.cc. @node Submitting patches,,Design notes,Internals -@anchor{internals/index submitting-patches}@anchor{392} +@anchor{internals/index submitting-patches}@anchor{3ba} @section Submitting patches @@ -15564,7 +16182,7 @@ large and inconsequential (e.g. anchor renumbering), rather like generated committing to svn. @node Indices and tables,Index,Internals,Top -@anchor{index indices-and-tables}@anchor{393} +@anchor{index indices-and-tables}@anchor{3bb} @unnumbered Indices and tables diff --git a/gcc/jit/docs/topics/expressions.rst b/gcc/jit/docs/topics/expressions.rst index 9267b6d2ad6..d51264af73f 100644 --- a/gcc/jit/docs/topics/expressions.rst +++ b/gcc/jit/docs/topics/expressions.rst @@ -24,7 +24,7 @@ Rvalues ------- .. type:: gcc_jit_rvalue -A :c:type:`gcc_jit_rvalue *` is an expression that can be computed. +A :c:type:`gcc_jit_rvalue` is an expression that can be computed. It can be simple, e.g.: @@ -602,7 +602,7 @@ Function calls gcc_jit_rvalue_set_bool_require_tail_call (gcc_jit_rvalue *call,\ int require_tail_call) - Given an :c:type:`gcc_jit_rvalue *` for a call created through + Given an :c:type:`gcc_jit_rvalue` for a call created through :c:func:`gcc_jit_context_new_call` or :c:func:`gcc_jit_context_new_call_through_ptr`, mark/clear the call as needing tail-call optimization. The optimizer will @@ -721,8 +721,8 @@ where the rvalue is computed by reading from the storage area. #ifdef LIBGCCJIT_HAVE_gcc_jit_lvalue_set_tls_model -.. function:: void - gcc_jit_lvalue_set_link_section (gcc_jit_lvalue *lvalue, +.. function:: void\ + gcc_jit_lvalue_set_link_section (gcc_jit_lvalue *lvalue,\ const char *section_name) Set the link section of a variable. diff --git a/gcc/jit/docs/topics/types.rst b/gcc/jit/docs/topics/types.rst index 9779ad26b6f..c2082c0ef3e 100644 --- a/gcc/jit/docs/topics/types.rst +++ b/gcc/jit/docs/topics/types.rst @@ -192,7 +192,7 @@ A compound type analagous to a C `struct`. A field within a :c:type:`gcc_jit_struct`. -You can model C `struct` types by creating :c:type:`gcc_jit_struct *` and +You can model C `struct` types by creating :c:type:`gcc_jit_struct` and :c:type:`gcc_jit_field` instances, in either order: * by creating the fields, then the structure. For example, to model: @@ -375,7 +375,7 @@ Reflection API Given a function type, return its number of parameters. .. function:: gcc_jit_type *\ - gcc_jit_function_type_get_param_type (gcc_jit_function_type *function_type, + gcc_jit_function_type_get_param_type (gcc_jit_function_type *function_type,\ size_t index) Given a function type, return the type of the specified parameter. @@ -417,7 +417,7 @@ Reflection API alignment qualifiers. .. function:: gcc_jit_field *\ - gcc_jit_struct_get_field (gcc_jit_struct *struct_type, + gcc_jit_struct_get_field (gcc_jit_struct *struct_type,\ size_t index) Get a struct field by index.