------- Comment #13 from pinskia at gcc dot gnu dot org  2006-01-24 18:24 
-------
Lets look at the final IR:
  _M_extract (&cin, &__l);
  this.90 = (struct basic_ios<char,std::char_traits<char> > *) &cin;
  D.31548 = this.90 + *(long int *) (cin._vptr.basic_istream + -24);
  __a.59 = (int) D.31548->D.24021._M_streambuf_state;
  if ((__a.59 & 5) == 0) goto <L15>; else goto <L10>;

<L15>:;
  __l.93 = __l;
  if (__l.93 < -2147483648) goto <L17>; else goto <L14>;

<L14>:;
  if (__l.93 > 2147483647) goto <L17>; else goto <L7>;

<L7>:;
  x = (int) __l.93;

<L10>:;
  if (((int) cin.D.29238.D.24021._M_streambuf_state & 5) != 0) goto <L22>; else
goto <L1>;

<L22>:;
  x = -1;


How would the middle-end know that _M_streambuf_state& 5 is set as there is a
call to _M_extract?

There is no way.  The bogus part is in the libstdc++ and no where in the
front-ends or the middle-end.

The only way to fix this bogus part is just to disable the warning for "may"
use uninitialized variable which causes more regressions and lets us catch less
errors.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++


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

Reply via email to