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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [reassoc-14.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -fdump-tree-reassoc1" } */
3
 
4
int test1 (int x, int y, int z, int weight)
5
{
6
  int tmp1 = x * weight;
7
  int tmp2 = y * weight;
8
  int tmp3 = (x - y) * weight;
9
  return tmp1 + (tmp2 + tmp3);
10
}
11
 
12
int test2 (int x, int y, int z, int weight)
13
{
14
  int tmp1 = x * weight;
15
  int tmp2 = y * weight * weight;
16
  int tmp3 = z * weight * weight * weight;
17
  return tmp1 + tmp2 + tmp3;
18
}
19
 
20
/* There should be one multiplication left in test1 and three in test2.  */
21
 
22
/* { dg-final { scan-tree-dump-times "\\\*" 4 "reassoc1" } } */
23
/* { dg-final { cleanup-tree-dump "reassoc1" } } */

powered by: WebSVN 2.1.0

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