Updated header
[libfirm] / ir / ana / irmemory.c
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief    Memory disambiguator
23  * @author   Michael Beck
24  * @date     27.12.2006
25  * @version  $Id$
26  */
27 #ifdef HAVE_CONFIG_H
28 #include "config.h"
29 #endif
30
31 #include <stdlib.h>
32
33 #include "irnode_t.h"
34 #include "irgraph_t.h"
35 #include "irprog_t.h"
36 #include "irmemory.h"
37 #include "irflag.h"
38 #include "hashptr.h"
39 #include "irflag.h"
40 #include "irouts.h"
41 #include "irgwalk.h"
42 #include "irprintf.h"
43
44 /** The source language specific language disambiguator function. */
45 static DISAMBIGUATOR_FUNC language_disambuigator = NULL;
46
47 /** The global memory disambiguator options. */
48 static unsigned global_mem_disamgig_opt = aa_opt_no_opt;
49
50 /* Get the memory disambiguator options for a graph. */
51 unsigned get_irg_memory_disambiguator_options(ir_graph *irg) {
52         unsigned opt = irg->mem_disambig_opt;
53         if (opt & aa_opt_inherited)
54                 return global_mem_disamgig_opt;
55         return opt;
56 }  /* get_irg_memory_disambiguator_options */
57
58 /*  Set the memory disambiguator options for a graph. */
59 void set_irg_memory_disambiguator_options(ir_graph *irg, unsigned options) {
60         irg->mem_disambig_opt = options & ~aa_opt_inherited;
61 }  /* set_irg_memory_disambiguator_options */
62
63 /* Set the global disambiguator options for all graphs not having local options. */
64 void set_irp_memory_disambiguator_options(unsigned options) {
65         global_mem_disamgig_opt = options;
66 }  /* set_irp_memory_disambiguator_options */
67
68 /**
69  * Find the base address and entity of an Sel node.
70  *
71  * @param sel  the node
72  * @param pEnt after return points to the base entity.
73  *
74  * @return the base address.
75  */
76 static ir_node *find_base_adr(ir_node *sel, ir_entity **pEnt) {
77         ir_node *ptr = get_Sel_ptr(sel);
78
79         while (is_Sel(ptr)) {
80                 sel = ptr;
81                 ptr = get_Sel_ptr(sel);
82         }
83         *pEnt = get_Sel_entity(sel);
84         return ptr;
85 }  /* find_base_adr */
86
87 /**
88  * Check if the address can be decomposed into base PLUS offset.
89  */
90 static int has_offset(ir_node *adr, int *offset) {
91         if (is_SymConst(adr)) {
92                 *offset = 0;
93                 return 1;
94         }
95         if (is_Sel(adr)) {
96                 ir_entity *ent = get_Sel_entity(adr);
97                 ir_type   *owner = get_entity_owner(ent);
98
99                 if (get_type_state(owner) != layout_fixed) {
100                         /* The layout is NOT fixed yet, symbolic evaluation needed */
101                 }
102         }
103         return 0;
104 }  /* has_offset */
105
106 /**
107  * Two address expressions have the same base address,
108  * check if there offsets are different.
109  *
110  * @param adr1  The first address.
111  * @param adr2  The second address.
112  */
113 static ir_alias_relation different_offsets(ir_node *adr1, ir_node *adr2) {
114         int offset1, offset2;
115         if (has_offset(adr1, &offset1) && has_offset(adr2, &offset2)) {
116                 /* */
117         }
118         return may_alias;
119 }  /* different_offsets */
120
121 /**
122  * Determine the alias relation by checking if adr1 and adr2 are pointer
123  * to different type.
124  *
125  * @param adr1    The first address.
126  * @param adr2    The second address.
127  */
128 static ir_alias_relation different_types(ir_node *adr1, ir_node *adr2)
129 {
130         ir_entity *ent1 = NULL, *ent2 = NULL;
131
132         if (is_SymConst(adr1) && get_SymConst_kind(adr1) == symconst_addr_ent)
133                 ent1 = get_SymConst_entity(adr1);
134         else if (is_Sel(adr1))
135                 ent1 = get_Sel_entity(adr1);
136
137         if (is_SymConst(adr2) && get_SymConst_kind(adr2) == symconst_addr_ent)
138                 ent2 = get_SymConst_entity(adr2);
139         else if (is_Sel(adr2))
140                 ent2 = get_Sel_entity(adr2);
141
142         if (ent1 != NULL && ent2 != NULL) {
143                 ir_type *tp1 = get_entity_type(ent1);
144                 ir_type *tp2 = get_entity_type(ent2);
145
146                 if (tp1 != tp2) {
147                         if (is_Pointer_type(tp1) && is_Pointer_type(tp2)) {
148                                 /* do deref until no pointer types are found */
149                                 do {
150                                         tp1 = get_pointer_points_to_type(tp1);
151                                         tp2 = get_pointer_points_to_type(tp2);
152                                 } while (is_Pointer_type(tp1) && is_Pointer_type(tp2));
153                         }
154
155                         if (get_type_tpop(tp1) != get_type_tpop(tp2)) {
156                                 /* different type structure */
157                                 return no_alias;
158                         }
159                         if (is_Class_type(tp1)) {
160                                 /* check class hierarchy */
161                                 if (! is_SubClass_of(tp1, tp2) &&
162                                         ! is_SubClass_of(tp2, tp1))
163                                         return no_alias;
164                         } else {
165                                 /* different types */
166                                 return no_alias;
167                         }
168                 }
169         }
170         return may_alias;
171 }  /* different_types */
172
173 /**
174  * Returns non-zero if a node is a routine parameter.
175  *
176  * @param node  the node to test
177  */
178 static int is_arg_Proj(ir_node *node) {
179         if (! is_Proj(node))
180                 return 0;
181         node = get_Proj_pred(node);
182         if (! is_Proj(node))
183                 return 0;
184         return pn_Start_T_args == get_Proj_proj(node) && is_Start(get_Proj_pred(node));
185 }  /* is_arg_Proj */
186
187 /**
188  * Determine the alias relation between two addresses.
189  */
190 static ir_alias_relation _get_alias_relation(
191         ir_graph *irg,
192         ir_node *adr1, ir_mode *mode1,
193         ir_node *adr2, ir_mode *mode2)
194 {
195         ir_opcode op1, op2;
196         ir_entity *ent1, *ent2;
197         unsigned options;
198
199         if (! get_opt_alias_analysis())
200                 return may_alias;
201
202         if (adr1 == adr2)
203                 return sure_alias;
204
205         options = get_irg_memory_disambiguator_options(irg);
206
207         /* The Armageddon switch */
208         if (options & aa_opt_no_alias)
209                 return no_alias;
210
211         /* Two save some code, sort the addresses by its id's. Beware, this
212            might break some things, so better check here. */
213         assert(iro_SymConst < iro_Sel && iro_Sel < iro_Proj && "Code dependence breaked");
214         op1 = get_irn_opcode(adr1);
215         op2 = get_irn_opcode(adr2);
216
217         if (op1 > op2) {
218                 ir_node *t = adr1;
219                 ir_mode *m = mode1;
220                 adr1  = adr2;
221                 mode1 = mode2;
222                 adr2  = t;
223                 mode2 = m;
224         }
225
226         if (is_SymConst(adr1) && get_SymConst_kind(adr1) == symconst_addr_ent) {
227                 /* first address is a global variable */
228
229                 if (is_SymConst(adr2) && get_SymConst_kind(adr2) == symconst_addr_ent) {
230                         /* both addresses are global variables and we know
231                            they are different (R1 a) */
232                         if (get_SymConst_entity(adr1) != get_SymConst_entity(adr2))
233                                 return no_alias;
234                         else {
235                                 /* equal addresses */
236                                 return sure_alias;
237                         }
238                 }
239                 if (is_Sel(adr2)) {
240                         ir_node *base = find_base_adr(adr2, &ent2);
241
242                         if (is_SymConst(base) && get_SymConst_kind(base) == symconst_addr_ent) {
243                                 /* base address is a global var (R1 a) */
244                                 if (adr1 != base)
245                                         return no_alias;
246                                 if (base == adr1)
247                                         return different_offsets(adr1, adr2);
248                         } else if (base == get_irg_frame(irg)) {
249                                 /* the second one is a local variable so they are always
250                                    different (R1 b) */
251                                 return no_alias;
252                         } else if (base == get_irg_tls(irg)) {
253                                 /* the second one is a TLS variable so they are always
254                                    different (R1 c) */
255                                 return no_alias;
256                         }
257                 }
258
259                 /* Here we are: the first is a global var, the second some pointer. */
260                 ent1 = get_SymConst_entity(adr1);
261                 if (get_entity_address_taken(ent1) == ir_address_not_taken) {
262                         /* The address of the global variable was never taken, so
263                            the pointer cannot match (R2). */
264                         return no_alias;
265                 }
266         } else if (is_Sel(adr1)) {
267                 /* the first address is a Sel */
268                 ir_node *base1 = find_base_adr(adr1, &ent1);
269
270                 if (base1 == get_irg_frame(irg)) {
271                         /* the first is a local variable */
272                         if (is_Sel(adr2)) {
273                                 /* the second address is a Sel */
274                                 ir_node *base2 = find_base_adr(adr2, &ent2);
275
276                                 if (base2 == get_irg_frame(irg)) {
277                                         /* both addresses are local variables and we know
278                                            they are different (R1 a) */
279                                         if (ent1 != ent2)
280                                                 return no_alias;
281                                         else
282                                                 return different_offsets(adr1, adr2);
283                                 } else if (base2 == get_irg_tls(irg)) {
284                                         /* the second one is a TLS variable so they are always
285                                        different (R1 d) */
286                                         return no_alias;
287                                 } else if (is_arg_Proj(base2)) {
288                                         /* the second one is an offset from a parameter so they are
289                                            always different (R1 e) */
290                                         return no_alias;
291                                 }
292                         } else if (is_arg_Proj(adr2)) {
293                                 /* a local variable and a parameter are always different (R1 e) */
294                                 return no_alias;
295                         }
296                 } else if (base1 == get_irg_tls(irg)) {
297                         /* the first is a TLS variable */
298                         if (is_Sel(adr2)) {
299                                 /* the second address is a Sel */
300                                 ir_node *base2 = find_base_adr(adr2, &ent2);
301
302                                 if (base2 == get_irg_frame(irg)) {
303                                         /* the second one is a local variable so they are always
304                                        different (R1 d) */
305                                         return no_alias;
306                                 } else if (base2 == get_irg_tls(irg)) {
307                                         /* both addresses are TLS variables and we know
308                                            they are different (R1 a) */
309                                         if (ent1 != ent2)
310                                                 return no_alias;
311                                         else
312                                                 return different_offsets(adr1, adr2);
313                                 }
314                         }
315                 } else if (is_arg_Proj(base1)) {
316                         /* the first one is an offset from a parameter */
317                         if (is_Sel(adr2)) {
318                                 /* the second address is a Sel */
319                                 ir_node *base2 = find_base_adr(adr2, &ent2);
320
321                                 if (base2 == get_irg_frame(irg)) {
322                                         /* the second one is a local variable so they are always
323                                        different (R1 e) */
324                                         return no_alias;
325                                 }
326                         }
327                 }
328         }
329
330         if (options & aa_opt_type_based) { /* Type based alias analysis */
331                 ir_alias_relation rel;
332
333                 if (options & aa_opt_byte_type_may_alias) {
334                         if (get_mode_size_bits(mode1) == 8 || get_mode_size_bits(mode2) == 8) {
335                                 /* One of the modes address a byte. Assume a may_alias and leave
336                                    the type based check. */
337                                 goto leave_type_based_alias;
338                         }
339                 }
340                 /* cheap check: If the mode sizes did not match, the types MUST be different */
341                 if (get_mode_size_bits(mode1) != get_mode_size_bits(mode2))
342                         return no_alias;
343
344                 /* try rule R5 */
345                 rel = different_types(adr1, adr2);
346                 if (rel != may_alias)
347                         return rel;
348 leave_type_based_alias:;
349         }
350
351         /* do we have a language specific memory disambiguator? */
352         if (language_disambuigator) {
353                 ir_alias_relation rel = (*language_disambuigator)(irg, adr1, mode1, adr2, mode2);
354                 if (rel != may_alias)
355                         return rel;
356         }
357
358         /* access points-to information here */
359         return may_alias;
360 }  /* _get_alias_relation */
361
362 /*
363  * Determine the alias relation between two addresses.
364  */
365 ir_alias_relation get_alias_relation(
366         ir_graph *irg,
367         ir_node *adr1, ir_mode *mode1,
368         ir_node *adr2, ir_mode *mode2)
369 {
370         ir_alias_relation rel = _get_alias_relation(irg, adr1, mode1, adr2, mode2);
371         return rel;
372 }  /* get_alias_relation */
373
374 /* Set a source language specific memory disambiguator function. */
375 void set_language_memory_disambiguator(DISAMBIGUATOR_FUNC func) {
376         language_disambuigator = func;
377 }  /* set_language_memory_disambiguator */
378
379 /** The result cache for the memory disambiguator. */
380 static set *result_cache = NULL;
381
382 /** An entry in the relation cache. */
383 typedef struct mem_disambig_entry {
384         ir_node           *adr1;    /**< The first address. */
385         ir_node           *adr2;    /**< The second address. */
386         ir_alias_relation result;   /**< The alias relation result. */
387 } mem_disambig_entry;
388
389 #define HASH_ENTRY(adr1, adr2)  (HASH_PTR(adr1) ^ HASH_PTR(adr2))
390
391 /**
392  * Compare two relation cache entries.
393  */
394 static int cmp_mem_disambig_entry(const void *elt, const void *key, size_t size) {
395         const mem_disambig_entry *p1 = elt;
396         const mem_disambig_entry *p2 = key;
397
398         return p1->adr1 == p2->adr1 && p1->adr2 == p2->adr2;
399 }  /* cmp_mem_disambig_entry */
400
401 /**
402  * Initialize the relation cache.
403  */
404 void mem_disambig_init(void) {
405         result_cache = new_set(cmp_mem_disambig_entry, 8);
406 }  /* mem_disambig_init */
407
408 /*
409  * Determine the alias relation between two addresses.
410  */
411 ir_alias_relation get_alias_relation_ex(
412         ir_graph *irg,
413         ir_node *adr1, ir_mode *mode1,
414         ir_node *adr2, ir_mode *mode2)
415 {
416         mem_disambig_entry key, *entry;
417
418         if (! get_opt_alias_analysis())
419                 return may_alias;
420
421         if (get_irn_opcode(adr1) > get_irn_opcode(adr2)) {
422                 ir_node *t = adr1;
423                 adr1 = adr2;
424                 adr2 = t;
425         }
426
427         key.adr1 = adr1;
428         key.adr2 = adr2;
429         entry = set_find(result_cache, &key, sizeof(key), HASH_ENTRY(adr1, adr2));
430         if (entry)
431                 return entry->result;
432
433         key.result = get_alias_relation(irg, adr1, mode1, adr2, mode2);
434
435         set_insert(result_cache, &key, sizeof(key), HASH_ENTRY(adr1, adr2));
436         return key.result;
437 }  /* get_alias_relation_ex */
438
439 /* Free the relation cache. */
440 void mem_disambig_term(void) {
441         if (result_cache) {
442                 del_set(result_cache);
443                 result_cache = NULL;
444         }
445 }  /* mem_disambig_term */
446
447 /**
448  * Check the mode of a Load/Store with the mode of the entity
449  * that is accessed.
450  * If the mode of the entity and the Load/Store mode do not match, we
451  * have the bad reinterpret case:
452  *
453  * int i;
454  * char b = *(char *)&i;
455  *
456  * We do NOT count this as one value and return address_taken
457  * in that case.
458  * However, we support an often used case. If the mode is two-complement
459  * we allow casts between signed/unsigned.
460  *
461  * @param mode     the mode of the Load/Store
462  * @param ent_mode the mode of the accessed entity
463  *
464  * @return non-zero if the Load/Store is a hidden cast, zero else
465  */
466 static int is_hidden_cast(ir_mode *mode, ir_mode *ent_mode) {
467         if (ent_mode != mode) {
468                 if (ent_mode == NULL ||
469                         get_mode_size_bits(ent_mode) != get_mode_size_bits(mode) ||
470                         get_mode_sort(ent_mode) != get_mode_sort(mode) ||
471                         get_mode_arithmetic(ent_mode) != irma_twos_complement ||
472                         get_mode_arithmetic(mode) != irma_twos_complement)
473                         return 1;
474         }
475         return 0;
476 }  /* is_hidden_cast */
477
478 /**
479  * Determine the address_taken state of a node (or it's successor Sels).
480  *
481  * @param irn  the node
482  */
483 static ir_address_taken_state find_address_taken_state(ir_node *irn) {
484         int     i;
485         ir_mode *emode, *mode;
486         ir_node *value;
487         ir_entity *ent;
488
489         for (i = get_irn_n_outs(irn) - 1; i >= 0; --i) {
490                 ir_node *succ = get_irn_out(irn, i);
491
492                 switch (get_irn_opcode(succ)) {
493                 case iro_Load:
494                         /* check if this load is not a hidden conversion */
495                         mode = get_Load_mode(succ);
496                         ent = is_SymConst(irn) ? get_SymConst_entity(irn) : get_Sel_entity(irn);
497                         emode = get_type_mode(get_entity_type(ent));
498                         if (is_hidden_cast(mode, emode))
499                                 return ir_address_taken;
500                         break;
501
502                 case iro_Store:
503                         /* check that the node is not the Store's value */
504                         value = get_Store_value(succ);
505                         if (value == irn)
506                                 return ir_address_taken;
507                         /* check if this Store is not a hidden conversion */
508                         mode = get_irn_mode(value);
509                         ent = is_SymConst(irn) ? get_SymConst_entity(irn) : get_Sel_entity(irn);
510                         emode = get_type_mode(get_entity_type(ent));
511                         if (is_hidden_cast(mode, emode))
512                                 return ir_address_taken;
513                         break;
514
515                 case iro_Sel: {
516                         /* Check the successor of irn. */
517                         ir_address_taken_state res = find_address_taken_state(succ);
518                         if (res != ir_address_not_taken)
519                                 return res;
520                         break;
521                 }
522
523                 case iro_Call:
524                         /* Only the call address is not an address taker but
525                            this is an uninteresting case, so we ignore it here. */
526                         return ir_address_taken;
527
528                 default:
529                         /* another op, the address may be taken */
530                         return ir_address_taken_unknown;
531                 }
532         }
533         /* All successors finished, the address is not taken. */
534         return ir_address_not_taken;
535 }  /* find_address_taken_state */
536
537 /**
538  * Update the "address taken" flag of all frame entities.
539  */
540 static void analyse_irg_address_taken(ir_graph *irg) {
541         ir_type *ft = get_irg_frame_type(irg);
542         ir_node *irg_frame;
543         int i;
544
545         /* set initial state to not_taken, as this is the "smallest" state */
546         for (i = get_class_n_members(ft) - 1; i >= 0; --i) {
547                 ir_entity *ent = get_class_member(ft, i);
548
549                 set_entity_address_taken(ent, ir_address_not_taken);
550         }
551
552         assure_irg_outs(irg);
553
554         irg_frame = get_irg_frame(irg);
555
556         for (i = get_irn_n_outs(irg_frame) - 1; i >= 0; --i) {
557                 ir_node *succ = get_irn_out(irg_frame, i);
558                 ir_address_taken_state state;
559
560             if (is_Sel(succ)) {
561                         ir_entity *ent = get_Sel_entity(succ);
562
563                         if (get_entity_address_taken(ent) == ir_address_taken)
564                                 continue;
565
566                         state = find_address_taken_state(succ);
567                         if (state > get_entity_address_taken(ent))
568                                 set_entity_address_taken(ent, state);
569                 }
570         }
571         /* now computed */
572         irg->adr_taken_state = ir_address_taken_computed;
573 }  /* analyse_address_taken */
574
575 /* Returns the current address taken state of the graph. */
576 ir_address_taken_computed_state get_irg_address_taken_state(const ir_graph *irg) {
577         return irg->adr_taken_state;
578 }  /* get_irg_address_taken_state */
579
580 /* Sets the current address taken state of the graph. */
581 void set_irg_address_taken_state(ir_graph *irg, ir_address_taken_computed_state state) {
582         irg->adr_taken_state = state;
583 }  /* set_irg_address_taken_state */
584
585 /* Assure that the address taken flag is computed for the given graph. */
586 void assure_irg_address_taken_computed(ir_graph *irg) {
587         if (irg->adr_taken_state == ir_address_taken_not_computed)
588                 analyse_irg_address_taken(irg);
589 }  /* assure_irg_address_taken_computed */
590
591 /**
592  * Initialize the address_taken flag for a global type like type.
593  */
594 static void init_taken_flag(ir_type * tp) {
595         int i;
596
597         /* All external visible entities are at least
598            ir_address_taken_unknown. This is very conservative. */
599         for (i = get_compound_n_members(tp) - 1; i >= 0; --i) {
600                 ir_entity *ent = get_compound_member(tp, i);
601                 ir_address_taken_state state;
602
603                 state = get_entity_visibility(ent) == visibility_external_visible ?
604                                 ir_address_taken_unknown : ir_address_not_taken ;
605                 set_entity_address_taken(ent, state);
606         }
607 }  /* init_taken_flag */
608
609 #if 0
610 /**
611  * Print the address taken state of all entities of a given type for debugging.
612  */
613 static void print_address_taken_state(ir_type *tp) {
614         int i;
615         for (i = get_compound_n_members(tp) - 1; i >= 0; --i) {
616                 ir_entity *ent = get_compound_member(tp, i);
617                 ir_address_taken_state state = get_entity_address_taken(ent);
618
619                 if (state != ir_address_not_taken) {
620                         assert(ir_address_not_taken <= state && state <= ir_address_taken);
621                         ir_printf("%+F: %s\n", ent, get_address_taken_state_name(state));
622                 }
623         }
624 }  /* print_address_taken_state */
625 #endif
626
627 /**
628  * Post-walker: check for global entity address
629  */
630 static void check_global_address(ir_node *irn, void *env) {
631         ir_node *tls = env;
632         ir_entity *ent;
633         ir_address_taken_state state;
634
635         if (is_SymConst(irn) && get_SymConst_kind(irn) == symconst_addr_ent) {
636                 /* A global. */
637                 ent = get_SymConst_entity(irn);
638         } else if (is_Sel(irn) && get_Sel_ptr(irn) == tls) {
639                 /* A TLS variable. */
640                 ent = get_Sel_entity(irn);
641         } else
642                 return;
643
644         if (get_entity_address_taken(ent) >= ir_address_taken) {
645                 /* Already at the maximum. */
646                 return;
647         }
648         state = find_address_taken_state(irn);
649         if (state > get_entity_address_taken(ent))
650                 set_entity_address_taken(ent, state);
651 }  /* check_global_address */
652
653 /**
654  * Update the "address taken" flag of all global entities.
655  */
656 static void analyse_irp_globals_address_taken(void) {
657         int i;
658
659         init_taken_flag(get_glob_type());
660         init_taken_flag(get_tls_type());
661
662         for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
663                 ir_graph *irg = get_irp_irg(i);
664
665                 assure_irg_outs(irg);
666                 irg_walk_graph(irg, NULL, check_global_address, get_irg_tls(irg));
667         }
668         //print_address_taken_state(get_glob_type());
669         //print_address_taken_state(get_tls_type());
670
671         /* now computed */
672         irp->globals_adr_taken_state = ir_address_taken_computed;
673 }  /* analyse_irp_globals_address_taken */
674
675 /* Returns the current address taken state of the globals. */
676 ir_address_taken_computed_state get_irp_globals_address_taken_state(void) {
677         return irp->globals_adr_taken_state;
678 }  /* get_irp_globals_address_taken_state */
679
680 /* Sets the current address taken state of the graph. */
681 void set_irp_globals_address_taken_state(ir_address_taken_computed_state state) {
682         irp->globals_adr_taken_state = state;
683 }  /* set_irg_address_taken_state */
684
685 /* Assure that the address taken flag is computed for the globals. */
686 void assure_irp_globals_address_taken_computed(void) {
687         if (irp->globals_adr_taken_state == ir_address_taken_not_computed)
688                 analyse_irp_globals_address_taken();
689 }  /* assure_irp_globals_address_taken_computed */