]> gcc.gnu.org Git - gcc.git/blame - gcc/run-rtl-passes.c
re PR target/92462 ([arm32] -ftree-pre makes a variable to be wrongly hoisted out)
[gcc.git] / gcc / run-rtl-passes.c
CommitLineData
c2e84327 1/* run-rtl-passes.c - Run RTL passes directly from frontend
a5544970 2 Copyright (C) 2016-2019 Free Software Foundation, Inc.
c2e84327
DM
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#include "config.h"
21#include "system.h"
22#include "coretypes.h"
23#include "target.h"
24#include "rtl.h"
25#include "function.h"
26#include "basic-block.h"
27#include "tree-pass.h"
28#include "context.h"
29#include "pass_manager.h"
30#include "bitmap.h"
31#include "df.h"
32#include "regs.h"
91a00d11 33#include "output.h"
83087d65 34#include "debug.h" /* for debug_hooks. */
c2e84327
DM
35#include "insn-attr-common.h" /* for INSN_SCHEDULING. */
36#include "insn-attr.h" /* for init_sched_attrs. */
37#include "run-rtl-passes.h"
38
39/* Run the backend passes, starting at the given pass.
40 Take ownership of INITIAL_PASS_NAME. */
41
42void
43run_rtl_passes (char *initial_pass_name)
44{
45 cfun->pass_startwith = initial_pass_name;
46 max_regno = max_reg_num ();
47
83087d65 48 /* cgraphunit.c normally handles this. */
91a00d11 49 switch_to_section (text_section);
83087d65
JJ
50 (*debug_hooks->assembly_start) ();
51
c2e84327
DM
52 /* Pass "expand" normally sets this up. */
53#ifdef INSN_SCHEDULING
54 init_sched_attrs ();
55#endif
56
57 bitmap_obstack_initialize (NULL);
58 bitmap_obstack_initialize (&reg_obstack);
59
60 opt_pass *rest_of_compilation
61 = g->get_passes ()->get_rest_of_compilation ();
62 gcc_assert (rest_of_compilation);
63 execute_pass_list (cfun, rest_of_compilation);
64
65 opt_pass *clean_slate = g->get_passes ()->get_clean_slate ();
66 gcc_assert (clean_slate);
67 execute_pass_list (cfun, clean_slate);
68
69 bitmap_obstack_release (&reg_obstack);
70
71 cfun->curr_properties |= PROP_rtl;
72}
This page took 1.918983 seconds and 5 git commands to generate.