On 12/23/2009 02:43 PM, Jie Zhang wrote:
Hi,

We just got a similar problem on Blackfin GCC recently. Let me take the
test code from the bug as an example:

I reduce the test case to a simpler one:

$ cat foo.c
unsigned int
foo (volatile unsigned short *p)
{
  return *p;
}

I the tree dump "foo.c.126t.optimized", GCC refused to eliminate D.1256 because the first statement contains a volatile operand:

  D.1256 ={v} *p;
  return (unsigned int) D.1256;

I'm not familiar with the trees. Is it possible to replace D.1256 and have something like below?

  return (unsigned int) {v} *p;

I experiment a little. It seems {v} will be lost in SSA name replacing during out of SSA transform. Can anyone pointed me if it's possible to do the replace but still keep {v}? Or I should find another way to do that? Or it's wrong to do this optimization?

Thanks,

Jie

Reply via email to