From patchwork Sun Oct 16 13:48:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Rosen X-Patchwork-Id: 4693 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B398023E0C for ; Sun, 16 Oct 2011 13:48:28 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 8071BA1834F for ; Sun, 16 Oct 2011 13:48:28 +0000 (UTC) Received: by bkbzs2 with SMTP id zs2so5598622bkb.11 for ; Sun, 16 Oct 2011 06:48:28 -0700 (PDT) Received: by 10.223.17.3 with SMTP id q3mr17869927faa.28.1318772907882; Sun, 16 Oct 2011 06:48:27 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.24.41 with SMTP id r9cs73417laf; Sun, 16 Oct 2011 06:48:27 -0700 (PDT) Received: by 10.52.37.44 with SMTP id v12mr16337171vdj.53.1318772905599; Sun, 16 Oct 2011 06:48:25 -0700 (PDT) Received: from mail-qy0-f171.google.com (mail-qy0-f171.google.com [209.85.216.171]) by mx.google.com with ESMTPS id ex5si9808669vdb.126.2011.10.16.06.48.25 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Oct 2011 06:48:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.216.171 is neither permitted nor denied by best guess record for domain of ira.rosen@linaro.org) client-ip=209.85.216.171; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.216.171 is neither permitted nor denied by best guess record for domain of ira.rosen@linaro.org) smtp.mail=ira.rosen@linaro.org Received: by qyk33 with SMTP id 33so379359qyk.16 for ; Sun, 16 Oct 2011 06:48:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.34.136 with SMTP id l8mr1175397qcd.237.1318772904742; Sun, 16 Oct 2011 06:48:24 -0700 (PDT) Received: by 10.229.247.205 with HTTP; Sun, 16 Oct 2011 06:48:24 -0700 (PDT) Date: Sun, 16 Oct 2011 15:48:24 +0200 Message-ID: Subject: [patch] Fix PR tree-optimization/50727 From: Ira Rosen To: gcc-patches@gcc.gnu.org Cc: Patch Tracking Hi, This patch fixes another occurrence of the same bug as in PR 50635. Bootstrapped and tested on powerpc64-suse-linux. Committed. Ira ChangeLog: PR tree-optimization/50727 * tree-vect-patterns.c (vect_operation_fits_smaller_type): Add DEF_STMT to the list of statements to be replaced by the pattern statements. testsuite/ChangeLog: PR tree-optimization/50727 * gcc.dg/vect/pr50727.c: New test. Index: testsuite/gcc.dg/vect/pr50727.c =================================================================== --- testsuite/gcc.dg/vect/pr50727.c (revision 0) +++ testsuite/gcc.dg/vect/pr50727.c (revision 0) @@ -0,0 +1,21 @@ +/* { dg-do compile } */ + +typedef unsigned char uint8_t; +typedef unsigned long uint32_t; +void +f0a (uint32_t * __restrict__ result, uint32_t * arg2, + uint8_t * __restrict__ arg4) +{ + int idx; + for (idx = 0; idx < 429; idx += 1) + { + uint32_t temp_9; + uint32_t temp_11; + temp_9 = ((-19 | arg4[idx]) >> arg2[idx]); + temp_11 = (((-19 ^ arg4[idx]) & arg2[idx]) ^ temp_9); + result[idx] = temp_11; + } +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ + Index: tree-vect-patterns.c =================================================================== --- tree-vect-patterns.c (revision 180054) +++ tree-vect-patterns.c (working copy) @@ -1001,6 +1001,7 @@ vect_operation_fits_smaller_type (gimple stmt, tre || TREE_TYPE (gimple_assign_lhs (new_stmt)) != interm_type) return false; + VEC_safe_push (gimple, heap, *stmts, def_stmt); oprnd = gimple_assign_lhs (new_stmt); } else