From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1322 invoked by alias); 10 Aug 2004 07:29:39 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 1315 invoked from network); 10 Aug 2004 07:29:38 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 10 Aug 2004 07:29:38 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i7A7TXe1029839 for ; Tue, 10 Aug 2004 03:29:38 -0400 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i7A7TVa02313; Tue, 10 Aug 2004 03:29:32 -0400 To: gdb-patches@sources.redhat.com Subject: RFA: Don't try to take address of SIMD vectors From: Jim Blandy Date: Tue, 10 Aug 2004 07:29:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-08/txt/msg00353.txt.bz2 This is, in some sense, a followup to: http://sources.redhat.com/ml/gdb-patches/2002-05/msg00027.html No regressions on i686-pc-linux-gnu or powerpc-unknown-linux-gnu; fixes vector subscripting on PowerPC E500 SIMD vectors. 2004-08-09 Jim Blandy * eval.c (evaluate_subexp_with_coercion): Don't try to produce a pointer to the value's first element if it's a SIMD vector value, not an ordinary array. Index: gdb/eval.c =================================================================== RCS file: /cvs/src/src/gdb/eval.c,v retrieving revision 1.41 diff -c -p -r1.41 eval.c *** gdb/eval.c 8 Apr 2004 21:18:12 -0000 1.41 --- gdb/eval.c 9 Aug 2004 23:01:19 -0000 *************** evaluate_subexp_with_coercion (struct ex *** 2157,2162 **** --- 2157,2163 ---- int pc; struct value *val; struct symbol *var; + struct type *type; pc = (*pos); op = exp->elts[pc].opcode; *************** evaluate_subexp_with_coercion (struct ex *** 2165,2171 **** { case OP_VAR_VALUE: var = exp->elts[pc + 2].symbol; ! if (TYPE_CODE (check_typedef (SYMBOL_TYPE (var))) == TYPE_CODE_ARRAY && CAST_IS_CONVERSION) { (*pos) += 4; --- 2166,2179 ---- { case OP_VAR_VALUE: var = exp->elts[pc + 2].symbol; ! type = check_typedef (SYMBOL_TYPE (var)); ! ! /* If the variable's value is an array, produce a pointer to its ! first element. But if it's a SIMD vector, leave it alone --- ! we can't do address arithmetic to find their elements, and ! value_subscript handles them specially. */ ! if (TYPE_CODE (type) == TYPE_CODE_ARRAY ! && ! TYPE_VECTOR (type) && CAST_IS_CONVERSION) { (*pos) += 4;