From patchwork Thu Oct 20 20:54:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [cxx-mem-model] expand_atomic_load: Handle an empty target Date: Thu, 20 Oct 2011 10:54:46 -0000 From: Aldy Hernandez X-Patchwork-Id: 120874 Message-Id: <4EA08A96.4070209@redhat.com> To: Andrew MacLeod , gcc-patches Found this while testing the branch on ia64. The call to expand_val_compare_and_swap() above returns NULL_RTX when it can't find a suitable instruction. OK for branch? * optabs.c (expand_atomic_load): Handle a NULL target. Index: optabs.c =================================================================== --- optabs.c (revision 180273) +++ optabs.c (working copy) @@ -7140,7 +7140,7 @@ expand_atomic_load (rtx target, rtx mem, return target; } - if (target == const0_rtx) + if (!target || target == const0_rtx) target = gen_reg_rtx (mode); /* Emit the appropriate barrier before the load. */