From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32389 invoked by alias); 18 Dec 2012 13:26:59 -0000 Received: (qmail 32376 invoked by uid 22791); 18 Dec 2012 13:26:58 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Dec 2012 13:26:26 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 6915FA4F01 for ; Tue, 18 Dec 2012 14:26:25 +0100 (CET) Date: Tue, 18 Dec 2012 13:26:00 -0000 From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix gcc.dg/tree-ssa/reassoc-19.c testcase Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg01109.txt.bz2 Revisiting PR40815, in particular the attached supposedly bad dump shows: D.2021_14 = (unsigned int) rite_2; D.2022_9 = (unsigned int) element_5(D); D.2023_15 = -D.2022_9; D.2024_16 = D.2021_14 + D.2023_15; rite_17 = (char *) D.2024_16; while now we have _7 = (sizetype) element_6(D); _8 = -_7; rite_9 = rite_1 + _8; which TER will happily forward into the POINTER_PLUS_EXPR. Thus the following adjusts the dump-scanning to expect exactly that simplified form. Tested on x86_64-unknown-linux-gnu, applied. Richard. 2012-12-18 Richard Biener * gcc.dg/tree-ssa/reassoc-19.c: Adjust. Index: gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c (revision 194578) +++ gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-Os -fdump-tree-reassoc2" } */ +/* { dg-options "-Os -fdump-tree-optimized" } */ /* Slightly changed testcase from PR middle-end/40815. */ void bar(char*, char*, int); @@ -8,14 +8,15 @@ void foo(char* left, char* rite, int ele while (left <= rite) { /* This should expand into - D.zzzz = D.zzzz - D.xxxx; - and NOT to - D.D.yyyy = -D.xxxx; D.zzzz = D.zzzz + D.yyyy; */ + _7 = (sizetype) element_6(D); + _8 = -_7; + rite_9 = rite_1 + _8; */ rite -= element; bar(left, rite, element); } } -/* There should be no " + " in the dump. */ -/* { dg-final { scan-tree-dump-times " \\\+ " 0 "reassoc2" } } */ -/* { dg-final { cleanup-tree-dump "reassoc2" } } */ +/* { dg-final { scan-tree-dump-times "= \\\(sizetype\\\) element" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "= -" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times " \\\+ " 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */