PATCH: fix building invalid IR lowering initializer list

Nick Lewycky nlewycky at google.com
Tue Mar 17 18:05:57 PDT 2015


On 17 March 2015 at 17:48, Richard Smith <richard at metafoo.co.uk> wrote:

> On Tue, Mar 17, 2015 at 5:20 PM, Nick Lewycky <nlewycky at google.com> wrote:
>
>> On 16 March 2015 at 19:24, Nick Lewycky <nlewycky at google.com> wrote:
>>
>>> On 16 March 2015 at 19:17, Richard Smith <richard at metafoo.co.uk> wrote:
>>>
>>>> Thanks, LGTM!
>>>>
>>>
>>> Thanks, r232454!
>>>
>>
>> Got reverted and root caused in PR22940, here's another attempt at the
>> patch which doesn't break the testcase in PR22940. Please review!
>>
>
> It might be cleaner to move the getBitCast calls into the caller of
> createReferenceTemporary.
>

Yes, it is. Attached!

Nick


> On Mon, Mar 16, 2015 at 5:19 PM, Nick Lewycky <nlewycky at google.com> wrote:
>>>>
>>>>> On 16 March 2015 at 16:19, Richard Smith <richard at metafoo.co.uk>
>>>>> wrote:
>>>>>
>>>>>> On Mon, Mar 16, 2015 at 4:00 PM, Nick Lewycky <nlewycky at google.com>
>>>>>> wrote:
>>>>>>
>>>>>>> The attached patch fixes a case where we produce an invalid store
>>>>>>> where the value type is not the same as the pointee type of the pointer.
>>>>>>> This occurs when lowering to a global variable because the GV must have the
>>>>>>> type of a pointer to its initializer, yet the initializer is not quite the
>>>>>>> same that we use for the value. Fix it up by adding a cast.
>>>>>>>
>>>>>>> Ben, I've cc'd you because I think this is a regression from your
>>>>>>> r231564.
>>>>>>>
>>>>>>> Please review!
>>>>>>>
>>>>>>
>>>>>> Do the SD_Thread and SD_Static cases need the same handling? It looks
>>>>>> like both of those cases can also return a Value with the wrong Type.
>>>>>>
>>>>>
>>>>> They do! Patch attached.
>>>>>
>>>>> Nick
>>>>>
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150317/998014b0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-init_list_glbl_type-4.patch
Type: text/x-patch
Size: 3500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150317/998014b0/attachment.bin>


More information about the cfe-commits mailing list