From: J"orn Rennecke Date: Tue, 3 Mar 1998 20:45:49 +0000 (+0000) Subject: final.c (max_labelno): New static variable. X-Git-Tag: prereleases/egcs-1.1-prerelease~2203 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=de7987a645e310ed5701e693ccbbc8d25179686b;p=thirdparty%2Fgcc.git final.c (max_labelno): New static variable. * final.c (max_labelno): New static variable. (final_scan_insn): Check max_labelno before outputting an alignment for a label. (shorten_branches): Remove unused variable length_align. Fix some minor problems with new shortening code. From-SVN: r18390 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bb7680cd2261..13166c135998 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Tue Mar 3 21:48:35 1998 J"orn Rennecke + + * final.c (max_labelno): New static variable. + (final_scan_insn): Check max_labelno before outputting an + alignment for a label. + + (shorten_branches): Remove unused variable length_align. + Tue Mar 3 14:27:23 1998 Kaveh R. Ghazi * sparc.c (ultrasparc_adjust_cost): Add default case in diff --git a/gcc/final.c b/gcc/final.c index c9bc23397e85..a3ad85af912e 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -795,7 +795,7 @@ short *label_align; /* sh.c needs this to calculate constant tables. */ #define INSN_SHUID(INSN) (uid_shuid[INSN_UID (INSN)]) -static int min_labelno; +static int min_labelno, max_labelno; #define LABEL_TO_ALIGNMENT(LABEL) \ (label_align[CODE_LABEL_NUMBER (LABEL) - min_labelno]) @@ -932,7 +932,6 @@ shorten_branches (first) rtx insn; int max_uid; int i; - int max_labelno; int max_log; #ifdef HAVE_ATTR_length #define MAX_CODE_ALIGN 16 @@ -1079,7 +1078,6 @@ shorten_branches (first) { int uid = INSN_UID (seq); int log; - int length_align; log = (GET_CODE (seq) == CODE_LABEL ? LABEL_TO_ALIGNMENT (seq) : 0); uid_align[uid] = align_tab[0]; insn_addresses[uid] = --insn_current_address; @@ -2011,12 +2009,16 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) break; case CODE_LABEL: - { - int align = LABEL_TO_ALIGNMENT (insn); + if (CODE_LABEL_NUMBER (insn) <= max_labelno) + { + int align = LABEL_TO_ALIGNMENT (insn); - if (align && NEXT_INSN (insn)) - ASM_OUTPUT_ALIGN (file, align); - } + /* The target port might emit labels in the output function for + some insn, e.g. sh.c output_branchy_insn. */ + if (align && NEXT_INSN (insn) + && CODE_LABEL_NUMBER (insn) <= max_labelno) + ASM_OUTPUT_ALIGN (file, align); + } CC_STATUS_INIT; if (prescan > 0) break;