aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/attribs.cc22
-rw-r--r--gcc/attribs.h1
-rw-r--r--gcc/auto-profile.cc20
-rw-r--r--gcc/auto-profile.h2
-rw-r--r--gcc/c/c-typeck.cc3
-rw-r--r--gcc/cfgexpand.cc6
-rw-r--r--gcc/config/aarch64/aarch64.cc28
-rw-r--r--gcc/diagnostics/output-spec.cc654
-rw-r--r--gcc/diagnostics/output-spec.h24
-rw-r--r--gcc/doc/tm.texi19
-rw-r--r--gcc/doc/tm.texi.in2
-rw-r--r--gcc/fold-const.cc2
-rw-r--r--gcc/gimple.h2
-rw-r--r--gcc/gimplify.cc3
-rw-r--r--gcc/ipa-devirt.cc2
-rw-r--r--gcc/ipa-param-manipulation.cc2
-rw-r--r--gcc/ipa-profile.cc2
-rw-r--r--gcc/ipa-prop.cc2
-rw-r--r--gcc/libgdiagnostics.cc7
-rw-r--r--gcc/multiple_target.cc114
-rw-r--r--gcc/opts-diagnostic.cc26
-rw-r--r--gcc/target.def22
-rw-r--r--gcc/testsuite/g++.target/aarch64/fmv-selection1.C40
-rw-r--r--gcc/testsuite/g++.target/aarch64/fmv-selection2.C40
-rw-r--r--gcc/testsuite/g++.target/aarch64/fmv-selection3.C25
-rw-r--r--gcc/testsuite/g++.target/aarch64/fmv-selection4.C30
-rw-r--r--gcc/testsuite/g++.target/aarch64/fmv-selection5.C28
-rw-r--r--gcc/testsuite/g++.target/aarch64/fmv-selection6.C27
-rw-r--r--gcc/testsuite/g++.target/aarch64/fmv-selection7.C65
-rw-r--r--gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s1244.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s2244.c2
-rw-r--r--gcc/testsuite/lib/sarif.py1
-rw-r--r--gcc/tree-if-conv.cc2
-rw-r--r--gcc/tree-ssa-alias.cc4
-rw-r--r--gcc/tree.h2
-rw-r--r--libstdc++-v3/include/std/inplace_vector9
36 files changed, 829 insertions, 413 deletions
diff --git a/gcc/attribs.cc b/gcc/attribs.cc
index 29b88b8..7d7f8f3 100644
--- a/gcc/attribs.cc
+++ b/gcc/attribs.cc
@@ -1086,6 +1086,28 @@ make_attribute (string_slice name, string_slice arg_name, tree chain)
return attr;
}
+/* Default implementation of TARGET_OPTION_FUNCTIONS_B_RESOLVABLE_FROM_A.
+ Used to check very basically if DECL_B is callable from DECL_A.
+ For now this checks if the version strings are the same. */
+
+bool
+functions_b_resolvable_from_a (tree decl_a, tree decl_b,
+ tree base ATTRIBUTE_UNUSED)
+{
+ const char *attr_name = TARGET_HAS_FMV_TARGET_ATTRIBUTE
+ ? "target"
+ : "target_version";
+
+ tree attr_a = lookup_attribute (attr_name, DECL_ATTRIBUTES (decl_a));
+ tree attr_b = lookup_attribute (attr_name, DECL_ATTRIBUTES (decl_b));
+
+ gcc_assert (attr_b);
+ if (!attr_a)
+ return false;
+
+ return attribute_value_equal (attr_a, attr_b);
+}
+
/* Comparator function to be used in qsort routine to sort attribute
specification strings to "target". */
diff --git a/gcc/attribs.h b/gcc/attribs.h
index c4a4fb0..b6f3d5a 100644
--- a/gcc/attribs.h
+++ b/gcc/attribs.h
@@ -56,6 +56,7 @@ extern struct scoped_attributes *
extern char *sorted_attr_string (tree);
extern tree make_dispatcher_decl (const tree);
extern bool is_function_default_version (const tree);
+extern bool functions_b_resolvable_from_a (tree, tree, tree);
extern void handle_ignored_attributes_option (vec<char *> *);
/* Return a type like TTYPE except that its TYPE_ATTRIBUTES
diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc
index 0b0ab4a..8c8d9be 100644
--- a/gcc/auto-profile.cc
+++ b/gcc/auto-profile.cc
@@ -100,7 +100,7 @@ along with GCC; see the file COPYING3. If not see
significantly form one inline instance to another and from the
offline version.
- This is controlled by -fauto-profile-inlinig and is independent
+ This is controlled by -fauto-profile-inlining and is independent
of -fearly-inlining.
Phase 4: In AFDO pass.
@@ -128,7 +128,7 @@ along with GCC; see the file COPYING3. If not see
considered cols. */
gcov_type afdo_hot_bb_threshod = -1;
-/* Return ture if COUNT is possiby hot. */
+/* Return true if COUNT is possibly hot. */
bool
maybe_hot_afdo_count_p (profile_count count)
{
@@ -372,7 +372,7 @@ public:
removed_icall_target_ = true;
}
- /* Reutrn true if function is removed from indir target list. */
+ /* Return true if function is removed from indir target list. */
bool
removed_icall_target ()
{
@@ -506,7 +506,7 @@ private:
to it. */
bool realized_;
- /* Ture if function is in worklist for merging/offlining. */
+ /* True if function is in worklist for merging/offlining. */
bool in_worklist_;
/* Pointer to outer function instance or NULL if this
@@ -1090,7 +1090,7 @@ function_instance::merge (function_instance *other,
}
/* Make inline function FN offline.
- If tolevel function of same name already exists, then merge profiles.
+ If toplevel function of same name already exists, then merge profiles.
Otherwise turn FN toplevel. Return true if new toplevel function
was introduced.
If new toplevel functions are created and NEW_FUNCTIONS != NULL,
@@ -1641,7 +1641,7 @@ function_instance::match (cgraph_node *node,
unsigned int start_location = get_combined_location
(DECL_STRUCT_FUNCTION (node->decl)->function_start_locus, node->decl);
/* When outputting code to builtins location we use line number 0.
- craeate_gcov is stupid and hapilly computes offsets across files.
+ create_gcov is stupid and happily computes offsets across files.
Silently ignore it. */
unsigned int zero_location
= ((unsigned)(1-DECL_SOURCE_LINE (node->decl))) << 16;
@@ -2093,11 +2093,11 @@ autofdo_source_profile::offline_external_functions ()
seen.add (iter.first);
}
- /* Now process all tolevel (offline) function instances.
+ /* Now process all toplevel (offline) function instances.
If instance has no definition in this translation unit,
first offline all inlined functions which are defined here
- (so we do not lose porfile due to cross-module inlining
+ (so we do not lose profile due to cross-module inlining
done by link-time optimizers).
If instance has a definition, look into all inlined functions
@@ -2697,7 +2697,7 @@ autofdo_source_profile::get_function_instance_by_inline_stack (
if (s == NULL)
{
/* afdo inliner extends the stack by last entry with unknown
- location while chekcing if function was inlined during train run.
+ location while checking if function was inlined during train run.
We do not want to print diagnostics about every function
which is not inlined. */
if (s && dump_enabled_p () && stack[i].location != UNKNOWN_LOCATION)
@@ -3441,7 +3441,7 @@ cmp (const void *a, const void *b)
return 0;
}
-/* To scalle a connected component of graph we collect desired scales of
+/* To scale a connected component of graph we collect desired scales of
basic blocks on the boundary and then compute a robust average. */
struct scale
diff --git a/gcc/auto-profile.h b/gcc/auto-profile.h
index 639e263..3cce5f2 100644
--- a/gcc/auto-profile.h
+++ b/gcc/auto-profile.h
@@ -39,7 +39,7 @@ extern void remove_afdo_speculative_target (cgraph_edge *);
considered cols. */
extern gcov_type afdo_hot_bb_threshold;
-/* Return ture if COUNT is possiby hot. */
+/* Return true if COUNT is possibly hot. */
extern bool maybe_hot_afdo_count_p (profile_count count);
#endif /* AUTO_PROFILE_H */
diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index b96215a..9b2aeea 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -3696,7 +3696,8 @@ mark_decl_used (tree ref, bool address)
if (static_p)
C_DECL_USED (ref) = 1;
- if (nonloc_p)
+ if (nonloc_p && (VAR_OR_FUNCTION_DECL_P (ref)
+ || TREE_CODE (ref) == PARM_DECL))
DECL_NONLOCAL (ref) = 1;
/* Nothing to do anymore. */
diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc
index 8950294..5c3ba50 100644
--- a/gcc/cfgexpand.cc
+++ b/gcc/cfgexpand.cc
@@ -90,7 +90,7 @@ along with GCC; see the file COPYING3. If not see
struct ssaexpand SA;
/* This variable holds the currently expanded gimple statement for purposes
- of comminucating the profile info to the builtin expanders. */
+ of communicating the profile info to the builtin expanders. */
gimple *currently_expanding_gimple_stmt;
static rtx expand_debug_expr (tree);
@@ -834,8 +834,8 @@ add_scope_conflicts_2 (vars_ssa_cache &cache, tree name,
{
gcc_assert (TREE_CODE (name) == SSA_NAME);
- /* Querry the cache for the mapping of addresses that are referendd by
- ssa name NAME. Querrying it will fill in it. */
+ /* Query the cache for the mapping of addresses that are referenced by
+ ssa name NAME. Querying it will fill in it. */
bitmap_iterator bi;
unsigned i;
const_bitmap bmap = cache (name);
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 9ccee4b..031da86 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -20640,6 +20640,30 @@ aarch64_compare_version_priority (tree decl1, tree decl2)
return compare_feature_masks (mask1, mask2);
}
+/* Implement TARGET_OPTION_FUNCTIONS_B_RESOLVABLE_FROM_A. */
+
+bool
+aarch64_functions_b_resolvable_from_a (tree decl_a, tree decl_b, tree baseline)
+{
+ auto baseline_isa = aarch64_get_isa_flags
+ (TREE_TARGET_OPTION (aarch64_fndecl_options (baseline)));
+ auto isa_a = baseline_isa;
+ auto isa_b = baseline_isa;
+
+ auto a_version = get_target_version (decl_a);
+ auto b_version = get_target_version (decl_b);
+ if (a_version.is_valid ())
+ aarch64_parse_fmv_features (a_version, &isa_a, NULL, NULL);
+ if (b_version.is_valid ())
+ aarch64_parse_fmv_features (b_version, &isa_b, NULL, NULL);
+
+ /* Are there any bits of b that arent in a. */
+ if (isa_b & (~isa_a))
+ return false;
+
+ return true;
+}
+
/* Build the struct __ifunc_arg_t type:
struct __ifunc_arg_t
@@ -32854,6 +32878,10 @@ aarch64_libgcc_floating_mode_supported_p
#undef TARGET_COMPARE_VERSION_PRIORITY
#define TARGET_COMPARE_VERSION_PRIORITY aarch64_compare_version_priority
+#undef TARGET_OPTION_FUNCTIONS_B_RESOLVABLE_FROM_A
+#define TARGET_OPTION_FUNCTIONS_B_RESOLVABLE_FROM_A \
+ aarch64_functions_b_resolvable_from_a
+
#undef TARGET_GENERATE_VERSION_DISPATCHER_BODY
#define TARGET_GENERATE_VERSION_DISPATCHER_BODY \
aarch64_generate_version_dispatcher_body
diff --git a/gcc/diagnostics/output-spec.cc b/gcc/diagnostics/output-spec.cc
index 8ec638a..28ea044f 100644
--- a/gcc/diagnostics/output-spec.cc
+++ b/gcc/diagnostics/output-spec.cc
@@ -42,13 +42,24 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostics/output-spec.h"
/* A namespace for handling the DSL of the arguments of
- -fdiagnostics-add-output= and -fdiagnostics-set-output=. */
+ -fdiagnostics-add-output= and -fdiagnostics-set-output=
+ which look like:
+ SCHEME[:KEY=VALUE(,KEY=VALUE)*]
+ We call this an output spec. */
namespace diagnostics {
namespace output_spec {
+class scheme_handler;
+
/* Decls. */
+/* A class for the result of the first stage of parsing an output spec,
+ where values are represented as untyped strings.
+ The scheme might not exist.
+ The keys have not been validated against the scheme.
+ The values have not been validated against their keys. */
+
struct scheme_name_and_params
{
std::string m_scheme_name;
@@ -62,94 +73,12 @@ struct scheme_name_and_params
class output_factory
{
public:
- class scheme_handler
- {
- public:
- scheme_handler (std::string scheme_name)
- : m_scheme_name (std::move (scheme_name))
- {}
- virtual ~scheme_handler () {}
-
- const std::string &get_scheme_name () const { return m_scheme_name; }
-
- virtual std::unique_ptr<sink>
- make_sink (const context &ctxt,
- diagnostics::context &dc,
- const char *unparsed_arg,
- const scheme_name_and_params &parsed_arg) const = 0;
-
- protected:
- bool
- parse_bool_value (const context &ctxt,
- const char *unparsed_arg,
- const std::string &key,
- const std::string &value,
- bool &out) const
- {
- if (value == "yes")
- {
- out = true;
- return true;
- }
- else if (value == "no")
- {
- out = false;
- return true;
- }
- else
- {
- ctxt.report_error
- ("%<%s%s%>:"
- " unexpected value %qs for key %qs; expected %qs or %qs",
- ctxt.get_option_name (), unparsed_arg,
- value.c_str (),
- key.c_str (),
- "yes", "no");
-
- return false;
- }
- }
- template <typename EnumType, size_t NumValues>
- bool
- parse_enum_value (const context &ctxt,
- const char *unparsed_arg,
- const std::string &key,
- const std::string &value,
- const std::array<std::pair<const char *, EnumType>, NumValues> &value_names,
- EnumType &out) const
- {
- for (auto &iter : value_names)
- if (value == iter.first)
- {
- out = iter.second;
- return true;
- }
-
- auto_vec<const char *> known_values;
- for (auto iter : value_names)
- known_values.safe_push (iter.first);
- pp_markup::comma_separated_quoted_strings e (known_values);
- ctxt.report_error
- ("%<%s%s%>:"
- " unexpected value %qs for key %qs; known values: %e",
- ctxt.get_option_name (), unparsed_arg,
- value.c_str (),
- key.c_str (),
- &e);
- return false;
- }
-
- private:
- const std::string m_scheme_name;
- };
-
output_factory ();
std::unique_ptr<sink>
make_sink (const context &ctxt,
diagnostics::context &dc,
- const char *unparsed_arg,
- const scheme_name_and_params &parsed_arg);
+ const scheme_name_and_params &scheme_and_kvs);
const scheme_handler *get_scheme_handler (const std::string &scheme_name);
@@ -157,44 +86,158 @@ private:
std::vector<std::unique_ptr<scheme_handler>> m_scheme_handlers;
};
-class text_scheme_handler : public output_factory::scheme_handler
+class scheme_handler
{
public:
+ scheme_handler (std::string scheme_name)
+ : m_scheme_name (std::move (scheme_name))
+ {}
+ virtual ~scheme_handler () {}
+
+ const std::string &get_scheme_name () const { return m_scheme_name; }
+
+ virtual std::unique_ptr<sink>
+ make_sink (const context &ctxt,
+ diagnostics::context &dc,
+ const scheme_name_and_params &scheme_and_kvs) const = 0;
+
+protected:
+ bool
+ parse_bool_value (const context &ctxt,
+ const std::string &key,
+ const std::string &value,
+ bool &out) const
+ {
+ if (value == "yes")
+ {
+ out = true;
+ return true;
+ }
+ else if (value == "no")
+ {
+ out = false;
+ return true;
+ }
+ else
+ {
+ ctxt.report_error
+ ("%<%s%s%>:"
+ " unexpected value %qs for key %qs; expected %qs or %qs",
+ ctxt.get_option_name (), ctxt.get_unparsed_spec (),
+ value.c_str (),
+ key.c_str (),
+ "yes", "no");
+
+ return false;
+ }
+ }
+ template <typename EnumType, size_t NumValues>
+ bool
+ parse_enum_value (const context &ctxt,
+ const std::string &key,
+ const std::string &value,
+ const std::array<std::pair<const char *, EnumType>, NumValues> &value_names,
+ EnumType &out) const
+ {
+ for (auto &iter : value_names)
+ if (value == iter.first)
+ {
+ out = iter.second;
+ return true;
+ }
+
+ auto_vec<const char *> known_values;
+ for (auto iter : value_names)
+ known_values.safe_push (iter.first);
+ pp_markup::comma_separated_quoted_strings e (known_values);
+ ctxt.report_error
+ ("%<%s%s%>:"
+ " unexpected value %qs for key %qs; known values: %e",
+ ctxt.get_option_name (), ctxt.get_unparsed_spec (),
+ value.c_str (),
+ key.c_str (),
+ &e);
+ return false;
+ }
+
+private:
+ const std::string m_scheme_name;
+};
+
+class text_scheme_handler : public scheme_handler
+{
+public:
+ struct decoded_args
+ {
+ bool m_show_color;
+ bool m_show_nesting;
+ bool m_show_locations_in_nesting;
+ bool m_show_levels;
+ };
+
text_scheme_handler () : scheme_handler ("text") {}
std::unique_ptr<sink>
make_sink (const context &ctxt,
diagnostics::context &dc,
- const char *unparsed_arg,
- const scheme_name_and_params &parsed_arg) const final override;
+ const scheme_name_and_params &scheme_and_kvs) const final override;
+
+ bool
+ decode_kv (const context &ctxt,
+ const std::string &key,
+ const std::string &value,
+ decoded_args &out_opts) const;
};
-class sarif_scheme_handler : public output_factory::scheme_handler
+class sarif_scheme_handler : public scheme_handler
{
public:
+ struct decoded_args
+ {
+ label_text m_filename;
+ enum sarif_serialization_kind m_serialization_kind;
+ sarif_generation_options m_generation_opts;
+ };
+
sarif_scheme_handler () : scheme_handler ("sarif") {}
std::unique_ptr<sink>
make_sink (const context &ctxt,
diagnostics::context &dc,
- const char *unparsed_arg,
- const scheme_name_and_params &parsed_arg) const final override;
+ const scheme_name_and_params &scheme_and_kvs) const final override;
+
+ bool
+ decode_kv (const context &ctxt,
+ const std::string &key,
+ const std::string &value,
+ decoded_args &out_opts) const;
private:
static std::unique_ptr<sarif_serialization_format>
make_sarif_serialization_object (enum sarif_serialization_kind);
};
-class html_scheme_handler : public output_factory::scheme_handler
+class html_scheme_handler : public scheme_handler
{
public:
+ struct decoded_args
+ {
+ label_text m_filename;
+ html_generation_options m_html_gen_opts;
+ };
+
html_scheme_handler () : scheme_handler ("experimental-html") {}
std::unique_ptr<sink>
make_sink (const context &ctxt,
diagnostics::context &dc,
- const char *unparsed_arg,
- const scheme_name_and_params &parsed_arg) const final override;
+ const scheme_name_and_params &scheme_and_kvs) const final override;
+
+ bool
+ decode_kv (const context &ctxt,
+ const std::string &key,
+ const std::string &value,
+ decoded_args &opts_out) const;
};
/* struct context. */
@@ -209,8 +252,7 @@ context::report_error (const char *gmsgid, ...) const
}
void
-context::report_unknown_key (const char *unparsed_arg,
- const std::string &key,
+context::report_unknown_key (const std::string &key,
const std::string &scheme_name,
auto_vec<const char *> &known_keys) const
{
@@ -218,13 +260,12 @@ context::report_unknown_key (const char *unparsed_arg,
report_error
("%<%s%s%>:"
" unknown key %qs for format %qs; known keys: %e",
- get_option_name (), unparsed_arg,
+ get_option_name (), get_unparsed_spec (),
key.c_str (), scheme_name.c_str (), &e);
}
void
-context::report_missing_key (const char *unparsed_arg,
- const std::string &key,
+context::report_missing_key (const std::string &key,
const std::string &scheme_name,
const char *metavar) const
{
@@ -232,7 +273,7 @@ context::report_missing_key (const char *unparsed_arg,
("%<%s%s%>:"
" missing required key %qs for format %qs;"
" try %<%s%s:%s=%s%>",
- get_option_name (), unparsed_arg,
+ get_option_name (), get_unparsed_spec (),
key.c_str (), scheme_name.c_str (),
get_option_name (), scheme_name.c_str (), key.c_str (), metavar);
}
@@ -250,12 +291,13 @@ context::open_output_file (label_text &&filename) const
}
static std::unique_ptr<scheme_name_and_params>
-parse (const context &ctxt, const char *unparsed_arg)
+parse (const context &ctxt)
{
scheme_name_and_params result;
- if (const char *const colon = strchr (unparsed_arg, ':'))
+ const char *const unparsed_spec = ctxt.get_unparsed_spec ();
+ if (const char *const colon = strchr (unparsed_spec, ':'))
{
- result.m_scheme_name = std::string (unparsed_arg, colon - unparsed_arg);
+ result.m_scheme_name = std::string (unparsed_spec, colon - unparsed_spec);
/* Expect zero of more of KEY=VALUE,KEY=VALUE, etc .*/
const char *iter = colon + 1;
const char *last_separator = ":";
@@ -271,7 +313,7 @@ parse (const context &ctxt, const char *unparsed_arg)
" expected KEY=VALUE-style parameter for format %qs"
" after %qs;"
" got %qs",
- ctxt.get_option_name (), unparsed_arg,
+ ctxt.get_option_name (), ctxt.get_unparsed_spec (),
result.m_scheme_name.c_str (),
last_separator,
iter);
@@ -295,23 +337,22 @@ parse (const context &ctxt, const char *unparsed_arg)
}
}
else
- result.m_scheme_name = unparsed_arg;
+ result.m_scheme_name = unparsed_spec;
return std::make_unique<scheme_name_and_params> (std::move (result));
}
std::unique_ptr<sink>
-context::parse_and_make_sink (const char *unparsed_arg,
- diagnostics::context &dc)
+context::parse_and_make_sink (diagnostics::context &dc)
{
- auto parsed_arg = parse (*this, unparsed_arg);
+ auto parsed_arg = parse (*this);
if (!parsed_arg)
return nullptr;
output_factory factory;
- return factory.make_sink (*this, dc, unparsed_arg, *parsed_arg);
+ return factory.make_sink (*this, dc, *parsed_arg);
}
-/* class output_factory::scheme_handler. */
+/* class scheme_handler. */
/* class output_factory. */
@@ -322,7 +363,7 @@ output_factory::output_factory ()
m_scheme_handlers.push_back (std::make_unique<html_scheme_handler> ());
}
-const output_factory::scheme_handler *
+const scheme_handler *
output_factory::get_scheme_handler (const std::string &scheme_name)
{
for (auto &iter : m_scheme_handlers)
@@ -334,10 +375,9 @@ output_factory::get_scheme_handler (const std::string &scheme_name)
std::unique_ptr<sink>
output_factory::make_sink (const context &ctxt,
diagnostics::context &dc,
- const char *unparsed_arg,
- const scheme_name_and_params &parsed_arg)
+ const scheme_name_and_params &scheme_and_kvs)
{
- auto scheme_handler = get_scheme_handler (parsed_arg.m_scheme_name);
+ auto scheme_handler = get_scheme_handler (scheme_and_kvs.m_scheme_name);
if (!scheme_handler)
{
auto_vec<const char *> strings;
@@ -346,155 +386,97 @@ output_factory::make_sink (const context &ctxt,
pp_markup::comma_separated_quoted_strings e (strings);
ctxt.report_error ("%<%s%s%>:"
" unrecognized format %qs; known formats: %e",
- ctxt.get_option_name (), unparsed_arg,
- parsed_arg.m_scheme_name.c_str (), &e);
+ ctxt.get_option_name (), ctxt.get_unparsed_spec (),
+ scheme_and_kvs.m_scheme_name.c_str (), &e);
return nullptr;
}
- return scheme_handler->make_sink (ctxt, dc, unparsed_arg, parsed_arg);
+ return scheme_handler->make_sink (ctxt, dc, scheme_and_kvs);
}
-/* class text_scheme_handler : public output_factory::scheme_handler. */
+/* class text_scheme_handler : public scheme_handler. */
std::unique_ptr<sink>
text_scheme_handler::make_sink (const context &ctxt,
diagnostics::context &dc,
- const char *unparsed_arg,
- const scheme_name_and_params &parsed_arg) const
+ const scheme_name_and_params &scheme_and_kvs) const
{
- bool show_color = pp_show_color (dc.get_reference_printer ());
- bool show_nesting = true;
- bool show_locations_in_nesting = true;
- bool show_levels = false;
- for (auto& iter : parsed_arg.m_kvs)
+ decoded_args opts;
+ opts.m_show_color = pp_show_color (dc.get_reference_printer ());
+ opts.m_show_nesting = true;
+ opts.m_show_locations_in_nesting = true;
+ opts.m_show_levels = false;
+ for (auto& iter : scheme_and_kvs.m_kvs)
{
const std::string &key = iter.first;
const std::string &value = iter.second;
- if (key == "color")
- {
- if (!parse_bool_value (ctxt, unparsed_arg, key, value, show_color))
- return nullptr;
- continue;
- }
- if (key == "show-nesting")
- {
- if (!parse_bool_value (ctxt, unparsed_arg, key, value,
- show_nesting))
- return nullptr;
- continue;
- }
- if (key == "show-nesting-locations")
- {
- if (!parse_bool_value (ctxt, unparsed_arg, key, value,
- show_locations_in_nesting))
- return nullptr;
- continue;
- }
- if (key == "show-nesting-levels")
- {
- if (!parse_bool_value (ctxt, unparsed_arg, key, value, show_levels))
- return nullptr;
- continue;
- }
-
- /* Key not found. */
- auto_vec<const char *> known_keys;
- known_keys.safe_push ("color");
- known_keys.safe_push ("show-nesting");
- known_keys.safe_push ("show-nesting-locations");
- known_keys.safe_push ("show-nesting-levels");
- ctxt.report_unknown_key (unparsed_arg, key, get_scheme_name (),
- known_keys);
- return nullptr;
+ if (!decode_kv (ctxt, key, value, opts))
+ return nullptr;
}
auto sink = std::make_unique<diagnostics::text_sink> (dc);
- sink->set_show_nesting (show_nesting);
- sink->set_show_locations_in_nesting (show_locations_in_nesting);
- sink->set_show_nesting_levels (show_levels);
+ sink->set_show_nesting (opts.m_show_nesting);
+ sink->set_show_locations_in_nesting (opts.m_show_locations_in_nesting);
+ sink->set_show_nesting_levels (opts.m_show_levels);
+ pp_show_color (sink->get_printer ()) = opts.m_show_color;
return sink;
}
-/* class sarif_scheme_handler : public output_factory::scheme_handler. */
+bool
+text_scheme_handler::decode_kv (const context &ctxt,
+ const std::string &key,
+ const std::string &value,
+ decoded_args &opts_out) const
+{
+ if (key == "color")
+ return parse_bool_value (ctxt, key, value, opts_out.m_show_color);
+ if (key == "show-nesting")
+ return parse_bool_value (ctxt, key, value, opts_out.m_show_nesting);
+ if (key == "show-nesting-locations")
+ return parse_bool_value (ctxt, key, value,
+ opts_out.m_show_locations_in_nesting);
+ if (key == "show-nesting-levels")
+ return parse_bool_value (ctxt, key, value, opts_out.m_show_levels);
+
+ /* Key not found. */
+ auto_vec<const char *> known_keys;
+ known_keys.safe_push ("color");
+ known_keys.safe_push ("show-nesting");
+ known_keys.safe_push ("show-nesting-locations");
+ known_keys.safe_push ("show-nesting-levels");
+ ctxt.report_unknown_key (key, get_scheme_name (), known_keys);
+ return false;
+}
+
+/* class sarif_scheme_handler : public scheme_handler. */
std::unique_ptr<sink>
-sarif_scheme_handler::make_sink (const context &ctxt,
- diagnostics::context &dc,
- const char *unparsed_arg,
- const scheme_name_and_params &parsed_arg) const
+sarif_scheme_handler::
+make_sink (const context &ctxt,
+ diagnostics::context &dc,
+ const scheme_name_and_params &scheme_and_kvs) const
{
- label_text filename;
- enum sarif_serialization_kind serialization_kind
- = sarif_serialization_kind::json;
- sarif_generation_options sarif_gen_opts;
- for (auto& iter : parsed_arg.m_kvs)
+ decoded_args opts;
+ opts.m_serialization_kind = sarif_serialization_kind::json;
+
+ for (auto& iter : scheme_and_kvs.m_kvs)
{
const std::string &key = iter.first;
const std::string &value = iter.second;
- if (key == "file")
- {
- filename = label_text::take (xstrdup (value.c_str ()));
- continue;
- }
- if (key == "serialization")
- {
- static const std::array<std::pair<const char *, enum sarif_serialization_kind>,
- (size_t)sarif_serialization_kind::num_values> value_names
- {{{"json", sarif_serialization_kind::json}}};
-
- if (!parse_enum_value<enum sarif_serialization_kind>
- (ctxt, unparsed_arg,
- key, value,
- value_names,
- serialization_kind))
- return nullptr;
- continue;
- }
- if (key == "version")
- {
- static const std::array<std::pair<const char *, enum sarif_version>,
- (size_t)sarif_version::num_versions> value_names
- {{{"2.1", sarif_version::v2_1_0},
- {"2.2-prerelease", sarif_version::v2_2_prerelease_2024_08_08}}};
-
- if (!parse_enum_value<enum sarif_version>
- (ctxt, unparsed_arg,
- key, value,
- value_names,
- sarif_gen_opts.m_version))
- return nullptr;
- continue;
- }
- if (key == "state-graphs")
- {
- if (!parse_bool_value (ctxt, unparsed_arg, key, value,
- sarif_gen_opts.m_state_graph))
- return nullptr;
- continue;
- }
-
- /* Key not found. */
- auto_vec<const char *> known_keys;
- known_keys.safe_push ("file");
- known_keys.safe_push ("serialization");
- known_keys.safe_push ("state-graphs");
- known_keys.safe_push ("version");
- ctxt.report_unknown_key (unparsed_arg, key, get_scheme_name (),
- known_keys);
- return nullptr;
+ if (!decode_kv (ctxt, key, value, opts))
+ return nullptr;
}
output_file output_file_;
- if (filename.get ())
- output_file_ = ctxt.open_output_file (std::move (filename));
+ if (opts.m_filename.get ())
+ output_file_ = ctxt.open_output_file (std::move (opts.m_filename));
else
// Default filename
{
const char *basename = ctxt.get_base_filename ();
if (!basename)
{
- ctxt.report_missing_key (unparsed_arg,
- "file",
+ ctxt.report_missing_key ("file",
get_scheme_name (),
"FILENAME");
return nullptr;
@@ -503,21 +485,71 @@ sarif_scheme_handler::make_sink (const context &ctxt,
= open_sarif_output_file (dc,
ctxt.get_affected_location_mgr (),
basename,
- serialization_kind);
+ opts.m_serialization_kind);
}
if (!output_file_)
return nullptr;
- auto serialization_obj = make_sarif_serialization_object (serialization_kind);
+ auto serialization_obj
+ = make_sarif_serialization_object (opts.m_serialization_kind);
auto sink = make_sarif_sink (dc,
*ctxt.get_affected_location_mgr (),
std::move (serialization_obj),
- sarif_gen_opts,
+ opts.m_generation_opts,
std::move (output_file_));
+
return sink;
}
+bool
+sarif_scheme_handler::decode_kv (const context &ctxt,
+ const std::string &key,
+ const std::string &value,
+ decoded_args &opts_out) const
+{
+ if (key == "file")
+ {
+ opts_out.m_filename = label_text::take (xstrdup (value.c_str ()));
+ return true;
+ }
+ if (key == "serialization")
+ {
+ static const std::array<std::pair<const char *, enum sarif_serialization_kind>,
+ (size_t)sarif_serialization_kind::num_values> value_names
+ {{{"json", sarif_serialization_kind::json}}};
+ return parse_enum_value<enum sarif_serialization_kind>
+ (ctxt,
+ key, value,
+ value_names,
+ opts_out.m_serialization_kind);
+ }
+ if (key == "version")
+ {
+ static const std::array<std::pair<const char *, enum sarif_version>,
+ (size_t)sarif_version::num_versions> value_names
+ {{{"2.1", sarif_version::v2_1_0},
+ {"2.2-prerelease", sarif_version::v2_2_prerelease_2024_08_08}}};
+ return parse_enum_value<enum sarif_version>
+ (ctxt,
+ key, value,
+ value_names,
+ opts_out.m_generation_opts.m_version);
+ }
+ if (key == "state-graphs")
+ return parse_bool_value (ctxt, key, value,
+ opts_out.m_generation_opts.m_state_graph);
+
+ /* Key not found. */
+ auto_vec<const char *> known_keys;
+ known_keys.safe_push ("file");
+ known_keys.safe_push ("serialization");
+ known_keys.safe_push ("state-graphs");
+ known_keys.safe_push ("version");
+ ctxt.report_unknown_key (key, get_scheme_name (), known_keys);
+ return false;
+}
+
std::unique_ptr<sarif_serialization_format>
sarif_scheme_handler::
make_sarif_serialization_object (enum sarif_serialization_kind kind)
@@ -532,85 +564,33 @@ make_sarif_serialization_object (enum sarif_serialization_kind kind)
}
}
-/* class html_scheme_handler : public output_factory::scheme_handler. */
+/* class html_scheme_handler : public scheme_handler. */
std::unique_ptr<sink>
-html_scheme_handler::make_sink (const context &ctxt,
- diagnostics::context &dc,
- const char *unparsed_arg,
- const scheme_name_and_params &parsed_arg) const
+html_scheme_handler::
+make_sink (const context &ctxt,
+ diagnostics::context &dc,
+ const scheme_name_and_params &scheme_and_kvs) const
{
- label_text filename;
- html_generation_options html_gen_opts;
- for (auto& iter : parsed_arg.m_kvs)
+ decoded_args opts;
+ for (auto& iter : scheme_and_kvs.m_kvs)
{
const std::string &key = iter.first;
const std::string &value = iter.second;
- if (key == "css")
- {
- if (!parse_bool_value (ctxt, unparsed_arg, key, value,
- html_gen_opts.m_css))
- return nullptr;
- continue;
- }
- if (key == "file")
- {
- filename = label_text::take (xstrdup (value.c_str ()));
- continue;
- }
- if (key == "javascript")
- {
- if (!parse_bool_value (ctxt, unparsed_arg, key, value,
- html_gen_opts.m_javascript))
- return nullptr;
- continue;
- }
- if (key == "show-state-diagrams")
- {
- if (!parse_bool_value (ctxt, unparsed_arg, key, value,
- html_gen_opts.m_show_state_diagrams))
- return nullptr;
- continue;
- }
- if (key == "show-state-diagrams-dot-src")
- {
- if (!parse_bool_value (ctxt, unparsed_arg, key, value,
- html_gen_opts.m_show_state_diagrams_dot_src))
- return nullptr;
- continue;
- }
- if (key == "show-state-diagrams-sarif")
- {
- if (!parse_bool_value (ctxt, unparsed_arg, key, value,
- html_gen_opts.m_show_state_diagrams_sarif))
- return nullptr;
- continue;
- }
-
- /* Key not found. */
- auto_vec<const char *> known_keys;
- known_keys.safe_push ("css");
- known_keys.safe_push ("file");
- known_keys.safe_push ("javascript");
- known_keys.safe_push ("show-state-diagrams");
- known_keys.safe_push ("show-state-diagram-dot-src");
- known_keys.safe_push ("show-state-diagram-sarif");
- ctxt.report_unknown_key (unparsed_arg, key, get_scheme_name (),
- known_keys);
- return nullptr;
+ if (!decode_kv (ctxt, key, value, opts))
+ return nullptr;
}
output_file output_file_;
- if (filename.get ())
- output_file_ = ctxt.open_output_file (std::move (filename));
+ if (opts.m_filename.get ())
+ output_file_ = ctxt.open_output_file (std::move (opts.m_filename));
else
// Default filename
{
const char *basename = ctxt.get_base_filename ();
if (!basename)
{
- ctxt.report_missing_key (unparsed_arg,
- "file",
+ ctxt.report_missing_key ("file",
get_scheme_name (),
"FILENAME");
return nullptr;
@@ -626,11 +606,51 @@ html_scheme_handler::make_sink (const context &ctxt,
auto sink = make_html_sink (dc,
*ctxt.get_affected_location_mgr (),
- html_gen_opts,
+ opts.m_html_gen_opts,
std::move (output_file_));
return sink;
}
+bool
+html_scheme_handler::decode_kv (const context &ctxt,
+ const std::string &key,
+ const std::string &value,
+ decoded_args &opts_out) const
+{
+ if (key == "css")
+ return parse_bool_value (ctxt, key, value, opts_out.m_html_gen_opts.m_css);
+ if (key == "file")
+ {
+ opts_out.m_filename = label_text::take (xstrdup (value.c_str ()));
+ return true;
+ }
+ if (key == "javascript")
+ return parse_bool_value (ctxt, key, value,
+ opts_out.m_html_gen_opts.m_javascript);
+ if (key == "show-state-diagrams")
+ return parse_bool_value (ctxt, key, value,
+ opts_out.m_html_gen_opts.m_show_state_diagrams);
+ if (key == "show-state-diagrams-dot-src")
+ return parse_bool_value
+ (ctxt, key, value,
+ opts_out.m_html_gen_opts.m_show_state_diagrams_dot_src);
+ if (key == "show-state-diagrams-sarif")
+ return parse_bool_value
+ (ctxt, key, value,
+ opts_out.m_html_gen_opts.m_show_state_diagrams_sarif);
+
+ /* Key not found. */
+ auto_vec<const char *> known_keys;
+ known_keys.safe_push ("css");
+ known_keys.safe_push ("file");
+ known_keys.safe_push ("javascript");
+ known_keys.safe_push ("show-state-diagrams");
+ known_keys.safe_push ("show-state-diagram-dot-src");
+ known_keys.safe_push ("show-state-diagram-sarif");
+ ctxt.report_unknown_key (key, get_scheme_name (), known_keys);
+ return false;
+}
+
} // namespace output_spec
#if CHECKING_P
@@ -668,12 +688,14 @@ struct parser_test
test_spec_context (diagnostics::context &dc,
line_maps *location_mgr,
location_t loc,
- const char *option_name)
+ const char *option_name,
+ const char *unparsed_arg)
: dc_spec_context (dc,
location_mgr,
location_mgr,
loc,
- option_name)
+ option_name,
+ unparsed_arg)
{
}
@@ -684,18 +706,18 @@ struct parser_test
}
};
- parser_test ()
+ parser_test (const char *unparsed_spec)
: m_dc (),
- m_ctxt (m_dc, line_table, UNKNOWN_LOCATION, "-fOPTION="),
+ m_ctxt (m_dc, line_table, UNKNOWN_LOCATION, "-fOPTION=", unparsed_spec),
m_fmt (m_dc.get_sink (0))
{
pp_buffer (m_fmt.get_printer ())->m_flush_p = false;
}
std::unique_ptr<diagnostics::output_spec::scheme_name_and_params>
- parse (const char *unparsed_arg)
+ parse ()
{
- return diagnostics::output_spec::parse (m_ctxt, unparsed_arg);
+ return diagnostics::output_spec::parse (m_ctxt);
}
bool execution_failed_p () const
@@ -725,8 +747,8 @@ test_output_arg_parsing ()
/* Minimal correct example. */
{
- parser_test pt;
- auto result = pt.parse ("foo");
+ parser_test pt ("foo");
+ auto result = pt.parse ();
ASSERT_EQ (result->m_scheme_name, "foo");
ASSERT_EQ (result->m_kvs.size (), 0);
ASSERT_FALSE (pt.execution_failed_p ());
@@ -734,8 +756,8 @@ test_output_arg_parsing ()
/* Stray trailing colon with no key/value pairs. */
{
- parser_test pt;
- auto result = pt.parse ("foo:");
+ parser_test pt ("foo:");
+ auto result = pt.parse ();
ASSERT_EQ (result, nullptr);
ASSERT_TRUE (pt.execution_failed_p ());
ASSERT_STREQ (pt.get_diagnostic_text (),
@@ -747,8 +769,8 @@ test_output_arg_parsing ()
/* No key before '='. */
{
- parser_test pt;
- auto result = pt.parse ("foo:=");
+ parser_test pt ("foo:=");
+ auto result = pt.parse ();
ASSERT_EQ (result, nullptr);
ASSERT_TRUE (pt.execution_failed_p ());
ASSERT_STREQ (pt.get_diagnostic_text (),
@@ -760,8 +782,8 @@ test_output_arg_parsing ()
/* No value for key. */
{
- parser_test pt;
- auto result = pt.parse ("foo:key,");
+ parser_test pt ("foo:key,");
+ auto result = pt.parse ();
ASSERT_EQ (result, nullptr);
ASSERT_TRUE (pt.execution_failed_p ());
ASSERT_STREQ (pt.get_diagnostic_text (),
@@ -773,8 +795,8 @@ test_output_arg_parsing ()
/* Correct example, with one key/value pair. */
{
- parser_test pt;
- auto result = pt.parse ("foo:key=value");
+ parser_test pt ("foo:key=value");
+ auto result = pt.parse ();
ASSERT_EQ (result->m_scheme_name, "foo");
ASSERT_EQ (result->m_kvs.size (), 1);
ASSERT_EQ (result->m_kvs[0].first, "key");
@@ -784,8 +806,8 @@ test_output_arg_parsing ()
/* Stray trailing comma. */
{
- parser_test pt;
- auto result = pt.parse ("foo:key=value,");
+ parser_test pt ("foo:key=value,");
+ auto result = pt.parse ();
ASSERT_EQ (result, nullptr);
ASSERT_TRUE (pt.execution_failed_p ());
ASSERT_STREQ (pt.get_diagnostic_text (),
@@ -797,8 +819,8 @@ test_output_arg_parsing ()
/* Correct example, with two key/value pairs. */
{
- parser_test pt;
- auto result = pt.parse ("foo:color=red,shape=circle");
+ parser_test pt ("foo:color=red,shape=circle");
+ auto result = pt.parse ();
ASSERT_EQ (result->m_scheme_name, "foo");
ASSERT_EQ (result->m_kvs.size (), 2);
ASSERT_EQ (result->m_kvs[0].first, "color");
diff --git a/gcc/diagnostics/output-spec.h b/gcc/diagnostics/output-spec.h
index c84d237..e24002b 100644
--- a/gcc/diagnostics/output-spec.h
+++ b/gcc/diagnostics/output-spec.h
@@ -34,22 +34,19 @@ class context
{
public:
std::unique_ptr<sink>
- parse_and_make_sink (const char *,
- diagnostics::context &dc);
+ parse_and_make_sink (diagnostics::context &dc);
void
report_error (const char *gmsgid, ...) const
ATTRIBUTE_GCC_DIAG(2,3);
void
- report_unknown_key (const char *unparsed_arg,
- const std::string &key,
+ report_unknown_key (const std::string &key,
const std::string &scheme_name,
auto_vec<const char *> &known_keys) const;
void
- report_missing_key (const char *unparsed_arg,
- const std::string &key,
+ report_missing_key (const std::string &key,
const std::string &scheme_name,
const char *metavar) const;
@@ -59,6 +56,9 @@ class context
const char *
get_option_name () const { return m_option_name; }
+ const char *
+ get_unparsed_spec () const { return m_unparsed_spec; }
+
line_maps *
get_affected_location_mgr () const { return m_affected_location_mgr; }
@@ -72,13 +72,20 @@ class context
protected:
context (const char *option_name,
+ const char *unparsed_spec,
line_maps *affected_location_mgr)
: m_option_name (option_name),
+ m_unparsed_spec (unparsed_spec),
m_affected_location_mgr (affected_location_mgr)
{
}
+ // e.g. "-fdiagnostics-add-output="
const char *m_option_name;
+
+ // e.g. "scheme:foo=bar,key=value"
+ const char *m_unparsed_spec;
+
line_maps *m_affected_location_mgr;
};
@@ -91,8 +98,9 @@ public:
line_maps *affected_location_mgr,
line_maps *control_location_mgr,
location_t loc,
- const char *option_name)
- : context (option_name, affected_location_mgr),
+ const char *option_name,
+ const char *unparsed_spec)
+ : context (option_name, unparsed_spec, affected_location_mgr),
m_dc (dc),
m_control_location_mgr (control_location_mgr),
m_loc (loc)
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 218bf3a..981bb2d 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -10983,6 +10983,25 @@ This target hook returns @code{true} if the target/target-version strings
@var{fn1} and @var{fn2} imply the same function version.
@end deftypefn
+@deftypefn {Target Hook} bool TARGET_OPTION_FUNCTIONS_B_RESOLVABLE_FROM_A (tree @var{decl_a}, tree @var{decl_v}, tree @var{base})
+@var{decl_b} is a function declaration with a function multi-versioning
+(FMV) attribute; this attribute is either @code{target} or
+@code{target_version}, depending on @code{TARGET_HAS_FMV_TARGET_ATTRIBUTE}.
+@var{decl_a} is a function declaration that may or may not have an FMV
+attribute.
+
+Return true if we have enough information to determine that the
+requirements of @var{decl_b}'s FMV attribute are met whenever @var{decl_a}
+is executed, given that the target supports all features required by
+function declaration @var{base}.
+
+The default implementation just checks whether @var{decl_a} has the same
+FMV attribute as @var{decl_b}. This is conservatively correct,
+but ports can do better by taking the relationships between architecture
+features into account. For example, on AArch64, @code{sve} is present
+whenever @code{sve2} is present.
+@end deftypefn
+
@deftypefn {Target Hook} bool TARGET_CAN_INLINE_P (tree @var{caller}, tree @var{callee})
This target hook returns @code{false} if the @var{caller} function
cannot inline @var{callee}, based on target specific information. By
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 57653a1..842ea12 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -7142,6 +7142,8 @@ with the target specific attributes. The default value is @code{','}.
@hook TARGET_OPTION_SAME_FUNCTION_VERSIONS
+@hook TARGET_OPTION_FUNCTIONS_B_RESOLVABLE_FROM_A
+
@hook TARGET_CAN_INLINE_P
@hook TARGET_UPDATE_IPA_FN_TARGET_INFO
diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc
index fe7a5fe..e8cfee8 100644
--- a/gcc/fold-const.cc
+++ b/gcc/fold-const.cc
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
@@ This would also make life easier when this technology is used
@@ for cross-compilers. */
-/* The entry points in this file are fold, size_int_wide and size_binop.
+/* The entry points in this file are fold, size_int and size_binop.
fold takes a tree as argument and returns a simplified tree.
diff --git a/gcc/gimple.h b/gcc/gimple.h
index da32651..0356bc5 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1545,7 +1545,7 @@ extern size_t const gimple_ops_offset_[];
extern enum gimple_statement_structure_enum const gss_for_code_[];
/* This variable holds the currently expanded gimple statement for purposes
- of comminucating the profile info to the builtin expanders. */
+ of communicating the profile info to the builtin expanders. */
extern gimple *currently_expanding_gimple_stmt;
size_t gimple_size (enum gimple_code code, unsigned num_ops = 0);
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index 9009683..9c5aa06 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -1280,7 +1280,8 @@ build_stack_save_restore (gcall **save, gcall **restore)
1, tmp_var);
}
-/* Generate IFN_ASAN_MARK call that poisons shadow of a for DECL variable. */
+/* Generate IFN_ASAN_MARK call that poisons shadow memory of the DECL
+ variable. */
static tree
build_asan_poison_call_expr (tree decl)
diff --git a/gcc/ipa-devirt.cc b/gcc/ipa-devirt.cc
index 9953833..c10d67f 100644
--- a/gcc/ipa-devirt.cc
+++ b/gcc/ipa-devirt.cc
@@ -1801,7 +1801,7 @@ add_type_duplicate (odr_type val, tree type)
before we can pass them to odr_types_equivalent_p (PR lto/83121). */
if (lto_location_cache::current_cache)
lto_location_cache::current_cache->apply_location_cache ();
- /* As a special case we stream mangles names of integer types so we can see
+ /* As a special case we stream mangled names of integer types so we can see
if they are believed to be same even though they have different
representation. Avoid bogus warning on mismatches in these. */
if (TREE_CODE (type) != INTEGER_TYPE
diff --git a/gcc/ipa-param-manipulation.cc b/gcc/ipa-param-manipulation.cc
index 9b74fe2..4878867 100644
--- a/gcc/ipa-param-manipulation.cc
+++ b/gcc/ipa-param-manipulation.cc
@@ -1672,7 +1672,7 @@ ipa_param_body_adjustments
in ADJUSTMENTS. FNDECL designates the new function clone which is being
modified. OLD_FNDECL is the function of which FNDECL is a clone (and which
at the time of invocation still share DECL_ARGUMENTS). ID is the
- copy_body_data structure driving the wholy body copying process. VARS is a
+ copy_body_data structure driving the whole body copying process. VARS is a
pointer to the head of the list of new local variables, TREE_MAP is the map
that drives tree substitution in the cloning process. */
diff --git a/gcc/ipa-profile.cc b/gcc/ipa-profile.cc
index 4d0a8c9..e4c0ff5 100644
--- a/gcc/ipa-profile.cc
+++ b/gcc/ipa-profile.cc
@@ -625,7 +625,7 @@ ipa_propagate_frequency_1 (struct cgraph_node *node, void *data)
return edge != NULL;
}
-/* Return ture if NODE contains hot calls. */
+/* Return true if NODE contains hot calls. */
bool
contains_hot_call_p (struct cgraph_node *node)
diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
index 84d4fb5..bf52ffe 100644
--- a/gcc/ipa-prop.cc
+++ b/gcc/ipa-prop.cc
@@ -130,7 +130,7 @@ struct ipa_cst_ref_desc
/* Linked list of duplicates created when call graph edges are cloned. */
struct ipa_cst_ref_desc *next_duplicate;
/* Number of references in IPA structures, IPA_UNDESCRIBED_USE if the value
- if out of control. */
+ is out of control. */
int refcount;
};
diff --git a/gcc/libgdiagnostics.cc b/gcc/libgdiagnostics.cc
index cceddff..6b269a1 100644
--- a/gcc/libgdiagnostics.cc
+++ b/gcc/libgdiagnostics.cc
@@ -2481,9 +2481,10 @@ struct spec_context : public diagnostics::output_spec::context
{
public:
spec_context (const char *option_name,
+ const char *unparsed_spec,
diagnostic_manager &affected_mgr,
diagnostic_manager &control_mgr)
- : context (option_name, affected_mgr.get_line_table ()),
+ : context (option_name, unparsed_spec, affected_mgr.get_line_table ()),
m_control_mgr (control_mgr)
{}
@@ -2519,8 +2520,8 @@ diagnostic_manager_add_sink_from_spec (diagnostic_manager *affected_mgr,
FAIL_IF_NULL (spec);
FAIL_IF_NULL (control_mgr);
- spec_context ctxt (option_name, *affected_mgr, *control_mgr);
- auto inner_sink = ctxt.parse_and_make_sink (spec, affected_mgr->get_dc ());
+ spec_context ctxt (option_name, spec, *affected_mgr, *control_mgr);
+ auto inner_sink = ctxt.parse_and_make_sink (affected_mgr->get_dc ());
if (!inner_sink)
return -1;
affected_mgr->get_dc ().add_sink (std::move (inner_sink));
diff --git a/gcc/multiple_target.cc b/gcc/multiple_target.cc
index e85d7e7..02353d9 100644
--- a/gcc/multiple_target.cc
+++ b/gcc/multiple_target.cc
@@ -423,61 +423,100 @@ expand_target_clones (struct cgraph_node *node, bool definition)
return true;
}
-/* When NODE is a target clone, consider all callees and redirect
- to a clone with equal target attributes. That prevents multiple
- multi-versioning dispatches and a call-chain can be optimized.
-
- This optimisation might pick the wrong version in some cases, since knowing
- that we meet the target requirements for a matching callee version does not
- tell us that we won't also meet the target requirements for a higher
- priority callee version at runtime. Since this is longstanding behaviour
- for x86 and powerpc, we preserve it for those targets, but skip the optimisation
- for targets that use the "target_version" attribute for multi-versioning. */
+/* When NODE is part of an FMV function set, consider all callees and check if
+ any can provably always resolve a certain version and then call that version
+ directly. */
static void
redirect_to_specific_clone (cgraph_node *node)
{
- cgraph_function_version_info *fv = node->function_version ();
- if (fv == NULL)
- return;
-
- gcc_assert (TARGET_HAS_FMV_TARGET_ATTRIBUTE);
- tree attr_target = lookup_attribute ("target", DECL_ATTRIBUTES (node->decl));
- if (attr_target == NULL_TREE)
+ if (!targetm.compare_version_priority || !optimize)
return;
/* We need to remember NEXT_CALLER as it could be modified in the loop. */
for (cgraph_edge *e = node->callees; e ; e = e->next_callee)
{
- cgraph_function_version_info *fv2 = e->callee->function_version ();
- if (!fv2)
+ /* Only if this is a call to a dispatched symbol. */
+ if (!e->callee->dispatcher_function)
continue;
- tree attr_target2 = lookup_attribute ("target",
- DECL_ATTRIBUTES (e->callee->decl));
+ cgraph_function_version_info *callee_v
+ = e->callee->function_version ();
+ cgraph_function_version_info *caller_v
+ = e->caller->function_version ();
+
+ gcc_assert (callee_v);
- /* Function is not calling proper target clone. */
- if (attr_target2 == NULL_TREE
- || !attribute_value_equal (attr_target, attr_target2))
+ /* Find the default nodes for both callee and caller (if present). */
+ cgraph_function_version_info *callee_default_v = callee_v->next;
+ cgraph_function_version_info *caller_default_v = caller_v;
+ if (caller_v)
{
- while (fv2->prev != NULL)
- fv2 = fv2->prev;
+ while (caller_default_v->prev)
+ caller_default_v = caller_default_v->prev;
+ if (!is_function_default_version (caller_default_v->this_node->decl))
+ caller_default_v = NULL;
+ }
+
+ /* If this is not the TU that contains the definition of the default
+ version we are not guaranteed to have visibility of all versions
+ so cannot reason about them. */
+ if (!callee_default_v
+ || !callee_default_v->this_node->binds_to_current_def_p ())
+ continue;
+
+ cgraph_function_version_info *highest_callable_fn = NULL;
+ for (cgraph_function_version_info *ver = callee_v->next;
+ ver;
+ ver = ver->next)
+ if (targetm.target_option.functions_b_resolvable_from_a
+ (node->decl, ver->this_node->decl, node->decl))
+ highest_callable_fn = ver;
- /* Try to find a clone with equal target attribute. */
- for (; fv2 != NULL; fv2 = fv2->next)
+ if (!highest_callable_fn)
+ continue;
+
+ bool inlinable = true;
+
+ /* If there are higher priority versions of callee and caller has no
+ more version information, then not callable. */
+ if (highest_callable_fn->next)
+ {
+ /* If this is not the TU where the callee default is defined then
+ cannot reason about the caller versions. */
+ if (!caller_default_v
+ || !caller_default_v->this_node->binds_to_current_def_p ())
+ continue;
+
+ /* If every higher priority version would imply a higher priority
+ version of caller would have been selected, then this is
+ callable. */
+ for (cgraph_function_version_info *callee_ver
+ = highest_callable_fn->next;
+ callee_ver; callee_ver = callee_ver->next)
{
- cgraph_node *callee = fv2->this_node;
- attr_target2 = lookup_attribute ("target",
- DECL_ATTRIBUTES (callee->decl));
- if (attr_target2 != NULL_TREE
- && attribute_value_equal (attr_target, attr_target2))
+ bool is_possible = true;
+ for (cgraph_function_version_info *caller_ver = caller_v->next;
+ caller_ver; caller_ver = caller_ver->next)
+ if (targetm.target_option.functions_b_resolvable_from_a
+ (callee_ver->this_node->decl, caller_ver->this_node->decl,
+ node->decl))
+ {
+ is_possible = false;
+ break;
+ }
+ if (is_possible)
{
- e->redirect_callee (callee);
- cgraph_edge::redirect_call_stmt_to_callee (e);
+ inlinable = false;
break;
}
}
}
+ if (inlinable)
+ {
+ e->redirect_callee (highest_callable_fn->this_node);
+ cgraph_edge::redirect_call_stmt_to_callee (e);
+ }
}
}
@@ -566,9 +605,8 @@ ipa_target_clone (bool early)
for (unsigned i = 0; i < to_dispatch.length (); i++)
create_dispatcher_calls (to_dispatch[i]);
- if (TARGET_HAS_FMV_TARGET_ATTRIBUTE)
- FOR_EACH_FUNCTION (node)
- redirect_to_specific_clone (node);
+ FOR_EACH_FUNCTION (node)
+ redirect_to_specific_clone (node);
return 0;
}
diff --git a/gcc/opts-diagnostic.cc b/gcc/opts-diagnostic.cc
index 0e0296a..6f459ec 100644
--- a/gcc/opts-diagnostic.cc
+++ b/gcc/opts-diagnostic.cc
@@ -47,12 +47,14 @@ public:
diagnostics::context &dc,
line_maps *location_mgr,
location_t loc,
- const char *option_name)
+ const char *option_name,
+ const char *option_value)
: dc_spec_context (dc,
location_mgr,
location_mgr,
loc,
- option_name),
+ option_name,
+ option_value),
m_opts (opts)
{}
@@ -72,17 +74,17 @@ public:
void
handle_OPT_fdiagnostics_add_output_ (const gcc_options &opts,
diagnostics::context &dc,
- const char *arg,
+ const char *unparsed_spec,
location_t loc)
{
- gcc_assert (arg);
+ gcc_assert (unparsed_spec);
gcc_assert (line_table);
const char *const option_name = "-fdiagnostics-add-output=";
DIAGNOSTICS_LOG_SCOPE_PRINTF2 (dc.get_logger (),
- "handling: %s%s", option_name, arg);
- opt_spec_context ctxt (opts, dc, line_table, loc, option_name);
- auto sink = ctxt.parse_and_make_sink (arg, dc);
+ "handling: %s%s", option_name, unparsed_spec);
+ opt_spec_context ctxt (opts, dc, line_table, loc, option_name, unparsed_spec);
+ auto sink = ctxt.parse_and_make_sink (dc);
if (!sink)
return;
@@ -93,17 +95,17 @@ handle_OPT_fdiagnostics_add_output_ (const gcc_options &opts,
void
handle_OPT_fdiagnostics_set_output_ (const gcc_options &opts,
diagnostics::context &dc,
- const char *arg,
+ const char *unparsed_spec,
location_t loc)
{
- gcc_assert (arg);
+ gcc_assert (unparsed_spec);
gcc_assert (line_table);
const char *const option_name = "-fdiagnostics-set-output=";
DIAGNOSTICS_LOG_SCOPE_PRINTF2 (dc.get_logger (),
- "handling: %s%s", option_name, arg);
- opt_spec_context ctxt (opts, dc, line_table, loc, option_name);
- auto sink = ctxt.parse_and_make_sink (arg, dc);
+ "handling: %s%s", option_name, unparsed_spec);
+ opt_spec_context ctxt (opts, dc, line_table, loc, option_name, unparsed_spec);
+ auto sink = ctxt.parse_and_make_sink (dc);
if (!sink)
return;
diff --git a/gcc/target.def b/gcc/target.def
index b6f95f3..3e58dcf 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -6934,6 +6934,28 @@ DEFHOOK
bool, (string_slice fn1, string_slice fn2),
hook_stringslice_stringslice_unreachable)
+/* Checks if we can be certain that function DECL_A could resolve DECL_B. */
+DEFHOOK
+(functions_b_resolvable_from_a,
+ "@var{decl_b} is a function declaration with a function multi-versioning\n\
+(FMV) attribute; this attribute is either @code{target} or\n\
+@code{target_version}, depending on @code{TARGET_HAS_FMV_TARGET_ATTRIBUTE}.\n\
+@var{decl_a} is a function declaration that may or may not have an FMV\n\
+attribute.\n\
+\n\
+Return true if we have enough information to determine that the\n\
+requirements of @var{decl_b}'s FMV attribute are met whenever @var{decl_a}\n\
+is executed, given that the target supports all features required by\n\
+function declaration @var{base}.\n\
+\n\
+The default implementation just checks whether @var{decl_a} has the same\n\
+FMV attribute as @var{decl_b}. This is conservatively correct,\n\
+but ports can do better by taking the relationships between architecture\n\
+features into account. For example, on AArch64, @code{sve} is present\n\
+whenever @code{sve2} is present.",
+ bool, (tree decl_a, tree decl_v, tree base),
+ functions_b_resolvable_from_a)
+
/* Function to determine if one function can inline another function. */
#undef HOOK_PREFIX
#define HOOK_PREFIX "TARGET_"
diff --git a/gcc/testsuite/g++.target/aarch64/fmv-selection1.C b/gcc/testsuite/g++.target/aarch64/fmv-selection1.C
new file mode 100644
index 0000000..4ee5446
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/fmv-selection1.C
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O2 -march=armv8-a" } */
+
+__attribute__((target_version("default")))
+__attribute__((optimize("O0")))
+int foo ()
+{
+ return 1;
+}
+
+__attribute__((target_version("rng")))
+__attribute__((optimize("O0")))
+int foo ()
+{
+ return 2;
+}
+
+__attribute__((target_version("flagm")))
+__attribute__((optimize("O0")))
+int foo ()
+{
+ return 3;
+}
+
+__attribute__((target_version("rng+flagm")))
+__attribute__((optimize("O0")))
+int foo ()
+{
+ return 4;
+}
+
+int bar()
+{
+ return foo ();
+}
+
+/* Cannot optimize */
+/* { dg-final { scan-assembler-times "\n\tb\t_Z3foov\n" 1 } } */
+
diff --git a/gcc/testsuite/g++.target/aarch64/fmv-selection2.C b/gcc/testsuite/g++.target/aarch64/fmv-selection2.C
new file mode 100644
index 0000000..f580dac
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/fmv-selection2.C
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O2 -march=armv8-a+rng+flagm" } */
+
+__attribute__((target_version("default")))
+__attribute__((optimize("O0")))
+int foo ()
+{
+ return 1;
+}
+
+__attribute__((target_version("rng")))
+__attribute__((optimize("O0")))
+int foo ()
+{
+ return 2;
+}
+
+__attribute__((target_version("flagm")))
+__attribute__((optimize("O0")))
+int foo ()
+{
+ return 3;
+}
+
+__attribute__((target_version("rng+flagm")))
+__attribute__((optimize("O0")))
+int foo ()
+{
+ return 4;
+}
+
+int bar()
+{
+ return foo ();
+}
+
+/* Can optimize to highest priority function */
+/* { dg-final { scan-assembler-times "\n\tb\t_Z3foov\._MrngMflagm\n" 1 } } */
+
diff --git a/gcc/testsuite/g++.target/aarch64/fmv-selection3.C b/gcc/testsuite/g++.target/aarch64/fmv-selection3.C
new file mode 100644
index 0000000..6b52fd4
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/fmv-selection3.C
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O2 -march=armv8-a" } */
+
+__attribute__((target_version("default")))
+__attribute__((optimize("O0")))
+int foo ()
+{ return 1; }
+
+__attribute__((target_version("rng")))
+int foo ();
+__attribute__((target_version("flagm")))
+int foo ();
+__attribute__((target_version("rng+flagm")))
+int foo ();
+
+__attribute__((target_version("rng+flagm")))
+int bar()
+{
+ return foo ();
+}
+
+/* Cannot optimize */
+/* { dg-final { scan-assembler-times "\n\tb\t_Z3foov\._MrngMflagm\n" 1 } } */
+
diff --git a/gcc/testsuite/g++.target/aarch64/fmv-selection4.C b/gcc/testsuite/g++.target/aarch64/fmv-selection4.C
new file mode 100644
index 0000000..155145d
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/fmv-selection4.C
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O2 -march=armv8-a" } */
+
+__attribute__((target_version("default")))
+__attribute__((optimize("O0")))
+int foo ()
+{ return 1; }
+
+__attribute__((target_version("rng")))
+int foo ();
+__attribute__((target_version("flagm")))
+int foo ();
+__attribute__((target_version("rng+flagm")))
+int foo ();
+
+__attribute__((target_version("default")))
+int bar()
+{
+ return foo ();
+}
+
+__attribute__((target_version("rng")))
+int bar();
+
+__attribute__((target_version("flagm")))
+int bar();
+
+/* { dg-final { scan-assembler-times "\n\tb\t_Z3foov\.default\n" 1 } } */
+
diff --git a/gcc/testsuite/g++.target/aarch64/fmv-selection5.C b/gcc/testsuite/g++.target/aarch64/fmv-selection5.C
new file mode 100644
index 0000000..4d6d38e
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/fmv-selection5.C
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O2 -march=armv8-a" } */
+
+__attribute__((target_version("default")))
+__attribute__((optimize("O0")))
+int foo ()
+{ return 1; }
+
+__attribute__((target_version("rng")))
+int foo ();
+__attribute__((target_version("flagm")))
+int foo ();
+__attribute__((target_version("rng+flagm")))
+int foo ();
+
+__attribute__((target_version("default")))
+int bar()
+{
+ return foo ();
+}
+
+__attribute__((target_version("flagm")))
+int bar();
+
+/* { dg-final { scan-assembler-times "\n\tb\t_Z3foov\.default\n" 0 } } */
+/* { dg-final { scan-assembler-times "\n\tb\t_Z3foov\n" 1 } } */
+
diff --git a/gcc/testsuite/g++.target/aarch64/fmv-selection6.C b/gcc/testsuite/g++.target/aarch64/fmv-selection6.C
new file mode 100644
index 0000000..db384e1
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/fmv-selection6.C
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O2 -march=armv8-a+rng" } */
+
+__attribute__((target_version("default")))
+__attribute__((optimize("O0")))
+int foo ()
+{ return 1; }
+
+__attribute__((target_version("rng")))
+int foo ();
+__attribute__((target_version("flagm")))
+int foo ();
+__attribute__((target_version("rng+flagm")))
+int foo ();
+
+__attribute__((target_version("default")))
+int bar()
+{
+ return foo ();
+}
+
+__attribute__((target_version("flagm")))
+int bar();
+
+/* { dg-final { scan-assembler-times "\n\tb\t_Z3foov\._Mrng\n" 1 } } */
+
diff --git a/gcc/testsuite/g++.target/aarch64/fmv-selection7.C b/gcc/testsuite/g++.target/aarch64/fmv-selection7.C
new file mode 100644
index 0000000..41e7462
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/fmv-selection7.C
@@ -0,0 +1,65 @@
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O2 -march=armv8-a" } */
+
+[[gnu::optimize("O0")]]
+[[gnu::target_version ("default")]]
+int bar () {
+ return 1;
+}
+
+[[gnu::optimize("O0")]]
+[[gnu::target ("+sve2")]]
+[[gnu::target_version ("sve")]]
+int bar ();
+
+[[gnu::target ("+sve")]]
+int foo () {
+ return bar();
+}
+
+/* { dg-final { scan-assembler-times "\n\tb\t_Z3barv\._Msve\n" 1 } } */
+
+[[gnu::target_version ("default")]]
+int bar2 () {
+ return 1;
+}
+
+[[gnu::target_version ("sve2")]]
+int bar2 ();
+
+[[gnu::target_version ("default")]]
+int foo2 ();
+
+[[gnu::target_version ("sve")]]
+[[gnu::target ("+sve2")]]
+int foo2 () {
+ return bar2();
+}
+
+/* { dg-final { scan-assembler-times "\n\tb\t_Z4bar2v\._Msve2\n" 1 } } */
+
+[[gnu::target_version ("default")]]
+int bar3 () {
+ return 1;
+}
+
+[[gnu::target_version ("sve")]]
+int bar3 ();
+
+[[gnu::target ("+rng")]]
+[[gnu::target_version ("sve2")]]
+int bar3 ();
+
+[[gnu::target_version ("default")]]
+int foo3 ();
+
+[[gnu::target_version ("sve")]]
+int foo3 () {
+ return bar3 ();
+}
+
+[[gnu::target_version ("sve2+rng")]]
+int foo3 ();
+
+/* { dg-final { scan-assembler-times "\n\tb\t_Z4bar3v\n" 1 } } */
diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s1244.c b/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s1244.c
index 94a3041..3b76bb3 100644
--- a/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s1244.c
+++ b/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s1244.c
@@ -9,7 +9,7 @@
real_t s1244(struct args_t * func_args)
{
// node splitting
-// cycle with ture and anti dependency
+// cycle with true and anti dependency
initialise_arrays(__func__);
diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s2244.c b/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s2244.c
index 9b0ca74..277ebb8 100644
--- a/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s2244.c
+++ b/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s2244.c
@@ -9,7 +9,7 @@
real_t s2244(struct args_t * func_args)
{
// node splitting
-// cycle with ture and anti dependency
+// cycle with true and anti dependency
initialise_arrays(__func__);
diff --git a/gcc/testsuite/lib/sarif.py b/gcc/testsuite/lib/sarif.py
index d75a87e..f0b3ddd 100644
--- a/gcc/testsuite/lib/sarif.py
+++ b/gcc/testsuite/lib/sarif.py
@@ -1,6 +1,5 @@
import json
import os
-import xml.etree.ElementTree as ET
def sarif_from_env():
# return parsed JSON content a SARIF_PATH file
diff --git a/gcc/tree-if-conv.cc b/gcc/tree-if-conv.cc
index e96c89e..0bb3de9 100644
--- a/gcc/tree-if-conv.cc
+++ b/gcc/tree-if-conv.cc
@@ -3444,7 +3444,7 @@ version_loop_for_if_conversion (class loop *loop, vec<gimple *> *preds)
}
initialize_original_copy_tables ();
- /* At this point we invalidate porfile confistency until IFN_LOOP_VECTORIZED
+ /* At this point we invalidate profile consistency until IFN_LOOP_VECTORIZED
is re-merged in the vectorizer. */
new_loop = loop_version (loop, cond, &cond_bb,
profile_probability::always (),
diff --git a/gcc/tree-ssa-alias.cc b/gcc/tree-ssa-alias.cc
index 9b028e0..76aac6f 100644
--- a/gcc/tree-ssa-alias.cc
+++ b/gcc/tree-ssa-alias.cc
@@ -4167,7 +4167,7 @@ attr_fnspec::verify ()
}
}
-/* Return ture if TYPE1 and TYPE2 will always give the same answer
+/* Return true if TYPE1 and TYPE2 will always give the same answer
when compared with other types using same_type_for_tbaa. */
static bool
@@ -4191,7 +4191,7 @@ types_equal_for_same_type_for_tbaa_p (tree type1, tree type2,
return TYPE_CANONICAL (type1) == TYPE_CANONICAL (type2);
}
-/* Return ture if TYPE1 and TYPE2 will always give the same answer
+/* Return true if TYPE1 and TYPE2 will always give the same answer
when compared with other types using same_type_for_tbaa. */
bool
diff --git a/gcc/tree.h b/gcc/tree.h
index b1d1434..4c8ad98 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5960,7 +5960,7 @@ tree_code_for_canonical_type_merging (enum tree_code code)
return code;
}
-/* Return ture if get_alias_set care about TYPE_CANONICAL of given type.
+/* Return true if get_alias_set care about TYPE_CANONICAL of given type.
We don't define the types for pointers, arrays and vectors. The reason is
that pointers are handled specially: ptr_type_node accesses conflict with
accesses to all other pointers. This is done by alias.cc.
diff --git a/libstdc++-v3/include/std/inplace_vector b/libstdc++-v3/include/std/inplace_vector
index 91ceace..7aa6f9d 100644
--- a/libstdc++-v3/include/std/inplace_vector
+++ b/libstdc++-v3/include/std/inplace_vector
@@ -823,6 +823,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__detail::__synth3way);
}
+ // [inplace.vector.special], specialized algorithms
constexpr friend void
swap(inplace_vector& __x, inplace_vector& __y)
noexcept(is_nothrow_swappable_v<_Tp> && is_nothrow_move_constructible_v<_Tp>)
@@ -907,13 +908,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
};
- // [inplace.vector.special], specialized algorithms
- template<typename _Tp, size_t _Nm>
- constexpr void
- swap(inplace_vector<_Tp, _Nm>& __x, inplace_vector<_Tp, _Nm>& __y)
- noexcept(noexcept(__x.swap(__y)))
- { __x.swap(__y); }
-
// specialization for zero capacity, that is required to be trivally copyable
// and empty regardless of _Tp.
template<typename _Tp>
@@ -992,6 +986,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
if (__il.size() != 0)
__throw_bad_alloc();
+ return *this;
}
template<__any_input_iterator _InputIterator>