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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [badshift.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 rtl-optimization/20532 */
2
 
3
/* { dg-do run } */
4
/* { dg-options "" } */
5
/* { dg-options "-march=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
6
 
7
/* We used to optimize the DImode shift-by-32 to zero because in combine
8
   we turned:
9
 
10
     (v << 31) + (v << 31)
11
 
12
   into:
13
 
14
     (v * (((HOST_WIDE_INT)1 << 31) + ((HOST_WIDE_INT)1 << 31)))
15
 
16
   With a 32-bit HOST_WIDE_INT, the coefficient overflowed to zero.  */
17
 
18
unsigned long long int badshift(unsigned long long int v)
19
{
20
        return v << 31 << 1;
21
}
22
 
23
extern void abort ();
24
 
25
int main() {
26
  if (badshift (1) == 0)
27
    abort ();
28
  return 0;
29
}

powered by: WebSVN 2.1.0

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