This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/12792] New: {u,}int64_t variables are incorrectly reported as used uninitialized


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: {u,}int64_t variables are incorrectly reported as used
                    uninitialized
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: chris at pin dot lu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-unknown-netbsdelf
  GCC host triplet: m68k--netbsdelf
GCC target triplet: m68k--netbsdelf

long long int and long long unsigned int variables trigger the following 
warning even though the variables are initialized:
longlongint.c: In function `main':
longlongint.c:7: warning: `blkno' might be used uninitialized in this function

reduced test case:
---- cut here ----
# 1 "longlongint.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "longlongint.c"

int printf (const char * __restrict, ...);

int
main(int argc, char **argv)
{
  long long int blkno;
  long long int t5;

  t5 = 1;

  blkno = t5 * t5;

  printf("%lld\n", blkno);

  return 0;
}
---- cut here ----
compilation command:
> cc -O1 -Wall longlongint.c -c                                                
longlongint.c: In function `main':
longlongint.c:7: warning: `blkno' might be used uninitialized in this function

There's no warning at -O0, there's a warning at Os, O1 and above.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]