This is the mail archive of the gcc@gcc.gnu.org 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]

[tree-ssa] Bug in jump threading


Hello,

the jump threading works incorrectly in this situation:

x_1 = pointer;
t_1 = x_1->field;

if (t_1)
  goto L1;

  ...


L1:
  x1_1 = pointer;
  if (!x1_1)
    goto L2;

...

L2:
  x1_2 = phi (..., x1_1 (from L1 block));
  ...

before the goto L1 is threaded to L2, variables are rewritten out of
ssa:

x = pointer;
t_1 = x->field;

if (t_1)
  goto L1;

  ...


L1:
  x1 = pointer;
  if (!x1)
    goto L2;

  ...

L2:
  ...

Now when you thread the jump, you lose the assignment to x1.

Can be reproduced using attached testcase -- ./cc1 -O1 -Wuninitialized tc1.i

It prevents my loop header copying patch from bootstrapping, so it would
be nice if you could do something with it.

Zdenek

Attachment: tc1.i
Description: Text document


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