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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr46309.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* PR tree-optimization/46309 */
2
/* { dg-do compile } */
3
/* { dg-options "-O2 -fdump-tree-reassoc-details" } */
4
/* The transformation depends on BRANCH_COST being greater than 1
5
   (see the notes in the PR), so try to force that.  */
6
/* { dg-additional-options "-mtune=octeon2" { target mips*-*-* } } */
7
/* { dg-additional-options "-mbranch-cost=2" { target avr*-*-* s390*-*-* } } */
8
 
9
int
10
f1 (int a)
11
{
12
  int v1 = (a == 3);
13
  int v2 = (a == 1);
14
  int v3 = (a == 4);
15
  int v4 = (a == 2);
16
  return v1 || v2 || v3 || v4;
17
}
18
 
19
int
20
f2 (int a)
21
{
22
  int v1 = (a == 1);
23
  int v2 = (a == 2);
24
  int v3 = (a == 3);
25
  int v4 = (a == 4);
26
  return v1 || v2 || v3 || v4;
27
}
28
 
29
int
30
f3 (int a)
31
{
32
  int v1 = (a == 3);
33
  int v2 = (a == 1);
34
  return v1 || v2;
35
}
36
 
37
int
38
f4 (int a)
39
{
40
  int v1 = (a == 1);
41
  int v2 = (a == 2);
42
  return v1 || v2;
43
}
44
 
45
int
46
f5 (unsigned int a)
47
{
48
  int v1 = (a <= 31);
49
  int v2 = (a >= 64 && a <= 95);
50
  return v1 || v2;
51
}
52
 
53
int
54
f6 (unsigned int a)
55
{
56
  int v1 = (a <= 31);
57
  int v2 = (a >= 64 && a <= 95);
58
  int v3 = (a >= 128 && a <= 159);
59
  int v4 = (a >= 192 && a <= 223);
60
  return v1 || v2 || v3 || v4;
61
}
62
 
63
/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.2, 2. and -.3, 3. and -.4, 4.\[\n\r\]* into" 2 "reassoc1" } } */
64
/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.3, 3.\[\n\r\]* into" 1 "reassoc1" } } */
65
/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.2, 2.\[\n\r\]* into" 1 "reassoc1" } } */
66
/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.0, 31. and -.64, 95.\[\n\r\]* into" 2 "reassoc1" } } */
67
/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.128, 159. and -.192, 223.\[\n\r\]* into" 1 "reassoc1" } } */
68
/* { dg-final { scan-tree-dump-times "Optimizing range tests D.\[0-9\]*_\[0-9\]* -.0, 31. and -.128, 159.\[\n\r\]* into" 1 "reassoc2" } } */
69
/* { dg-final { cleanup-tree-dump "reassoc1" } } */
70
/* { dg-final { cleanup-tree-dump "reassoc2" } } */

powered by: WebSVN 2.1.0

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