Bug 56972 - Missing "may be used uninitialized" warning for "obvious" uninitialized
Summary: Missing "may be used uninitialized" warning for "obvious" uninitialized
Status: RESOLVED DUPLICATE of bug 18501
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: unknown
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2013-04-15 16:48 UTC by Paul Pluzhnikov
Modified: 2013-04-15 18:46 UTC (History)
1 user (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Paul Pluzhnikov 2013-04-15 16:48:52 UTC
Google ref: b/8616613

// t.c
int f(int x)
  int ret;
  switch (x) {
    case 3:
      ret = 0;
  return ret;

int main()
  return f(2);

gcc -c -Wall -Wextra t.c
# no output

gcc -c -Wall -Wextra -O2 t.c
# no output
Comment 1 Manuel López-Ibáñez 2013-04-15 18:46:59 UTC
Infamous PR18501. With:

~/test1/197214/build/gcc/cc1 -Wall -Wextra -O1 pr56972.c -fdump-tree-all-lineno

you can see that pr56972.c.020t.copyrename1 contains the uninit use but pr56972.c.021t.ccp1 has removed it.

*** This bug has been marked as a duplicate of bug 18501 ***