diff mbox

[cxx-mem-model] expand_atomic_load: Handle an empty target

Message ID 4EA08A96.4070209@redhat.com
State New
Headers show

Commit Message

Aldy Hernandez Oct. 20, 2011, 8:54 p.m. UTC
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.

Comments

Andrew MacLeod Oct. 20, 2011, 8:56 p.m. UTC | #1
On 10/20/2011 04:54 PM, Aldy Hernandez wrote:
> 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?

yes.   btw, did you audit the other new expand routines to see if they 
handled a NULL return target as well?

Andrew
Aldy Hernandez Oct. 20, 2011, 9:05 p.m. UTC | #2
On 10/20/11 15:56, Andrew MacLeod wrote:
> On 10/20/2011 04:54 PM, Aldy Hernandez wrote:
>> 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?
>
> yes. btw, did you audit the other new expand routines to see if they
> handled a NULL return target as well?
>
> Andrew

They seem ok, but I am re-running tests on ia64 to see if I find other 
similar failures.  If I do, I will submit fixes.

Aldy
diff mbox

Patch

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.  */