Mercurial > hg > CbC > CbC_gcc
comparison gcc/df-scan.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 /* Scanning of rtl for dataflow analysis. | 1 /* Scanning of rtl for dataflow analysis. |
2 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, | 2 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
3 2008, 2009 Free Software Foundation, Inc. | 3 2008, 2009, 2010 Free Software Foundation, Inc. |
4 Originally contributed by Michael P. Hayes | 4 Originally contributed by Michael P. Hayes |
5 (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com) | 5 (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com) |
6 Major rewrite contributed by Danny Berlin (dberlin@dberlin.org) | 6 Major rewrite contributed by Danny Berlin (dberlin@dberlin.org) |
7 and Kenneth Zadeck (zadeck@naturalbridge.com). | 7 and Kenneth Zadeck (zadeck@naturalbridge.com). |
8 | 8 |
283 | 283 |
284 static void | 284 static void |
285 df_scan_set_bb_info (unsigned int index, | 285 df_scan_set_bb_info (unsigned int index, |
286 struct df_scan_bb_info *bb_info) | 286 struct df_scan_bb_info *bb_info) |
287 { | 287 { |
288 gcc_assert (df_scan); | |
289 df_grow_bb_info (df_scan); | 288 df_grow_bb_info (df_scan); |
290 df_scan->block_info[index] = (void *) bb_info; | 289 df_scan->block_info[index] = (void *) bb_info; |
291 } | 290 } |
292 | 291 |
293 | 292 |
1300 if (dump_file) | 1299 if (dump_file) |
1301 fprintf (dump_file, "scanning new insn with uid = %d.\n", uid); | 1300 fprintf (dump_file, "scanning new insn with uid = %d.\n", uid); |
1302 } | 1301 } |
1303 | 1302 |
1304 df_refs_add_to_chains (&collection_rec, bb, insn); | 1303 df_refs_add_to_chains (&collection_rec, bb, insn); |
1305 df_set_bb_dirty (bb); | 1304 if (DEBUG_INSN_P (insn)) |
1305 df_set_bb_dirty_nonlr (bb); | |
1306 else | |
1307 df_set_bb_dirty (bb); | |
1306 | 1308 |
1307 VEC_free (df_ref, stack, collection_rec.def_vec); | 1309 VEC_free (df_ref, stack, collection_rec.def_vec); |
1308 VEC_free (df_ref, stack, collection_rec.use_vec); | 1310 VEC_free (df_ref, stack, collection_rec.use_vec); |
1309 VEC_free (df_ref, stack, collection_rec.eq_use_vec); | 1311 VEC_free (df_ref, stack, collection_rec.eq_use_vec); |
1310 VEC_free (df_mw_hardreg_ptr, stack, collection_rec.mw_vec); | 1312 VEC_free (df_mw_hardreg_ptr, stack, collection_rec.mw_vec); |
1319 df_insn_rescan_debug_internal (rtx insn) | 1321 df_insn_rescan_debug_internal (rtx insn) |
1320 { | 1322 { |
1321 unsigned int uid = INSN_UID (insn); | 1323 unsigned int uid = INSN_UID (insn); |
1322 struct df_insn_info *insn_info; | 1324 struct df_insn_info *insn_info; |
1323 | 1325 |
1324 gcc_assert (DEBUG_INSN_P (insn)); | 1326 gcc_assert (DEBUG_INSN_P (insn) |
1325 gcc_assert (VAR_LOC_UNKNOWN_P (INSN_VAR_LOCATION_LOC (insn))); | 1327 && VAR_LOC_UNKNOWN_P (INSN_VAR_LOCATION_LOC (insn))); |
1326 | 1328 |
1327 if (!df) | 1329 if (!df) |
1328 return false; | 1330 return false; |
1329 | 1331 |
1330 insn_info = DF_INSN_UID_SAFE_GET (INSN_UID (insn)); | 1332 insn_info = DF_INSN_UID_SAFE_GET (INSN_UID (insn)); |
2392 if (DF_REF_EXTRACT_WIDTH (ref1) != DF_REF_EXTRACT_WIDTH (ref2)) | 2394 if (DF_REF_EXTRACT_WIDTH (ref1) != DF_REF_EXTRACT_WIDTH (ref2)) |
2393 return DF_REF_EXTRACT_WIDTH (ref1) - DF_REF_EXTRACT_WIDTH (ref2); | 2395 return DF_REF_EXTRACT_WIDTH (ref1) - DF_REF_EXTRACT_WIDTH (ref2); |
2394 if (DF_REF_EXTRACT_MODE (ref1) != DF_REF_EXTRACT_MODE (ref2)) | 2396 if (DF_REF_EXTRACT_MODE (ref1) != DF_REF_EXTRACT_MODE (ref2)) |
2395 return DF_REF_EXTRACT_MODE (ref1) - DF_REF_EXTRACT_MODE (ref2); | 2397 return DF_REF_EXTRACT_MODE (ref1) - DF_REF_EXTRACT_MODE (ref2); |
2396 } | 2398 } |
2397 return 0; | 2399 return (int)DF_REF_ORDER (ref1) - (int)DF_REF_ORDER (ref2); |
2398 } | 2400 } |
2399 | 2401 |
2400 static void | 2402 static void |
2401 df_swap_refs (VEC(df_ref,stack) **ref_vec, int i, int j) | 2403 df_swap_refs (VEC(df_ref,stack) **ref_vec, int i, int j) |
2402 { | 2404 { |
2601 { | 2603 { |
2602 gcc_assert (regno < FIRST_PSEUDO_REGISTER); | 2604 gcc_assert (regno < FIRST_PSEUDO_REGISTER); |
2603 df->hard_regs_live_count[regno]++; | 2605 df->hard_regs_live_count[regno]++; |
2604 } | 2606 } |
2605 | 2607 |
2606 gcc_assert (DF_REF_NEXT_REG (this_ref) == NULL); | 2608 gcc_assert (DF_REF_NEXT_REG (this_ref) == NULL |
2607 gcc_assert (DF_REF_PREV_REG (this_ref) == NULL); | 2609 && DF_REF_PREV_REG (this_ref) == NULL); |
2608 | 2610 |
2609 DF_REF_NEXT_REG (this_ref) = head; | 2611 DF_REF_NEXT_REG (this_ref) = head; |
2610 | 2612 |
2611 /* We cannot actually link to the head of the chain. */ | 2613 /* We cannot actually link to the head of the chain. */ |
2612 DF_REF_PREV_REG (this_ref) = NULL; | 2614 DF_REF_PREV_REG (this_ref) = NULL; |
3849 bitmap set = (bitmap) vset; | 3851 bitmap set = (bitmap) vset; |
3850 int regno = REGNO (reg); | 3852 int regno = REGNO (reg); |
3851 | 3853 |
3852 gcc_assert (GET_MODE (reg) != BLKmode); | 3854 gcc_assert (GET_MODE (reg) != BLKmode); |
3853 | 3855 |
3854 bitmap_set_bit (set, regno); | |
3855 if (regno < FIRST_PSEUDO_REGISTER) | 3856 if (regno < FIRST_PSEUDO_REGISTER) |
3856 { | 3857 { |
3857 int n = hard_regno_nregs[regno][GET_MODE (reg)]; | 3858 int n = hard_regno_nregs[regno][GET_MODE (reg)]; |
3858 while (--n > 0) | 3859 bitmap_set_range (set, regno, n); |
3859 bitmap_set_bit (set, regno + n); | 3860 } |
3860 } | 3861 else |
3862 bitmap_set_bit (set, regno); | |
3861 } | 3863 } |
3862 | 3864 |
3863 | 3865 |
3864 /* Set the bit for regs that are considered being defined at the entry. */ | 3866 /* Set the bit for regs that are considered being defined at the entry. */ |
3865 | 3867 |
4255 for the conditions that this array is set. */ | 4257 for the conditions that this array is set. */ |
4256 | 4258 |
4257 bool | 4259 bool |
4258 df_hard_reg_used_p (unsigned int reg) | 4260 df_hard_reg_used_p (unsigned int reg) |
4259 { | 4261 { |
4260 gcc_assert (df); | |
4261 return df->hard_regs_live_count[reg] != 0; | 4262 return df->hard_regs_live_count[reg] != 0; |
4262 } | 4263 } |
4263 | 4264 |
4264 | 4265 |
4265 /* A count of the number of times REG is actually used in the some | 4266 /* A count of the number of times REG is actually used in the some |
4270 | 4271 |
4271 | 4272 |
4272 unsigned int | 4273 unsigned int |
4273 df_hard_reg_used_count (unsigned int reg) | 4274 df_hard_reg_used_count (unsigned int reg) |
4274 { | 4275 { |
4275 gcc_assert (df); | |
4276 return df->hard_regs_live_count[reg]; | 4276 return df->hard_regs_live_count[reg]; |
4277 } | 4277 } |
4278 | 4278 |
4279 | 4279 |
4280 /* Get the value of regs_ever_live[REGNO]. */ | 4280 /* Get the value of regs_ever_live[REGNO]. */ |