This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [fortran patch] Don't use TREE_LISTs for storing arguments to intrinsic functions
- From: "Lee Millward" <lee dot millward at codesourcery dot com>
- To: "Brooks Moses" <brooks dot moses at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Tue, 8 May 2007 19:47:46 +0100
- Subject: Re: [fortran patch] Don't use TREE_LISTs for storing arguments to intrinsic functions
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=dXQyP9pyFBKQWXKp88WwVWsxSFOoC+9eW8xTmGBWds/rViJf20kMjxtvM3yc+St5z3NFoLEpDYbLy/sKJacuyefQqJHkqSGanUalP+pSod+MO0ayt7/Sql69HEvDkqoK0N6dfsOkH7vxvyPOR1KiPcu0ARicBQ4vi/ihQ5RG8DU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=t1pCjHgoV094foL6B7/LmAaQZQpaScTfGxOZjPOHgLJaE1gVk/OwcZMaH6JaIkFO+I8DDQmy1uTsRaeg8Rae4D7KI66l8qrvtIEQH9xU17OKr4aFKIVcYv2tSZ/rcyBZneoS732btVkea2elbGiVpJyyv3EYW5/jgND5URYwV7U=
- References: <9784d3ab0705071520k1f0c1563ib16810e65852924a@mail.gmail.com> <46402258.5030706@codesourcery.com> <4.3.1.2.20070508112105.03cdc938@cits1.stanford.edu>
Hi Brooks,
On 5/8/07, Brooks Moses <brooks.moses@codesourcery.com> wrote:
I'm still baffled by this, then. The two lines that I quoted are the only
uses of formal in this function, right? As far as I can see, neither of
them affects the number of iterations of the loop or the calculation of the
number of arguments, unless I'm completely missing something. Could you
please lead me through how this works?
I found this when I was debugging some testsuite failures which showed
that functions such as gfc_conv_intrinsic_scan were segfaulting
because gfc_intrinsic_argument_list length was telling it there was 5
arguments so control reached the "else" branch where the 5th argument
is passed to convert that promptly segfaulted because it wasn't set to
anything.
Following the code through in gfc_conv_intrinsic_function_args showed
it only populated 4 of those expected 5 arguments (this is where your
gcc_assert(curr_arg == nargs) will be useful) because "formal" became
NULL after the 4th iteration, terminating the loop.
Cheers,
Lee