PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr71866.c
blobb9c1a77660e16c6b805bcd61607575d701947d3b
1 /* { dg-do compile } */
2 /* { dg-additional-options "-ftree-pre -fcode-hoisting" } */
4 __extension__ typedef __UINTPTR_TYPE__ uintptr_t;
6 typedef unsigned char u8;
7 extern unsigned long pci_io_base;
8 u8 in_8 (const volatile void *);
9 int eeh_enabled ();
10 void eeh_check_failure ();
11 static inline
12 u8 eeh_readb(const volatile void *addr)
14 u8 val = in_8(addr);
15 if (((val) == (u8)~0 && eeh_enabled())) eeh_check_failure();
16 return val;
18 extern struct ppc_pci_io {
19 void (*outb) (u8 val, unsigned long port);
21 ppc_pci_io;
22 static inline
23 u8 readb (const volatile void * addr)
25 return eeh_readb((addr));
27 static inline
28 u8 inb (unsigned long port)
30 return readb((volatile void *)(uintptr_t)pci_io_base + port);
32 static inline
33 void outb (u8 val, unsigned long port)
35 if (ppc_pci_io.outb != ((void *)0)) ppc_pci_io.outb (val, port);
37 void frob_econtrol(unsigned long base_hi, unsigned char m, unsigned char v)
39 unsigned char ectr = 0;
40 if (m != 0xff) ectr = inb((base_hi + 0x2));
41 outb((ectr & ~m) ^ v, (base_hi + 0x2));