From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8416 invoked by alias); 18 Mar 2012 22:49:42 -0000 Received: (qmail 8408 invoked by uid 22791); 18 Mar 2012 22:49:41 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 18 Mar 2012 22:49:28 +0000 From: "steven at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/43940] DOM doesn't propagate constants properly Date: Sun, 18 Mar 2012 23:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: steven at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: steven at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-03/txt/msg01489.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43940 --- Comment #5 from Steven Bosscher 2012-03-18 22:48:49 UTC --- With trunk today (r185508), on x86_64-linux at -O2 -fno-tree-vrp: The .072t.ifcombine dump: main () { void * p; : p_2 = __builtin_malloc (4); if (p_2 != 0B) goto ; else goto ; : __builtin_free (p_2); : # p_1 = PHI __builtin_free (p_1); return 0; } And the .073t.phiopt1 dump: main () { void * p; : p_2 = __builtin_malloc (4); if (p_2 != 0B) goto ; else goto ; : __builtin_free (p_2); : # p_1 = PHI <0B(2), 0B(3)> __builtin_free (p_1); return 0; } And finally the 080t.dom1 dump: main () { void * p; : p_2 = __builtin_malloc (4); if (p_2 != 0B) goto ; else goto ; : __builtin_free (p_2); : # p_1 = PHI <0B(2), 0B(3)> GIMPLE_NOP return 0; }