aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/flow.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-02-25 23:10:31 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-02-25 23:10:31 +0100
commit3d617353dda682db8b3eb6ea8c1fdfa89edfe5e2 (patch)
tree5b304807553a44b79ff430d838b1e1b9f72e10e7 /flow.c
parent60c1f2706e30eacc29296e6cb5d9327c85a01340 (diff)
parent2f92df710ef708c5e5fabb551189213e9ad5127e (diff)
downloadsparse-dev-3d617353dda682db8b3eb6ea8c1fdfa89edfe5e2.tar.gz
Merge branch 'asm-dom'
* asm: output *memory* operands need their address as *input* * asm: teach dominates() about OP_ASM
Diffstat (limited to 'flow.c')
-rw-r--r--flow.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/flow.c b/flow.c
index bda277aa..5d630187 100644
--- a/flow.c
+++ b/flow.c
@@ -490,12 +490,21 @@ static inline int distinct_symbols(pseudo_t a, pseudo_t b)
*/
int dominates(pseudo_t pseudo, struct instruction *insn, struct instruction *dom, int local)
{
- int opcode = dom->opcode;
-
- if (opcode == OP_CALL || opcode == OP_ENTRY)
+ switch (dom->opcode) {
+ case OP_CALL: case OP_ENTRY:
return local ? 0 : -1;
- if (opcode != OP_LOAD && opcode != OP_STORE)
+ case OP_LOAD: case OP_STORE:
+ break;
+ case OP_ASM:
+ if (dom->clobber_memory)
+ return -1;
+ if (dom->output_memory)
+ return -1;
+ return 0;
+ default:
return 0;
+ }
+
if (dom->src != pseudo) {
if (local)
return 0;