diff mbox

[testsuite] Add dg-require-stack-check

Message ID CAKdteOYwOFyj1wNMBRkoyJBJNMC+Ua1m3Gh+HBA+4W84fgHfTQ@mail.gmail.com
State New
Headers show

Commit Message

Christophe Lyon July 11, 2017, 2:09 p.m. UTC
On 10 July 2017 at 10:01, Christophe Lyon <christophe.lyon@linaro.org> wrote:
> Hi,
>
>
> On 6 July 2017 at 06:50, Jeff Law <law@redhat.com> wrote:
>> On 07/04/2017 02:50 AM, Christophe Lyon wrote:
>>> On 3 July 2017 at 17:30, Jeff Law <law@redhat.com> wrote:
>>>> On 07/03/2017 09:00 AM, Christophe Lyon wrote:
>>>>> Hi,
>>>>>
>>>>> This is a follow-up to
>>>>> https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01791.html
>>>>>
>>>>> This patch adds dg-require-stack-check and updates the tests that use
>>>>> dg-options "-fstack-check" to avoid failures on configurations that to
>>>>> not support it.
>>>>>
>>>>> I merely copied what we currently do to check if visibility flags are
>>>>> supported, and cross-tested on aarch64 and arm targets with the
>>>>> results I expected.
>>>>>
>>>>> This means that my testing does not cover the changes I propose for
>>>>> i386 and gnat.
>>>>>
>>>>> Is it OK nonetheless?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Christophe
>>>>>
>>>>>
>>>>> stack-check-et.chlog.txt
>>>>>
>>>>>
>>>>> 2017-07-03  Christophe Lyon  <christophe.lyon@linaro.org>
>>>>>
>>>>>       * lib/target-supports-dg.exp (dg-require-stack-check): New.
>>>>>       * lib/target-supports.exp (check_stack_check_available): New.
>>>>>       * g++.dg/other/i386-9.C: Add dg-require-stack-check.
>>>>>       * gcc.c-torture/compile/stack-check-1.c: Likewise.
>>>>>       * gcc.dg/graphite/run-id-pr47653.c: Likewise.
>>>>>       * gcc.dg/pr47443.c: Likewise.
>>>>>       * gcc.dg/pr48134.c: Likewise.
>>>>>       * gcc.dg/pr70017.c: Likewise.
>>>>>       * gcc.target/aarch64/stack-checking.c: Likewise.
>>>>>       * gcc.target/arm/stack-checking.c: Likewise.
>>>>>       * gcc.target/i386/pr48723.c: Likewise.
>>>>>       * gcc.target/i386/pr55672.c: Likewise.
>>>>>       * gcc.target/i386/pr67265-2.c: Likewise.
>>>>>       * gcc.target/i386/pr67265.c: Likewise.
>>>>>       * gnat.dg/opt49.adb: Likewise.
>>>>>       * gnat.dg/stack_check1.adb: Likewise.
>>>>>       * gnat.dg/stack_check2.adb: Likewise.
>>>>>       * gnat.dg/stack_check3.adb: Likewise.
>>>> ACK once you address Rainer's comments.  I've got further stack-check
>>>> tests in the queue which I'll update once your change goes in.
>>>>
>>>> jeff
>>> Here is an updated version, which adds documentation for dg-require-stack-check.
>>>
>>> I also ran make-check on and x86_64 with ada enabled and checked the logs:
>>> the updated i386/* and gnat.dg* tests all pass, and are preceded by
>>> the compilation
>>> of the "stack_check" sample.
>>>
>>> OK?
>>>
>>> Thanks,
>>>
>>> Christophe
>>>
>>>
>>> stack-check-et.chlog.txt
>>>
>>>
>>> 2017-07-04  Christophe Lyon  <christophe.lyon@linaro.org>
>>>
>>>       gcc/
>>>       * doc/sourcebuild.texi (Test Directives, Variants of
>>>       dg-require-support): Add documentation for dg-require-stack-check.
>>>
>>>       gcc/testsuite/
>>>       * lib/target-supports-dg.exp (dg-require-stack-check): New.
>>>       * lib/target-supports.exp (check_stack_check_available): New.
>>>       * g++.dg/other/i386-9.C: Add dg-require-stack-check.
>>>       * gcc.c-torture/compile/stack-check-1.c: Likewise.
>>>       * gcc.dg/graphite/run-id-pr47653.c: Likewise.
>>>       * gcc.dg/pr47443.c: Likewise.
>>>       * gcc.dg/pr48134.c: Likewise.
>>>       * gcc.dg/pr70017.c: Likewise.
>>>       * gcc.target/aarch64/stack-checking.c: Likewise.
>>>       * gcc.target/arm/stack-checking.c: Likewise.
>>>       * gcc.target/i386/pr48723.c: Likewise.
>>>       * gcc.target/i386/pr55672.c: Likewise.
>>>       * gcc.target/i386/pr67265-2.c: Likewise.
>>>       * gcc.target/i386/pr67265.c: Likewise.
>>>       * gnat.dg/opt49.adb: Likewise.
>>>       * gnat.dg/stack_check1.adb: Likewise.
>>>       * gnat.dg/stack_check2.adb: Likewise.
>>>       * gnat.dg/stack_check3.adb: Likewise.
>> OK for the trunk.  Thanks for doing this!
>>
>
> I've committed this as r250013.
>
> Since then, I've noticed that pr48134 randomly fails.
>
> According to gcc.log, this seems related the order wrt pr47443.
> pr48134 uses -fstack-check=specific, while pr47443 uses -fstack-check=generic.
>
> When pr47443 appears before pr48134 in gcc.log, the latter fails,
> otherwise it is unsupported.
>
> Looking at gcc.log, it seems that dg-require-stack-check is not always called.
> Is there some caching in dejagnu I'm not aware of, that would ignore
> the value of the
> parameter (assuming that dg-require-stack-check "specific" and
> dg-require-stack-check "generic" return the same value?)
>
> Am I missing anything obvious?
>

It turns out I was... check_no_compiler_messages actually caches the
results using the testcase name, so using "stack_check" was insufficient.

The attached patch uses "stack_check_$stack_kind" instead, to make it
unique per fstack-check option.

OK?

Thanks,

Christophe

> Thanks,
>
> Christophe
>
>
>> Jeff
2017-07-11  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	* lib/target-supports.exp (check_stack_check_available): Make
	testcase name depend on stack_kind.

Comments

Christophe Lyon July 12, 2017, 7:54 a.m. UTC | #1
On 11 July 2017 at 16:09, Christophe Lyon <christophe.lyon@linaro.org> wrote:
> On 10 July 2017 at 10:01, Christophe Lyon <christophe.lyon@linaro.org> wrote:
>> Hi,
>>
>>
>> On 6 July 2017 at 06:50, Jeff Law <law@redhat.com> wrote:
>>> On 07/04/2017 02:50 AM, Christophe Lyon wrote:
>>>> On 3 July 2017 at 17:30, Jeff Law <law@redhat.com> wrote:
>>>>> On 07/03/2017 09:00 AM, Christophe Lyon wrote:
>>>>>> Hi,
>>>>>>
>>>>>> This is a follow-up to
>>>>>> https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01791.html
>>>>>>
>>>>>> This patch adds dg-require-stack-check and updates the tests that use
>>>>>> dg-options "-fstack-check" to avoid failures on configurations that to
>>>>>> not support it.
>>>>>>
>>>>>> I merely copied what we currently do to check if visibility flags are
>>>>>> supported, and cross-tested on aarch64 and arm targets with the
>>>>>> results I expected.
>>>>>>
>>>>>> This means that my testing does not cover the changes I propose for
>>>>>> i386 and gnat.
>>>>>>
>>>>>> Is it OK nonetheless?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Christophe
>>>>>>
>>>>>>
>>>>>> stack-check-et.chlog.txt
>>>>>>
>>>>>>
>>>>>> 2017-07-03  Christophe Lyon  <christophe.lyon@linaro.org>
>>>>>>
>>>>>>       * lib/target-supports-dg.exp (dg-require-stack-check): New.
>>>>>>       * lib/target-supports.exp (check_stack_check_available): New.
>>>>>>       * g++.dg/other/i386-9.C: Add dg-require-stack-check.
>>>>>>       * gcc.c-torture/compile/stack-check-1.c: Likewise.
>>>>>>       * gcc.dg/graphite/run-id-pr47653.c: Likewise.
>>>>>>       * gcc.dg/pr47443.c: Likewise.
>>>>>>       * gcc.dg/pr48134.c: Likewise.
>>>>>>       * gcc.dg/pr70017.c: Likewise.
>>>>>>       * gcc.target/aarch64/stack-checking.c: Likewise.
>>>>>>       * gcc.target/arm/stack-checking.c: Likewise.
>>>>>>       * gcc.target/i386/pr48723.c: Likewise.
>>>>>>       * gcc.target/i386/pr55672.c: Likewise.
>>>>>>       * gcc.target/i386/pr67265-2.c: Likewise.
>>>>>>       * gcc.target/i386/pr67265.c: Likewise.
>>>>>>       * gnat.dg/opt49.adb: Likewise.
>>>>>>       * gnat.dg/stack_check1.adb: Likewise.
>>>>>>       * gnat.dg/stack_check2.adb: Likewise.
>>>>>>       * gnat.dg/stack_check3.adb: Likewise.
>>>>> ACK once you address Rainer's comments.  I've got further stack-check
>>>>> tests in the queue which I'll update once your change goes in.
>>>>>
>>>>> jeff
>>>> Here is an updated version, which adds documentation for dg-require-stack-check.
>>>>
>>>> I also ran make-check on and x86_64 with ada enabled and checked the logs:
>>>> the updated i386/* and gnat.dg* tests all pass, and are preceded by
>>>> the compilation
>>>> of the "stack_check" sample.
>>>>
>>>> OK?
>>>>
>>>> Thanks,
>>>>
>>>> Christophe
>>>>
>>>>
>>>> stack-check-et.chlog.txt
>>>>
>>>>
>>>> 2017-07-04  Christophe Lyon  <christophe.lyon@linaro.org>
>>>>
>>>>       gcc/
>>>>       * doc/sourcebuild.texi (Test Directives, Variants of
>>>>       dg-require-support): Add documentation for dg-require-stack-check.
>>>>
>>>>       gcc/testsuite/
>>>>       * lib/target-supports-dg.exp (dg-require-stack-check): New.
>>>>       * lib/target-supports.exp (check_stack_check_available): New.
>>>>       * g++.dg/other/i386-9.C: Add dg-require-stack-check.
>>>>       * gcc.c-torture/compile/stack-check-1.c: Likewise.
>>>>       * gcc.dg/graphite/run-id-pr47653.c: Likewise.
>>>>       * gcc.dg/pr47443.c: Likewise.
>>>>       * gcc.dg/pr48134.c: Likewise.
>>>>       * gcc.dg/pr70017.c: Likewise.
>>>>       * gcc.target/aarch64/stack-checking.c: Likewise.
>>>>       * gcc.target/arm/stack-checking.c: Likewise.
>>>>       * gcc.target/i386/pr48723.c: Likewise.
>>>>       * gcc.target/i386/pr55672.c: Likewise.
>>>>       * gcc.target/i386/pr67265-2.c: Likewise.
>>>>       * gcc.target/i386/pr67265.c: Likewise.
>>>>       * gnat.dg/opt49.adb: Likewise.
>>>>       * gnat.dg/stack_check1.adb: Likewise.
>>>>       * gnat.dg/stack_check2.adb: Likewise.
>>>>       * gnat.dg/stack_check3.adb: Likewise.
>>> OK for the trunk.  Thanks for doing this!
>>>
>>
>> I've committed this as r250013.
>>
>> Since then, I've noticed that pr48134 randomly fails.
>>
>> According to gcc.log, this seems related the order wrt pr47443.
>> pr48134 uses -fstack-check=specific, while pr47443 uses -fstack-check=generic.
>>
>> When pr47443 appears before pr48134 in gcc.log, the latter fails,
>> otherwise it is unsupported.
>>
>> Looking at gcc.log, it seems that dg-require-stack-check is not always called.
>> Is there some caching in dejagnu I'm not aware of, that would ignore
>> the value of the
>> parameter (assuming that dg-require-stack-check "specific" and
>> dg-require-stack-check "generic" return the same value?)
>>
>> Am I missing anything obvious?
>>
>
> It turns out I was... check_no_compiler_messages actually caches the
> results using the testcase name, so using "stack_check" was insufficient.
>
> The attached patch uses "stack_check_$stack_kind" instead, to make it
> unique per fstack-check option.
>

I went ahead and committed it as r250149.

Christophe

> OK?
>
> Thanks,
>
> Christophe
>
>> Thanks,
>>
>> Christophe
>>
>>
>>> Jeff
diff mbox

Patch

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 7fb51cc..97d834c 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1069,7 +1069,7 @@  proc check_stack_check_available { stack_kind } {
 	set stack_opt "-fstack-check"
     } else { set stack_opt "-fstack-check=$stack_kind" }
 
-    return [check_no_compiler_messages stack_check executable {
+    return [check_no_compiler_messages stack_check_$stack_kind executable {
 	int main (void) { return 0; }
     } "$stack_opt"]
 }