aboutsummaryrefslogtreecommitdiff
path: root/bfd/xtensa-isa.c
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@acm.org>2008-03-03 23:23:41 +0000
committerBob Wilson <bob.wilson@acm.org>2008-03-03 23:23:41 +0000
commit77cba8a32b4cec9c12249fa59391242c039a1842 (patch)
treed45203ee16e0e37165d0e50b0bbd552fe3c98cb8 /bfd/xtensa-isa.c
parent332fbd6f66ba68a2452e153e830b6d5c6560e066 (diff)
downloadfsf-binutils-gdb-77cba8a32b4cec9c12249fa59391242c039a1842.zip
fsf-binutils-gdb-77cba8a32b4cec9c12249fa59391242c039a1842.tar.gz
fsf-binutils-gdb-77cba8a32b4cec9c12249fa59391242c039a1842.tar.bz2
bfd/
* xtensa-isa.c (xtensa_isa_num_pipe_stages): Make max_stage static and only compute its value once. gas/ * config/tc-xtensa.c (xtensa_num_pipe_stages): New. (md_begin): Initialize it. (resources_conflict): Use it.
Diffstat (limited to 'bfd/xtensa-isa.c')
-rw-r--r--bfd/xtensa-isa.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/bfd/xtensa-isa.c b/bfd/xtensa-isa.c
index ced8257..35b27db 100644
--- a/bfd/xtensa-isa.c
+++ b/bfd/xtensa-isa.c
@@ -1,5 +1,5 @@
/* Configurable Xtensa ISA support.
- Copyright 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -411,7 +411,12 @@ xtensa_isa_num_pipe_stages (xtensa_isa isa)
xtensa_opcode opcode;
xtensa_funcUnit_use *use;
int num_opcodes, num_uses;
- int i, stage, max_stage = XTENSA_UNDEFINED;
+ int i, stage;
+ static int max_stage = XTENSA_UNDEFINED;
+
+ /* Only compute the value once. */
+ if (max_stage != XTENSA_UNDEFINED)
+ return max_stage + 1;
num_opcodes = xtensa_isa_num_opcodes (isa);
for (opcode = 0; opcode < num_opcodes; opcode++)