OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.dg/] [uninit-10-O0.c] - Diff between revs 298 and 384

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 298 Rev 384
/* { dg-do compile } */
/* { dg-do compile } */
/* { dg-options "-Wall" } */
/* { dg-options "-Wall" } */
/* On Alpha EV4, dead code elimination and cfg simplification conspired
/* On Alpha EV4, dead code elimination and cfg simplification conspired
   to leave the register containing 'C' marked live, though all references
   to leave the register containing 'C' marked live, though all references
   to the variable had been removed.  */
   to the variable had been removed.  */
 
 
struct operand_data
struct operand_data
{
{
  struct operand_data *next;
  struct operand_data *next;
  int index;
  int index;
  const char *predicate;
  const char *predicate;
  const char *constraint;
  const char *constraint;
  int mode;
  int mode;
  unsigned char n_alternatives;
  unsigned char n_alternatives;
  char address_p;
  char address_p;
  char strict_low;
  char strict_low;
  char eliminable;
  char eliminable;
  char seen;
  char seen;
};
};
 
 
struct data
struct data
{
{
  struct data *next;
  struct data *next;
  const char *name;
  const char *name;
  const char *template;
  const char *template;
  int code_number;
  int code_number;
  int index_number;
  int index_number;
  int lineno;
  int lineno;
  int n_operands;
  int n_operands;
  int n_dups;
  int n_dups;
  int n_alternatives;
  int n_alternatives;
  int operand_number;
  int operand_number;
  int output_format;
  int output_format;
  struct operand_data operand[40];
  struct operand_data operand[40];
};
};
 
 
extern void message_with_line (int, const char *, ...)
extern void message_with_line (int, const char *, ...)
     __attribute__ ((__format__ (__printf__, 2, 3)));
     __attribute__ ((__format__ (__printf__, 2, 3)));
extern int have_error;
extern int have_error;
 
 
extern char *strchr (__const char *__s, int __c) __attribute__ ((__pure__));
extern char *strchr (__const char *__s, int __c) __attribute__ ((__pure__));
 
 
void
void
validate_insn_alternatives (d)
validate_insn_alternatives (d)
     struct data *d;
     struct data *d;
{
{
  int n = 0, start;
  int n = 0, start;
 
 
  for (start = 0; start < d->n_operands; start++)
  for (start = 0; start < d->n_operands; start++)
    if (d->operand[start].n_alternatives > 0)
    if (d->operand[start].n_alternatives > 0)
      {
      {
        int len, i;
        int len, i;
        const char *p;
        const char *p;
        char c;  /* { dg-bogus "used uninitialized" "uninitialized variable warning" } */
        char c;  /* { dg-bogus "used uninitialized" "uninitialized variable warning" } */
        int which_alternative = 0;
        int which_alternative = 0;
        int alternative_count_unsure = 0;
        int alternative_count_unsure = 0;
 
 
        for (p = d->operand[start].constraint; (c = *p); p += len)
        for (p = d->operand[start].constraint; (c = *p); p += len)
          {
          {
            len = 1;
            len = 1;
 
 
            if (len < 1 || (len > 1 && strchr (",#*+=&%!0123456789", c)))
            if (len < 1 || (len > 1 && strchr (",#*+=&%!0123456789", c)))
              {
              {
                message_with_line (d->lineno,
                message_with_line (d->lineno,
                                   "invalid length %d for char '%c' in alternative %d of operand %d",
                                   "invalid length %d for char '%c' in alternative %d of operand %d",
                                    len, c, which_alternative, start);
                                    len, c, which_alternative, start);
                len = 1;
                len = 1;
                have_error = 1;
                have_error = 1;
              }
              }
 
 
            if (c == ',')
            if (c == ',')
              {
              {
                which_alternative++;
                which_alternative++;
                continue;
                continue;
              }
              }
 
 
            for (i = 1; i < len; i++)
            for (i = 1; i < len; i++)
              if (p[i] == '\0')
              if (p[i] == '\0')
                {
                {
                  message_with_line (d->lineno,
                  message_with_line (d->lineno,
                                     "NUL in alternative %d of operand %d",
                                     "NUL in alternative %d of operand %d",
                                     which_alternative, start);
                                     which_alternative, start);
                  alternative_count_unsure = 1;
                  alternative_count_unsure = 1;
                  break;
                  break;
                }
                }
              else if (strchr (",#*", p[i]))
              else if (strchr (",#*", p[i]))
                {
                {
                  message_with_line (d->lineno,
                  message_with_line (d->lineno,
                                     "'%c' in alternative %d of operand %d",
                                     "'%c' in alternative %d of operand %d",
                                     p[i], which_alternative, start);
                                     p[i], which_alternative, start);
                  alternative_count_unsure = 1;
                  alternative_count_unsure = 1;
                }
                }
          }
          }
        if (alternative_count_unsure)
        if (alternative_count_unsure)
          have_error = 1;
          have_error = 1;
        else if (n == 0)
        else if (n == 0)
          n = d->operand[start].n_alternatives;
          n = d->operand[start].n_alternatives;
        else if (n != d->operand[start].n_alternatives)
        else if (n != d->operand[start].n_alternatives)
          {
          {
            message_with_line (d->lineno,
            message_with_line (d->lineno,
                               "wrong number of alternatives in operand %d",
                               "wrong number of alternatives in operand %d",
                               start);
                               start);
            have_error = 1;
            have_error = 1;
          }
          }
      }
      }
 
 
 
 
  d->n_alternatives = n;
  d->n_alternatives = n;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.