summaryrefslogtreecommitdiff
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
commit6223c66b485f82d35cc120b52f9008568cd74353 (patch)
treec402aaafaefe6cf11c9087475777c5bb6c3ee31e /bfd/xtensa-isa.c
parentb8a2c81c38654bbc630f1c7b54d0a6bbd0a4c08e (diff)
downloadbinutils-redhat-6223c66b485f82d35cc120b52f9008568cd74353.tar.gz
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 ced8257914..35b27db84d 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++)