https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67196
Manuel López-Ibáñez changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last reconfirmed||2015-08-12
CC||manu at gcc dot gnu.org
Blocks||24639
Ever confirmed|0 |1
--- Comment #1 from Manuel López-Ibáñez ---
For some reason, the uninit pass does not even analyze the predicates and
thinks all uses are unguarded (or it doesn't dump it).
A shorter testcase:
int some_test(int);
int test (int n)
{
int num_captions_in_row = 0;
int first_caption = 0; /* set to zero here */
int first_caption_idx;
int i;
for (i = 0; i < n; i++)
{
if (some_test (i))
{
num_captions_in_row++;
first_caption = 1; /* only ever set here */
first_caption_idx = i; /* set here */
}
}
/* The guard on "first_caption" here requires we entered the block
above that sets "first_caption_idx". */
if (first_caption && num_captions_in_row == 1)
return first_caption_idx; /* get bogus warning here at -O1 and above */
return 0;
}
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
[Bug 24639] [meta-bug] bug to track all Wuninitialized issues