This is an archive of the discontinued LLVM Phabricator instance.

[OMPT] Use alloca() to force availability of frame pointer
ClosedPublic

Authored by sconvent on Jun 18 2018, 7:24 AM.

Details

Summary

When compiling with icc, there is a problem with reenter frame addresses in parallel_begin callbacks in the interoperability.c testcase. (The address is not available. thus NULL)
Using alloca() forces availability of the frame pointer.

Diff Detail

Repository
rL LLVM

Event Timeline

sconvent created this revision.Jun 18 2018, 7:24 AM
protze.joachim added a comment.EditedJun 18 2018, 7:27 AM

The problem, which gets visible in this test case is the use of __builtin_frame_address(1), which is documented to be not safe.
Is there a better way to get the canonical frame address of the calling function? Also the address returned by __builtin_frame_address seems to be different from the canonical frame address. How can we get the requested address?

hbae added inline comments.Jun 20 2018, 7:02 AM
runtime/test/ompt/misc/interoperability.cpp
13 ↗(On Diff #151712)

Can you try to insert an alloca() call here? It can force using the frame pointer in many cases (compilers).

void *p = alloca(0);
sconvent updated this revision to Diff 152638.Jun 25 2018, 1:58 AM
sconvent retitled this revision from [OMPT] Interoperability testcase is expected to fail with icc to [OMPT] Use alloca() to force availability of frame pointer .
sconvent edited the summary of this revision. (Show Details)

Use alloca() to force availability of frame pointer

sconvent updated this revision to Diff 152640.Jun 25 2018, 2:06 AM

Add comment explaining the use of alloca()

hbae accepted this revision.Jun 29 2018, 9:26 AM

LGTM

This revision is now accepted and ready to land.Jun 29 2018, 9:26 AM
This revision was automatically updated to reflect the committed changes.