aboutsummaryrefslogtreecommitdiffstats
path: root/cse.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-12-13 12:00:29 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:06:07 -0700
commit6278edfccdbb3b6a0bbe9f066991e28564ea0884 (patch)
treed1f3c4fe4125a8899eb74c16e4b289b08c25cb04 /cse.c
parente2c6465a7833ded210fc3fb331c143611df15f34 (diff)
downloadsparse-6278edfccdbb3b6a0bbe9f066991e28564ea0884.tar.gz
sparse-6278edfccdbb3b6a0bbe9f066991e28564ea0884.tar.xz
sparse-6278edfccdbb3b6a0bbe9f066991e28564ea0884.zip
Split OP_SETVAL into OP_SETVAL (fp expressions and labels) and OP_SYMADDR
(symbol addresses). They are pretty different. Symbol addresses have special meaning during various phases, from symbol simplification to CSE.
Diffstat (limited to 'cse.c')
-rw-r--r--cse.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/cse.c b/cse.c
index 31ceafd..758884c 100644
--- a/cse.c
+++ b/cse.c
@@ -76,6 +76,9 @@ static void clean_up_one_instruction(struct basic_block *bb, struct instruction
case OP_SETVAL:
hash += hashval(insn->val);
+ break;
+
+ case OP_SYMADDR:
hash += hashval(insn->symbol);
break;
@@ -188,11 +191,14 @@ static int insn_compare(const void *_i1, const void *_i2)
return i1->src1 < i2->src1 ? -1 : 1;
break;
+ case OP_SYMADDR:
+ if (i1->symbol != i2->symbol)
+ return i1->symbol < i2->symbol ? -1 : 1;
+ break;
+
case OP_SETVAL:
if (i1->val != i2->val)
return i1->val < i2->val ? -1 : 1;
- if (i1->symbol != i2->symbol)
- return i1->symbol < i2->symbol ? -1 : 1;
break;
/* Other */