* cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
@ 2017-01-13 10:40 kbuild test robot
2017-01-13 15:40 ` [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Arnd Bergmann
0 siblings, 1 reply; 14+ messages in thread
From: kbuild test robot @ 2017-01-13 10:40 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: kbuild-all, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 3212 bytes --]
Hi Arnd,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 557ed56cc75e0a33c15ba438734a280bac23bd32
commit: a76bcf557ef408b368cf26f52a60865bfc27b632 Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"
date: 9 weeks ago
config: x86_64-randconfig-s1-01131717 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
git checkout a76bcf557ef408b368cf26f52a60865bfc27b632
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_ringbuffer.c: In function 'intel_ring_setup_status_page':
drivers/gpu/drm/i915/intel_ringbuffer.c:438: error: 'mmio.reg' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_csr.c: In function 'parse_csr_fw':
drivers/gpu/drm/i915/intel_csr.c:194: error: 'si' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_csr.c:194: note: 'si' was declared here
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_sprite.c: In function 'intel_check_sprite_plane':
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_x' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_y' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_w' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_h' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_tv.c: In function 'intel_tv_detect':
drivers/gpu/drm/i915/intel_tv.c:1315: error: 'type' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen8_ggtt_insert_entries':
drivers/gpu/drm/i915/i915_gem_gtt.c:2341: error: 'gtt_entry' may be used uninitialized in this function
drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen6_ggtt_insert_entries':
drivers/gpu/drm/i915/i915_gem_gtt.c:2438: error: 'gtt_entry' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem.c: In function 'i915_gem_object_map':
drivers/gpu/drm/i915/i915_gem.c:2382: error: 'pgprot.pgprot' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26465 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized
2017-01-13 10:40 cc1: error: unrecognized command line option "-Wno-maybe-uninitialized" kbuild test robot
@ 2017-01-13 15:40 ` Arnd Bergmann
2017-01-27 16:03 ` Arnd Bergmann
2017-03-14 16:17 ` Masahiro Yamada
0 siblings, 2 replies; 14+ messages in thread
From: Arnd Bergmann @ 2017-01-13 15:40 UTC (permalink / raw)
To: Michal Marek
Cc: linux-kbuild, fengguang.wu, kbuild-all, Arnd Bergmann, stable,
linux-kernel
In commit a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning
for "make W=1""), I reverted another change that happened to fix a problem
with old compilers, and now we get this report again with old compilers
(prior to gcc-4.8) and GCOV enabled:
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_ringbuffer.c: In function 'intel_ring_setup_status_page':
drivers/gpu/drm/i915/intel_ringbuffer.c:438: error: 'mmio.reg' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
The problem is that we turn off the warning conditionally in a number
of places as we should, but one of them does it unconditionally.
Instead, change it to call cc-disable-warning as we do elsewhere.
The original patch that caused it was merged into linux-4.7, then
4.8 removed the change and 4.9 brought it back, so we probably want
a backport to 4.9 once this is merged.
Cc: stable@vger.kernel.org
Fixes: a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"")
Fixes: e72e2dfe7c16 ("gcov: disable -Wmaybe-uninitialized warning")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 4fcc0f2dd93c..dbe9ce5d0e96 100644
--- a/Makefile
+++ b/Makefile
@@ -370,7 +370,7 @@ LDFLAGS_MODULE =
CFLAGS_KERNEL =
AFLAGS_KERNEL =
LDFLAGS_vmlinux =
-CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im -Wno-maybe-uninitialized
+CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,)
--
2.9.0
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized
2017-01-13 15:40 ` [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Arnd Bergmann
@ 2017-01-27 16:03 ` Arnd Bergmann
2017-03-14 16:17 ` Masahiro Yamada
1 sibling, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2017-01-27 16:03 UTC (permalink / raw)
To: Michal Marek
Cc: linux-kbuild, fengguang.wu, kbuild-all, Arnd Bergmann, stable,
Linux Kernel Mailing List, Andrew Morton
On Fri, Jan 13, 2017 at 4:40 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> In commit a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning
> for "make W=1""), I reverted another change that happened to fix a problem
> with old compilers, and now we get this report again with old compilers
> (prior to gcc-4.8) and GCOV enabled:
>
> cc1: warnings being treated as errors
> drivers/gpu/drm/i915/intel_ringbuffer.c: In function 'intel_ring_setup_status_page':
> drivers/gpu/drm/i915/intel_ringbuffer.c:438: error: 'mmio.reg' may be used uninitialized in this function
> At top level:
>>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
>
> The problem is that we turn off the warning conditionally in a number
> of places as we should, but one of them does it unconditionally.
> Instead, change it to call cc-disable-warning as we do elsewhere.
>
> The original patch that caused it was merged into linux-4.7, then
> 4.8 removed the change and 4.9 brought it back, so we probably want
> a backport to 4.9 once this is merged.
>
> Cc: stable@vger.kernel.org
> Fixes: a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"")
> Fixes: e72e2dfe7c16 ("gcov: disable -Wmaybe-uninitialized warning")
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Hi Michal,
any plans to pick this up for v4.10?
Arnd
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 4fcc0f2dd93c..dbe9ce5d0e96 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -370,7 +370,7 @@ LDFLAGS_MODULE =
> CFLAGS_KERNEL =
> AFLAGS_KERNEL =
> LDFLAGS_vmlinux =
> -CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im -Wno-maybe-uninitialized
> +CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
> CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,)
>
>
> --
> 2.9.0
>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized
2017-01-13 15:40 ` [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Arnd Bergmann
2017-01-27 16:03 ` Arnd Bergmann
@ 2017-03-14 16:17 ` Masahiro Yamada
2017-03-14 20:52 ` Arnd Bergmann
1 sibling, 1 reply; 14+ messages in thread
From: Masahiro Yamada @ 2017-03-14 16:17 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Michal Marek, Linux Kbuild mailing list, Fengguang Wu,
kbuild-all, stable, Linux Kernel Mailing List
Hi Arnd,
2017-01-14 0:40 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
> In commit a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning
> for "make W=1""), I reverted another change that happened to fix a problem
> with old compilers, and now we get this report again with old compilers
> (prior to gcc-4.8) and GCOV enabled:
>
> cc1: warnings being treated as errors
> drivers/gpu/drm/i915/intel_ringbuffer.c: In function 'intel_ring_setup_status_page':
> drivers/gpu/drm/i915/intel_ringbuffer.c:438: error: 'mmio.reg' may be used uninitialized in this function
> At top level:
>>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
>
> The problem is that we turn off the warning conditionally in a number
> of places as we should, but one of them does it unconditionally.
> Instead, change it to call cc-disable-warning as we do elsewhere.
>
> The original patch that caused it was merged into linux-4.7, then
> 4.8 removed the change and 4.9 brought it back, so we probably want
> a backport to 4.9 once this is merged.
>
> Cc: stable@vger.kernel.org
> Fixes: a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"")
> Fixes: e72e2dfe7c16 ("gcov: disable -Wmaybe-uninitialized warning")
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied to linux-kbuild/fixes.
But, please let me ask one question.
When I was checking your commit a76bcf557ef4,
I noticed the following code:
KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \
$(call cc-disable-warning,maybe-uninitialized,))
It was not clear to me where this comes from
because it is not the revert of Linus' commit.
My best guess is:
maybe-uninitialized was introduced by gcc 4.7,
but only reliable for gcc 4.9 or later.
So it should be disabled for gcc < 4.9
Is this correct?
Thanks!
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized
2017-03-14 16:17 ` Masahiro Yamada
@ 2017-03-14 20:52 ` Arnd Bergmann
2017-03-16 14:23 ` Arnd Bergmann
2017-03-16 17:35 ` Masahiro Yamada
0 siblings, 2 replies; 14+ messages in thread
From: Arnd Bergmann @ 2017-03-14 20:52 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Michal Marek, Linux Kbuild mailing list, Fengguang Wu,
kbuild-all, stable, Linux Kernel Mailing List
On Tue, Mar 14, 2017 at 5:17 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Hi Arnd,
>
> 2017-01-14 0:40 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
>> In commit a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning
>> for "make W=1""), I reverted another change that happened to fix a problem
>> with old compilers, and now we get this report again with old compilers
>> (prior to gcc-4.8) and GCOV enabled:
>>
>> cc1: warnings being treated as errors
>> drivers/gpu/drm/i915/intel_ringbuffer.c: In function 'intel_ring_setup_status_page':
>> drivers/gpu/drm/i915/intel_ringbuffer.c:438: error: 'mmio.reg' may be used uninitialized in this function
>> At top level:
>>>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
>>
>> The problem is that we turn off the warning conditionally in a number
>> of places as we should, but one of them does it unconditionally.
>> Instead, change it to call cc-disable-warning as we do elsewhere.
>>
>> The original patch that caused it was merged into linux-4.7, then
>> 4.8 removed the change and 4.9 brought it back, so we probably want
>> a backport to 4.9 once this is merged.
>>
>> Cc: stable@vger.kernel.org
>> Fixes: a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"")
>> Fixes: e72e2dfe7c16 ("gcov: disable -Wmaybe-uninitialized warning")
>> Reported-by: kbuild test robot <fengguang.wu@intel.com>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
>
> Applied to linux-kbuild/fixes.
Thanks!
> But, please let me ask one question.
>
> When I was checking your commit a76bcf557ef4,
> I noticed the following code:
>
>
> KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \
> $(call cc-disable-warning,maybe-uninitialized,))
>
>
>
> It was not clear to me where this comes from
> because it is not the revert of Linus' commit.
>
>
> My best guess is:
> maybe-uninitialized was introduced by gcc 4.7,
> but only reliable for gcc 4.9 or later.
> So it should be disabled for gcc < 4.9
>
>
> Is this correct?
Yes. Actually this warning is by definition not reliable, but gcc-4.9
got a lot better than earlier versions, and the set of false positives
in 4.9 is different from the one in 4.8, which introduced the flag.
As most people have 4.9 or higher, it makes sense to address all
the warnings found by that version by modifying the code (either
fixing bugs or working around false positives), but to just disable it
for 4.8 and earlier.
In older compiler versions, -Wuninitialized controlled both the
"definitely uninitialized" and the "possibly uninitialized" warnings,
and also had a lot of false positives, but 4.7 and earlier also
prouce lots of other warnings. I try to get a warning free build with
4.8 and higher but don't even try for old versions at the moment,
though I have an idea for how we could do that too.
Arnd
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized
2017-03-14 20:52 ` Arnd Bergmann
@ 2017-03-16 14:23 ` Arnd Bergmann
2017-03-16 14:31 ` [PATCH] kbuild: fix compile time regression Arnd Bergmann
2017-03-16 17:38 ` [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Masahiro Yamada
2017-03-16 17:35 ` Masahiro Yamada
1 sibling, 2 replies; 14+ messages in thread
From: Arnd Bergmann @ 2017-03-16 14:23 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Michal Marek, Linux Kbuild mailing list, Fengguang Wu,
kbuild-all, stable, Linux Kernel Mailing List
On Tue, Mar 14, 2017 at 9:52 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tue, Mar 14, 2017 at 5:17 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>> Hi Arnd,
>>
>> 2017-01-14 0:40 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
>>> In commit a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning
>>> for "make W=1""), I reverted another change that happened to fix a problem
>>> with old compilers, and now we get this report again with old compilers
>>> (prior to gcc-4.8) and GCOV enabled:
>>>
>>> cc1: warnings being treated as errors
>>> drivers/gpu/drm/i915/intel_ringbuffer.c: In function 'intel_ring_setup_status_page':
>>> drivers/gpu/drm/i915/intel_ringbuffer.c:438: error: 'mmio.reg' may be used uninitialized in this function
>>> At top level:
>>>>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
>>>
>>> The problem is that we turn off the warning conditionally in a number
>>> of places as we should, but one of them does it unconditionally.
>>> Instead, change it to call cc-disable-warning as we do elsewhere.
>>>
>>> The original patch that caused it was merged into linux-4.7, then
>>> 4.8 removed the change and 4.9 brought it back, so we probably want
>>> a backport to 4.9 once this is merged.
>>>
>>> Cc: stable@vger.kernel.org
>>> Fixes: a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"")
>>> Fixes: e72e2dfe7c16 ("gcov: disable -Wmaybe-uninitialized warning")
>>> Reported-by: kbuild test robot <fengguang.wu@intel.com>
>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>
>>
>> Applied to linux-kbuild/fixes.
Hmm, after I've carried this patch for months, I now found that it
caused a build
time regression. I'm sending a fix for that too, please either apply the fix
on top, or fold it into the first patch.
Arnd
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH] kbuild: fix compile time regression
2017-03-16 14:23 ` Arnd Bergmann
@ 2017-03-16 14:31 ` Arnd Bergmann
2017-03-16 17:41 ` Masahiro Yamada
2017-03-16 17:38 ` [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Masahiro Yamada
1 sibling, 1 reply; 14+ messages in thread
From: Arnd Bergmann @ 2017-03-16 14:31 UTC (permalink / raw)
To: Masahiro Yamada; +Cc: Michal Marek, Arnd Bergmann, linux-kbuild, linux-kernel
I noticed that a patch I did causes the time for a clean rebuild to
go up significantly, from 13 to 18 seconds on ARM defconfig, and
in the worst case forcing a rebuild of every file each time.
The fix is very simple, using a ':=' assignment instead of '='
to force the cc-disable-warning call to only be evaluated once
instead of every time.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 3a964fa3a787..e7d4d20deb4e 100644
--- a/Makefile
+++ b/Makefile
@@ -381,7 +381,7 @@ LDFLAGS_MODULE =
CFLAGS_KERNEL =
AFLAGS_KERNEL =
LDFLAGS_vmlinux =
-CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
+CFLAGS_GCOV := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,)
ifeq ($(COMPILER),clang)
--
2.9.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] kbuild: fix compile time regression
2017-03-16 14:31 ` [PATCH] kbuild: fix compile time regression Arnd Bergmann
@ 2017-03-16 17:41 ` Masahiro Yamada
0 siblings, 0 replies; 14+ messages in thread
From: Masahiro Yamada @ 2017-03-16 17:41 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Michal Marek, Linux Kbuild mailing list, Linux Kernel Mailing List
2017-03-16 23:31 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
> I noticed that a patch I did causes the time for a clean rebuild to
> go up significantly, from 13 to 18 seconds on ARM defconfig, and
> in the worst case forcing a rebuild of every file each time.
>
> The fix is very simple, using a ':=' assignment instead of '='
> to force the cc-disable-warning call to only be evaluated once
> instead of every time.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 3a964fa3a787..e7d4d20deb4e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -381,7 +381,7 @@ LDFLAGS_MODULE =
> CFLAGS_KERNEL =
> AFLAGS_KERNEL =
> LDFLAGS_vmlinux =
> -CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
> +CFLAGS_GCOV := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
> CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,)
>
> ifeq ($(COMPILER),clang)
> --
Squashed into the first patch.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized
2017-03-16 14:23 ` Arnd Bergmann
2017-03-16 14:31 ` [PATCH] kbuild: fix compile time regression Arnd Bergmann
@ 2017-03-16 17:38 ` Masahiro Yamada
1 sibling, 0 replies; 14+ messages in thread
From: Masahiro Yamada @ 2017-03-16 17:38 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Michal Marek, Linux Kbuild mailing list, Fengguang Wu,
kbuild-all, stable, Linux Kernel Mailing List
Hi Arnd,
2017-03-16 23:23 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
> On Tue, Mar 14, 2017 at 9:52 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Tue, Mar 14, 2017 at 5:17 PM, Masahiro Yamada
>> <yamada.masahiro@socionext.com> wrote:
>>> Hi Arnd,
>>>
>>> 2017-01-14 0:40 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
>>>> In commit a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning
>>>> for "make W=1""), I reverted another change that happened to fix a problem
>>>> with old compilers, and now we get this report again with old compilers
>>>> (prior to gcc-4.8) and GCOV enabled:
>>>>
>>>> cc1: warnings being treated as errors
>>>> drivers/gpu/drm/i915/intel_ringbuffer.c: In function 'intel_ring_setup_status_page':
>>>> drivers/gpu/drm/i915/intel_ringbuffer.c:438: error: 'mmio.reg' may be used uninitialized in this function
>>>> At top level:
>>>>>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
>>>>
>>>> The problem is that we turn off the warning conditionally in a number
>>>> of places as we should, but one of them does it unconditionally.
>>>> Instead, change it to call cc-disable-warning as we do elsewhere.
>>>>
>>>> The original patch that caused it was merged into linux-4.7, then
>>>> 4.8 removed the change and 4.9 brought it back, so we probably want
>>>> a backport to 4.9 once this is merged.
>>>>
>>>> Cc: stable@vger.kernel.org
>>>> Fixes: a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"")
>>>> Fixes: e72e2dfe7c16 ("gcov: disable -Wmaybe-uninitialized warning")
>>>> Reported-by: kbuild test robot <fengguang.wu@intel.com>
>>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>>
>>>
>>> Applied to linux-kbuild/fixes.
>
> Hmm, after I've carried this patch for months, I now found that it
> caused a build
> time regression. I'm sending a fix for that too, please either apply the fix
> on top, or fold it into the first patch.
>
It is good that I had forgot to push my branch.
I will squash the two.
I'd like to combine the two git-log.
The git-log of the squashed one will be like follows.
If you want to edit it more, please let me know. Thanks!
---------------------------------------->8-------------------------------------
build: use cc-disable-warning consistently for maybe-uninitialized
In commit a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning
for "make W=1""), I reverted another change that happened to fix a problem
with old compilers, and now we get this report again with old compilers
(prior to gcc-4.8) and GCOV enabled:
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_ringbuffer.c: In function
'intel_ring_setup_status_page':
drivers/gpu/drm/i915/intel_ringbuffer.c:438: error: 'mmio.reg' may
be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
The problem is that we turn off the warning conditionally in a number
of places as we should, but one of them does it unconditionally.
Instead, change it to call cc-disable-warning as we do elsewhere.
The original patch that caused it was merged into linux-4.7, then
4.8 removed the change and 4.9 brought it back, so we probably want
a backport to 4.9 once this is merged.
Use a ':=' assignment instead of '=' to force the cc-disable-warning
call to only be evaluated once instead of every time.
Cc: stable@vger.kernel.org
Fixes: a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning for
"make W=1"")
Fixes: e72e2dfe7c16 ("gcov: disable -Wmaybe-uninitialized warning")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---------------------------------------->8-------------------------------------
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized
2017-03-14 20:52 ` Arnd Bergmann
2017-03-16 14:23 ` Arnd Bergmann
@ 2017-03-16 17:35 ` Masahiro Yamada
1 sibling, 0 replies; 14+ messages in thread
From: Masahiro Yamada @ 2017-03-16 17:35 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Michal Marek, Linux Kbuild mailing list, Fengguang Wu,
kbuild-all, stable, Linux Kernel Mailing List
Hi Arnd,
2017-03-15 5:52 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
> On Tue, Mar 14, 2017 at 5:17 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>> Hi Arnd,
>>
>> 2017-01-14 0:40 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
>>> In commit a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning
>>> for "make W=1""), I reverted another change that happened to fix a problem
>>> with old compilers, and now we get this report again with old compilers
>>> (prior to gcc-4.8) and GCOV enabled:
>>>
>>> cc1: warnings being treated as errors
>>> drivers/gpu/drm/i915/intel_ringbuffer.c: In function 'intel_ring_setup_status_page':
>>> drivers/gpu/drm/i915/intel_ringbuffer.c:438: error: 'mmio.reg' may be used uninitialized in this function
>>> At top level:
>>>>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
>>>
>>> The problem is that we turn off the warning conditionally in a number
>>> of places as we should, but one of them does it unconditionally.
>>> Instead, change it to call cc-disable-warning as we do elsewhere.
>>>
>>> The original patch that caused it was merged into linux-4.7, then
>>> 4.8 removed the change and 4.9 brought it back, so we probably want
>>> a backport to 4.9 once this is merged.
>>>
>>> Cc: stable@vger.kernel.org
>>> Fixes: a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"")
>>> Fixes: e72e2dfe7c16 ("gcov: disable -Wmaybe-uninitialized warning")
>>> Reported-by: kbuild test robot <fengguang.wu@intel.com>
>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>
>>
>> Applied to linux-kbuild/fixes.
>
> Thanks!
>
>> But, please let me ask one question.
>>
>> When I was checking your commit a76bcf557ef4,
>> I noticed the following code:
>>
>>
>> KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \
>> $(call cc-disable-warning,maybe-uninitialized,))
>>
>>
>>
>> It was not clear to me where this comes from
>> because it is not the revert of Linus' commit.
>>
>>
>> My best guess is:
>> maybe-uninitialized was introduced by gcc 4.7,
>> but only reliable for gcc 4.9 or later.
>> So it should be disabled for gcc < 4.9
>>
>>
>> Is this correct?
>
> Yes. Actually this warning is by definition not reliable, but gcc-4.9
> got a lot better than earlier versions, and the set of false positives
> in 4.9 is different from the one in 4.8, which introduced the flag.
> As most people have 4.9 or higher, it makes sense to address all
> the warnings found by that version by modifying the code (either
> fixing bugs or working around false positives), but to just disable it
> for 4.8 and earlier.
>
> In older compiler versions, -Wuninitialized controlled both the
> "definitely uninitialized" and the "possibly uninitialized" warnings,
> and also had a lot of false positives, but 4.7 and earlier also
> prouce lots of other warnings. I try to get a warning free build with
> 4.8 and higher but don't even try for old versions at the moment,
> though I have an idea for how we could do that too.
>
Thanks for clarification!
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 14+ messages in thread
* cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
@ 2017-02-07 1:43 kbuild test robot
0 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2017-02-07 1:43 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: kbuild-all, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2988 bytes --]
Hi Arnd,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f7d6040aa45df6ffd9e891114125dc919f18b96b
commit: a76bcf557ef408b368cf26f52a60865bfc27b632 Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"
date: 3 months ago
config: x86_64-randconfig-s0-02070724 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
git checkout a76bcf557ef408b368cf26f52a60865bfc27b632
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_sprite.c: In function 'intel_check_sprite_plane':
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_x' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_y' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_w' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_h' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen8_ggtt_insert_entries':
drivers/gpu/drm/i915/i915_gem_gtt.c:2341: error: 'gtt_entry' may be used uninitialized in this function
drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen6_ggtt_insert_entries':
drivers/gpu/drm/i915/i915_gem_gtt.c:2438: error: 'gtt_entry' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem.c: In function 'i915_gem_object_map':
drivers/gpu/drm/i915/i915_gem.c:2382: error: 'pgprot.pgprot' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem_render_state.c: In function 'i915_gem_render_state_init':
drivers/gpu/drm/i915/i915_gem_render_state.c:176: error: 'so.aux_batch_offset' may be used uninitialized in this function
drivers/gpu/drm/i915/i915_gem_render_state.c:176: error: 'so.aux_batch_size' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_tv.c: In function 'intel_tv_detect':
drivers/gpu/drm/i915/intel_tv.c:1315: error: 'type' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30141 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread* cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
@ 2017-01-27 15:39 kbuild test robot
0 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2017-01-27 15:39 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: kbuild-all, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2988 bytes --]
Hi Arnd,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fd694aaa46c7ed811b72eb47d5eb11ce7ab3f7f1
commit: a76bcf557ef408b368cf26f52a60865bfc27b632 Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"
date: 3 months ago
config: x86_64-randconfig-b0-01272236 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
git checkout a76bcf557ef408b368cf26f52a60865bfc27b632
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen8_ggtt_insert_entries':
drivers/gpu/drm/i915/i915_gem_gtt.c:2341: error: 'gtt_entry' may be used uninitialized in this function
drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen6_ggtt_insert_entries':
drivers/gpu/drm/i915/i915_gem_gtt.c:2438: error: 'gtt_entry' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem.c: In function 'i915_gem_object_map':
drivers/gpu/drm/i915/i915_gem.c:2382: error: 'pgprot.pgprot' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem_render_state.c: In function 'i915_gem_render_state_init':
drivers/gpu/drm/i915/i915_gem_render_state.c:176: error: 'so.aux_batch_offset' may be used uninitialized in this function
drivers/gpu/drm/i915/i915_gem_render_state.c:176: error: 'so.aux_batch_size' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_sprite.c: In function 'intel_check_sprite_plane':
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_x' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_y' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_w' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_h' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_tv.c: In function 'intel_tv_detect':
drivers/gpu/drm/i915/intel_tv.c:1315: error: 'type' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26098 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread* cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
@ 2016-12-27 6:55 kbuild test robot
0 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2016-12-27 6:55 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: kbuild-all, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1920 bytes --]
Hi Arnd,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0dad3a3014a0b9e72521ff44f17e0054f43dcdea
commit: a76bcf557ef408b368cf26f52a60865bfc27b632 Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"
date: 7 weeks ago
config: x86_64-randconfig-s0-12271426 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
git checkout a76bcf557ef408b368cf26f52a60865bfc27b632
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen8_ggtt_insert_entries':
drivers/gpu/drm/i915/i915_gem_gtt.c:2341: error: 'gtt_entry' may be used uninitialized in this function
drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen6_ggtt_insert_entries':
drivers/gpu/drm/i915/i915_gem_gtt.c:2438: error: 'gtt_entry' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem.c: In function 'i915_gem_object_map':
drivers/gpu/drm/i915/i915_gem.c:2382: error: 'pgprot.pgprot' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_ringbuffer.c: In function 'intel_ring_setup_status_page':
drivers/gpu/drm/i915/intel_ringbuffer.c:438: error: 'mmio.reg' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26136 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread* cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
@ 2016-12-04 12:38 kbuild test robot
0 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2016-12-04 12:38 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: kbuild-all, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2938 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0cb65c83304a341b9d09678448d7c8b550689531
commit: a76bcf557ef408b368cf26f52a60865bfc27b632 Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"
date: 3 weeks ago
config: x86_64-randconfig-s2-12042007 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
git checkout a76bcf557ef408b368cf26f52a60865bfc27b632
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen8_ggtt_insert_entries':
drivers/gpu/drm/i915/i915_gem_gtt.c:2341: error: 'gtt_entry' may be used uninitialized in this function
drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen6_ggtt_insert_entries':
drivers/gpu/drm/i915/i915_gem_gtt.c:2438: error: 'gtt_entry' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem.c: In function 'i915_gem_object_map':
drivers/gpu/drm/i915/i915_gem.c:2382: error: 'pgprot.pgprot' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/i915_gem_render_state.c: In function 'i915_gem_render_state_init':
drivers/gpu/drm/i915/i915_gem_render_state.c:176: error: 'so.aux_batch_offset' may be used uninitialized in this function
drivers/gpu/drm/i915/i915_gem_render_state.c:176: error: 'so.aux_batch_size' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_sprite.c: In function 'intel_check_sprite_plane':
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_x' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_y' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_w' may be used uninitialized in this function
drivers/gpu/drm/i915/intel_sprite.c:763: error: 'src_h' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
--
cc1: warnings being treated as errors
drivers/gpu/drm/i915/intel_tv.c: In function 'intel_tv_detect':
drivers/gpu/drm/i915/intel_tv.c:1315: error: 'type' may be used uninitialized in this function
At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 23670 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2017-03-16 17:42 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-13 10:40 cc1: error: unrecognized command line option "-Wno-maybe-uninitialized" kbuild test robot
2017-01-13 15:40 ` [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Arnd Bergmann
2017-01-27 16:03 ` Arnd Bergmann
2017-03-14 16:17 ` Masahiro Yamada
2017-03-14 20:52 ` Arnd Bergmann
2017-03-16 14:23 ` Arnd Bergmann
2017-03-16 14:31 ` [PATCH] kbuild: fix compile time regression Arnd Bergmann
2017-03-16 17:41 ` Masahiro Yamada
2017-03-16 17:38 ` [PATCH] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Masahiro Yamada
2017-03-16 17:35 ` Masahiro Yamada
-- strict thread matches above, loose matches on Subject: below --
2017-02-07 1:43 cc1: error: unrecognized command line option "-Wno-maybe-uninitialized" kbuild test robot
2017-01-27 15:39 kbuild test robot
2016-12-27 6:55 kbuild test robot
2016-12-04 12:38 kbuild test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®