+/* Handle ABI backwards compatibility for past bugs where we didn't call
+ check_abi_tags in places where it's needed: call check_abi_tags and warn if
+ it makes a difference. */
+
+static void
+maybe_check_abi_tags (tree t)
+{
+ tree attr = lookup_attribute ("abi_tag", DECL_ATTRIBUTES (t));
+ tree oldtags = NULL_TREE;
+ if (attr)
+ oldtags = TREE_VALUE (attr);
+
+ check_abi_tags (t);
+
+ if (!attr)
+ attr = lookup_attribute ("abi_tag", DECL_ATTRIBUTES (t));
+ if (attr && TREE_VALUE (attr) != oldtags
+ && abi_version_crosses (10))
+ warning_at (DECL_SOURCE_LOCATION (t), OPT_Wabi,
+ "the mangled name of the initialization guard variable for"
+ "%qD changes between -fabi-version=%d and -fabi-version=%d",
+ t, flag_abi_version, warn_abi_version);
+}
+