Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757825AbcCCNqh (ORCPT ); Thu, 3 Mar 2016 08:46:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54487 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757756AbcCCNqf (ORCPT ); Thu, 3 Mar 2016 08:46:35 -0500 Date: Thu, 3 Mar 2016 14:46:25 +0100 From: Jakub Jelinek To: Ingo Molnar Cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Colin King , Ingo Molnar , linux-kernel@vger.kernel.org, Richard Henderson , Dan Carpenter , Linus Torvalds , Andrew Morton Subject: Re: Q: why didn't GCC warn about this uninitialized variable? (was: Re: [PATCH] perf tests: initialize sa.sa_flags) Message-ID: <20160303134625.GF3017@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <1456923322-29697-1-git-send-email-colin.king@canonical.com> <20160302125901.GF6356@twins.programming.kicks-ass.net> <20160302130350.GO3604@kernel.org> <20160302132127.GG6356@twins.programming.kicks-ass.net> <20160302132323.GP3604@kernel.org> <20160303121944.GB2484@gmail.com> <20160303125542.GD3017@tucnak.redhat.com> <20160303132433.GA9460@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160303132433.GA9460@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 727 Lines: 15 On Thu, Mar 03, 2016 at 02:24:34PM +0100, Ingo Molnar wrote: > 6 hours of PeterZ time translates to quite a bit of code restructuring overhead to > eliminate false positive warnings... I'll file a bugzilla enhancement request for this (with new attribute), perhaps we could do it in FRE that is able to see through memory stores/loads even in addressable structures in some cases. Though, certainly GCC 7 material. And, in this particular case it couldn't do anything anyway, because the sigfillset call is not inlined, and takes address of a field in the structure. The compiler can't know if it doesn't cast it back to struct sigaction and initialize the other fields. BTW, valgrind should be able to detect this. Jakub