From 826c956468619f8a064cd0ea499d2dd80e333b88 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Wed, 18 Aug 2004 22:31:03 +0000 Subject: [PATCH] insn-notes.def, [...]: New files. * insn-notes.def, reg-notes.def: New files. * rtl.h: Use them to define enum insn_note and enum reg_note. * rtl.c: Use them to define note_insn_name and reg_note_name. * modulo-sched.c, sched-rgn.c, final.c: NOTE_DISABLE_SCHED_OF_BLOCK renamed to NOTE_INSN_DISABLE_SCHED_OF_BLOCK. From-SVN: r86212 --- gcc/ChangeLog | 27 ++++-- gcc/final.c | 2 +- gcc/insn-notes.def | 108 ++++++++++++++++++++++ gcc/modulo-sched.c | 2 +- gcc/reg-notes.def | 168 +++++++++++++++++++++++++++++++++ gcc/rtl.c | 35 +++---- gcc/rtl.h | 225 +++------------------------------------------ gcc/sched-rgn.c | 2 +- 8 files changed, 320 insertions(+), 249 deletions(-) create mode 100644 gcc/insn-notes.def create mode 100644 gcc/reg-notes.def diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d781d3e966a..ca4b8b86411 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2004-08-18 Zack Weinberg + + * insn-notes.def, reg-notes.def: New files. + * rtl.h: Use them to define enum insn_note and enum reg_note. + * rtl.c: Use them to define note_insn_name and reg_note_name. + + * modulo-sched.c, sched-rgn.c, final.c: NOTE_DISABLE_SCHED_OF_BLOCK + renamed to NOTE_INSN_DISABLE_SCHED_OF_BLOCK. + 2004-08-18 Richard Earnshaw * arm.c (arm_size_rtx_costs): New function. @@ -74,26 +83,26 @@ 2004-08-18 Andrew Pinski - * config/rs6000/darwin.md: Delete the altivec patterns which are + * config/rs6000/darwin.md: Delete the altivec patterns which are handled differently now. (load_macho_picbase_di): Make sure that is only happens for TARGET_64BIT (macho_correct_pic_di): Likewise. (call_indirect_nonlocal_darwin64): Likewise. Delete the save world/saveFP/saveVec patterns. - + Revert the reversion of: 2004-08-16 Stan Shebs - * config/darwin.c (macho_indirect_data_reference): Add DImode case. - * config/rs6000/rs6000.md: Include darwin.md. - (builtin_setjmp_receiver): Add DImode case. - * config/rs6000/rs6000.c (rs6000_emit_move): Add DImode case to - Darwin bits. + * config/darwin.c (macho_indirect_data_reference): Add DImode case. + * config/rs6000/rs6000.md: Include darwin.md. + (builtin_setjmp_receiver): Add DImode case. + * config/rs6000/rs6000.c (rs6000_emit_move): Add DImode case to + Darwin bits. 2004-08-18 Matt Austern Dead code stripping * darwin.h (EH_FRAME_SECTION_ATTR): Mark so it doesn't get stripped. * darwin.c (darwin_file_end): Mark file as potentially strippable. - + 2004-08-18 Richard Henderson * alias.c (readonly_fields_p): Remove. @@ -152,7 +161,7 @@ 2004-08-18 Andrew Pinski - * config/darwin.c (machopic_legitimize_pic_address): Only set + * config/darwin.c (machopic_legitimize_pic_address): Only set MEM_READONLY_P in the non TARGET_TOC case. 2004-08-18 Zack Weinberg diff --git a/gcc/final.c b/gcc/final.c index 4f5d824fed1..fd631ca6cca 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1704,7 +1704,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, case NOTE_INSN_FUNCTION_END: case NOTE_INSN_REPEATED_LINE_NUMBER: case NOTE_INSN_EXPECTED_VALUE: - case NOTE_DISABLE_SCHED_OF_BLOCK: + case NOTE_INSN_DISABLE_SCHED_OF_BLOCK: break; case NOTE_INSN_UNLIKELY_EXECUTED_CODE: diff --git a/gcc/insn-notes.def b/gcc/insn-notes.def new file mode 100644 index 00000000000..3b164e8629e --- /dev/null +++ b/gcc/insn-notes.def @@ -0,0 +1,108 @@ +/* Insn note definitions. + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ + +/* This file defines all the codes that may appear in the + NOTE_LINE_NUMBER field of a NOTE insn for kinds of notes that are + not line numbers. Source files define DEF_INSN_NOTE appropriately + before including this file. + + We are slowly removing the concept of insn-chain notes from the + compiler. Adding new codes to this file is STRONGLY DISCOURAGED. + If you think you need one, look for other ways to express what you + mean, such as register notes or bits in the basic-block structure. */ + +/* Shorthand. */ +#define INSN_NOTE(NAME) DEF_INSN_NOTE (NOTE_INSN_##NAME) + +/* This note is used to get rid of an insn when it isn't safe to patch + the insn out of the chain. */ +INSN_NOTE (DELETED) + +/* Generated in place of user-declared labels when they are deleted. */ +INSN_NOTE (DELETED_LABEL) + +/* These are used to mark the beginning and end of a lexical block. + See NOTE_BLOCK and reorder_blocks. */ +INSN_NOTE (BLOCK_BEG) +INSN_NOTE (BLOCK_END) + +/* These mark the extremes of a loop. */ +INSN_NOTE (LOOP_BEG) +INSN_NOTE (LOOP_END) + +/* Generated at the place in a loop that `continue' jumps to. */ +INSN_NOTE (LOOP_CONT) +/* Generated at the start of a duplicated exit test. */ +INSN_NOTE (LOOP_VTOP) + +/* This note indicates the start of the real body of the function, + i.e. the point just after all of the parms have been moved into + their homes, etc. */ +INSN_NOTE (FUNCTION_BEG) + +/* This kind of note is generated at the end of the function body, + just before the return insn or return label. In an optimizing + compilation it is deleted by the first jump optimization, after + enabling that optimizer to determine whether control can fall + off the end of the function body without a return statement. */ +INSN_NOTE (FUNCTION_END) + +/* This marks the point immediately after the last prologue insn. */ +INSN_NOTE (PROLOGUE_END) + +/* This marks the point immediately prior to the first epilogue insn. */ +INSN_NOTE (EPILOGUE_BEG) + +/* These note where exception handling regions begin and end. + Uses NOTE_EH_HANDLER to identify the region in question. */ +INSN_NOTE (EH_REGION_BEG) +INSN_NOTE (EH_REGION_END) + +/* Generated whenever a duplicate line number note is output. + For example, one is output after the end of an inline function, + in order to prevent the line containing the inline call from + being counted twice in gcov. */ +INSN_NOTE (REPEATED_LINE_NUMBER) + +/* The location of a variable. */ +INSN_NOTE (VAR_LOCATION) + +/* Record the expected value of a register at a location. Uses + NOTE_EXPECTED_VALUE; stored as (eq (reg) (const_int)). */ +INSN_NOTE (EXPECTED_VALUE) + +/* Record the struct for the following basic block. Uses + NOTE_BASIC_BLOCK. FIXME: Redundant with the basic block pointer + now included in every insn. */ +INSN_NOTE (BASIC_BLOCK) + +/* Record that the current basic block is unlikely to be executed and + should be moved to the UNLIKELY_EXECUTED_TEXT_SECTION. FIXME: Make + this a bit on the basic block structure. */ +INSN_NOTE (UNLIKELY_EXECUTED_CODE) + +/* Mark that a block shouldn't be scheduled. This is currently used + in modulo scheduling. Modulo scheduling adds this note to the + blocks of the modulo-scheduled loops to disable scheduling them in + the later traditional scheduling passes. FIXME: Make this a bit on + the basic block structure. */ +INSN_NOTE (DISABLE_SCHED_OF_BLOCK) + +#undef INSN_NOTE diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c index 86e0f8c4640..84f33364eb1 100644 --- a/gcc/modulo-sched.c +++ b/gcc/modulo-sched.c @@ -1112,7 +1112,7 @@ sms_schedule (FILE *dump_file) /* Mark this loop as software pipelined so the later scheduling passes doesn't touch it. */ if (! flag_resched_modulo_sched) - emit_note_before (NOTE_DISABLE_SCHED_OF_BLOCK, + emit_note_before (NOTE_INSN_DISABLE_SCHED_OF_BLOCK, g->closing_branch->insn); generate_reg_moves (ps); diff --git a/gcc/reg-notes.def b/gcc/reg-notes.def new file mode 100644 index 00000000000..cb0343facd9 --- /dev/null +++ b/gcc/reg-notes.def @@ -0,0 +1,168 @@ +/* Register note definitions. + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ + +/* This file defines all the codes that may appear on individual + EXPR_LIST rtxes in the REG_NOTES chain of an insn. The codes are + stored in the mode field of the EXPR_LIST. Source files define + DEF_INSN_NOTE appropriately before including this file. */ + +/* Shorthand. */ +#define REG_NOTE(NAME) DEF_REG_NOTE (REG_##NAME) + +/* The value in REG dies in this insn (i.e., it is not needed past + this insn). If REG is set in this insn, the REG_DEAD note may, + but need not, be omitted. */ +REG_NOTE (DEAD) + +/* The REG is autoincremented or autodecremented in this insn. */ +REG_NOTE (INC) + +/* Describes the insn as a whole; it says that the insn sets a + register to a constant value or to be equivalent to a memory + address. If the register is spilled to the stack then the constant + value should be substituted for it. The contents of the REG_EQUIV + is the constant value or memory address, which may be different + from the source of the SET although it has the same value. A + REG_EQUIV note may also appear on an insn which copies a register + parameter to a pseudo-register, if there is a memory address which + could be used to hold that pseudo-register throughout the function. */ +REG_NOTE (EQUIV) + +/* Like REG_EQUIV except that the destination is only momentarily + equal to the specified rtx. Therefore, it cannot be used for + substitution; but it can be used for cse. */ +REG_NOTE (EQUAL) + +/* This insn copies the return-value of a library call out of the hard + reg for return values. This note is actually an INSN_LIST and it + points to the first insn involved in setting up arguments for the + call. flow.c uses this to delete the entire library call when its + result is dead. */ +REG_NOTE (RETVAL) + +/* The inverse of REG_RETVAL: it goes on the first insn of the library + call and points at the one that has the REG_RETVAL. This note is + also an INSN_LIST. */ +REG_NOTE (LIBCALL) + +/* The register is always nonnegative during the containing loop. + This is used in branches so that decrement and branch instructions + terminating on zero can be matched. There must be an insn pattern + in the md file named `decrement_and_branch_until_zero' or else this + will never be added to any instructions. */ +REG_NOTE (NONNEG) + +/* There is no conflict *after this insn* between the register in the + note and the destination of this insn. */ +REG_NOTE (NO_CONFLICT) + +/* Identifies a register set in this insn and never used. */ +REG_NOTE (UNUSED) + +/* REG_CC_SETTER and REG_CC_USER link a pair of insns that set and use + CC0, respectively. Normally, these are required to be consecutive + insns, but we permit putting a cc0-setting insn in the delay slot + of a branch as long as only one copy of the insn exists. In that + case, these notes point from one to the other to allow code + generation to determine what any require information and to + properly update CC_STATUS. These notes are INSN_LISTs. */ +REG_NOTE (CC_SETTER) +REG_NOTE (CC_USER) + +/* Points to a CODE_LABEL. Used by non-JUMP_INSNs to say that the + CODE_LABEL contained in the REG_LABEL note is used by the insn. + This note is an INSN_LIST. */ +REG_NOTE (LABEL) + +/* REG_DEP_ANTI and REG_DEP_OUTPUT are used in LOG_LINKS to represent + write-after-read and write-after-write dependencies respectively. + Data dependencies, which are the only type of LOG_LINK created by + flow, are represented by a 0 reg note kind. */ +REG_NOTE (DEP_ANTI) +REG_NOTE (DEP_OUTPUT) + +/* REG_BR_PROB is attached to JUMP_INSNs and CALL_INSNs. It has an + integer value. For jumps, it is the probability that this is a + taken branch. For calls, it is the probability that this call + won't return. */ +REG_NOTE (BR_PROB) + +/* REG_VALUE_PROFILE is attached when the profile is read in to an + insn before that the code to profile the value is inserted. It + contains the results of profiling. */ +REG_NOTE (VALUE_PROFILE) + +/* Attached to a call insn; indicates that the call is malloc-like and + that the pointer returned cannot alias anything else. */ +REG_NOTE (NOALIAS) + +/* Used to optimize rtl generated by dynamic stack allocations for + targets where SETJMP_VIA_SAVE_AREA is true. */ +REG_NOTE (SAVE_AREA) + +/* REG_BR_PRED is attached to JUMP_INSNs and CALL_INSNSs. It contains + CONCAT of two integer value. First specifies the branch predictor + that added the note, second specifies the predicted hitrate of + branch in the same format as REG_BR_PROB note uses. */ +REG_NOTE (BR_PRED) + +/* Attached to insns that are RTX_FRAME_RELATED_P, but are too complex + for DWARF to interpret what they imply. The attached rtx is used + instead of intuition. */ +REG_NOTE (FRAME_RELATED_EXPR) + +/* Indicates that REG holds the exception context for the function. + This context is shared by inline functions, so the code to acquire + the real exception context is delayed until after inlining. */ +REG_NOTE (EH_CONTEXT) + +/* Indicates what exception region an INSN belongs in. This is used + to indicate what region to which a call may throw. REGION 0 + indicates that a call cannot throw at all. REGION -1 indicates + that it cannot throw, nor will it execute a non-local goto. */ +REG_NOTE (EH_REGION) + +/* Used by haifa-sched to save NOTE_INSN notes across scheduling. */ +REG_NOTE (SAVE_NOTE) + +/* Indicates that this insn (which is part of the prologue) computes a + value which might not be used later, and if so it's OK to delete + the insn. Normally, deleting any insn in the prologue is an error. + At present the parameter is unused and set to (const_int 0). */ +REG_NOTE (MAYBE_DEAD) + +/* Indicates that a call does not return. */ +REG_NOTE (NORETURN) + +/* Indicates that an indirect jump is a non-local goto instead of a + computed goto. */ +REG_NOTE (NON_LOCAL_GOTO) + +/* Indicates that a jump crosses between hot and cold sections in a + (partitioned) assembly or .o file, and therefore should not be + reduced to a simpler jump by optimizations. */ +REG_NOTE (CROSSING_JUMP) + +/* This kind of note is generated at each to `setjmp', and similar + functions that can return twice. */ +REG_NOTE (SETJMP) + +/* Indicate calls that always returns. */ +REG_NOTE (ALWAYS_RETURN) diff --git a/gcc/rtl.c b/gcc/rtl.c index 8a283065c38..8136514ea09 100644 --- a/gcc/rtl.c +++ b/gcc/rtl.c @@ -115,38 +115,27 @@ const unsigned char rtx_size[NUM_RTX_CODE] = { #undef DEF_RTL_EXPR }; +/* Make sure all NOTE_INSN_* values are negative. */ +extern char NOTE_INSN_MAX_isnt_negative_adjust_NOTE_INSN_BIAS +[NOTE_INSN_MAX < 0 ? 1 : -1]; + /* Names for kinds of NOTEs and REG_NOTEs. */ const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS] = { - "", "NOTE_INSN_DELETED", - "NOTE_INSN_BLOCK_BEG", "NOTE_INSN_BLOCK_END", - "NOTE_INSN_LOOP_BEG", "NOTE_INSN_LOOP_END", - "NOTE_INSN_LOOP_CONT", "NOTE_INSN_LOOP_VTOP", - "NOTE_DISABLE_SCHED_OF_BLOCK", - "NOTE_INSN_FUNCTION_END", - "NOTE_INSN_PROLOGUE_END", "NOTE_INSN_EPILOGUE_BEG", - "NOTE_INSN_DELETED_LABEL", "NOTE_INSN_FUNCTION_BEG", - "NOTE_INSN_EH_REGION_BEG", "NOTE_INSN_EH_REGION_END", - "NOTE_INSN_REPEATED_LINE_NUMBER", - "NOTE_INSN_BASIC_BLOCK", "NOTE_INSN_EXPECTED_VALUE", - "NOTE_INSN_UNLIKELY_EXECUTED_CODE", - "NOTE_INSN_VAR_LOCATION" + "", +#define DEF_INSN_NOTE(NAME) #NAME, +#include "insn-notes.def" +#undef DEF_INSN_NOTE }; -const char * const reg_note_name[] = +const char * const reg_note_name[REG_NOTE_MAX] = { - "", "REG_DEAD", "REG_INC", "REG_EQUIV", "REG_EQUAL", - "REG_RETVAL", "REG_LIBCALL", "REG_NONNEG", - "REG_NO_CONFLICT", "REG_UNUSED", "REG_CC_SETTER", "REG_CC_USER", - "REG_LABEL", "REG_DEP_ANTI", "REG_DEP_OUTPUT", "REG_BR_PROB", - "REG_VALUE_PROFILE", "REG_NOALIAS", "REG_SAVE_AREA", "REG_BR_PRED", - "REG_FRAME_RELATED_EXPR", "REG_EH_CONTEXT", "REG_EH_REGION", - "REG_SAVE_NOTE", "REG_MAYBE_DEAD", "REG_NORETURN", - "REG_NON_LOCAL_GOTO", "REG_CROSSING_JUMP", "REG_SETJMP", "REG_ALWAYS_RETURN" +#define DEF_REG_NOTE(NAME) #NAME, +#include "reg-notes.def" +#undef DEF_REG_NOTE }; - #ifdef GATHER_STATISTICS static int rtx_alloc_counts[(int) LAST_AND_UNUSED_RTX_CODE]; static int rtx_alloc_sizes[(int) LAST_AND_UNUSED_RTX_CODE]; diff --git a/gcc/rtl.h b/gcc/rtl.h index 0d0e300ca60..120e7944373 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -722,146 +722,12 @@ do { \ #define REG_NOTES(INSN) XEXP(INSN, 8) -/* Don't forget to change reg_note_name in rtl.c. */ enum reg_note { - /* The value in REG dies in this insn (i.e., it is not needed past - this insn). If REG is set in this insn, the REG_DEAD note may, - but need not, be omitted. */ - REG_DEAD = 1, - - /* The REG is autoincremented or autodecremented. */ - REG_INC, - - /* Describes the insn as a whole; it says that the insn sets a register - to a constant value or to be equivalent to a memory address. If the - register is spilled to the stack then the constant value should be - substituted for it. The contents of the REG_EQUIV is the constant - value or memory address, which may be different from the source of - the SET although it has the same value. A REG_EQUIV note may also - appear on an insn which copies a register parameter to a pseudo-register, - if there is a memory address which could be used to hold that - pseudo-register throughout the function. */ - REG_EQUIV, - - /* Like REG_EQUIV except that the destination is only momentarily equal - to the specified rtx. Therefore, it cannot be used for substitution; - but it can be used for cse. */ - REG_EQUAL, - - /* This insn copies the return-value of a library call out of the hard reg - for return values. This note is actually an INSN_LIST and it points to - the first insn involved in setting up arguments for the call. flow.c - uses this to delete the entire library call when its result is dead. */ - REG_RETVAL, - - /* The inverse of REG_RETVAL: it goes on the first insn of the library call - and points at the one that has the REG_RETVAL. This note is also an - INSN_LIST. */ - REG_LIBCALL, - - /* The register is always nonnegative during the containing loop. This is - used in branches so that decrement and branch instructions terminating - on zero can be matched. There must be an insn pattern in the md file - named `decrement_and_branch_until_zero' or else this will never be added - to any instructions. */ - REG_NONNEG, - - /* There is no conflict *after this insn* between the register in the note - and the destination of this insn. */ - REG_NO_CONFLICT, - - /* Identifies a register set in this insn and never used. */ - REG_UNUSED, - - /* REG_CC_SETTER and REG_CC_USER link a pair of insns that set and use CC0, - respectively. Normally, these are required to be consecutive insns, but - we permit putting a cc0-setting insn in the delay slot of a branch as - long as only one copy of the insn exists. In that case, these notes - point from one to the other to allow code generation to determine what - any require information and to properly update CC_STATUS. These notes - are INSN_LISTs. */ - REG_CC_SETTER, REG_CC_USER, - - /* Points to a CODE_LABEL. Used by non-JUMP_INSNs to say that the - CODE_LABEL contained in the REG_LABEL note is used by the insn. - This note is an INSN_LIST. */ - REG_LABEL, - - /* REG_DEP_ANTI and REG_DEP_OUTPUT are used in LOG_LINKS to represent - write-after-read and write-after-write dependencies respectively. - Data dependencies, which are the only type of LOG_LINK created by - flow, are represented by a 0 reg note kind. */ - REG_DEP_ANTI, REG_DEP_OUTPUT, - - /* REG_BR_PROB is attached to JUMP_INSNs and CALL_INSNs. - It has an integer value. For jumps, it is the probability that this is a - taken branch. For calls, it is the probability that this call won't - return. */ - REG_BR_PROB, - - /* REG_VALUE_PROFILE is attached when the profile is read in to an insn - before that the code to profile the value is inserted. It contains - the results of profiling. */ - REG_VALUE_PROFILE, - - /* Attached to a call insn; indicates that the call is malloc-like and - that the pointer returned cannot alias anything else. */ - REG_NOALIAS, - - /* Used to optimize rtl generated by dynamic stack allocations for targets - where SETJMP_VIA_SAVE_AREA is true. */ - REG_SAVE_AREA, - - /* REG_BR_PRED is attached to JUMP_INSNs and CALL_INSNSs. It contains - CONCAT of two integer value. First specifies the branch predictor - that added the note, second specifies the predicted hitrate of branch - in the same format as REG_BR_PROB note uses. */ - REG_BR_PRED, - - /* Attached to insns that are RTX_FRAME_RELATED_P, but are too complex - for DWARF to interpret what they imply. The attached rtx is used - instead of intuition. */ - REG_FRAME_RELATED_EXPR, - - /* Indicates that REG holds the exception context for the function. - This context is shared by inline functions, so the code to acquire - the real exception context is delayed until after inlining. */ - REG_EH_CONTEXT, - - /* Indicates what exception region an INSN belongs in. This is used to - indicate what region to which a call may throw. REGION 0 indicates - that a call cannot throw at all. REGION -1 indicates that it cannot - throw, nor will it execute a non-local goto. */ - REG_EH_REGION, - - /* Used by haifa-sched to save NOTE_INSN notes across scheduling. */ - REG_SAVE_NOTE, - - /* Indicates that this insn (which is part of the prologue) computes - a value which might not be used later, and if so it's OK to delete - the insn. Normally, deleting any insn in the prologue is an error. - At present the parameter is unused and set to (const_int 0). */ - REG_MAYBE_DEAD, - - /* Indicates that a call does not return. */ - REG_NORETURN, - - /* Indicates that an indirect jump is a non-local goto instead of a - computed goto. */ - REG_NON_LOCAL_GOTO, - - /* Indicates that a jump crosses between hot and cold sections - in a (partitioned) assembly or .o file, and therefore should not be - reduced to a simpler jump by optimizations. */ - REG_CROSSING_JUMP, - - /* This kind of note is generated at each to `setjmp', - and similar functions that can return twice. */ - REG_SETJMP, - - /* Indicate calls that always returns. */ - REG_ALWAYS_RETURN +#define DEF_REG_NOTE(NAME) NAME, +#include "reg-notes.def" +#undef DEF_REG_NOTE + REG_NOTE_MAX }; /* The base value for branch probability notes. */ @@ -944,93 +810,24 @@ extern const char * const reg_note_name[]; 0, VAR_LOCATION)) #define NOTE_VAR_LOCATION_LOC(INSN) (XCEXP (XCEXP (INSN, 4, NOTE), \ 1, VAR_LOCATION)) - -/* Codes that appear in the NOTE_LINE_NUMBER field - for kinds of notes that are not line numbers. +/* Codes that appear in the NOTE_LINE_NUMBER field for kinds of notes + that are not line numbers. These codes are all negative. + Notice that we do not try to use zero here for any of the special note codes because sometimes the source line actually can be zero! This happens (for example) when we are generating code for the per-translation-unit constructor - and destructor routines for some C++ translation unit. - - If you should change any of the following values, or if you - should add a new value here, don't forget to change the - note_insn_name array in rtl.c. */ + and destructor routines for some C++ translation unit. */ enum insn_note { /* Keep all of these numbers negative. Adjust as needed. */ NOTE_INSN_BIAS = -100, - /* This note is used to get rid of an insn - when it isn't safe to patch the insn out of the chain. */ - NOTE_INSN_DELETED, - - /* These are used to mark the beginning and end of a lexical block. - See NOTE_BLOCK and reorder_blocks. */ - NOTE_INSN_BLOCK_BEG, - NOTE_INSN_BLOCK_END, - - /* These mark the extremes of a loop. */ - NOTE_INSN_LOOP_BEG, - NOTE_INSN_LOOP_END, - - /* Generated at the place in a loop that `continue' jumps to. */ - NOTE_INSN_LOOP_CONT, - /* Generated at the start of a duplicated exit test. */ - NOTE_INSN_LOOP_VTOP, - - /* Mark that a block shouldn't be scheduled. This is currently - used in modulo scheduling. Modulo scheduling adds this note - to the blocks of the modulo-scheduled loops to disable scheduling - them in the later traditional scheduling passes. */ - NOTE_DISABLE_SCHED_OF_BLOCK, - - /* This kind of note is generated at the end of the function body, - just before the return insn or return label. In an optimizing - compilation it is deleted by the first jump optimization, after - enabling that optimizer to determine whether control can fall - off the end of the function body without a return statement. */ - NOTE_INSN_FUNCTION_END, - - /* This marks the point immediately after the last prologue insn. */ - NOTE_INSN_PROLOGUE_END, - - /* This marks the point immediately prior to the first epilogue insn. */ - NOTE_INSN_EPILOGUE_BEG, - - /* Generated in place of user-declared labels when they are deleted. */ - NOTE_INSN_DELETED_LABEL, - - /* This note indicates the start of the real body of the function, - i.e. the point just after all of the parms have been moved into - their homes, etc. */ - NOTE_INSN_FUNCTION_BEG, - - /* These note where exception handling regions begin and end. - Uses NOTE_EH_HANDLER to identify the region in question. */ - NOTE_INSN_EH_REGION_BEG, - NOTE_INSN_EH_REGION_END, - - /* Generated whenever a duplicate line number note is output. For example, - one is output after the end of an inline function, in order to prevent - the line containing the inline call from being counted twice in gcov. */ - NOTE_INSN_REPEATED_LINE_NUMBER, - - /* Record the struct for the following basic block. Uses NOTE_BASIC_BLOCK. */ - NOTE_INSN_BASIC_BLOCK, - - /* Record the expected value of a register at a location. Uses - NOTE_EXPECTED_VALUE; stored as (eq (reg) (const_int)). */ - NOTE_INSN_EXPECTED_VALUE, - - /* Record that the current basic block is unlikely to be executed and - should be moved to the UNLIKELY_EXECUTED_TEXT_SECTION. */ - NOTE_INSN_UNLIKELY_EXECUTED_CODE, - - /* The location of a variable. */ - NOTE_INSN_VAR_LOCATION, +#define DEF_INSN_NOTE(NAME) NAME, +#include "insn-notes.def" +#undef DEF_INSN_NOTE NOTE_INSN_MAX }; diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index 62d2f2343b7..e7717265e75 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -2352,7 +2352,7 @@ sched_is_disabled_for_current_region_p (void) insn = PREV_INSN (insn)) if (GET_CODE (insn) == NOTE && (NOTE_LINE_NUMBER (insn) - == NOTE_DISABLE_SCHED_OF_BLOCK)) + == NOTE_INSN_DISABLE_SCHED_OF_BLOCK)) { disable_sched = true; break; -- 2.30.2