public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Update testsuite to run with slim LTO
@ 2011-09-27 17:54 Jan Hubicka
  2011-09-30 14:56 ` Diego Novillo
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Jan Hubicka @ 2011-09-27 17:54 UTC (permalink / raw)
  To: gcc-patches, dnovillo, rguenther, ak

Hi,
this patch updates testsuite to cover both fat and slim LTO when linker plugin
is used and also both linker plugin and collect2 paths.  I didn't wanted to
slow down testing too much so I just distributes the flags across existing runs
with aim to maximize the coverage of testing matrix that is bit large now.
I believe it is sufficient and testsuite now runs a bit faster than previously
since slim LTO saves some effort.

sync and pr34850 tests doesn't pass with slim LTO. The reason is that they
excpects diagnostics that is output too late in compilation (usually at
expansion time).  These should be probably fixed as QOI issue but they are not
real bug - the diagnostics will be output at linktime.  I will open PR tracking
this.  We probably should output pretty much everything till end of early opts
except for stuff that really looks for optimization results.  Especially now
when we handle always inline in early inlining.

Honza

	* lib/lto.exp: When linker plugin is available test both
	plugin/non-plugin LTO paths as well as fat and slim LTO.
	lib/c-torture.exp: Likewise.
	lib/gcc-dg.exp: Likweise
	* gcc.c-torture/compile/sync-1.c: Do not run with slim LTO.
	* gcc.c-torture/compile/sync-2.c: Do not run with slim LTO.
	* gcc.c-torture/compile/sync-3.c: Do not run with slim LTO.
	* gcc.dg/noncompile/920507-1.c: Do not run with slim LTO.
	* g++.dg/torture/pr34850.C: Do not run with slim LTO
Index: lib/lto.exp
===================================================================
*** lib/lto.exp	(revision 179274)
--- lib/lto.exp	(working copy)
*************** proc lto_init { args } {
*** 66,79 ****
      # You can put this in the environment before site.exp is written or
      # add it to site.exp directly.
      if ![info exists LTO_OPTIONS] {
! 	set LTO_OPTIONS [list	\
! 	    {-O0 -flto -flto-partition=none } \
! 	    {-O2 -flto -flto-partition=none } \
! 	    {-O0 -flto -flto-partition=1to1 } \
! 	    {-O2 -flto -flto-partition=1to1 } \
! 	    {-O0 -flto}		\
! 	    {-O2 -flto}		\
! 	]
      }
  }
  
--- 66,89 ----
      # You can put this in the environment before site.exp is written or
      # add it to site.exp directly.
      if ![info exists LTO_OPTIONS] {
!         if [check_effective_target_lto] {
! 	  set LTO_OPTIONS [list	\
! 	      {-O0 -flto -flto-partition=none -fuse-linker-plugin} \
! 	      {-O2 -flto -flto-partition=none -fuse-linker-plugin -fno-fat-lto-objects } \
! 	      {-O0 -flto -flto-partition=1to1 -fno-use-linker-plugin } \
! 	      {-O2 -flto -flto-partition=1to1 -fno-use-linker-plugin } \
! 	      {-O0 -flto -fuse-linker-plugin -fno-fat-lto-objects }	\
! 	      {-O2 -flto -fuse-linker-plugin}	\
! 	  ]
!  	} else {
! 	  set LTO_OPTIONS [list	\
! 	      {-O0 -flto -flto-partition=none } \
! 	      {-O2 -flto -flto-partition=none } \
! 	      {-O0 -flto -flto-partition=1to1 } \
! 	      {-O2 -flto -flto-partition=1to1 } \
! 	      {-O0 -flto }	\
! 	      {-O2 -flto}		\
! 	}
      }
  }
  
Index: lib/c-torture.exp
===================================================================
*** lib/c-torture.exp	(revision 179274)
--- lib/c-torture.exp	(working copy)
*************** if [info exists ADDITIONAL_TORTURE_OPTIO
*** 52,61 ****
  
  set LTO_TORTURE_OPTIONS ""
  if [check_effective_target_lto] {
!     set LTO_TORTURE_OPTIONS [list \
! 	{ -O2 -flto -flto-partition=none } \
! 	{ -O2 -flto }
!     ]
  }
  
  global GCC_UNDER_TEST
--- 52,69 ----
  
  set LTO_TORTURE_OPTIONS ""
  if [check_effective_target_lto] {
!     # When having plugin test both slim and fat LTO and plugin/nonplugin
!     # path.
!     if [check_linker_plugin_available] {
!       set LTO_TORTURE_OPTIONS [list \
! 	  { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \
! 	  { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects }
!       ]
!     } else {
!       set LTO_TORTURE_OPTIONS [list \
! 	  { -O2 -flto -flto-partition=none } \
! 	  { -O2 -flto -fuse-linker-plugin }
!     }
  }
  
  global GCC_UNDER_TEST
Index: lib/gcc-dg.exp
===================================================================
*** lib/gcc-dg.exp	(revision 179274)
--- lib/gcc-dg.exp	(working copy)
*************** if [info exists ADDITIONAL_TORTURE_OPTIO
*** 69,78 ****
  
  set LTO_TORTURE_OPTIONS ""
  if [check_effective_target_lto] {
!     set LTO_TORTURE_OPTIONS [list \
! 	{ -O2 -flto -flto-partition=none } \
! 	{ -O2 -flto }
!     ]
  }
  
  
--- 69,86 ----
  
  set LTO_TORTURE_OPTIONS ""
  if [check_effective_target_lto] {
!     # When having plugin test both slim and fat LTO and plugin/nonplugin
!     # path.
!     if [check_linker_plugin_available] {
!       set LTO_TORTURE_OPTIONS [list \
! 	  { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \
! 	  { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects }
!       ]
!     } else {
!       set LTO_TORTURE_OPTIONS [list \
! 	  { -O2 -flto -flto-partition=none } \
! 	  { -O2 -flto -fuse-linker-plugin }
!     }
  }
  
  
Index: gcc.c-torture/execute/builtins/strstr-asm.c
===================================================================
*** gcc.c-torture/execute/builtins/strstr-asm.c	(revision 179274)
--- gcc.c-torture/execute/builtins/strstr-asm.c	(working copy)
***************
*** 2,7 ****
--- 2,8 ----
  
     Ensure all expected transformations of builtin strstr occur and
     perform correctly in presence of redirect.  */
+ /* { dg-options "-ffat-lto-objects" } */
  
  #define ASMNAME(cname)  ASMNAME2 (__USER_LABEL_PREFIX__, cname)
  #define ASMNAME2(prefix, cname) STRING (prefix) cname
Index: gcc.c-torture/compile/sync-1.c
===================================================================
*** gcc.c-torture/compile/sync-1.c	(revision 179274)
--- gcc.c-torture/compile/sync-1.c	(working copy)
***************
*** 1,5 ****
--- 1,6 ----
  /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
  /* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+ /* { dg-options "-ffat-lto-objects" } */
  
  /* Validate that each of the __sync builtins compiles.  This won't 
     necessarily link, since the target might not support the builtin,
Index: gcc.c-torture/compile/sync-3.c
===================================================================
*** gcc.c-torture/compile/sync-3.c	(revision 179274)
--- gcc.c-torture/compile/sync-3.c	(working copy)
***************
*** 1,4 ****
--- 1,5 ----
  /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+ /* { dg-options "-ffat-lto-objects" } */
  
  /* Validate that each of the __sync builtins compiles.  This won't 
     necessarily link, since the target might not support the builtin,
Index: gcc.c-torture/compile/sync-2.c
===================================================================
*** gcc.c-torture/compile/sync-2.c	(revision 179274)
--- gcc.c-torture/compile/sync-2.c	(working copy)
***************
*** 1,4 ****
--- 1,5 ----
  /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+ /* { dg-options "-ffat-lto-objects" } */
  
  /* Validate that each of the __sync builtins compiles.  This won't 
     necessarily link, since the target might not support the builtin,
Index: gcc.dg/noncompile/invalid_asm.c
===================================================================
*** gcc.dg/noncompile/invalid_asm.c	(revision 179274)
--- gcc.dg/noncompile/invalid_asm.c	(working copy)
***************
*** 1,3 ****
--- 1,4 ----
+ /* { dg-options "-ffat-lto-objects" } */
  asm_invalid_register_name()
  {
    asm("":::"this_is_an_invalid_register_name");	/* { dg-error "unknown register" } */
Index: gcc.dg/noncompile/920507-1.c
===================================================================
*** gcc.dg/noncompile/920507-1.c	(revision 179274)
--- gcc.dg/noncompile/920507-1.c	(working copy)
***************
*** 1,3 ****
--- 1,4 ----
+ /* { dg-options "-ffat-lto-objects" } */
  int *
  x(void)
  {
Index: gcc.dg/torture/pr36400.c
===================================================================
*** gcc.dg/torture/pr36400.c	(revision 179274)
--- gcc.dg/torture/pr36400.c	(working copy)
***************
*** 1,4 ****
--- 1,5 ----
  /* { dg-do compile } */
+ /* { dg-options "-ffat-lto-objects" } */
  
  struct barstruct { char const* some_string; };
  
Index: g++.dg/torture/pr34850.C
===================================================================
*** g++.dg/torture/pr34850.C	(revision 179283)
--- g++.dg/torture/pr34850.C	(working copy)
***************
*** 1,5 ****
--- 1,6 ----
  /* { dg-do compile } */
  /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
+ /* { dg-options "-ffat-lto-objects" } */
  
  typedef unsigned char uint8_t;
  typedef unsigned int uint32_t;

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2023-05-10 13:42 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-27 17:54 Update testsuite to run with slim LTO Jan Hubicka
2011-09-30 14:56 ` Diego Novillo
2011-10-20 19:34 ` Breakage with "Update testsuite to run with slim LTO" Hans-Peter Nilsson
2011-10-20 19:53   ` Andi Kleen
2011-10-21  0:39   ` Jan Hubicka
2011-10-21  5:22     ` [RFA:] fix breakage " Hans-Peter Nilsson
2011-10-21  9:58       ` Jan Hubicka
2011-10-21 12:23         ` Iain Sandoe
2011-10-21 12:35           ` Rainer Orth
2011-10-21 16:20             ` Jan Hubicka
2011-10-21 17:40               ` Hans-Peter Nilsson
2011-10-21 18:52                 ` Jan Hubicka
2011-10-21 19:56                   ` Hans-Peter Nilsson
2011-10-24 12:08             ` Richard Guenther
2011-10-28 14:59       ` ping: [RFA:] testsuite infrastructure for options implied by dg-final methods Hans-Peter Nilsson
2011-11-04 13:56         ` ping*2: " Hans-Peter Nilsson
2011-11-04 17:05           ` Mike Stump
2011-11-04 17:54             ` Hans-Peter Nilsson
2011-11-04 18:14               ` Mike Stump
2011-11-04 18:16                 ` Hans-Peter Nilsson
2023-05-03 11:16 ` Let each 'lto_init' determine the default 'LTO_OPTIONS', and 'torture-init' the 'LTO_TORTURE_OPTIONS' (was: Update testsuite to run with slim LTO) Thomas Schwinge
2023-05-03 11:46   ` Richard Biener
2023-05-09  7:32     ` Christophe Lyon
2023-05-09  9:00       ` Testsuite: Add missing 'torture-init'/'torture-finish' around 'LTO_TORTURE_OPTIONS' usage (was: Let each 'lto_init' determine the default 'LTO_OPTIONS', and 'torture-init' the 'LTO_TORTURE_OPTIONS') Thomas Schwinge
2023-05-09 15:17         ` Christophe Lyon
2023-05-09 19:14           ` Christophe Lyon
2023-05-10  7:51             ` Testsuite: Add 'torture-init-done', and use it to conditionalize implicit 'torture-init' (was: Testsuite: Add missing 'torture-init'/'torture-finish' around 'LTO_TORTURE_OPTIONS' usage (was: Let each 'lto_init' determine the default 'LTO_OPTIONS', and 'torture-init' the 'LTO_TORTURE_OPTIONS')) Thomas Schwinge
2023-05-10 13:42               ` Christophe Lyon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).