aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarek Michalkiewicz <marekm@linux.org.pl>2000-11-19 08:10:54 +0100
committerDenis Chertykov <denisc@gcc.gnu.org>2000-11-19 10:10:54 +0300
commite9284adfd06bd4f01bdc8fa4f708d3b9850e82d2 (patch)
treef0d45bdca223defbcb01607e87f2e113e0766c4d /gcc
parent67c72a630824f2bb6a51298d09b6f11873edcbeb (diff)
downloadgcc-e9284adfd06bd4f01bdc8fa4f708d3b9850e82d2.zip
gcc-e9284adfd06bd4f01bdc8fa4f708d3b9850e82d2.tar.gz
gcc-e9284adfd06bd4f01bdc8fa4f708d3b9850e82d2.tar.bz2
avr-protos.h (avr_output_addr_vec_elt): Prototype.
* config/avr/avr-protos.h (avr_output_addr_vec_elt): Prototype. * config/avr/avr.c (jump_tables_size): New variable. (function_prologue): Initialize it as 0. (function_epilogue): Add it to function_size. (avr_output_addr_vec_elt): New function. Count words in jump tables in jump_tables_size. Move code ... * config/avr/avr.h (ASM_OUTPUT_ADDR_VEC_ELT): ... from here. Call avr_output_addr_vec_elt instead. * config/avr/avr.md (tablejump): Remove disabled define_expand. From-SVN: r37557
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/config/avr/avr-protos.h1
-rw-r--r--gcc/config/avr/avr.c18
-rw-r--r--gcc/config/avr/avr.h7
-rw-r--r--gcc/config/avr/avr.md5
5 files changed, 32 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fc844b8..59c5f77 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2000-11-18 Marek Michalkiewicz <marekm@linux.org.pl>
+
+ * config/avr/avr-protos.h (avr_output_addr_vec_elt): Prototype.
+ * config/avr/avr.c (jump_tables_size): New variable.
+ (function_prologue): Initialize it as 0.
+ (function_epilogue): Add it to function_size.
+ (avr_output_addr_vec_elt): New function. Count words in jump
+ tables in jump_tables_size. Move code ...
+ * config/avr/avr.h (ASM_OUTPUT_ADDR_VEC_ELT): ... from here.
+ Call avr_output_addr_vec_elt instead.
+ * config/avr/avr.md (tablejump): Remove disabled define_expand.
+
2000-11-18 Mark Mitchell <mark@codesourcery.com>
* configure.in: Make --enable-new-gxx-abi the default.
diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h
index 14d34d1..4fa887a 100644
--- a/gcc/config/avr/avr-protos.h
+++ b/gcc/config/avr/avr-protos.h
@@ -110,6 +110,7 @@ extern const char * lshrhi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char * lshrsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern void avr_output_bld PARAMS ((rtx operands[], int bit_nr));
+extern void avr_output_addr_vec_elt PARAMS ((FILE *stream, int value));
extern enum reg_class preferred_reload_class PARAMS ((rtx x,
enum reg_class class));
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 38cd078..9427de7 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -88,6 +88,9 @@ static int commands_in_epilogues;
static int prologue_size;
static int epilogue_size;
+/* Size of all jump tables in the current function, in words. */
+static int jump_tables_size;
+
/* Initial stack value specified by the `-minit-stack=' option */
const char *avr_init_stack = "__stack";
@@ -549,6 +552,7 @@ function_prologue (file, size)
&& !interrupt_func_p && !signal_func_p && live_seq);
last_insn_address = 0;
+ jump_tables_size = 0;
prologue_size = 0;
fprintf (file, "/* prologue: frame size=%d */\n", size);
@@ -683,6 +687,7 @@ function_epilogue (file, size)
main_p = MAIN_NAME_P (DECL_NAME (current_function_decl));
function_size = (INSN_ADDRESSES (INSN_UID (get_last_insn ()))
- INSN_ADDRESSES (INSN_UID (get_insns ())));
+ function_size += jump_tables_size;
live_seq = sequent_regs_live ();
minimize = (TARGET_CALL_PROLOGUES
&& !interrupt_func_p && !signal_func_p && live_seq);
@@ -5296,3 +5301,16 @@ avr_output_bld (operands, bit_nr)
output_asm_insn (s, operands);
}
+void
+avr_output_addr_vec_elt (stream, value)
+ FILE *stream;
+ int value;
+{
+ if (AVR_MEGA)
+ fprintf (stream, "\t.word pm(.L%d)\n", value);
+ else
+ fprintf (stream, "\trjmp .L%d\n", value);
+
+ jump_tables_size++;
+}
+
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index f5116a9..897dffe 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -2713,12 +2713,7 @@ sprintf (STRING, "*.%s%d", PREFIX, NUM)
not be optimal, since this macro is used only when profiling. */
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
-do { \
- if (AVR_MEGA) \
- fprintf (STREAM, "\t.word pm(.L%d)\n", VALUE); \
- else \
- fprintf (STREAM, "\trjmp .L%d\n", VALUE); \
-} while (0)
+ avr_output_addr_vec_elt(STREAM, VALUE)
/* This macro should be provided on machines where the addresses in a
dispatch table are absolute.
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index 325a545..57972e6 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -1849,11 +1849,6 @@
(set_attr "cc" "none,none")])
;; table jump
-(define_expand "tablejump"
- [(parallel [(set (pc) (match_operand:HI 0 "register_operand" ""))
- (use (label_ref (match_operand 1 "" "")))])]
- "0 && optimize"
- "")
;; Note: the (mem:HI (...)) memory references here are special - actually
;; the data is read from a word address in program memory (r31:r30 is the