[Bug tree-optimization/67196] Another false positive from -Wmaybe-uninitialized

2020-02-25 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67196

Jeffrey A. Law  changed:

   What|Removed |Added

 CC||law at redhat dot com

--- Comment #2 from Jeffrey A. Law  ---
I believe jump threading doesn't thread in this case because doing so is going
to muck up the loop structures.  Essentially it has to thread from outside the
loop through the loop header to a point in the interior of the loop.  Except
for a very limited number of circumstances that creates irreducible loops and
it's avoided.

[Bug tree-optimization/67196] Another false positive from -Wmaybe-uninitialized

2015-08-12 Thread manu at gcc dot gnu.org
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