diff mbox

Fixes to must-tail-call tests

Message ID 1464106264-58571-1-git-send-email-dmalcolm@redhat.com
State New
Headers show

Commit Message

David Malcolm May 24, 2016, 4:11 p.m. UTC
The following fixes the known failures of the must-tail-call tests.

Tested with --target=
* aarch64-unknown-linux-gnu
* ia64-unknown-linux-gnu
* m68k-unknown-linux-gnu
* x86_64-pc-linux-gnu
 
OK for trunk?

gcc/testsuite/ChangeLog:
	* gcc.dg/plugin/must-tail-call-2.c (test_2_caller): Generalize
	expected error message to allow "argument must by passed by
	copying".
	(test_3): Generalize expected error message to allow for failure
	of targetm.function_ok_for_sibcall.
	(test_4): Likewise.
	(test_5): Likewise.
---
 gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Rainer Orth May 25, 2016, 9:31 a.m. UTC | #1
David Malcolm <dmalcolm@redhat.com> writes:

> The following fixes the known failures of the must-tail-call tests.
>
> Tested with --target=
> * aarch64-unknown-linux-gnu
> * ia64-unknown-linux-gnu
> * m68k-unknown-linux-gnu
> * x86_64-pc-linux-gnu

Even with this patch, there are still failures on sparc-sun-solaris2.12:

FAIL: gcc.dg/plugin/must-tail-call-1.c -fplugin=./must_tail_call_plugin.so (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c:12:10: error: cannot tail-call: target is not able to optimize the call into a sibling call

FAIL: gcc.dg/plugin/must-tail-call-2.c -fplugin=./must_tail_call_plugin.so (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c:32:10: error: cannot tail-call: target is not able to optimize the call into a sibling call

	Rainer
Thomas Preudhomme May 27, 2016, 12:29 p.m. UTC | #2
Hi Rainer,

On Wednesday 25 May 2016 11:31:12 Rainer Orth wrote:
> David Malcolm <dmalcolm@redhat.com> writes:
> > The following fixes the known failures of the must-tail-call tests.
> > 
> > Tested with --target=
> > * aarch64-unknown-linux-gnu
> > * ia64-unknown-linux-gnu
> > * m68k-unknown-linux-gnu
> > * x86_64-pc-linux-gnu
> 
> Even with this patch, there are still failures on sparc-sun-solaris2.12:
> 
> FAIL: gcc.dg/plugin/must-tail-call-1.c -fplugin=./must_tail_call_plugin.so
> (test for excess errors)
> 
> Excess errors:
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c:1
> 2:10: error: cannot tail-call: target is not able to optimize the call into
> a sibling call
> 
> FAIL: gcc.dg/plugin/must-tail-call-2.c -fplugin=./must_tail_call_plugin.so
> (test for excess errors)
> 
> Excess errors:
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c:3
> 2:10: error: cannot tail-call: target is not able to optimize the call into
> a sibling call

Now that the logic is in place, you probably want to add sparc-sun-solaris in 
plugin.exp to the the list of architecture where tail call plugin tests should 
be skipped, alongside Thumb-1 ARM targets.

Best regards,

Thomas
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c b/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c
index c5504f8..ca81b35 100644
--- a/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c
+++ b/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c
@@ -29,14 +29,14 @@  int __attribute__((noinline,noclone))
 test_2_caller (int i)
 {
   struct box b;
-  return test_2_callee (i + 1, b); /* { dg-error "cannot tail-call: callee required more stack slots than the caller" } */
+  return test_2_callee (i + 1, b); /* { dg-error "cannot tail-call: callee required more stack slots than the caller|argument must be passed by copying" } */
 }
 
 extern void setjmp (void);
 void
 test_3 (void)
 {
-  setjmp (); /* { dg-error "cannot tail-call: callee returns twice" } */
+  setjmp (); /* { dg-error "cannot tail-call: callee returns twice|target is not able to optimize the call into a sibling call" } */
 }
 
 void
@@ -45,7 +45,7 @@  test_4 (void)
   void nested (void)
   {
   }
-  nested (); /* { dg-error "cannot tail-call: nested function" } */
+  nested (); /* { dg-error "cannot tail-call: nested function|target is not able to optimize the call into a sibling call" } */
 }
 
 typedef void (fn_ptr_t) (void);
@@ -54,5 +54,5 @@  volatile fn_ptr_t fn_ptr;
 void
 test_5 (void)
 {
-  fn_ptr (); /* { dg-error "cannot tail-call: callee does not return" } */
+  fn_ptr (); /* { dg-error "cannot tail-call: callee does not return|target is not able to optimize the call into a sibling call" } */
 }