https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67443

--- Comment #4 from Dominik Vogt <vogt at linux dot vnet.ibm.com> ---
Now this is the result of my efforts of reducing the original large test
program to a minimum.

---
struct s_t 
{ 
  unsigned f1: 8; 
  unsigned f2: 24; 
}; 
bool foo(int a, int **pp, s_t **pps, void *s, int **x) 
{ 
  s_t *ps = *pps; 
  int *gt; 
  int y; 
  int z; 

  __asm__ __volatile__ ("" : : : "0","1","2","3","6","7","14"); 
  unsigned i = **pp; 
  if (**pp >= 999 && **x < 77) 
    { 
      ps->f1 = **x; 
      ps->f2 = **pp; 
    } 
  __asm__ __volatile__ ("" : : : "0","1","2","3","4","5","6","7","8"); 
  do { y &= *gt; } while (y != 0); 
  __asm__ __volatile__ ("" : : : "memory", "2","3","4","5"); 
  do { z &= *gt; } while (z != 0); 
  return i && x && ps && s; 
} 
---

Without having looked at the Rtl yet, I strongly suspect that the uninitialised
variables y and z trigger the problem.  Originally this was inlined code of a
function returning int or bool but without a return statement.  The __asm__
__volatile__ lines are replacements for functions calls to simplify the test. 
Whether the "stc" is removed or not seems to depend on which registers are
available and on how many variables are still in use.

See attached .tar.bz2 contains the test program, the assembler output and the
rtl output of -da.  If you need more information, just ask.

Reply via email to