summaryrefslogtreecommitdiff
path: root/bfd/xtensa-isa.c
diff options
context:
space:
mode:
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++)