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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr17252.c] - Diff between revs 149 and 154

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

Rev 149 Rev 154
/* PR 17252.  When a char * pointer P takes its own address, storing
/* PR 17252.  When a char * pointer P takes its own address, storing
   into *P changes P itself.  */
   into *P changes P itself.  */
 
 
char *a;
char *a;
 
 
main ()
main ()
{
{
  /* Make 'a' point to itself.  */
  /* Make 'a' point to itself.  */
  a = (char *)&a;
  a = (char *)&a;
 
 
  /* Change what 'a' is pointing to.  */
  /* Change what 'a' is pointing to.  */
  a[0]++;
  a[0]++;
 
 
  /* If a's memory tag does not contain 'a' in its alias set, we will
  /* If a's memory tag does not contain 'a' in its alias set, we will
     think that this predicate is superfluous and change it to
     think that this predicate is superfluous and change it to
     'if (1)'.  */
     'if (1)'.  */
  if (a == (char *)&a)
  if (a == (char *)&a)
    abort ();
    abort ();
 
 
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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