From c25568b38e8917a0a1400a4e66a78468d539cb67 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Feb 22 2023 15:01:36 +0000 Subject: Update to latest sparse git tree HEAD Signed-off-by: Jeff Layton --- diff --git a/.gitignore b/.gitignore index 5bf0508..07a09ec 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ sparse-0.4.2.tar.bz2 /sparse-0.6.3.tar.xz /sparse-0.6.4-rc1.tar.xz /sparse-0.6.4.tar.xz +/sparse-0.6.4-gce1a6720f69e.tar.xz diff --git a/0001-fix-unreplaced-warnings-caused-by-using-typeof-on-in.patch b/0001-fix-unreplaced-warnings-caused-by-using-typeof-on-in.patch deleted file mode 100644 index 51ac1ab..0000000 --- a/0001-fix-unreplaced-warnings-caused-by-using-typeof-on-in.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 0e1aae55e49cad7ea43848af5b58ff0f57e7af99 Mon Sep 17 00:00:00 2001 -From: Luc Van Oostenryck -Date: Thu, 23 Jun 2022 23:44:44 +0200 -Subject: [PATCH] fix "unreplaced" warnings caused by using typeof() on inline - functions - -Currently, sparse do all its inlining at the tree level, during -constant expansion. To not mix-up the evaluation of the original -function body in case the address of an inline function is taken or -when the function can't otherwise be inlined, the statements and -symbols lists of inline functions are kept in separated fields. -Then, if the original body must be evaluated it must first be -'uninlined' to have a copy in the usual fields. - -This make sense when dealing with the definition of the function. -But, when using typeof() on functions, the resulting type doesn't -refer to this definition, it's just a copy of the type and only -of the type. There shouldn't be any reasons to uninline anything. -However, the distinction between 'full function' and 'type only' -is not made during evaluation and the uninlining attempt produce -a lot of "warning: unreplaced symbol '...'" because of the lack -of a corresponding definition. - -Fix this by not doing the uninlining if the symbol lack a definition. - -Note: It would maybe be more appropriate for EXPR_TYPE to use - a stripped-own version of evaluate_symbol() doing only the - examination of the return and argument types, bypassing the - attempt to uninline the body and evaluate the initializer and - the statements since there is none of those for an EXPR_TYPE. - -Link: https://lore.kernel.org/all/202206191726.wq70mbMK-lkp@intel.com -Reported-by: kernel test robot -Signed-off-by: Luc Van Oostenryck ---- - evaluate.c | 2 +- - validation/inline-early/unreplaced-abstract.c | 28 +++++++++++++++++++ - validation/optim/devirtualize0.c | 17 +++++++++++ - 3 files changed, 46 insertions(+), 1 deletion(-) - create mode 100644 validation/inline-early/unreplaced-abstract.c - create mode 100644 validation/optim/devirtualize0.c - -diff --git a/evaluate.c b/evaluate.c -index 61f59ee3908e..fe716f631987 100644 ---- a/evaluate.c -+++ b/evaluate.c -@@ -3555,7 +3555,7 @@ static struct symbol *evaluate_symbol(struct symbol *sym) - current_fn = sym; - - examine_fn_arguments(base_type); -- if (!base_type->stmt && base_type->inline_stmt) -+ if (!base_type->stmt && base_type->inline_stmt && sym->definition) - uninline(sym); - if (base_type->stmt) - evaluate_statement(base_type->stmt); -diff --git a/validation/inline-early/unreplaced-abstract.c b/validation/inline-early/unreplaced-abstract.c -new file mode 100644 -index 000000000000..e38cd6681f14 ---- /dev/null -+++ b/validation/inline-early/unreplaced-abstract.c -@@ -0,0 +1,28 @@ -+static inline void f0(void) { } -+static inline long f1(long a) { return a + 1;} -+ -+_Static_assert([typeof(f0)] != [typeof(f1)]); -+ -+ -+static inline void g0(void) { } -+static inline long g1(long a) { return a + 1;} -+ -+extern long goo(long a); -+long goo(long a) -+{ -+ g0(); -+ return g1(a); -+} -+ -+_Static_assert([typeof(g0)] != [typeof(g1)]); -+ -+extern long moo(long a); -+long moo(long a) -+{ -+ typeof(f1) *f = g1; -+ return f(a); -+} -+ -+/* -+ * check-name: unreplaced-abstract -+ */ -diff --git a/validation/optim/devirtualize0.c b/validation/optim/devirtualize0.c -new file mode 100644 -index 000000000000..7079e79072fe ---- /dev/null -+++ b/validation/optim/devirtualize0.c -@@ -0,0 +1,17 @@ -+static inline long f1(long x) { return x + 1;} -+ -+extern long foo(long a); -+long foo(long a) -+{ -+ typeof(f1) *f = f1; -+ return f(a); -+} -+ -+/* -+ * check-name: devirtualize0 -+ * check-command: test-linearize -Wno-decl $file -+ * check-known-to-fail -+ * -+ * check-output-ignore -+ * check-output-excludes: call\\. -+ */ --- -2.37.1 - diff --git a/sources b/sources index f0a3202..4b1b152 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sparse-0.6.4.tar.xz) = 4ada31e588469d15862579dd7eb926ce1ad717bf96d38d425b9153f2efe73949fdda5bc59d05d926614a08d70e656e4ff531a5f0a1cf8e7725c596dcdba169f9 +SHA512 (sparse-0.6.4-gce1a6720f69e.tar.xz) = d9b5aa0f1bb3ff212429415d82de130cb40aee2aba4bf769bfd5a63e6c78fc762d64f43f8b15ba064a369de4ca2ffac3fb8fd1e4245334e74d8ca4be975cf6e6 diff --git a/sparse.spec b/sparse.spec index 47f7eb7..784b86f 100644 --- a/sparse.spec +++ b/sparse.spec @@ -3,7 +3,7 @@ Name: sparse Version: 0.6.4 # either a rc? or %\{nil\} -%define rcver %{nil} +%define rcver gce1a6720f69e %if "x%{?rcver}" != "x" %define build_ver %{version}-%{rcver} @@ -13,7 +13,7 @@ Version: 0.6.4 %define dotrc %{nil} %endif -Release: 3%{dotrc}%{?dist}.1 +Release: 4%{dotrc}%{?dist} Summary: A semantic parser of source files License: MIT URL: https://sparse.wiki.kernel.org @@ -24,8 +24,6 @@ BuildRequires: sqlite-devel Source0: https://www.kernel.org/pub/software/devel/sparse/dist/sparse-%{build_ver}.tar.xz -Patch0: 0001-fix-unreplaced-warnings-caused-by-using-typeof-on-in.patch - %description Sparse is a semantic parser of source files: it's neither a compiler (although it could be used as a front-end for one) nor is it a @@ -76,6 +74,9 @@ make clean %{_mandir}/man1/* %changelog +* Wed Feb 22 2023 Jeff Layton - 0.6.4-4.gce1a6720f69e +- Update to latest sparse git (commit ce1a6720f69e) + * Sat Jan 21 2023 Fedora Release Engineering - 0.6.4-3.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild