[cfe-dev] lifetime marker for expression-emission temporaries
David Blaikie via cfe-dev
cfe-dev at lists.llvm.org
Tue Aug 22 15:22:13 PDT 2017
Tim - you did some work on lifetime markers ~recently ( year or two ago)
for POC stack usage? Any ideas on this?
On Tue., 22 Aug. 2017, 11:00 am via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> Hi,
>
> Due to the missing lifetime markers for temporary allocas, an
> unreasonable stack size burst was observed
> (https://bugs.llvm.org/show_bug.cgi?id=34173). Using the C code below,
> you can see the missing lifetime markers for temporary allocas for sret:
>
> /* clang -Wframe-larger-than=1 -o bug bug.c -c -O1 */
>
> struct a {
> int a; int b;
> int c; int d;
> int f; int g;
> int h; int i;
> };
>
> struct a test_callee(void);
>
> int foo() {
> struct a b;
> b= test_callee();
> b= test_callee();
> b= test_callee();
> b= test_callee();
> b= test_callee();
> b= test_callee();
> return 0;
> }
>
> Based on John McCall's comment in Bug34173, the frond-end needs to be
> improved to properly add lifetime marks :
> Clang's adoption of lifetime markers has been rather piecemeal,
> especially for expression-emission temporaries like this. To do this
> properly, I think we'd need to honor full-expression lifetime implicitly
> rather than relying on ExprWithCleanups.
>
> Honestly, I don't have much experience in the front-end and I have other
> issues to handle in priority. Is there anyone who can volunteer for this
> issue ?
>
> Thanks,
> Jun
>
>
> --
> Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
> Technologies, Inc.
> Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a
> Linux Foundation Collaborative Project.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170822/8d4c92e9/attachment.html>
More information about the cfe-dev
mailing list