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

            Bug ID: 63224
           Summary: False Positive for -Wmaybe-uninitialized at -Os, not
                    -O2
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: joel at gcc dot gnu.org
            Target: arm-rtems sparc-rtems

This is for code from RTEMS. This warning appears to impact multiple targets. I
have only checked arm, i386, and sparc as doing this and powerpc as not. I can
follow up on all rtems targets if someone is interested and that helps debug.

I expect this is reproducible on other many targets.

Test code will be attached.

$ arm-rtems4.11-gcc -Wall -O2  -c unused.c
$ arm-rtems4.11-gcc -Wall -Os  -c unused.c
../../../../../../rtems/c/src/../../cpukit/libfs/src/dosfs/msdos_conv.c: In
function 'msdos_filename_utf8_to_long_name_for_save':
../../../../../../rtems/c/src/../../cpukit/libfs/src/dosfs/msdos_conv.c:452:34:
warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized]
         if ( name_size == UTF16_NULL_SIZE && c == UTF16_NULL ) {
                                  ^

Reply via email to