[LLVMdev] gfortran: array constructor problems

Michael McCracken michael.mccracken at gmail.com
Thu Sep 7 15:19:13 PDT 2006


On 9/6/06, Michael McCracken <michael.mccracken at gmail.com> wrote:
> On 9/6/06, Chris Lattner <sabre at nondot.org> wrote:
> > On Tue, 5 Sep 2006, Michael McCracken wrote:
> [snip]
> This works on my test case, which looked like this:
>
> type :: foo
> integer :: a
> integer :: b
> end type foo
> type (foo), parameter :: A(2) = (/ foo(1,2), foo(2,4) /)
>
> There is at least one other point in gfc_conv_array_initializer()
> where they build tree lists of structures using gfc_conv_structure().
> That part should probably set each tree's constant flag as well,
> probably on line 2843. However, I couldn't test that change, since the
> only way I could think of to get to that code path will crash gfortran
> somewhere else, and I didn't want to work on that just yet.
>
> To crash gfortran like that (it crashes a stock install gfortran on my
> linux box also), do this, with the same type foo:
>
> type (foo), parameter :: A(2) = foo(1,2)
>
> This should (and does with the IBM xlF compiler) generate an array
> with two identical structures, but actually just runs forever on its
> own and crashes under gdb.

I just had a chance to test this with a current vanilla gfortran SVN
build and it doesn't crash that. There don't seem to be any obvious
fixes in the diffs, but I'll keep looking.

When I get back to having a working llvm-gfortran I will take a look
at the proposed alternate patch from yesterday. (My laptop died
yesterday before I backed up the gfortran work).

Cheers,
-mike

-- 
Michael McCracken
UCSD CSE PhD Candidate
research: http://www.cse.ucsd.edu/~mmccrack/
misc: http://michael-mccracken.net/wp/



More information about the llvm-dev mailing list