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.dg/] [Wstrict-overflow-18.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
3
 
4
/* Don't warn about an overflow when folding i > 0.  The loop analysis
5
   should determine that i does not wrap.  */
6
 
7
struct c { unsigned int a; unsigned int b; };
8
extern void bar (struct c *);
9
int
10
foo (struct c *p)
11
{
12
  int i;
13
  int sum = 0;
14
 
15
  for (i = 0; i < p->a - p->b; ++i)
16
    {
17
      if (i > 0)
18
        sum += 2;
19
      bar (p);
20
    }
21
  return sum;
22
}

powered by: WebSVN 2.1.0

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