From: Michael Beck Date: Mon, 10 Mar 2008 10:47:32 +0000 (+0000) Subject: BugFix: compute the layout of the frame types AFTER the optimizations like X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=7cd4e7266b0f48b3d2c6c98592488cb2c4f3fc0f;p=cparser BugFix: compute the layout of the frame types AFTER the optimizations like inlining are finished: This fixes fehler110.c [r18923] --- diff --git a/driver/firm_opt.c b/driver/firm_opt.c index 1cf0253..9eaea88 100644 --- a/driver/firm_opt.c +++ b/driver/firm_opt.c @@ -714,24 +714,14 @@ static int compute_type_size(ir_type *ty) } /* compute_type_size */ /** - * layout all types of the Firm graph + * layout all non-frame types of the Firm graph */ static void compute_type_sizes(void) { int i; ir_type *tp; - ir_graph *irg; - /* all frame types */ - for (i = get_irp_n_irgs() - 1; i >= 0; --i) { - irg = get_irp_irg(i); - /* do not optimize away variables in debug mode */ - if (firm_opt.debug_mode == DBG_MODE_NONE) - opt_frame_irg(irg); - compute_type_size(get_irg_frame_type(irg)); - } - - /* all other types */ + /* all non-frame other types */ for (i = get_irp_n_types() - 1; i >= 0; --i) { tp = get_irp_type(i); compute_type_size(tp); @@ -747,6 +737,24 @@ static void compute_type_sizes(void) } } /* compute_type_sizes */ +/** + * layout all frame-types of the Firm graph + */ +static void compute_frame_type_sizes(void) +{ + int i; + ir_graph *irg; + + /* all frame types */ + for (i = get_irp_n_irgs() - 1; i >= 0; --i) { + irg = get_irp_irg(i); + /* do not optimize away variables in debug mode */ + if (firm_opt.debug_mode == DBG_MODE_NONE) + opt_frame_irg(irg); + compute_type_size(get_irg_frame_type(irg)); + } +} /* compute_frame_type_sizes */ + /** * do Firm lowering * @@ -1044,6 +1052,12 @@ void gen_firm_finish(FILE *out, const char *input_filename, int c_mode, int firm /* computes the sizes of all types that are still not computed */ compute_type_sizes(); + /* lower copyb nodes */ + for (i = get_irp_n_irgs() - 1; i >= 0; --i) { + ir_graph *irg = get_irp_irg(i); + lower_CopyB(irg, 128, 4); + } + if (firm_dump.statistic & STAT_BEFORE_OPT) { stat_dump_snapshot(input_filename, "noopt"); } @@ -1061,6 +1075,9 @@ void gen_firm_finish(FILE *out, const char *input_filename, int c_mode, int firm if (firm_opt.lower) do_firm_lowering(input_filename); + /* computes the sizes of all frame types */ + compute_frame_type_sizes(); + /* set the phase to low */ for (i = get_irp_n_irgs() - 1; i >= 0; --i) set_irg_phase_low(get_irp_irg(i));