File: alias_bug.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (60 lines) | stat: -rw-r--r-- 1,159 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* { dg-do compile } */
/* { dg-options "-O2 -fno-strict-aliasing -fdump-tree-optimized" } */

typedef unsigned u32;
typedef unsigned short u16;
typedef unsigned char u8;
struct biosregs {
 union {
  struct {
   u32 edi;
   u32 esi;
   u32 ebp;
   u32 _esp;
   u32 ebx;
   u32 edx;
   u32 ecx;
   u32 eax;
   u32 _fsgs;
   u32 _dses;
   u32 eflags;
  };
  struct {
   u16 di, hdi;
   u16 si, hsi;
   u16 bp, hbp;
   u16 _sp, _hsp;
   u16 bx, hbx;
   u16 dx, hdx;
   u16 cx, hcx;
   u16 ax, hax;
   u16 gs, fs;
   u16 es, ds;
   u16 flags, hflags;
  };
  struct {
   u8 dil, dih, edi2, edi3;
   u8 sil, sih, esi2, esi3;
   u8 bpl, bph, ebp2, ebp3;
   u8 _spl, _sph, _esp2, _esp3;
   u8 bl, bh, ebx2, ebx3;
   u8 dl, dh, edx2, edx3;
   u8 cl, ch, ecx2, ecx3;
   u8 al, ah, eax2, eax3;
  };
 };
};
void initregs(struct biosregs *regs);
void intcall(u8 int_no, const struct biosregs *ireg, struct biosregs *oreg);
static u32 *const gp = (u32*) 0x32;
void keyboard_set_repeat(void)
{
 struct biosregs ireg;
 *gp = 10;
 initregs(&ireg);
 ireg.ax = 0x0305;
 intcall(0x16, &ireg, ((void *)0));
}

/* { dg-final { scan-tree-dump-times "ireg.*ax" 1 "optimized"} } */