From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25666 invoked by alias); 18 Nov 2007 15:46:27 -0000 Received: (qmail 25657 invoked by uid 22791); 18 Nov 2007 15:46:27 -0000 X-Spam-Check-By: sourceware.org Received: from ns1.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 18 Nov 2007 15:46:24 +0000 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 25CC220DE2 for ; Sun, 18 Nov 2007 16:46:22 +0100 (CET) Date: Sun, 18 Nov 2007 18:56:00 -0000 From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR34127 Message-ID: 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: 2007-11/txt/msg00984.txt.bz2 This fixes PR34127, another fallout from the forwprop change. This will actually be the last try before I consider reverting to the original state ;) Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2007-11-18 Richard Guenther PR tree-optimization/34127 * tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars): Make code match up the comments, require compatibility of the pointed-to types. * gcc.c-torture/compile/pr34127.c: New testcase. Index: tree-ssa-forwprop.c =================================================================== *** tree-ssa-forwprop.c (revision 130257) --- tree-ssa-forwprop.c (working copy) *************** tree_ssa_forward_propagate_single_use_va *** 959,966 **** || TREE_CODE (rhs) == CONVERT_EXPR) && TREE_CODE (TREE_OPERAND (rhs, 0)) == ADDR_EXPR && POINTER_TYPE_P (TREE_TYPE (rhs)) ! && useless_type_conversion_p (TREE_TYPE (TREE_TYPE (TREE_OPERAND (rhs, 0))), ! TREE_TYPE (TREE_TYPE (rhs))))) { if (forward_propagate_addr_expr (lhs, rhs)) { --- 959,966 ---- || TREE_CODE (rhs) == CONVERT_EXPR) && TREE_CODE (TREE_OPERAND (rhs, 0)) == ADDR_EXPR && POINTER_TYPE_P (TREE_TYPE (rhs)) ! && types_compatible_p (TREE_TYPE (TREE_TYPE (TREE_OPERAND (rhs, 0))), ! TREE_TYPE (TREE_TYPE (rhs))))) { if (forward_propagate_addr_expr (lhs, rhs)) { Index: testsuite/gcc.c-torture/compile/pr34127.c =================================================================== *** testsuite/gcc.c-torture/compile/pr34127.c (revision 0) --- testsuite/gcc.c-torture/compile/pr34127.c (revision 0) *************** *** 0 **** --- 1,9 ---- + static void + whichtable(char **pfmt) + { + --*pfmt; + } + void prepare_s(const char *fmt) + { + whichtable((char **)&fmt); + }