projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f9580ab
)
fix 'COMMON' variables in cparser
author
Matthias Braun
<matze@braunis.de>
Wed, 3 Feb 2010 20:25:52 +0000
(20:25 +0000)
committer
Matthias Braun
<matze@braunis.de>
Wed, 3 Feb 2010 20:25:52 +0000
(20:25 +0000)
[r27033]
ast2firm.c
patch
|
blob
|
history
diff --git
a/ast2firm.c
b/ast2firm.c
index
e699f4a
..
764ea68
100644
(file)
--- a/
ast2firm.c
+++ b/
ast2firm.c
@@
-4549,6
+4549,9
@@
static void create_global_variable(entity_t *entity)
ir_type *var_type = entity->variable.thread_local ?
get_tls_type() : get_glob_type();
create_variable_entity(entity, DECLARATION_KIND_GLOBAL_VARIABLE, var_type);
+ /* uninitialized globals get merged in C */
+ if (entity->variable.initializer == NULL)
+ linkage |= IR_LINKAGE_MERGE;
add_entity_linkage(entity->variable.v.entity, linkage);
}