Patchwork [trans-mem] fix transaction_callable's with asm statements

login
register
mail settings
Submitter Aldy Hernandez
Date Jan. 12, 2011, 6:32 p.m.
Message ID <4D2DF3B0.5020609@redhat.com>
Download mbox | patch
Permalink /patch/78606/
State New
Headers show

Comments

Aldy Hernandez - Jan. 12, 2011, 6:32 p.m.
On 01/12/11 12:10, Richard Henderson wrote:
>>         /* Handle the easy initialization to zero.  */
>> -      if (CONSTRUCTOR_ELTS (rhs) == 0)
>> +      if (CONSTRUCTOR_ELTS (rhs) == 0&&  INTEGRAL_TYPE_P (type))
>>   	rhs = build_int_cst (type, 0);
> While this works, it's not what I intended.  In particular,
> you'll never see a CONSTRUCTOR for an integral type, so this
> condition will never fire.
>
> What's intended here is to store a zero of the proper size
> into the location.  So actually the little change is
>
>    rhs = build_int_cst (simple_type, 0);
>
> This should probably be done as a separate fix, since it
> turns out to be non-obvious.

Fixed in attached patch and committed.

> Ok. You're probably right that the ipa pass needs to be rewritten.
> Third time's the charm, right?

I hope so :).  I've committed this part of the patch independently.

Thanks.  Now, on to the actual bug I was fixing :).
* trans-mem.c (build_tm_store): Build correct type when handling
	CONSTRUCTORs.

Patch

Index: trans-mem.c
===================================================================
--- trans-mem.c	(revision 168726)
+++ trans-mem.c	(working copy)
@@ -2068,7 +2068,7 @@  build_tm_store (location_t loc, tree lhs
     {
       /* Handle the easy initialization to zero.  */
       if (CONSTRUCTOR_ELTS (rhs) == 0)
-	rhs = build_int_cst (type, 0);
+	rhs = build_int_cst (simple_type, 0);
       else
 	{
 	  /* ...otherwise punt to the caller and probably use