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]

egcs-1.1.1 spurious uninitialized variable warning


When I name the attached file "bug.c" and compile like so:

  egcs -c -Wuninitialized -Werror -O2 bug.c

I get the following result:

  bug.c: In function `HashTable45size45ceiling_':
  bug.c:15: warning: `t6' might be used uninitialized in this function

Don't stare too hard at the C code; it was machine-generated and
touched up a bit.  The point is that "t6" cannot possibly be used
uninitialized because its only use appears immediately after the only
assignment to it.

Even trivial changes to the code (e.g., removing the "noreturn"
attribute from "no_value_returned()") tend to make the problem
disappear.

My system is Red Hat Linux 5.1, but I doubt that matters because I
compiled egcs-1.1.1 myself.

Thanks!

 - Pat

======================================================================

extern void * HashTable45sizes_raw_binding_;
extern void * anonCND2D;
extern void * anontSH1p;
extern void * String_raw_val_;
extern void * int_raw_val_;
typedef int word;
#if 1
extern void no_value_returned(void) __attribute__((noreturn));
#endif

/* HashTable-size-ceiling */
word
HashTable45size45ceiling_ (word i0)
{
  word a[2], r[9], t0, t1, t2, t3, t4, t5, t6, t7;

/* Line 701 */
  t0 = 0;
/* Line 702 */
  t2 = *((int *) (((word) & HashTable45sizes_raw_binding_ + 4) + 4));
  t3 = *((int *) (t2 + -8));
  t1 = t3;
/* Line 703 */
L1:;
  if (t0 >= t1)
    goto L2;
/* Line 704 */
  t5 = *((int *) (((word) & HashTable45sizes_raw_binding_ + 4) + 4));
  t6 = *(int *) (t5 + 0 + (t0 * 4));
  t4 = t6;
/* Line 705 */
  if (t4 < i0)
    goto L3;
/* Line 706 */
  i0 = t4;
  goto L4;
L3:;
/* Line 707 */
  t7 = t0 + 1;
  t0 = t7;
  goto L5;
L2:;
/* Line 703 */
  goto L6;
L5:;
  goto L1;
L6:;
  error_ ((word) a, (word) & r[3]);
  no_value_returned ();
L4:;
  return i0;
}



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