From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4935 invoked by alias); 26 Jun 2008 22:38:21 -0000 Received: (qmail 4906 invoked by uid 22791); 26 Jun 2008 22:38:19 -0000 X-Spam-Check-By: sourceware.org Received: from outbound-sin.frontbridge.com (HELO SG2EHSOBE003.bigfish.com) (207.46.51.80) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 26 Jun 2008 22:37:58 +0000 Received: from mail138-sin-R.bigfish.com (10.3.40.3) by SG2EHSOBE003.bigfish.com (10.3.40.23) with Microsoft SMTP Server id 8.1.240.5; Thu, 26 Jun 2008 22:37:54 +0000 Received: from mail138-sin (localhost.localdomain [127.0.0.1]) by mail138-sin-R.bigfish.com (Postfix) with ESMTP id 169AC1AA0229; Thu, 26 Jun 2008 22:37:54 +0000 (UTC) X-BigFish: VS-25(zz154dM1432R98dR1455M7efV1805M19c2k7cf0izzzzz2dh6bh87il61h) X-Spam-TCS-SCL: 0:0 X-FB-DOMAIN-IP-MATCH: fail Received: by mail138-sin (MessageSwitch) id 1214519872439301_15119; Thu, 26 Jun 2008 22:37:52 +0000 (UCT) Received: from mail8.fw-sd.sony.com (mail8.fw-sd.sony.com [160.33.66.75]) by mail138-sin.bigfish.com (Postfix) with ESMTP id 015C71498057; Thu, 26 Jun 2008 22:37:51 +0000 (UTC) Received: from mail3.sjc.in.sel.sony.com (mail3.sjc.in.sel.sony.com [43.134.1.211]) by mail8.fw-sd.sony.com (8.12.11/8.12.11) with ESMTP id m5QMboaj014960; Thu, 26 Jun 2008 22:37:50 GMT Received: from constantine.playstation.sony.com ([162.49.67.15]) by mail3.sjc.in.sel.sony.com (8.12.11/8.12.11) with ESMTP id m5QMboFv000715; Thu, 26 Jun 2008 22:37:50 GMT Received: from trevor-ubuntu ([10.98.8.239]) by constantine.playstation.sony.com (Lotus Domino Release 7.0.3FP1) with ESMTP id 2008062615374987-4622 ; Thu, 26 Jun 2008 15:37:49 -0700 Received: from trevor by trevor-ubuntu with local (Exim 4.67) (envelope-from ) id 1KC05W-0007sH-I0; Thu, 26 Jun 2008 15:37:10 -0700 Date: Thu, 26 Jun 2008 23:14:00 -0000 From: To: Ulrich Weigand CC: Eric Botcazou , iant@google.com, gcc-patches@gcc.gnu.org, andrew_pinski@playstation.sony.com Subject: Re: [PATCH, v2] Re: [PATCH] Fix ICE in simplify_immed_subreg on SPU Message-ID: <20080626223710.GG30485@playstation.sony.com> References: <200806160027.42235.ebotcazou@adacore.com> <200806262209.m5QM9Ww5024891@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 In-Reply-To: <200806262209.m5QM9Ww5024891@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.5.15+20070412 (2007-04-11) Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline 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: 2008-06/txt/msg01708.txt.bz2 Ulrich, I have no additional information to refute the opinion that our usage is "non-representative". We have code that uses these semantics, so it is useful to us. The patch is ok. Go ahead and check it in. Trevor * Ulrich Weigand [2008-06-26 15:15]: > Eric Botcazou wrote: > > > > I think I'm with Ulrich here. A CONST_VECTOR containing a CONST seems > > > reasonable to me. Eric, can you clarify what you see as the problem? > > > > I don't see the point in changing the semantics of CONST_VECTOR because of > > a IMO non-representative testcase. > > I've looked at this again in more detail, and it seems that there is > indeed the pervasive assumption that CONST_VECTOR elements can only > be CONST_INT, CONST_DOUBLE, and CONST_FIXED. For example, dwarf2out.c > cannot handle anything else when constructing an DW_AT_const_value > attribute refering to a CONST_VECTOR. > > While I still think it would be better to allow any legitimate constant > as member of a CONST_VECTOR, this would require non-trivial changes to > dwarf2out.c and a couple of other places. Therefore, for now I think > it is best to change the SPU back-end to avoid generating CONST_VECTOR > expressions that are invalid according to the current middle-end rules. > At some later time those middle-end rules could be relaxed ... > > The following (SPU back-end only) patch implements this. While this > might result in somewhat less efficient code being generated for > certain case, those cases should be rather rare. > > Trevor/Andrew, what are your thoughts about this? Would this be OK > for mainline and 4.3? > > Tested on spu-elf with no regressions, fixes the pr34856 FAILs. > > Bye, > Ulrich > > > ChangeLog: > > PR target/34856 > * config/spu/spu.c (spu_builtin_splats): Do not generate > invalid CONST_VECTOR expressions. > (spu_expand_vector_init): Likewise. > > > Index: gcc/config/spu/spu.c > =================================================================== > *** gcc/config/spu/spu.c (revision 136912) > --- gcc/config/spu/spu.c (working copy) > *************** spu_builtin_splats (rtx ops[]) > *** 4576,4590 **** > constant_to_array (GET_MODE_INNER (mode), ops[1], arr); > emit_move_insn (ops[0], array_to_constant (mode, arr)); > } > - else if (!flag_pic && GET_MODE (ops[0]) == V4SImode && CONSTANT_P (ops[1])) > - { > - rtvec v = rtvec_alloc (4); > - RTVEC_ELT (v, 0) = ops[1]; > - RTVEC_ELT (v, 1) = ops[1]; > - RTVEC_ELT (v, 2) = ops[1]; > - RTVEC_ELT (v, 3) = ops[1]; > - emit_move_insn (ops[0], gen_rtx_CONST_VECTOR (mode, v)); > - } > else > { > rtx reg = gen_reg_rtx (TImode); > --- 4576,4581 ---- > *************** spu_expand_vector_init (rtx target, rtx > *** 4903,4909 **** > for (i = 0; i < n_elts; ++i) > { > x = XVECEXP (vals, 0, i); > ! if (!CONSTANT_P (x)) > ++n_var; > else > { > --- 4894,4902 ---- > for (i = 0; i < n_elts; ++i) > { > x = XVECEXP (vals, 0, i); > ! if (!(CONST_INT_P (x) > ! || GET_CODE (x) == CONST_DOUBLE > ! || GET_CODE (x) == CONST_FIXED)) > ++n_var; > else > { > *************** spu_expand_vector_init (rtx target, rtx > *** 4940,4947 **** > /* fill empty slots with the first constant, this increases > our chance of using splats in the recursive call below. */ > for (i = 0; i < n_elts; ++i) > ! if (!CONSTANT_P (XVECEXP (constant_parts_rtx, 0, i))) > ! XVECEXP (constant_parts_rtx, 0, i) = first_constant; > > spu_expand_vector_init (target, constant_parts_rtx); > } > --- 4933,4945 ---- > /* fill empty slots with the first constant, this increases > our chance of using splats in the recursive call below. */ > for (i = 0; i < n_elts; ++i) > ! { > ! x = XVECEXP (constant_parts_rtx, 0, i); > ! if (!(CONST_INT_P (x) > ! || GET_CODE (x) == CONST_DOUBLE > ! || GET_CODE (x) == CONST_FIXED)) > ! XVECEXP (constant_parts_rtx, 0, i) = first_constant; > ! } > > spu_expand_vector_init (target, constant_parts_rtx); > } > *************** spu_expand_vector_init (rtx target, rtx > *** 4957,4963 **** > for (i = 0; i < n_elts; ++i) > { > x = XVECEXP (vals, 0, i); > ! if (!CONSTANT_P (x)) > { > if (!register_operand (x, GET_MODE (x))) > x = force_reg (GET_MODE (x), x); > --- 4955,4963 ---- > for (i = 0; i < n_elts; ++i) > { > x = XVECEXP (vals, 0, i); > ! if (!(CONST_INT_P (x) > ! || GET_CODE (x) == CONST_DOUBLE > ! || GET_CODE (x) == CONST_FIXED)) > { > if (!register_operand (x, GET_MODE (x))) > x = force_reg (GET_MODE (x), x); > > -- > Dr. Ulrich Weigand > GNU Toolchain for Linux on System z and Cell BE > Ulrich.Weigand@de.ibm.com