testsuite: Support scanning tree-dumps

Message ID 20230306185255.721FC20405@pchp3.se.axis.com
State Unresolved
Headers
Series testsuite: Support scanning tree-dumps |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Hans-Peter Nilsson March 6, 2023, 6:52 p.m. UTC
  This is sort-of a spin-off from effective_target_tail_call: I thought
that'd best be implemented by scanning a tree-dump, specifically
-fdump-tree-optimized, but the "tail call" found there is emitted for
*all* targets.  Debugged and ready to apply, putting it out for
consideration as someone will need it (or should use it) sooner rather
than later...  Best committed rather than sitting in mail-archives so:
Ok to apply?
-- >8 --
No planned usage.

	* lib/target-supports.exp (check_compile): Support scanning tree-dumps.
---
 gcc/testsuite/lib/target-supports.exp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Comments

Mike Stump March 6, 2023, 9:17 p.m. UTC | #1
On Mar 6, 2023, at 10:52 AM, Hans-Peter Nilsson via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> Ok to apply?

Ok.

> 	* lib/target-supports.exp (check_compile): Support scanning tree-dumps.
  

Patch

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 4236c920baeb..0ca7a9680bb4 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -87,6 +87,7 @@  proc check_compile {basename type contents args} {
 	assembly { set output ${basename}[pid].s }
 	object { set output ${basename}[pid].o }
 	executable { set output ${basename}[pid].exe }
+	"tree-*" -
 	"rtl-*" {
 	    set output ${basename}[pid].s
 	    lappend options "additional_flags=-fdump-$type"
@@ -108,6 +109,9 @@  proc check_compile {basename type contents args} {
     if [regexp "rtl-(.*)" $type dummy rtl_type] {
 	set scan_output "[glob $src.\[0-9\]\[0-9\]\[0-9\]r.$rtl_type]"
 	file delete $output
+    } elseif [regexp "tree-(.*)" $type dummy tree_type] {
+	set scan_output "[glob $src.\[0-9\]\[0-9\]\[0-9\]t.$tree_type]"
+	file delete $output
     }
 
     # Restore additional_sources.