Address UNRESOLVED for 'g++.dg/tree-ssa/empty-loop.C' (was: optimize basic_string)

Message ID 87r06viibs.fsf@euler.schwinge.ddns.net
State Committed
Headers
Series Address UNRESOLVED for 'g++.dg/tree-ssa/empty-loop.C' (was: optimize basic_string) |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply

Commit Message

Thomas Schwinge Nov. 28, 2024, 1:44 p.m. UTC
  Hi!

On 2024-11-26T16:43:07+0100, Jan Hubicka <hubicka@ucw.cz> wrote:
> I also noticed that this patch trigger empty-loop.C failure which I
> originaly attributed to different change.  I filled PR117764 on that.
> We are no longer able to eliminate empty loops early, but we still 
> optimize them late.

> --- a/gcc/testsuite/g++.dg/tree-ssa/empty-loop.C
> +++ b/gcc/testsuite/g++.dg/tree-ssa/empty-loop.C
> @@ -30,5 +30,8 @@ int foo (vector<string> &v, list<string> &l, set<string> &s, map<int, string> &m
>  
>    return 0;
>  }
> -/* { dg-final { scan-tree-dump-not "if" "cddce2"} } */
> +/* Adding __builtin_unreachable to std::string::size() prevents cddce2 from
> +   eliminating the loop early, see PR117764.  */
> +/* { dg-final { scan-tree-dump-not "if" "cddce2" { xfail *-*-* } } } */
> +/* { dg-final { scan-tree-dump-not "if" "cddce3"} } */

Pushed to trunk branch commit 3e8d3079c31567d3e9f43cc2cb100ddef25f48a2
"Address UNRESOLVED for 'g++.dg/tree-ssa/empty-loop.C'", see attached.


Grüße
 Thomas
  

Patch

From 3e8d3079c31567d3e9f43cc2cb100ddef25f48a2 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Thu, 28 Nov 2024 14:31:17 +0100
Subject: [PATCH] Address UNRESOLVED for 'g++.dg/tree-ssa/empty-loop.C'

As of commit 1046c32de4956c3d706a2ff8683582fd21b8f360 "optimize basic_string",
we've got:

    PASS: g++.dg/tree-ssa/empty-loop.C  -std=gnu++17 (test for excess errors)
    [-PASS:-]{+XFAIL:+} g++.dg/tree-ssa/empty-loop.C  -std=gnu++17  scan-tree-dump-not cddce2 "if"
    {+UNRESOLVED: g++.dg/tree-ssa/empty-loop.C  -std=gnu++17  scan-tree-dump-not cddce3 "if"+}
    [Etc.]

	gcc/testsuite/
	* g++.dg/tree-ssa/empty-loop.C: Address UNRESOLVED.
---
 gcc/testsuite/g++.dg/tree-ssa/empty-loop.C | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.dg/tree-ssa/empty-loop.C b/gcc/testsuite/g++.dg/tree-ssa/empty-loop.C
index b7e7e27cc042..adb6ab582dbc 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/empty-loop.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/empty-loop.C
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-cddce2 -ffinite-loops -Wno-unused-result" } */
+/* { dg-options "-O2 -ffinite-loops -Wno-unused-result" } */
+/* { dg-additional-options "-fdump-tree-cddce2 -fdump-tree-cddce3" } */
 /* { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } } */
 
 #include <string>
-- 
2.34.1