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



bin.cheng <amker.cheng at gmail dot com> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

                 CC|                            |amker.cheng at gmail dot

                   |                            |com



--- Comment #1 from bin.cheng <amker.cheng at gmail dot com> 2012-10-20 
05:40:08 UTC ---

The failure is caused by higher register pressure in the THEN branch of the

case, though I am not sure why the register pressure is higher than x86-linux.



This can be fixed by simplifying test case as below:



/* { dg-options "-Os -fdump-rtl-hoist" }  */

/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression"

"hoist" } } */



#define BUF 100

int a[BUF];



void com (int);

void bar (int);



int foo (int x, int y, int z)

{

  /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,

     because its rtx_cost is too small.  */

  if (z)

    {

      a[1] = a[0];

      a[2] = a[1];

      a[3] = a[2];

      a[4] = a[3];

      a[5] = a[4];

      a[6] = a[5];

      a[7] = a[6];

      com (x+y);

    }

  else

    {

      bar (x+y);

    }



  return 0;

}



I will send a patch fixing this.

Reply via email to