static ir_node *ijmp_list;
static bool constant_folding;
+extern bool have_const_functions;
+
static const declaration_t *current_function_decl;
static ir_node *current_function_name;
static ir_node *current_funcsig;
}
if (decl->modifiers & DM_CONST) {
set_entity_additional_property(ent, mtp_property_const);
+ have_const_functions = true;
}
if (decl->modifiers & DM_USED) {
/* TRUE if the declaration includes the GNU
static void do_optimize_funccalls(void)
{
- optimize_funccalls(true, NULL);
+ optimize_funccalls(firm_const_exists, NULL);
}
static void do_gcse(ir_graph *irg)
/** use builtins for some libc functions */
bool use_builtins = false;
+/** we have extern function with const attribute. */
+bool have_const_functions = false;
+
/* to switch on printing of implicit casts */
extern bool print_implicit_casts;
}
gen_firm_finish(asm_out, filename, /*c_mode=*/1,
- /*firm_const_exists=*/0);
+ have_const_functions);
if (asm_out != out) {
fclose(asm_out);
}