From patchwork Thu Jan 19 09:36:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 136796 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 C4BF4B6F71 for ; Thu, 19 Jan 2012 20:36:31 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1327570593; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=HGHz14uuNTSg3lFYLWs5 MqJZ2Hc=; b=y66jTtAHMm0PEA/1PFqVlCGUR7efbGx9lh6beFXmb0ung2Wv7BzO 06/V9mcyZcuSe0wWE/Twv0EUYvgxcHJgG8cgv2+KjJPmDKfFh/JPOkfaSzgvNTsV aHsRIEbVtcxCcP4/mCE7Eap14SzEr/Mnbnu115BWh7g+qU7kHagsjLI= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ZlCh9unO68W1cS5ha+bxx6mG9uOUlOvnCZG8M51KpKGQbIOMDHto9G5p/pymbP iFQjKrsHJfbagC4/wAMK2j6VzU09NuGG31f/R3RABOd8oz+R9npPpXxxidAmj9sW EM4IpZjT0FYMfupDUXedzRGWxspL7XIKw/uItUbeBr7no=; Received: (qmail 30141 invoked by alias); 19 Jan 2012 09:36:25 -0000 Received: (qmail 30092 invoked by uid 22791); 19 Jan 2012 09:36:24 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL, BAYES_00, 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; Thu, 19 Jan 2012 09:36:10 +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 C53838FFDD for ; Thu, 19 Jan 2012 10:36:09 +0100 (CET) Date: Thu, 19 Jan 2012 10:36:09 +0100 (CET) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Testcase for PR37997 Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 ... which is confused about a useful testcase not using uninitialized variables. Testcase committed. Richard. 2012-01-19 Richard Guenther PR tree-optimization/37997 * gcc.dg/tree-ssa/ssa-pre-28.c: New testcase. Index: gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c (revision 0) +++ gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c (revision 0) @@ -0,0 +1,21 @@ +/* PR37997 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-pre-details" } */ + +int foo (int i, int b, int result) +{ + int mask; + if (b) + mask = -1; + else + mask = 0; + result = i + 1; + result = result & mask; + return result; +} + +/* We should insert i + 1 into the if (b) path as well as the simplified + i + 1 & -1 expression. And do replacement with two PHI temps. */ + +/* { dg-final { scan-tree-dump-times "with prephitmp" 2 "pre" } } */ +/* { dg-final { cleanup-tree-dump "pre" } } */