From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 652 invoked by alias); 16 Oct 2009 16:54:12 -0000 Received: (qmail 643 invoked by uid 22791); 16 Oct 2009 16:54:11 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL,BAYES_00 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; Fri, 16 Oct 2009 16:54:03 +0000 Received: from relay1.suse.de (mail2.suse.de [195.135.221.8]) by mx2.suse.de (Postfix) with ESMTP id 2F2428655F for ; Fri, 16 Oct 2009 18:54:01 +0200 (CEST) Date: Fri, 16 Oct 2009 17:08:00 -0000 From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR41728 Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 X-SW-Source: 2009-10/txt/msg01063.txt.bz2 DOM relies on the modified flag, so set it if fold_stmt folded anything. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2009-10-16 Richard Guenther PR tree-optimization/41728 * tree-ssa-dom.c (optimize_stmt): Mark the stmt modified if fold_stmt did anything. * gcc.c-torture/compile/pr41728.c: New testcase. Index: gcc/tree-ssa-dom.c =================================================================== *** gcc/tree-ssa-dom.c (revision 152897) --- gcc/tree-ssa-dom.c (working copy) *************** optimize_stmt (basic_block bb, gimple_st *** 2099,2104 **** --- 2099,2105 ---- if (fold_stmt (&si)) { stmt = gsi_stmt (si); + gimple_set_modified (stmt, true); if (dump_file && (dump_flags & TDF_DETAILS)) { Index: gcc/testsuite/gcc.c-torture/compile/pr41728.c =================================================================== *** gcc/testsuite/gcc.c-torture/compile/pr41728.c (revision 0) --- gcc/testsuite/gcc.c-torture/compile/pr41728.c (revision 0) *************** *** 0 **** --- 1,12 ---- + int a[8]; + int s244(void) + { + int lrc, j; + lrc = 0; + for (j=0; j<7; j++) + if(a[j] != a[j+1]) + lrc = 1; + if (lrc != 0) + return 0; + return 1; + }