This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [fortran patch] Don't use TREE_LISTs for storing arguments to intrinsic functions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]