diff mbox series

re PR tree-optimization/93210 (Sub-optimal code optimization on struct/combound constexpr (gcc vs. clang))

Message ID 20210414171349.2472165-1-stefansf@linux.ibm.com
State New
Headers show
Series re PR tree-optimization/93210 (Sub-optimal code optimization on struct/combound constexpr (gcc vs. clang)) | expand

Commit Message

Stefan Schulze Frielinghaus April 14, 2021, 5:13 p.m. UTC
Regarding test gcc.dg/pr93210.c, on different targets GIMPLE code may
slightly differ which is why the scan-tree-dump-times directive may
fail.  For example, for a RETURN_EXPR on x86_64 we have

  return 0x11100f0e0d0c0a090807060504030201;

whereas on IBM Z the first operand is a RESULT_DECL like

  <retval> = 0x102030405060708090a0c0d0e0f1011;
  return <retval>;

gcc/testsuite/ChangeLog:

	* gcc.dg/pr93210.c: Adapt regex in order to also support a
	RESULT_DECL as an operand for a RETURN_EXPR.

Ok for mainline?

---
 gcc/testsuite/gcc.dg/pr93210.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeff Law April 14, 2021, 8:19 p.m. UTC | #1
On 4/14/2021 11:13 AM, Stefan Schulze Frielinghaus via Gcc-patches wrote:
> Regarding test gcc.dg/pr93210.c, on different targets GIMPLE code may
> slightly differ which is why the scan-tree-dump-times directive may
> fail.  For example, for a RETURN_EXPR on x86_64 we have
>
>    return 0x11100f0e0d0c0a090807060504030201;
>
> whereas on IBM Z the first operand is a RESULT_DECL like
>
>    <retval> = 0x102030405060708090a0c0d0e0f1011;
>    return <retval>;
>
> gcc/testsuite/ChangeLog:
>
> 	* gcc.dg/pr93210.c: Adapt regex in order to also support a
> 	RESULT_DECL as an operand for a RETURN_EXPR.
>
> Ok for mainline?

OK

jeff
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/pr93210.c b/gcc/testsuite/gcc.dg/pr93210.c
index ec4194b6b49..134d32bc505 100644
--- a/gcc/testsuite/gcc.dg/pr93210.c
+++ b/gcc/testsuite/gcc.dg/pr93210.c
@@ -1,7 +1,7 @@ 
 /* PR tree-optimization/93210 */
 /* { dg-do run } */
 /* { dg-options "-O2 -fdump-tree-optimized" } */
-/* { dg-final { scan-tree-dump-times "return \[0-9]\[0-9a-fA-FxX]*;" 31 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "(?:return|<retval> =) \[0-9]\[0-9a-fA-FxX]*;" 31 "optimized" } } */
 
 #ifdef __SIZEOF_INT128__
 typedef unsigned __int128 L;