From 1370fde8af1b0b5c5e6204c0dea6ebffb85dce0a Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 26 Jun 2015 14:32:08 -0400 Subject: [PATCH] freedreno/ir3: fix crash in RA Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/ir3/ir3_ra.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/freedreno/ir3/ir3_ra.c b/src/gallium/drivers/freedreno/ir3/ir3_ra.c index 0436e01ab2c..ee610c7d01e 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_ra.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_ra.c @@ -403,6 +403,7 @@ get_definer(struct ir3_instruction *instr, int *sz, int *off) * the phi, so we don't need to chase definers */ struct ir3_register *src; + struct ir3_instruction *dd = d; /* note: don't use foreach_ssa_src as this gets called once * while assigning regs (which clears SSA flag) @@ -410,9 +411,11 @@ get_definer(struct ir3_instruction *instr, int *sz, int *off) foreach_src(src, d) { if (!src->instr) continue; - if (src->instr->ip < d->ip) - d = src->instr; + if (src->instr->ip < dd->ip) + dd = src->instr; } + + d = dd; } if (is_meta(d) && (d->opc == OPC_META_FO)) { -- 2.30.2