Mercurial > hg > CbC > CbC_gcc
comparison gcc/tree-into-ssa.c @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | 77e2b8dfacca |
children | f6334be47118 |
comparison
equal
deleted
inserted
replaced
56:3c8a44c06a95 | 63:b7f97abdc517 |
---|---|
1 /* Rewrite a program in Normal form into SSA. | 1 /* Rewrite a program in Normal form into SSA. |
2 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 | 2 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 |
3 Free Software Foundation, Inc. | 3 Free Software Foundation, Inc. |
4 Contributed by Diego Novillo <dnovillo@redhat.com> | 4 Contributed by Diego Novillo <dnovillo@redhat.com> |
5 | 5 |
6 This file is part of GCC. | 6 This file is part of GCC. |
7 | 7 |
23 #include "system.h" | 23 #include "system.h" |
24 #include "coretypes.h" | 24 #include "coretypes.h" |
25 #include "tm.h" | 25 #include "tm.h" |
26 #include "tree.h" | 26 #include "tree.h" |
27 #include "flags.h" | 27 #include "flags.h" |
28 #include "rtl.h" | |
29 #include "tm_p.h" | 28 #include "tm_p.h" |
30 #include "langhooks.h" | 29 #include "langhooks.h" |
31 #include "hard-reg-set.h" | |
32 #include "basic-block.h" | 30 #include "basic-block.h" |
33 #include "output.h" | 31 #include "output.h" |
34 #include "expr.h" | 32 #include "expr.h" |
35 #include "function.h" | 33 #include "function.h" |
36 #include "diagnostic.h" | 34 #include "diagnostic.h" |
35 #include "tree-pretty-print.h" | |
36 #include "gimple-pretty-print.h" | |
37 #include "bitmap.h" | 37 #include "bitmap.h" |
38 #include "tree-flow.h" | 38 #include "tree-flow.h" |
39 #include "gimple.h" | 39 #include "gimple.h" |
40 #include "tree-inline.h" | 40 #include "tree-inline.h" |
41 #include "varray.h" | |
42 #include "timevar.h" | 41 #include "timevar.h" |
43 #include "hashtab.h" | 42 #include "hashtab.h" |
44 #include "tree-dump.h" | 43 #include "tree-dump.h" |
45 #include "tree-pass.h" | 44 #include "tree-pass.h" |
46 #include "cfgloop.h" | 45 #include "cfgloop.h" |
47 #include "domwalk.h" | 46 #include "domwalk.h" |
48 #include "ggc.h" | |
49 #include "params.h" | 47 #include "params.h" |
50 #include "vecprim.h" | 48 #include "vecprim.h" |
51 | 49 |
52 | 50 |
53 /* This file builds the SSA form for a function as described in: | 51 /* This file builds the SSA form for a function as described in: |
1473 | 1471 |
1474 fprintf (file, "{ "); | 1472 fprintf (file, "{ "); |
1475 | 1473 |
1476 EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi) | 1474 EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi) |
1477 { | 1475 { |
1478 print_generic_expr (file, referenced_var (i), 0); | 1476 struct tree_decl_minimal in; |
1477 tree var; | |
1478 in.uid = i; | |
1479 var = (tree) htab_find_with_hash (gimple_referenced_vars (cfun), | |
1480 &in, i); | |
1481 if (var) | |
1482 print_generic_expr (file, var, 0); | |
1483 else | |
1484 fprintf (file, "D.%u", i); | |
1479 fprintf (file, " "); | 1485 fprintf (file, " "); |
1480 } | 1486 } |
1481 | 1487 |
1482 fprintf (file, "}"); | 1488 fprintf (file, "}"); |
1483 } | 1489 } |
1856 | 1862 |
1857 tracked_var = target_for_debug_bind (sym); | 1863 tracked_var = target_for_debug_bind (sym); |
1858 if (tracked_var) | 1864 if (tracked_var) |
1859 { | 1865 { |
1860 gimple note = gimple_build_debug_bind (tracked_var, def, stmt); | 1866 gimple note = gimple_build_debug_bind (tracked_var, def, stmt); |
1861 gsi_insert_after (&gsi, note, GSI_SAME_STMT); | 1867 /* If stmt ends the bb, insert the debug stmt on the single |
1868 non-EH edge from the stmt. */ | |
1869 if (gsi_one_before_end_p (gsi) && stmt_ends_bb_p (stmt)) | |
1870 { | |
1871 basic_block bb = gsi_bb (gsi); | |
1872 edge_iterator ei; | |
1873 edge e, ef = NULL; | |
1874 FOR_EACH_EDGE (e, ei, bb->succs) | |
1875 if (!(e->flags & EDGE_EH)) | |
1876 { | |
1877 gcc_assert (!ef); | |
1878 ef = e; | |
1879 } | |
1880 gcc_assert (ef | |
1881 && single_pred_p (ef->dest) | |
1882 && !phi_nodes (ef->dest) | |
1883 && ef->dest != EXIT_BLOCK_PTR); | |
1884 gsi_insert_on_edge_immediate (ef, note); | |
1885 } | |
1886 else | |
1887 gsi_insert_after (&gsi, note, GSI_SAME_STMT); | |
1862 } | 1888 } |
1863 } | 1889 } |
1864 | 1890 |
1865 register_new_update_single (def, sym); | 1891 register_new_update_single (def, sym); |
1866 } | 1892 } |