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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [Wstrict-overflow-23.c] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -Wstrict-overflow" } */
3
 
4
unsigned int
5
do_scrolling (unsigned int window_size, unsigned int writecost)
6
{
7
  unsigned int i = window_size;
8
 
9
  int terminal_window_p = 0;
10
  unsigned int queue = 0;
11
 
12
  for (i = window_size; i; i--)
13
    {
14
      if (writecost < i)
15
    ++queue;
16
      else if (writecost & 1)
17
    terminal_window_p = 1;
18
    }
19
 
20
  if (queue > 0)
21
    {
22
      if (!terminal_window_p)
23
    {
24
      terminal_window_p = 1;
25
    }
26
    }
27
 
28
  if (terminal_window_p)
29
    return 100;
30
  return 0;
31
}

powered by: WebSVN 2.1.0

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