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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [reassoc-14.c] - Blame information for rev 749

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 -fdump-tree-reassoc1" } */
3
 
4
unsigned int test1 (unsigned int x, unsigned int y, unsigned int z,
5
                    unsigned int weight)
6
{
7
  unsigned int tmp1 = x * weight;
8
  unsigned int tmp2 = y * weight;
9
  unsigned int tmp3 = (x - y) * weight;
10
  return tmp1 + (tmp2 + tmp3);
11
}
12
 
13
unsigned int test2 (unsigned int x, unsigned int y, unsigned int z,
14
                    unsigned int weight)
15
{
16
  unsigned int tmp1 = x * weight;
17
  unsigned int tmp2 = y * weight * weight;
18
  unsigned int tmp3 = z * weight * weight * weight;
19
  return tmp1 + tmp2 + tmp3;
20
}
21
 
22
/* There should be one multiplication left in test1 and three in test2.  */
23
 
24
/* { dg-final { scan-tree-dump-times "\\\*" 4 "reassoc1" } } */
25
/* { 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.