On 02/15/2018 07:01 PM, Martin Sebor wrote:
Thanks.  I've seen these fixes before but I still keep forgetting
to add the directive.

Hi,

I also forget about these directives when I do an x86_64 build-test-commit.

The alloca effective target is one of a bunch of effective targets that are formulated generically, but implementationwise are currently just a test for the nvptx target. So, I fix these test compilation fails when I run into them for nvptx target build & test.

It would be nice if the test harness could
detect this automatically for us and remind us to add the directive
even on targets where alloca is supported.


Agreed, that would be nice.

Some sort of a script (or even DejaGnu itself) would do it for
explicit calls to alloca but I can't think of a solution for
VLAs.  Do you have any idea if that might be doable and how?


I suppose it could be done by modifying the compiler: have the compiler print out the effective targets it requires for a test-case, if passed some switch, and have dejagnu pass the switch, parse the information, and emit a warning if an actually required effective target is not listed as required in the test-case.

It also could be done without modifying the compiler by dumping a tree file and grepping, but it sounds more fragile to me. Maybe for alloca the grepping method would work, but for other rarely-false effective targets it could be harder.

Thanks,
- Tom

Martin

On 02/15/2018 07:10 AM, Tom de Vries wrote:
Hi,

this patch requires effective target alloca for test-case
Wstringop-overflow-3.c.

Committed.

Thanks,
- Tom


Reply via email to