From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrvAu-0002es-AL for qemu-devel@nongnu.org; Fri, 12 Aug 2011 13:05:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QrvAt-0004mH-5w for qemu-devel@nongnu.org; Fri, 12 Aug 2011 13:05:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrvAs-0004mD-Sg for qemu-devel@nongnu.org; Fri, 12 Aug 2011 13:05:35 -0400 Message-ID: <4E455D5A.1070807@redhat.com> Date: Fri, 12 Aug 2011 19:05:30 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1312361359-15445-1-git-send-email-pbonzini@redhat.com> <1312361359-15445-11-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 10/16] scsi: move request parsing to common code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org On 08/12/2011 06:12 PM, Peter Maydell wrote: > This patch makes current master fail to compile with optimisation on: > > gcc complains: > hw/scsi-bus.c: In function =E2=80=98scsi_req_new=E2=80=99: > hw/scsi-bus.c:375: error: =E2=80=98req=E2=80=99 may be used uninitializ= ed in this function > > because in the 'else' clause we look at req->cmd.lba before we've > called alloc_req(). > > My guess is that the tracing should just be moved down to after the > allocation? You can also use cmd.lba instead of req->cmd.lba. I guess the failure depends on the compiler version and tracing options. Paolo