This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [CilkPlus] fix issues when cilk_spawn is used with nontrivial expressions


On 01/06/2016 01:11 PM, Ryan Burn wrote:



I could additionally check that the language is c++ before checking
those flags, but I'm not sure I see a way around using them. For c++,
the cilk_spawn expression can be nested within implicit conversion
operators or constructors as in this case:

struct A { operator int() { return 0; } };
A f();
int x = cilk_spawn f();

So I have to check for the conversion operators or constructors when
traversing the expression to search for the spawn. cp-tree.h has
macros that could be used to avoid checking TREE_LANG_FLAG directly,
but I wasn't sure if shared code files are allowed to include c++
specific headers. The code could be split to have a different version
for c++, but that would be more significant changes and could lead to
some code redundancy.

Any suggestions?
I think the checks, or at least part of them is going to have to move out of c-family common code and into the language specific front-ends.

As you note, that likely means a more intrusive change and possibly some code duplication. But looking at the language specific flags like that in code shared across front-ends is a recipe for disaster.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]