public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/55759] New: bogus warning when building drivers/ata/libata-core.c in v3.7 of the linux kernel
@ 2012-12-20 15:36 bp at alien8 dot de
  2012-12-20 15:43 ` [Bug regression/55759] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bp at alien8 dot de @ 2012-12-20 15:36 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55759

             Bug #: 55759
           Summary: bogus warning when building drivers/ata/libata-core.c
                    in v3.7 of the linux kernel
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bp@alien8.de


Hi,

when building kernel v3.7 with Debian's gcc: (Debian 4.7.2-4) 4.7.2, I
get the following warning:

$  make CC=gcc-4.7 drivers/ata/libata-core.o
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `relocs'.
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CC      kernel/bounds.s
  GEN     include/generated/bounds.h
  CC      arch/x86/kernel/asm-offsets.s
  GEN     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CC      scripts/mod/empty.o
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  CC      drivers/ata/libata-core.o
drivers/ata/libata-core.c: In function ‘ata_hpa_resize’:
drivers/ata/libata-core.c:1397:3: warning: ‘native_sectors’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
$

it falsely complains that native_sectors might be used unitialized. The
variable's value is assigned-to in an auxiliary function and passed to
it as a pointer.

The auxiliary function returns negative value on error and 0 on success
and its caller uses the native_sectors value returned over the pointer
only in the success case and in that case, native_sectors is always
properly initialized.

Also, gcc-4.6 (gcc-4.6 (Debian 4.6.3-14) 4.6.3) doesn't trigger that
same warning:

$  make CC=gcc-4.6 drivers/ata/libata-core.o
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `relocs'.
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CC      drivers/ata/libata-core.o
$

Thanks.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-20  0:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-20 15:36 [Bug regression/55759] New: bogus warning when building drivers/ata/libata-core.c in v3.7 of the linux kernel bp at alien8 dot de
2012-12-20 15:43 ` [Bug regression/55759] " rguenth at gcc dot gnu.org
2012-12-20 16:20 ` bp at alien8 dot de
2012-12-20 16:38 ` markus at trippelsdorf dot de
2012-12-20 18:34 ` markus at trippelsdorf dot de
2013-11-20  0:42 ` law at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).