From patchwork Wed May 27 21:13:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 477406 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F039A140323 for ; Thu, 28 May 2015 07:13:26 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=m6NDBG62; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=xc/kUTZ7GsomlRwsXDDKIAeUnBPM6ibnXopSudtAvKZALP lK94wwfcbIgPu3g7LxZi8QoOZ2b7b3747A0046q7DJy+qZaxm6q1/vlkjrEykdBX RB+LNewIQQldYl0UOVMd1DRDyHKlBmQ0FHlfYsT9+dKRo48RyazUKnzUDCM3A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=wT038n9nrrfRwybZB3zFc07Sgfs=; b=m6NDBG62UuTZIOBoY+dY NBqgStIkh1omX9mMpHSYlNRGQEKFRYolPpZlxbPGm0X/Fq5CNTb8f74Vuc5wDNk0 rAkaSVmFEbILcTwazHer7FD/EAvdjrHsffjWwKWKjnC+AbQpRkf25t4hJGSJQAUr 6hTgQk0dSORytBSJ5bemzbM= Received: (qmail 103301 invoked by alias); 27 May 2015 21:13:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 103290 invoked by uid 89); 27 May 2015 21:13:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 27 May 2015 21:13:18 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id A007FB6A3D for ; Wed, 27 May 2015 21:13:17 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-175.phx2.redhat.com [10.3.113.175]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4RLDH5O025430 for ; Wed, 27 May 2015 17:13:17 -0400 Message-ID: <5566336C.7030200@redhat.com> Date: Wed, 27 May 2015 15:13:16 -0600 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: Add testcase for pr39726, update ChangeLog to note when it was fixed X-IsSubscribed: yes My most recent match.pd changes inadvertently fixed 39726. I guess it's only fitting since it was 39726 that got me started looking at using match.pd to solve certain operand narrowing problems. This just adds a regression test for the m68k port and puts a marker on the ChangeLog entry which fixed 39726. Applied to the trunk. commit aff2f8a50a248d802d37ffcd478a12eb6ee3a72b Author: Jeff Law Date: Wed May 27 15:11:25 2015 -0600 PR target/39726 * gcc.dg/target/m68k/pr39726-1.c: New test. diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 76bb537..6528d42 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -2964,6 +2964,7 @@ 2015-05-07 Jeff Law + PR target/39726 * match.pd (bit_and (plus/minus (convert @0) (convert @1) mask): New simplifier to narrow arithmetic. * generic-match-head.c: (types_match, single_use): New functions. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1923a2f..a1a242e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-05-27 Jeff Law + + PR target/39726 + * gcc.dg/target/m68k/pr39726-1.c: New test. + 2015-05-27 Nathan Sidwell PR c++/66270 diff --git a/gcc/testsuite/gcc.target/m68k/pr39726.c b/gcc/testsuite/gcc.target/m68k/pr39726.c new file mode 100644 index 0000000..94d41ba --- /dev/null +++ b/gcc/testsuite/gcc.target/m68k/pr39726.c @@ -0,0 +1,65 @@ +/* { dg-do assemble } /* +/* { dg-options "-O2 -fomit-frame-pointer" } */ +/* { dg-final { object-size text <= 228 } } */ + +unsigned char v; + +int a0bs (unsigned char u, unsigned char w) +{ + if ((u - w) & 0x80) + v = 1; +} + +int a1bs (unsigned char u, unsigned char w) +{ + if ((u + w) & 0x80) + v = 1; +} + +int a0b (unsigned char u, unsigned char w) +{ + if ((u - w) & 0x22) + v = 1; +} + +int a1b (unsigned char u, unsigned char w) +{ + if ((u + w) & 0x22) + v = 1; +} + +int a0ws (unsigned short u, unsigned short w) +{ + if ((u - w) & 0x8000) + v = 1; +} + +int a1ws (unsigned short u, unsigned short w) +{ + if ((u + w) & 0x8000) + v = 1; +} + +int a0wbs (unsigned short u, unsigned short w) +{ + if ((u - w) & 0x80) + v = 1; +} + +int a1wbs (unsigned short u, unsigned short w) +{ + if ((u + w) & 0x80) + v = 1; +} + +int a0w (unsigned short u, unsigned short w) +{ + if ((u - w) & 0x8421) + v = 1; +} + +int a1w (unsigned short u, unsigned short w) +{ + if ((u + w) & 0x8421) + v = 1; +}