[PATCH] Fix printing of GCCAsmExprs with input or output arguments.

Nick Sumner nick.sumner at gmail.com
Mon Jun 22 16:05:01 PDT 2015


Hi Jon,

Thanks for fixing the test. I've been travelling, but I'm happy to
revise the other patches as necessary, too.

The second one should be target independent. The first one might be
better if the value is explicitly truncated to the ascii range rather
than casting to char (to allow for non-posix compatibility).

Thanks,
Nick


On Tue, Jun 9, 2015 at 7:37 AM, Jonathan Roelofs
<jonathan at codesourcery.com> wrote:
>
>
> On 6/8/15 3:29 PM, Nick Sumner wrote:
>>
>> Thanks. Can you please commit it?
>
>
> Sure. Committed r239406. Build breakage (on non x86 hosts) fixed in r239407.
>
>>
>> If you are (or anyone else is) interested, I've got two other
>> outstanding patches for AST printing bugs:
>>
>>
>> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150525/130001.html
>>
>> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150525/130082.html'
>
>
> I'll take a look.
>
>
> Jon
>
>
>>
>> Thanks,
>> Nick
>>
>>
>> On Mon, Jun 8, 2015 at 12:11 PM, Jonathan Roelofs
>> <jonathan at codesourcery.com> wrote:
>>>
>>>
>>>
>>> On 6/8/15 12:55 PM, Nick Sumner wrote:
>>>>
>>>>
>>>> Hi all,
>>>>
>>>> The attached patch fixes a bug with printing GCCAsmExprs. Presently,
>>>> the required parentheses around input and output arguments are
>>>> omitted. Thus, given the code:
>>>>
>>>> __asm__ __volatile__("addl %%ebx,%%eax" : "=a" (added) : "a" (1), "b"
>>>> (2)
>>>> );
>>>>
>>>> The expr is presently printed as:
>>>> asm volatile ("addl %%ebx,%%eax" : "=a" added : "a" 1, "b" 2);
>>>>
>>>> With the patch, the expr is printed as:
>>>> asm volatile ("addl %%ebx,%%eax" : "=a" (added) : "a" (1), "b" (2));
>>>
>>>
>>>
>>> LGTM.
>>>
>>>
>>> Jon
>>>
>>>>
>>>> Best,
>>>> Nick
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> cfe-commits mailing list
>>>> cfe-commits at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>>>
>>>
>>> --
>>> Jon Roelofs
>>> jonathan at codesourcery.com
>>> CodeSourcery / Mentor Embedded
>
>
> --
> Jon Roelofs
> jonathan at codesourcery.com
> CodeSourcery / Mentor Embedded



More information about the cfe-commits mailing list