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: [testsuite, ada] Check for .cfi_personality support


I think these tests should be xfail for this case rather than unsupported. The main reason is not all assemblies will be supporting these directives and really this can be fixed without them. We should xfail them and file a bug (if not already filed) for this.

Sent from my iPhone

On May 17, 2010, at 12:30 PM, Rainer Orth <ro@CeBiTec.Uni- Bielefeld.DE> wrote:

Two Ada LTO testcase currently fail on i386-pc-solaris2.11 with the
bundled gas 2.19:

FAIL: gnat.dg/lto6.adb (test for excess errors)
Excess errors:
In file included from :44:0:
/vol/gcc/src/hg/trunk/solaris/gcc/testsuite/gnat.dg/lto6_pkg.ads: 4:8: sorry, unimplemented: Multiple EH personalities are supported only with assemblers supporting .cfi.personality directive.
lto-wrapper: /vol/gcc/obj/gcc-4.6.0-20100512/11-gcc-as90/gcc/xgcc returned 1 exit status
collect2: lto-wrapper returned 1 exit status
gnatlink: error when calling /vol/gcc/obj/gcc-4.6.0-20100512/11-gcc- as90/gcc/xgcc


WARNING: gnat.dg/lto6.adb compilation failed to produce executable

To avoid this, I'm introducing a new effective-target keyword,
cfi_personality. The test matches the the gcc/configure.ac checks
HAVE_GAS_CFI_DIRECTIVE (without the gcc_cv_as_cfi_advance_working part)
and HAVE_GAS_CFI_PERSONALITY_DIRECTIVE. In the implementation of
check_effective_target_cfi_personality, I had to set tool to default
temporarily, otherwise the Ada compiler would be used to compile the
testcase, which obviously breaks. I'm using default here instead of gcc
since the latter setting would require gnat-dg.exp to load gcc.exp,
which defines gcc_target_compile, while default_target_compile works
just as well in this case and is already included in DejaGnu.


This patch correctly detected the lack of .cfi_personality support and
made the previously failing testcases UNSUPPORTED.

Ok for mainline?

Rainer

--
--- --- --- --------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



2010-05-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>


   gcc:
   * doc/sourcebuild.texi (Effective-Target Keywords): Document
   cfi_personality.

   * lib/target-supports.exp
   (check_effective_target_cfi_personality): New proc.
   * gnat.dg/lto6.adb: Use dg-require-effective-target
   cfi_personality.
   * gnat.dg/lto8.adb: Likewise.

diff -r 2ac32d5ed330 gcc/doc/sourcebuild.texi
--- a/gcc/doc/sourcebuild.texi  Mon May 17 21:20:34 2010 +0200
+++ b/gcc/doc/sourcebuild.texi  Mon May 17 21:24:21 2010 +0200
@@ -1704,6 +1704,9 @@
@item automatic_stack_alignment
Target supports automatic stack alignment.

+@item cfi_personality
+Target assembler supports .cfi_personality directive.
+
@item cxa_atexit
Target uses @code{__cxa_atexit}.

diff -r 5c5793beb408 gcc/testsuite/gnat.dg/lto6.adb
--- a/gcc/testsuite/gnat.dg/lto6.adb    Sat May 15 19:22:36 2010 +0200
+++ b/gcc/testsuite/gnat.dg/lto6.adb    Mon May 17 18:48:12 2010 +0200
@@ -1,5 +1,6 @@
-- { dg-do run }
-- { dg-options "-O2 -flto" { target lto } }
+-- { dg-require-effective-target cfi_personality }

with Lto6_Pkg; use Lto6_Pkg;

diff -r 5c5793beb408 gcc/testsuite/gnat.dg/lto8.adb
--- a/gcc/testsuite/gnat.dg/lto8.adb    Sat May 15 19:22:36 2010 +0200
+++ b/gcc/testsuite/gnat.dg/lto8.adb    Mon May 17 18:48:12 2010 +0200
@@ -1,6 +1,7 @@
-- { dg-do run }
-- { dg-options "-gnatws" }
-- { dg-options "-gnatws -flto" { target lto } }
+-- { dg-require-effective-target cfi_personality }

pragma Locking_Policy (Ceiling_Locking);

diff -r 5c5793beb408 gcc/testsuite/lib/target-supports.exp
--- a/gcc/testsuite/lib/target-supports.exp Sat May 15 19:22:36 2010 +0200
+++ b/gcc/testsuite/lib/target-supports.exp Mon May 17 18:48:12 2010 +0200
@@ -605,6 +605,27 @@
}]
}


+# Return 1 if assembler supports .cfi_personality, 0 otherwise.
+
+proc check_effective_target_cfi_personality {} {
+ global tool
+ set saved_tool $tool
+ # Test with C compiler even if used inside gnat.dg.
+ set tool "default"
+ set cfi_personality [check_no_compiler_messages cfi_personality object {
+ int main (void) {
+ asm (" .text");
+ asm (".cfi_sections .debug_frame, .eh_frame");
+ asm (".cfi_startproc");
+ asm (".cfi_personality 0, symbol");
+ asm (".cfi_endproc");
+ return 0;
+ }
+ }]
+ set tool $saved_tool
+ return $cfi_personality
+}
+
# Return 1 if compilation with -fgraphite is error-free for trivial
# code, 0 otherwise.




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