gcc.dg/debug/debug-[12].c failures on cmov targets

Eric Botcazou ebotcazou@libertysurf.fr
Wed Dec 3 08:01:00 GMT 2003


Hi,

These two testcases fail on some targets with conditional moves (e.g. 
SPARC64) because a whole block is folded into the result at -O:

/* Verify that the scheduler does not discard the lexical block.  */
/* { dg-do compile } */
/* { dg-options "-dA" } */
/* { dg-final { scan-assembler "xyzzy" } } */
long foo(long p)
{
  {
    long xyzzy = 0;
    if (p)
      xyzzy = 2;
    return xyzzy;
  }
}

is folded into

long foo(long p)
{
   return p ? 2 : 0;
}

so the lexical block containing xyzzy is discarded and the variable with it.


Is this "fixable"? Is this worth "fixing"? Or can we XFAIL them, on the 
grounds that they don't exercise what they are supposed to?

-- 
Eric Botcazou



More information about the Gcc mailing list