From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19638 invoked by alias); 3 Jun 2009 07:04:16 -0000 Received: (qmail 19450 invoked by uid 22791); 3 Jun 2009 07:04:15 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Jun 2009 07:04:09 +0000 Received: from spaceape10.eur.corp.google.com (spaceape10.eur.corp.google.com [172.28.16.144]) by smtp-out.google.com with ESMTP id n53745SY023668 for ; Wed, 3 Jun 2009 08:04:05 +0100 Received: from pxi34 (pxi34.prod.google.com [10.243.27.34]) by spaceape10.eur.corp.google.com with ESMTP id n53742CI017262 for ; Wed, 3 Jun 2009 00:04:03 -0700 Received: by pxi34 with SMTP id 34so1131941pxi.2 for ; Wed, 03 Jun 2009 00:04:02 -0700 (PDT) Received: by 10.114.200.2 with SMTP id x2mr1072403waf.83.1244012642457; Wed, 03 Jun 2009 00:04:02 -0700 (PDT) Received: from localhost.localdomain.google.com (adsl-71-133-8-30.dsl.pltn13.pacbell.net [71.133.8.30]) by mx.google.com with ESMTPS id l38sm8364431waf.3.2009.06.03.00.04.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Jun 2009 00:04:02 -0700 (PDT) To: DJ Delorie Cc: gcc@gcc.gnu.org Subject: Re: question about TARGET_MUST_PASS_IN_STACK References: <200906030335.n533ZZJ6031276@greed.delorie.com> From: Ian Lance Taylor Date: Wed, 03 Jun 2009 07:04:00 -0000 In-Reply-To: <200906030335.n533ZZJ6031276@greed.delorie.com> (DJ Delorie's message of "Tue\, 2 Jun 2009 23\:35\:35 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes 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: 2009-06/txt/msg00031.txt.bz2 DJ Delorie writes: > On xstormy16, when structures with variable-length arrays are passed > to functions (execute/20020412-1.c), it appears that they're passed by > reference (based on examining the stack), despite the port not > explicitly requesting that. > > This causes a mis-match in the va_arg code, which assumes the array is > passed by value, just pushed to the stack portion of the argument > list. > > Which interpretation of these macros is correct? (based on that, I'll > debug further) > > Xstormy16 uses the default TARGET_MUST_PASS_IN_STACK, which returns > true only for variable-length arrays, and uses the default > TARGET_PASS_BY_REFERENCE, which always returns false. See the function pass_by_reference in function.c. /* GCC post 3.4 passes *all* variable sized types by reference. */ Ian