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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [opt/] [cse2.C] - Blame information for rev 825

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

Line No. Rev Author Line
1 149 jeremybenn
// This testcase caused ICE on IA-32 in simplify_unary_operation
2
// CSE did not assume SUBREGs changing mode from integral to floating.
3
// { dg-do run { target i?86-*-* sparc*-*-* x86_64-*-* } }
4
// { dg-options "-O2" }
5
 
6
struct A
7
{
8
  union
9
    {
10
      float f;
11
      unsigned int w;
12
    } a;
13
 
14
  static inline const A foo (void)
15
    {
16
      return A ((unsigned int) (__extension__ ((union { unsigned l; float d; })
17
                                               { l: 0x3f800000 }).d));
18
    }
19
  inline A (float f) { a.f = f; }
20
  A ();
21
  inline A (unsigned int w) { a.w = w; }
22
};
23
 
24
A::A()
25
{
26
  *this = foo ();
27
}
28
 
29
A a;
30
 
31
extern "C" void abort (void);
32
extern "C" void exit (int);
33
 
34
int main ()
35
{
36
  if (a.a.w != 1)
37
    abort ();
38
  exit (0);
39
}

powered by: WebSVN 2.1.0

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