aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2009-08-09 08:30:23 +0000
committerChristopher Li <sparse@chrisli.org>2009-08-02 03:06:58 -0700
commit2ceccd7b956b6588f2faa566b64249605ae52ceb (patch)
treefe635b57e9d96057560470f169f327acacddf480 /unssa.c
parentDefine __LP64__ for x86_64 unless in 32 bit mode (diff)
downloadsparse-2ceccd7b956b6588f2faa566b64249605ae52ceb.tar.gz
sparse-2ceccd7b956b6588f2faa566b64249605ae52ceb.tar.bz2
sparse-2ceccd7b956b6588f2faa566b64249605ae52ceb.zip
unssa: track uses when replacing a phi node
Hello, attached are patch, testing input for test-unssa and its outputs before patch and after patch. Thanks in advance for considering the patch! Kamil test: .L0x7f9fb2030010 <entry-point> phisrc.32 %phi2(ptr) <- %arg1 br .L0x7f9fb2030130 .L0x7f9fb2030130 copy.32 %r1(ptr) <- %r5(ptr) br %r1(ptr), .L0x7f9fb2030058, .L0x7f9fb20300e8 .L0x7f9fb2030058 load.32 %r3 <- 0[%r1(ptr)] phisrc.32 %phi3(ptr) <- %r3 br .L0x7f9fb2030130 .L0x7f9fb20300e8 ret test: .L0x7f4a7f7f1010 <entry-point> copy.32 %r5(ptr) <- %arg1 br .L0x7f4a7f7f1130 .L0x7f4a7f7f1130 copy.32 %r1(ptr) <- %r5(ptr) br %r1(ptr), .L0x7f4a7f7f1058, .L0x7f4a7f7f10e8 .L0x7f4a7f7f1058 load.32 %r3 <- 0[%r1(ptr)] copy.32 %r5(ptr) <- %r3 br .L0x7f4a7f7f1130 .L0x7f4a7f7f10e8 ret >From 66a02fa7cec780fc88d6ef4cce7a1e704928808a Mon Sep 17 00:00:00 2001 From: Kamil Dudka <kdudka@redhat.com> Date: Sun, 9 Aug 2009 10:22:11 +0200 Subject: [PATCH] unssa: track uses when replacing a phi node The output of test-unssa is inconsistent for a simple test-case without this patch: static void test(void **ptr) { while (ptr) { ptr = *ptr; } } Signed-off-by: Kamil Dudka <kdudka@redhat.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'unssa.c')
-rw-r--r--unssa.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/unssa.c b/unssa.c
index cd18313..3eea9b2 100644
--- a/unssa.c
+++ b/unssa.c
@@ -26,6 +26,7 @@
#include "lib.h"
#include "linearize.h"
#include "allocate.h"
+#include "flow.h"
#include <assert.h>
@@ -51,6 +52,7 @@ static void replace_phi_node(struct instruction *phi)
// update the current liveness
remove_pseudo(&phi->bb->needs, phi->target);
add_pseudo(&phi->bb->needs, tmp);
+ track_phi_uses(phi);
phi->opcode = OP_COPY;
phi->src = tmp;