2 /* { dg-require-alias "" } */
3 /* { dg-options "-O2" } */
9 typedef struct dw_cfi_struct
11 struct dw_cfi_struct
*dw_cfi_next
;
12 const char *dw_cfi_addr
;
16 typedef struct dw_fde_struct
18 const char *dw_fde_current_label
;
19 dw_cfi_node
*dw_fde_cfi
;
23 dw_cfi_node
*cie_cfi_head
;
24 unsigned fde_table_in_use
;
25 dw_fde_node
*fde_table
;
28 add_cfi (dw_cfi_node
**list_head
, dw_cfi_node
*cfi
)
32 for (p
= list_head
; (*p
) != ((void *)0); p
= &(*p
)->dw_cfi_next
)
38 __inline__
struct dw_cfi_struct
*
41 dw_cfi_node
*cfi
= (dw_cfi_node
*) malloc (sizeof (dw_cfi_node
));
43 memset (cfi
, 0, sizeof (dw_cfi_node
));
48 dwarf2out_cfi_label (void)
50 static char label
[20];
51 static unsigned long label_num
= 0;
53 sprintf (label
, "*.%s%u", "LCFI", (unsigned) (label_num
++));
58 add_fde_cfi (const char *label
, dw_cfi_node
*cfi
)
62 dw_fde_node
*fde
= fde_table
+ fde_table_in_use
- 1;
65 label
= dwarf2out_cfi_label ();
67 if (fde
->dw_fde_current_label
== ((void *)0)
68 || strcmp (label
, fde
->dw_fde_current_label
))
72 fde
->dw_fde_current_label
= label
= strdup (label
);
75 xcfi
->dw_cfi_addr
= label
;
76 add_cfi (&fde
->dw_fde_cfi
, xcfi
);
79 add_cfi (&fde
->dw_fde_cfi
, cfi
);
82 add_cfi (&cie_cfi_head
, cfi
);
92 fde_table
= (dw_fde_node
*) realloc (fde_table
,
93 sizeof (dw_fde_node
));
94 memset (fde_table
, 0, sizeof (dw_fde_node
));
96 add_fde_cfi ("", cfi
);
99 cfi
= fde
->dw_fde_cfi
;
104 if (cfi
->dw_cfi_addr
== NULL
)
107 if (strcmp ("*.LCFI0", cfi
->dw_cfi_addr
))