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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [unaligned-1.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* PR middle-end/7847 */
2
/* Originator: <jk@tools.de> */
3
/* { dg-do run } */
4
 
5
/* This used to fail on SPARC at runtime because of
6
   an unaligned memory access.  */
7
 
8
typedef char int8_t;
9
typedef short int16_t;
10
typedef int int32_t;
11
typedef unsigned char uint8_t;
12
typedef unsigned short uint16_t;
13
typedef unsigned int uint32_t;
14
 
15
typedef struct {
16
    uint32_t address;
17
    uint16_t size;
18
} __attribute__ ((packed)) sml_agl_data_t;
19
 
20
typedef struct {
21
  sml_agl_data_t data[9];
22
} __attribute__ ((packed)) sml_agli_t;
23
 
24
typedef struct {
25
  sml_agli_t sml_agli;
26
} __attribute__ ((packed)) dsi_t;
27
 
28
typedef struct {
29
  int a;
30
  dsi_t dsi_pack;
31
} dvd_priv_t;
32
 
33
int dvd_read_sector(dvd_priv_t *d, unsigned char* data)
34
{
35
  int i, skip=0;
36
 
37
  for (i=0; i < 9; i++)
38
    if ((skip=d->dsi_pack.sml_agli.data[i].address) != 0)
39
      break;
40
 
41
  return skip;
42
}
43
 
44
int main(void)
45
{
46
  static dvd_priv_t dvd_priv;
47
  dvd_read_sector(&dvd_priv, 0);
48
  return 0;
49
}

powered by: WebSVN 2.1.0

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