This is the mail archive of the 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 middle-end/20968] Spurious "may be used uninitialized" warning

------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-12 14:49 -------
Note this is not fully a regression but really a progression.
What is happening now is only partial optimizations is happen before the warning to happen.

>I was unable to reduce the test case further without making the warning
>disappear.  In particular, removing the increment of v1->count makes the warning
This is because we would then jump thread he jump.

Again this is because we are emitting the warning too soon, I might be able to come up with a testcase 
which shows that this is not really a regression but a progression in that we have warned in 3.4 and 
struct {int count;} *v1;
int c;
int k;

extern void baz(int);
void foo(void)
    int i;
    int r;
    if (k == 4)
        i = 1;
        r = 1;
        r = 0;

    if (!r)
        if (!c)
    if (!c)

There is no different from the case above and the functions you gave below.

There has been some talking about moving where we warn about uninitialized variables but I feel that 
you can get around this in your code.

           What    |Removed                     |Added
          Component|c                           |middle-end
            Summary|[4.0/4.1 Regression]        |Spurious "may be used
                   |Spurious "may be used       |uninitialized" warning
                   |uninitialized" warning      |

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