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]

[lno] tree loop optimization causes a problem in RTL alias analysis


Hi,
We have encountered a problem when the -ftree-loop-optimize flag is
specified. The problem causes bad schedules due to unnecessary memory
dependences. We compiled the below code example, and compared memory
attributes in the RTL with and without -ftree-loop-optimize. It turned
out that when -ftree-loop-optimize was enabled the memory attributes
(MEM_EXPR) were lost.

int a[128];
int b[128];

void f ()
{
  int i;
  for (i = 0; i < 128; i++)
    a[i] = b[i];
}

We used powerpc-apple-darwin7.2.0 with the following compiler flags:
"-O3 -ftree-loop-optimize -funroll-loops"
"-O3 -fno-tree-loop-optimize -funroll-loops"

The following code from alias.c uses that information, and cannot
proceed if that information is not present:

alias.c:

static int
nonoverlapping_memrefs_p (rtx x, rtx y)
{
  tree exprx = MEM_EXPR (x), expry = MEM_EXPR (y);
  rtx rtlx, rtly;
  rtx basex, basey;
  rtx moffsetx, moffsety;
  HOST_WIDE_INT offsetx = 0, offsety = 0, sizex, sizey, tem;

  /* Unless both have exprs, we can't tell anything.  */
  if (exprx == 0 || expry == 0)
    return 0;

....

Any suggestions on where in the tree-loop optimizer is the problem?

Thanks,


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