[Bug tree-optimization/15826] don't use "if" to extract a single bit bit-field.

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Apr 30 19:22:00 GMT 2008



------- Comment #7 from rguenth at gcc dot gnu dot org  2008-04-30 19:21 -------
On the trunk I have after phiopt1:

;; Function andrew (andrew)

Removing basic block 3
Merging blocks 2 and 4
andrew (struct s * p)
{
  _Bool D.1212;
  int i;
  unsigned int D.1183;
  <unnamed-unsigned:1> D.1182;

<bb 2>:
  D.1182_3 = p_2(D)->bit;
  (void) 0;
  D.1212_9 = D.1182_3 != 0;
  i_10 = (int) D.1212_9;
  D.1183_6 = (unsigned int) i_10;
  return D.1183_6;

}

;; Function foo (foo)

Removing basic block 3
Merging blocks 2 and 4
foo (struct s * p)
{
  _Bool D.1199;
  unsigned int D.1177;
  <unnamed-unsigned:1> D.1176;

<bb 2>:
  D.1176_3 = p_2(D)->bit;
  (void) 0;
  D.1199_8 = D.1176_3 != 0;
  D.1177_9 = (unsigned int) D.1199_8;
  return D.1177_9;

}

which the next forwprop pass optimizes to

foo (struct s * p)
{
  unsigned int D.1177;
  <unnamed-unsigned:1> D.1176;

<bb 2>:
  D.1176_3 = p_2(D)->bit;
  D.1177_9 = D.1176_3 != 0;
  return D.1177_9;

}

andrew (struct s * p)
{
  unsigned int D.1183;
  <unnamed-unsigned:1> D.1182;

<bb 2>:
  D.1182_3 = p_2(D)->bit;
  D.1183_6 = D.1182_3 != 0;
  return D.1183_6;

}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15826



More information about the Gcc-bugs mailing list