public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/66946] New: Spurious uninitialized warning
@ 2015-07-20 16:25 wdijkstr at arm dot com
  2015-07-21 13:10 ` [Bug tree-optimization/66946] " wdijkstr at arm dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: wdijkstr at arm dot com @ 2015-07-20 16:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66946

            Bug ID: 66946
           Summary: Spurious uninitialized warning
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wdijkstr at arm dot com
  Target Milestone: ---

Created attachment 36016
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36016&action=edit
preprocessed iso-2022-cn-ext.c

Since recently (around May) GCC6 has started to emit spurious uninitialized
warnings. An example from building GLIBC (compiled attached pp file with -O2
-Wall -c out.i):

In file included from iso-2022-cn-ext.c:659:0:
../iconv/skeleton.c: In function 'gconv':
../iconv/loop.c:325:295: warning: '*((void *)&buf+1)' is used uninitialized in
this function [-Wuninitialized]
../iconv/loop.c:325:295: warning: 'buf' is used uninitialized in this function
[-Wuninitialized]
../iconv/loop.c:325:295: warning: '*((void *)&buf+1)' is used uninitialized in
this function [-Wuninitialized]
../iconv/loop.c:325:295: warning: 'buf' is used uninitialized in this function
[-Wuninitialized]
In file included from iso-2022-cn-ext.c:659:0:
../iconv/loop.c:435:295: warning: '*((void *)&buf+1)' is used uninitialized in
this function [-Wuninitialized]
../iconv/loop.c:435:295: warning: 'buf' is used uninitialized in this function
[-Wuninitialized]

I checked the control flow and it seems correct.
glibc/iconvdata/iso-2022-cn-ext.c calls one of ucs4_to_gb2312, ucs4_to_isoir165
and ucs4_to_cns11643l1 at lines 432-447 - buf is not written if
__UNKNOWN_10646_CHAR is returned. In that case however the if statement is
executed which does eventually set buf[0] and buf[1]. There is no warning if
inlining is disabled, so it is caused by the ucs4_* inline functions not always
setting buf.


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

end of thread, other threads:[~2015-07-21 13:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-20 16:25 [Bug tree-optimization/66946] New: Spurious uninitialized warning wdijkstr at arm dot com
2015-07-21 13:10 ` [Bug tree-optimization/66946] " wdijkstr at arm dot com
2015-07-21 13:28 ` pinskia at gcc dot gnu.org
2015-07-21 13:31 ` pinskia at gcc dot gnu.org
2015-07-21 13:42 ` wdijkstr at arm 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).