diff options
-rw-r--r-- | gs/psi/imain.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/gs/psi/imain.c b/gs/psi/imain.c index fd329f772..4044ec180 100644 --- a/gs/psi/imain.c +++ b/gs/psi/imain.c @@ -241,15 +241,14 @@ gs_main_interpret(gs_main_instance *minst, ref * pref, int user_errors, return code; } -int -gs_main_init2(gs_main_instance * minst) -{ - i_ctx_t *i_ctx_p; - int code = gs_main_init1(minst); +/* gcc wants prototypes for all external functions. */ +int gs_main_init2aux(gs_main_instance * minst); + +/* This is an external function to work around */ +/* a bug in gcc 4.5.1 optimizer. See bug 692684. */ +int gs_main_init2aux(gs_main_instance * minst) { + i_ctx_t * i_ctx_p = minst->i_ctx_p; - if (code < 0) - return code; - i_ctx_p = minst->i_ctx_p; if (minst->init_done < 2) { int code, exit_code; ref error_object; @@ -292,6 +291,21 @@ gs_main_init2(gs_main_instance * minst) return code; #endif /* PSI_INCLUDED */ } + return 0; +} + +int +gs_main_init2(gs_main_instance * minst) +{ + i_ctx_t *i_ctx_p; + int code = gs_main_init1(minst); + + if (code < 0) + return code; + i_ctx_p = minst->i_ctx_p; + code = gs_main_init2aux(minst); + if (code < 0) + return code; i_ctx_p = minst->i_ctx_p; /* display_set_callback or run_string may change it */ if (gs_debug_c(':')) print_resource_usage(minst, &gs_imemory, "Start"); |