public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* lto testsuite may erase mathlib variable
@ 2014-01-03 13:57 BELBACHIR Selim
  2014-01-13 12:12 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: BELBACHIR Selim @ 2014-01-03 13:57 UTC (permalink / raw)
  To: gcc

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

Hi,

I noticed a problem in gcc/testsuite/g++.dg/lto/lto.exp

If the target does not support LTO (check_effective_target_lto) a brutal return is performed so the mathlib variable modified in lto_init will not be restored properly by lto_finish at the end of the script.

Subsequent testsuites will found an empty mathlib.

Regards,

Selim



[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 893 bytes --]

diff -r 64c513073b61 gcc/testsuite/g++.dg/lto/lto.exp
--- gcc/testsuite/g++.dg/lto/lto.exp	Thu Jan 02 13:52:00 2014 +0100
+++ gcc/testsuite/g++.dg/lto/lto.exp	Fri Jan 03 11:15:33 2014 +0100
@@ -43,18 +43,18 @@
 set sid "cp_lto"
 
 # If LTO has not been enabled, bail.
-if { ![check_effective_target_lto] } {
-    return
-}
+if { [check_effective_target_lto] } {
 
-# Main loop.
-foreach src [lsort [find $srcdir/$subdir *_0.C]] {
-    # If we're only testing specific files and this isn't one of them, skip it.
-    if ![runtest_file_p $runtests $src] then {
-	continue
+    # Main loop.
+    foreach src [lsort [find $srcdir/$subdir *_0.C]] {
+        # If we're only testing specific files and this isn't one of them, skip it.
+        if ![runtest_file_p $runtests $src] then {
+	    continue
+        }
+
+        lto-execute $src $sid
     }
 
-    lto-execute $src $sid
 }
 
 lto_finish

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

* Re: lto testsuite may erase mathlib variable
  2014-01-03 13:57 lto testsuite may erase mathlib variable BELBACHIR Selim
@ 2014-01-13 12:12 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2014-01-13 12:12 UTC (permalink / raw)
  To: BELBACHIR Selim; +Cc: gcc

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]

On Fri, Jan 3, 2014 at 11:18 AM, BELBACHIR Selim
<selim.belbachir@fr.thalesgroup.com> wrote:
> Hi,
>
> I noticed a problem in gcc/testsuite/g++.dg/lto/lto.exp
>
> If the target does not support LTO (check_effective_target_lto) a brutal return is performed so the mathlib variable modified in lto_init will not be restored properly by lto_finish at the end of the script.
>
> Subsequent testsuites will found an empty mathlib.

Rather than this I modified it to match gcc.dg/lto/lto.exp which does
this init after the bailout.

Tested on x86_64-linux, applied.

Richard.

> Regards,
>
> Selim
>
>

[-- Attachment #2: p --]
[-- Type: application/octet-stream, Size: 2476 bytes --]

2014-01-13  Richard Biener  <rguenther@suse.de>

	* g++.dg/lto/lto.exp: Do check_effective_target_lto check before
	adjusting mathlib options.
	* gfortran.dg/lto/lto.exp: Likewise.

Index: gcc/testsuite/g++.dg/lto/lto.exp
===================================================================
*** gcc/testsuite/g++.dg/lto/lto.exp	(revision 206575)
--- gcc/testsuite/g++.dg/lto/lto.exp	(working copy)
*************** load_lib target-libpath.exp
*** 35,40 ****
--- 35,45 ----
  # Load the language-independent compabibility support procedures.
  load_lib lto.exp
  
+ # If LTO has not been enabled, bail.
+ if { ![check_effective_target_lto] } {
+     return
+ }
+ 
  g++_init
  lto_init no-mathlib
  
*************** lto_init no-mathlib
*** 42,52 ****
  # with other lto tests running at the same time.
  set sid "cp_lto"
  
- # If LTO has not been enabled, bail.
- if { ![check_effective_target_lto] } {
-     return
- }
- 
  # Main loop.
  foreach src [lsort [find $srcdir/$subdir *_0.\[cC\]]] {
      # If we're only testing specific files and this isn't one of them, skip it.
--- 47,52 ----
Index: gcc/testsuite/gfortran.dg/lto/lto.exp
===================================================================
*** gcc/testsuite/gfortran.dg/lto/lto.exp	(revision 206575)
--- gcc/testsuite/gfortran.dg/lto/lto.exp	(working copy)
*************** load_lib gfortran-dg.exp
*** 34,50 ****
  # Load the language-independent compabibility support procedures.
  load_lib lto.exp
  
  lto_init no-mathlib
  
  # Define an identifier for use with this suite to avoid name conflicts
  # with other lto tests running at the same time.
  set sid "f_lto"
  
- # If LTO has not been enabled, bail.
- if { ![check_effective_target_lto] } {
-     return
- }
- 
  # Main loop.
  foreach src [lsort [glob -nocomplain $srcdir/$subdir/*_0.\[fF\]{,90,95,03,08} ]] {
      # If we're only testing specific files and this isn't one of them, skip it.
--- 34,50 ----
  # Load the language-independent compabibility support procedures.
  load_lib lto.exp
  
+ # If LTO has not been enabled, bail.
+ if { ![check_effective_target_lto] } {
+     return
+ }
+ 
  lto_init no-mathlib
  
  # Define an identifier for use with this suite to avoid name conflicts
  # with other lto tests running at the same time.
  set sid "f_lto"
  
  # Main loop.
  foreach src [lsort [glob -nocomplain $srcdir/$subdir/*_0.\[fF\]{,90,95,03,08} ]] {
      # If we're only testing specific files and this isn't one of them, skip it.

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

end of thread, other threads:[~2014-01-13 11:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-03 13:57 lto testsuite may erase mathlib variable BELBACHIR Selim
2014-01-13 12:12 ` Richard Biener

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).