Mercurial > hg > CbC > CbC_gcc
comparison gcc/regmove.c @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children |
comparison
equal
deleted
inserted
replaced
65:65488c3d617d | 67:f6334be47118 |
---|---|
1 /* Move registers around to reduce number of move instructions needed. | 1 /* Move registers around to reduce number of move instructions needed. |
2 Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, | 2 Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, |
3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 | 3 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
4 Free Software Foundation, Inc. | 4 Free Software Foundation, Inc. |
5 | 5 |
6 This file is part of GCC. | 6 This file is part of GCC. |
7 | 7 |
8 GCC is free software; you can redistribute it and/or modify it under | 8 GCC is free software; you can redistribute it and/or modify it under |
38 #include "flags.h" | 38 #include "flags.h" |
39 #include "function.h" | 39 #include "function.h" |
40 #include "expr.h" | 40 #include "expr.h" |
41 #include "basic-block.h" | 41 #include "basic-block.h" |
42 #include "except.h" | 42 #include "except.h" |
43 #include "toplev.h" | 43 #include "diagnostic-core.h" |
44 #include "reload.h" | 44 #include "reload.h" |
45 #include "timevar.h" | 45 #include "timevar.h" |
46 #include "tree-pass.h" | 46 #include "tree-pass.h" |
47 #include "df.h" | 47 #include "df.h" |
48 #include "ira.h" | 48 #include "ira.h" |
70 static int fixup_match_2 (rtx, rtx, rtx, rtx); | 70 static int fixup_match_2 (rtx, rtx, rtx, rtx); |
71 | 71 |
72 /* Return nonzero if registers with CLASS1 and CLASS2 can be merged without | 72 /* Return nonzero if registers with CLASS1 and CLASS2 can be merged without |
73 causing too much register allocation problems. */ | 73 causing too much register allocation problems. */ |
74 static int | 74 static int |
75 regclass_compatible_p (enum reg_class class0, enum reg_class class1) | 75 regclass_compatible_p (reg_class_t class0, reg_class_t class1) |
76 { | 76 { |
77 return (class0 == class1 | 77 return (class0 == class1 |
78 || (reg_class_subset_p (class0, class1) | 78 || (reg_class_subset_p (class0, class1) |
79 && ! CLASS_LIKELY_SPILLED_P (class0)) | 79 && ! targetm.class_likely_spilled_p (class0)) |
80 || (reg_class_subset_p (class1, class0) | 80 || (reg_class_subset_p (class1, class0) |
81 && ! CLASS_LIKELY_SPILLED_P (class1))); | 81 && ! targetm.class_likely_spilled_p (class1))); |
82 } | 82 } |
83 | 83 |
84 | 84 |
85 #ifdef AUTO_INC_DEC | 85 #ifdef AUTO_INC_DEC |
86 | 86 |
512 optimize_reg_copy_3 (rtx insn, rtx dest, rtx src) | 512 optimize_reg_copy_3 (rtx insn, rtx dest, rtx src) |
513 { | 513 { |
514 rtx src_reg = XEXP (src, 0); | 514 rtx src_reg = XEXP (src, 0); |
515 int src_no = REGNO (src_reg); | 515 int src_no = REGNO (src_reg); |
516 int dst_no = REGNO (dest); | 516 int dst_no = REGNO (dest); |
517 rtx p, set; | 517 rtx p, set, set_insn; |
518 enum machine_mode old_mode; | 518 enum machine_mode old_mode; |
519 basic_block bb = BLOCK_FOR_INSN (insn); | 519 basic_block bb = BLOCK_FOR_INSN (insn); |
520 | 520 |
521 if (src_no < FIRST_PSEUDO_REGISTER | 521 if (src_no < FIRST_PSEUDO_REGISTER |
522 || dst_no < FIRST_PSEUDO_REGISTER | 522 || dst_no < FIRST_PSEUDO_REGISTER |
550 if (GET_MODE_BITSIZE (GET_MODE (src_reg)) <= GET_MODE_BITSIZE (GET_MODE (src)) | 550 if (GET_MODE_BITSIZE (GET_MODE (src_reg)) <= GET_MODE_BITSIZE (GET_MODE (src)) |
551 && !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (GET_MODE (src)), | 551 && !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (GET_MODE (src)), |
552 GET_MODE_BITSIZE (GET_MODE (src_reg)))) | 552 GET_MODE_BITSIZE (GET_MODE (src_reg)))) |
553 return; | 553 return; |
554 | 554 |
555 set_insn = p; | |
555 old_mode = GET_MODE (src_reg); | 556 old_mode = GET_MODE (src_reg); |
556 PUT_MODE (src_reg, GET_MODE (src)); | 557 PUT_MODE (src_reg, GET_MODE (src)); |
557 XEXP (src, 0) = SET_SRC (set); | 558 XEXP (src, 0) = SET_SRC (set); |
558 | 559 |
559 /* Include this change in the group so that it's easily undone if | 560 /* Include this change in the group so that it's easily undone if |
582 PUT_MODE (src_reg, old_mode); | 583 PUT_MODE (src_reg, old_mode); |
583 XEXP (src, 0) = src_reg; | 584 XEXP (src, 0) = src_reg; |
584 } | 585 } |
585 else | 586 else |
586 { | 587 { |
587 rtx note = find_reg_note (p, REG_EQUAL, NULL_RTX); | 588 rtx note = find_reg_note (set_insn, REG_EQUAL, NULL_RTX); |
588 if (note) | 589 if (note) |
589 remove_note (p, note); | 590 { |
591 if (rtx_equal_p (XEXP (note, 0), XEXP (src, 0))) | |
592 { | |
593 XEXP (note, 0) | |
594 = gen_rtx_fmt_e (GET_CODE (src), GET_MODE (src), | |
595 XEXP (note, 0)); | |
596 df_notes_rescan (set_insn); | |
597 } | |
598 else | |
599 remove_note (set_insn, note); | |
600 } | |
590 } | 601 } |
591 } | 602 } |
592 | 603 |
593 | 604 |
594 /* If we were not able to update the users of src to use dest directly, try | 605 /* If we were not able to update the users of src to use dest directly, try |
1334 | 1345 |
1335 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'h': | 1346 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'h': |
1336 case 'j': case 'k': case 'l': case 'p': case 'q': case 't': case 'u': | 1347 case 'j': case 'k': case 'l': case 'p': case 'q': case 't': case 'u': |
1337 case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B': | 1348 case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B': |
1338 case 'C': case 'D': case 'W': case 'Y': case 'Z': | 1349 case 'C': case 'D': case 'W': case 'Y': case 'Z': |
1339 if (CLASS_LIKELY_SPILLED_P (REG_CLASS_FROM_CONSTRAINT ((unsigned char) c, p) )) | 1350 if (targetm.class_likely_spilled_p (REG_CLASS_FROM_CONSTRAINT ((unsigned char) c, p))) |
1340 likely_spilled[op_no] = 1; | 1351 likely_spilled[op_no] = 1; |
1341 break; | 1352 break; |
1342 } | 1353 } |
1343 p += CONSTRAINT_LEN (c, p); | 1354 p += CONSTRAINT_LEN (c, p); |
1344 } | 1355 } |