From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12401 invoked by alias); 13 Apr 2010 19:43:04 -0000 Received: (qmail 12392 invoked by uid 22791); 13 Apr 2010 19:43:04 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00,TW_TM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Apr 2010 19:42:59 +0000 Received: from sunsite.mff.cuni.cz (localhost [127.0.0.1]) by sunsite.mff.cuni.cz (8.14.3/8.14.3) with ESMTP id o3DJgtan031071; Tue, 13 Apr 2010 21:42:55 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.14.3/8.14.3/Submit) id o3DJgtut031069; Tue, 13 Apr 2010 21:42:55 +0200 Date: Tue, 13 Apr 2010 19:43:00 -0000 From: Jakub Jelinek To: Sebastian Pop Cc: gcc@gcc.gnu.org, Richard Guenther , Diego Novillo Subject: Re: Copy assignments for non scalar types Message-ID: <20100413194255.GA5553@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg00300.txt.bz2 On Tue, Apr 13, 2010 at 01:14:11PM -0500, Sebastian Pop wrote: > /* Create a new temp variable of type TYPE. Add GIMPLE_ASSIGN to assign EXP > to the new variable. */ > > static gimple > ifc_temp_var (tree type, tree exp) > { > const char *name = "_ifc_"; > tree var, new_name; > gimple stmt; > > /* Create new temporary variable. */ > var = create_tmp_var (type, name); > add_referenced_var (var); > > /* Build new statement to assign EXP to new variable. */ > stmt = gimple_build_assign (var, exp); > > /* Get SSA name for the new variable and set make new statement > its definition statement. */ > new_name = make_ssa_name (var, stmt); > gimple_assign_set_lhs (stmt, new_name); > SSA_NAME_DEF_STMT (new_name) = stmt; > update_stmt (stmt); > > return stmt; > } > > What is missing in this function to make it handle non scalar types? if (!is_gimple_reg (var)) you shouldn't create SSA name and change the lhs of the stmt. Jakub