[cfe-commits] [PATCH] for "Throwing exceptions from temporary object's destructor" issue

SENTHIL KUMAR THANGAVELU senthil.t at samsung.com
Mon Sep 17 01:56:33 PDT 2012


Hello all,
  Fixed regression failure CodeGenCXX/temporaries.cpp found in previous patch. Attachments contain the failing g++ test case and the patch containing fix. Patch fixes Bug 12306 ini-temp1.C issue only.

Regards
Senthil Kumar

------- Original Message -------
Sender : SENTHIL KUMAR THANGAVELU<senthil.t at samsung.com> ./Senior Technical Manager/SISO-Mobile Protocols & Platforms/Samsung Electronics
Date : Sep 12, 2012 20:40 (GMT+09:00)
Title : Patch for "Throwing exceptions from temporary object's destructor" issue

Hello all, John McCall,
    I have attached a patch for the issue we discussed previously "http://clang-developers.42468.n3.nabble.com/Throwing-exceptions-from-temporary-object-s-destructor-td4026498.html" specifically targetting only init-temp1.C(from gcc test suite) . Tested the patch on X86-linux and ARM-linux ran clang regression, all test cases passed except CodeGenCXX/temporaries.cpp.
   The issue was due to same landingpad being used for constructor and destructor of the same object and the parent auto var decl is not cleaned up(destructor called) when the destructor threw an exception. This patch creates a new landing pad containing a call to parent auto var decl's destructor. Once this destructor is called all other cleanup items are threaded through.
   I met with regression failure for the case CodeGenCXX/temporaries.cpp. I have reduced the test case only to contain the failure portion attached in email(temporaries.test.cpp). There is some pattern which the test case expects and the fix changes the pattern so the test case fails. I have attached the .ll file generated with and without the patch. Can someone suggest how to modify the test case? also I would like to know the rational required to modify the test case. The 2 ".ll" files were generated with the patch on 3.1 branch.  Please let me know your comments.

Description of attachments:
1) patch.p0.txt -  patch based on svn revision 163683
2) temporaries.test.cpp - reduced test case from CodeGenCXX/temporaries.cpp containing only the snippet causing failure.  If this snippet is removed from original test case, test passes.
3) temporaries.base.ll -  clang output without my changes for temporaries.test.cpp
4) temporaries.withchanges.ll - clang output with my changes for temporaries.test.cpp
5) init-temp1.C - test case from gcc test suite

Regards
Senthil Kumar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.sep17.p0.txt
Type: application/octet-stream
Size: 7072 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120917/566f99bc/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: init-temp1.C
Type: application/octet-stream
Size: 706 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120917/566f99bc/attachment-0001.obj>


More information about the cfe-commits mailing list