Mercurial > hg > CbC > CbC_gcc
comparison gcc/resource.c @ 132:d34655255c78
update gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 10:21:07 +0900 |
parents | 84e7813d76e9 |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
130:e108057fa461 | 132:d34655255c78 |
---|---|
1 /* Definitions for computing resource usage of specific insns. | 1 /* Definitions for computing resource usage of specific insns. |
2 Copyright (C) 1999-2017 Free Software Foundation, Inc. | 2 Copyright (C) 1999-2018 Free Software Foundation, Inc. |
3 | 3 |
4 This file is part of GCC. | 4 This file is part of GCC. |
5 | 5 |
6 GCC is free software; you can redistribute it and/or modify it under | 6 GCC is free software; you can redistribute it and/or modify it under |
7 the terms of the GNU General Public License as published by the Free | 7 the terms of the GNU General Public License as published by the Free |
106 } | 106 } |
107 | 107 |
108 if (GET_CODE (x) == CLOBBER) | 108 if (GET_CODE (x) == CLOBBER) |
109 for (i = first_regno; i < last_regno; i++) | 109 for (i = first_regno; i < last_regno; i++) |
110 CLEAR_HARD_REG_BIT (current_live_regs, i); | 110 CLEAR_HARD_REG_BIT (current_live_regs, i); |
111 else if (GET_CODE (x) == CLOBBER_HIGH) | |
112 /* No current target supports both branch delay slots and CLOBBER_HIGH. | |
113 We'd need more elaborate liveness tracking to handle that | |
114 combination. */ | |
115 gcc_unreachable (); | |
111 else | 116 else |
112 for (i = first_regno; i < last_regno; i++) | 117 for (i = first_regno; i < last_regno; i++) |
113 { | 118 { |
114 SET_HARD_REG_BIT (current_live_regs, i); | 119 SET_HARD_REG_BIT (current_live_regs, i); |
115 CLEAR_HARD_REG_BIT (pending_dead_regs, i); | 120 CLEAR_HARD_REG_BIT (pending_dead_regs, i); |
210 case CONST: | 215 case CONST: |
211 CASE_CONST_ANY: | 216 CASE_CONST_ANY: |
212 case PC: | 217 case PC: |
213 case SYMBOL_REF: | 218 case SYMBOL_REF: |
214 case LABEL_REF: | 219 case LABEL_REF: |
220 case DEBUG_INSN: | |
215 return; | 221 return; |
216 | 222 |
217 case SUBREG: | 223 case SUBREG: |
218 if (!REG_P (SUBREG_REG (x))) | 224 if (!REG_P (SUBREG_REG (x))) |
219 mark_referenced_resources (SUBREG_REG (x), res, false); | 225 mark_referenced_resources (SUBREG_REG (x), res, false); |
290 if (MEM_P (x)) | 296 if (MEM_P (x)) |
291 mark_referenced_resources (XEXP (x, 0), res, false); | 297 mark_referenced_resources (XEXP (x, 0), res, false); |
292 return; | 298 return; |
293 | 299 |
294 case CLOBBER: | 300 case CLOBBER: |
301 case CLOBBER_HIGH: | |
295 return; | 302 return; |
296 | 303 |
297 case CALL_INSN: | 304 case CALL_INSN: |
298 if (include_delayed_effects) | 305 if (include_delayed_effects) |
299 { | 306 { |
449 | 456 |
450 continue; | 457 continue; |
451 | 458 |
452 case BARRIER: | 459 case BARRIER: |
453 case NOTE: | 460 case NOTE: |
461 case DEBUG_INSN: | |
454 continue; | 462 continue; |
455 | 463 |
456 case INSN: | 464 case INSN: |
457 if (GET_CODE (PATTERN (insn)) == USE) | 465 if (GET_CODE (PATTERN (insn)) == USE) |
458 { | 466 { |
637 CASE_CONST_ANY: | 645 CASE_CONST_ANY: |
638 case LABEL_REF: | 646 case LABEL_REF: |
639 case SYMBOL_REF: | 647 case SYMBOL_REF: |
640 case CONST: | 648 case CONST: |
641 case PC: | 649 case PC: |
650 case DEBUG_INSN: | |
642 /* These don't set any resources. */ | 651 /* These don't set any resources. */ |
643 return; | 652 return; |
644 | 653 |
645 case CC0: | 654 case CC0: |
646 if (in_dest) | 655 if (in_dest) |
663 get_call_reg_set_usage (call_insn, ®s, regs_invalidated_by_call); | 672 get_call_reg_set_usage (call_insn, ®s, regs_invalidated_by_call); |
664 IOR_HARD_REG_SET (res->regs, regs); | 673 IOR_HARD_REG_SET (res->regs, regs); |
665 | 674 |
666 for (link = CALL_INSN_FUNCTION_USAGE (call_insn); | 675 for (link = CALL_INSN_FUNCTION_USAGE (call_insn); |
667 link; link = XEXP (link, 1)) | 676 link; link = XEXP (link, 1)) |
668 if (GET_CODE (XEXP (link, 0)) == CLOBBER) | 677 { |
669 mark_set_resources (SET_DEST (XEXP (link, 0)), res, 1, | 678 /* We could support CLOBBER_HIGH and treat it in the same way as |
670 MARK_SRC_DEST); | 679 HARD_REGNO_CALL_PART_CLOBBERED, but no port needs that |
680 yet. */ | |
681 gcc_assert (GET_CODE (XEXP (link, 0)) != CLOBBER_HIGH); | |
682 if (GET_CODE (XEXP (link, 0)) == CLOBBER) | |
683 mark_set_resources (SET_DEST (XEXP (link, 0)), res, 1, | |
684 MARK_SRC_DEST); | |
685 } | |
671 | 686 |
672 /* Check for a REG_SETJMP. If it exists, then we must | 687 /* Check for a REG_SETJMP. If it exists, then we must |
673 assume that this call can clobber any register. */ | 688 assume that this call can clobber any register. */ |
674 if (find_reg_note (call_insn, REG_SETJMP, NULL)) | 689 if (find_reg_note (call_insn, REG_SETJMP, NULL)) |
675 SET_HARD_REG_SET (res->regs); | 690 SET_HARD_REG_SET (res->regs); |
707 return; | 722 return; |
708 | 723 |
709 case CLOBBER: | 724 case CLOBBER: |
710 mark_set_resources (XEXP (x, 0), res, 1, MARK_SRC_DEST); | 725 mark_set_resources (XEXP (x, 0), res, 1, MARK_SRC_DEST); |
711 return; | 726 return; |
727 | |
728 case CLOBBER_HIGH: | |
729 /* No current target supports both branch delay slots and CLOBBER_HIGH. | |
730 We'd need more elaborate liveness tracking to handle that | |
731 combination. */ | |
732 gcc_unreachable (); | |
712 | 733 |
713 case SEQUENCE: | 734 case SEQUENCE: |
714 { | 735 { |
715 rtx_sequence *seq = as_a <rtx_sequence *> (x); | 736 rtx_sequence *seq = as_a <rtx_sequence *> (x); |
716 rtx control = seq->element (0); | 737 rtx control = seq->element (0); |