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: 120037 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]) by ozlabs.org (Postfix) with SMTP id 8CBFAB71A4 for ; Mon, 17 Oct 2011 00:48:42 +1100 (EST) Received: (qmail 21058 invoked by alias); 16 Oct 2011 13:48:41 -0000 Received: (qmail 21049 invoked by uid 22791); 16 Oct 2011 13:48:40 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qy0-f175.google.com (HELO mail-qy0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 16 Oct 2011 13:48:25 +0000 Received: by qyk35 with SMTP id 35so582280qyk.20 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 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 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