https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61779

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-07-14
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
f ()
{
  int iftmp.0_1;

  <bb 2>:

  <bb 3>:

  <bb 4>:
  # iftmp.0_1 = PHI <1(3)>
  __asm__ __volatile__(".pushsection .note.stapsdt,"?","note"
.4byte 992f-991f,994f-993f,3
.asciz "%n0@%1"
" :  : "_SDT_S1" "n" iftmp.0_1, "_SDT_A1" "nor" 0);
  goto <bb 3>;


Huh.  At -O0 we have the constant 1 propagated.  From folding builtins
we get

  _7 = 0;
  if (_7 == 0)
    goto <bb 5>;
  else
    goto <bb 4>;

  <bb 4>:

  <bb 5>:
  # iftmp.0_1 = PHI <1(3), -1(4)>

and copyprop then produces

  <bb 4>:
  # iftmp.0_1 = PHI <1(3)>

because copyprop does

Visiting statement:
if (_7 == 0)

No interesting values produced.

Adding Destination of edge (3 -> 5) to worklist

Adding Destination of edge (3 -> 4) to worklist

err.  Since copyprop also copy-propagates constants copy_prop_visit_cond_stmt
should try harder.

Mine.

Reply via email to