From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9675 invoked by alias); 13 Dec 2018 07:50:03 -0000 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 Received: (qmail 7751 invoked by uid 89); 13 Dec 2018 07:50:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Dec 2018 07:49:58 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E13F80F91 for ; Thu, 13 Dec 2018 07:49:57 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-214.ams2.redhat.com [10.36.117.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0002160C5C; Thu, 13 Dec 2018 07:49:56 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id wBD7nsY5011978; Thu, 13 Dec 2018 08:49:55 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id wBD7nreH011977; Thu, 13 Dec 2018 08:49:53 +0100 Date: Thu, 13 Dec 2018 07:50:00 -0000 From: Jakub Jelinek To: Jeff Law Cc: gcc-patches Subject: [PATCH] Fix split-path-5.c testcase (PR testsuite/88454) Message-ID: <20181213074953.GR12380@tucnak> Reply-To: Jakub Jelinek References: <2bac4239-d7ef-7555-a362-cfddc6bde931@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2bac4239-d7ef-7555-a362-cfddc6bde931@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00898.txt.bz2 Hi! On Mon, Dec 10, 2018 at 09:56:46PM -0700, Jeff Law wrote: > Note that split-path-5 has the same basic structure. A half-diamond > with a single statement in the middle block that should be trivially > if-convertable if profitable. So I adjusted that testcase. The split-path-5.c testcase now fails on powerpc64*, arm*, aarch64* etc. targets. When looking for the difference, I found out it is a -fsigned-char vs. -funsigned-char issue, on -funsigned-char targets we are simply compiling something quite different. The following patch fixes it, regtested on x86_64-linux (-m64/-m32) and tested with cross to aarch64-linux and powerpc64-linux. Ok for trunk? 2018-12-13 Jakub Jelinek PR testsuite/88454 * gcc.dg/tree-ssa/split-path-5.c (__ctype_ptr__): Change type from const char * to const signed char *. (bmhi_init): Change pattern parameter's type the same. Use __builtin_strlen instead of undeclared strlen. --- gcc/testsuite/gcc.dg/tree-ssa/split-path-5.c.jj 2018-12-11 11:02:09.003065907 +0100 +++ gcc/testsuite/gcc.dg/tree-ssa/split-path-5.c 2018-12-13 08:36:26.457533278 +0100 @@ -1,16 +1,16 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fsplit-paths -fdump-tree-split-paths-details -w" } */ -const extern char *__ctype_ptr__; +const extern signed char *__ctype_ptr__; typedef unsigned char uchar; static int patlen; static int skip[(0x7f * 2 + 1) + 1]; static uchar *pat = ((void *) 0); void -bmhi_init (const char *pattern) +bmhi_init (const signed char *pattern) { int i, lastpatchar; - patlen = strlen (pattern); + patlen = __builtin_strlen (pattern); for (i = 0; i < patlen; i++) pat[i] = ( { Jakub