OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [20070507-1.c] - Diff between revs 298 and 338

Only display areas with differences | Details | Blame | View Log

Rev 298 Rev 338
/* This failed on s390x due to bug in loop.c.
/* This failed on s390x due to bug in loop.c.
   loop.c failed to remove a REG_EQUAL note when
   loop.c failed to remove a REG_EQUAL note when
   hoisting an insn from a loop body.  */
   hoisting an insn from a loop body.  */
 
 
/* { dg-options "-O3 -fPIC" } */
/* { dg-options "-O3 -fPIC" } */
/* { dg-do run { target fpic } } */
/* { dg-do run { target fpic } } */
 
 
typedef __SIZE_TYPE__ size_t;
typedef __SIZE_TYPE__ size_t;
int memcmp(const void *s1, const void *s2, size_t n);
int memcmp(const void *s1, const void *s2, size_t n);
 
 
typedef struct
typedef struct
{
{
  char name[30];
  char name[30];
  int a;
  int a;
} LOCAL;
} LOCAL;
 
 
int global = 0;
int global = 0;
int sy = 1;
int sy = 1;
int subroutine_offset;
int subroutine_offset;
 
 
LOCAL local = { "local", 0 };
LOCAL local = { "local", 0 };
LOCAL keywords = { "keywords", 1 };
LOCAL keywords = { "keywords", 1 };
int local_table = 0;
int local_table = 0;
int keywords_table = 0;
int keywords_table = 0;
 
 
void __attribute__((noinline)) bar (char *p_buffer)
void __attribute__((noinline)) bar (char *p_buffer)
{
{
  p_buffer[255] = 1;
  p_buffer[255] = 1;
}
}
 
 
int __attribute__((noinline)) foo (char *p_str1)
int __attribute__((noinline)) foo (char *p_str1)
{
{
  global = 1;
  global = 1;
  return 1;
  return 1;
}
}
 
 
int __attribute__((noinline)) loop_next (int *p_table, char *p_table_head)
int __attribute__((noinline)) loop_next (int *p_table, char *p_table_head)
{
{
  static loop_next = 0;
  static loop_next = 0;
 
 
  if (loop_next == 1)
  if (loop_next == 1)
    return 1;
    return 1;
 
 
  loop_next = 1;
  loop_next = 1;
  return 0;
  return 0;
}
}
 
 
int
int
main ()
main ()
{
{
  char buffer[256];
  char buffer[256];
  int ende = 0;
  int ende = 0;
  int index;
  int index;
  int local_base = 2;
  int local_base = 2;
 
 
  keywords.a = 1;
  keywords.a = 1;
  for (sy = 0;; sy++)
  for (sy = 0;; sy++)
    {
    {
      for (index = 1;;)
      for (index = 1;;)
        {
        {
          bar (buffer);
          bar (buffer);
          if (buffer[sy] != 0)
          if (buffer[sy] != 0)
            {
            {
              ende = 1;
              ende = 1;
              break;
              break;
            };
            };
          if (foo (buffer))
          if (foo (buffer))
            {
            {
              keywords.a += index - 1;
              keywords.a += index - 1;
              break;
              break;
            }
            }
          index++;
          index++;
        }
        }
      if (ende)
      if (ende)
        break;
        break;
    }
    }
 
 
  subroutine_offset = 0;
  subroutine_offset = 0;
 
 
  for (;;)
  for (;;)
    {
    {
      if (loop_next (&keywords_table, (char*)&keywords))
      if (loop_next (&keywords_table, (char*)&keywords))
        break;
        break;
 
 
      if ((!memcmp (keywords.name, "+++", 3)))
      if ((!memcmp (keywords.name, "+++", 3)))
        local_base = 100;
        local_base = 100;
      else
      else
        local_base = 0;
        local_base = 0;
 
 
      if ((!memcmp (keywords.name, "+++", 3)))
      if ((!memcmp (keywords.name, "+++", 3)))
        subroutine_offset += local_table;
        subroutine_offset += local_table;
 
 
      for (;;)
      for (;;)
        {
        {
          if (loop_next (&local_table, (char*)&local))
          if (loop_next (&local_table, (char*)&local))
            break;;
            break;;
          if ((local.a == 0))
          if ((local.a == 0))
            continue;;
            continue;;
          foo (local.name);
          foo (local.name);
        }
        }
    }
    }
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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