[gfortran,commited] Fix a bunch of dg directives in the testsuite
Jerry DeLisle
jvdelisle@verizon.net
Tue Apr 10 19:29:00 GMT 2007
Tobias Burnus wrote:
> Hi,
>
> FX Coudert wrote:
>> I had for some time a patch to fix some directives in the testsuite,
>> as some of them were bogus ("dg-run" instead of "dg-do run", for
>> example; in that particular case, the testcase was actually never
>> run). Commited after regtesting on i686-linux.
> Thanks. (Somehow I lost this email as ezmlm told me; I used ezmlm's
> "get" functionally to obtain this message.)
>
>> One case is troubling, though: gfortran.dg/pointer_intent_1.f90 has a
>> "dg-run" instead of "dg-do run", and when I fixed that, it is run and
>> I discovered it fails at -O0. Tobias, could you look into it? Or do
>> you prefer that I open a PR?
>>
>> (PS: for some reason, line 63 of gfortran.dg/pointer_intent_1.f90 is
>> commented out: "!if(comp%point /= 27) call abort()". Would you mind
>> adding a comment about why it is so? I failed to guess the reason...)
> I don't know why there is the "!....", probably it did not work at some
> point.
>
> Here it (accidentally) runs without any abort. However, valgrind reveals:
>
> ==27761== Use of uninitialised value of size 8
> ==27761== at 0x400B9C: nonpointer.1353 (in
> /projects/tob/gcc/gcc/testsuite/gfortran.dg/a.out)
> ==27761== by 0x400915: MAIN__ (in
> /projects/tob/gcc/gcc/testsuite/gfortran.dg/a.out)
> ==27761== by 0x400BDB: main (fmain.c:22)
>
> This is:
> subroutine nonpointer(t)
> type(myT), intent(in) :: t
> t%point = 7 ! <------- uninitialized value here
> end subroutine nonpointer
>
> And stupidly as I am, I never allocated t%point :-(
>
> Is the patch ok? Tested x86-64 Linux.
>
> Tobias
>
> 2007-04-10 Tobias Burnus <burnus@net-b.de>
>
> * gfortran.dg/pointer_intent_1.f90: Fix test.
>
>
> Index: pointer_intent_1.f90
> ===================================================================
> --- pointer_intent_1.f90 (Revision 123694)
> +++ pointer_intent_1.f90 (Arbeitskopie)
> @@ -1,4 +1,4 @@
> -! { dg-run }
> +! { dg-do run }
> ! { dg-options "-std=f2003 -fall-intrinsics" }
> ! Pointer intent test
> ! PR fortran/29624
> @@ -21,7 +21,11 @@
> deallocate(p)
> nullify(p)
> call a(p,t)
> + t2%x = 5
> + allocate(t2%point)
> + t2%point = 42
> call nonpointer(t2)
> + if(t2%point /= 7) call abort()
> contains
> subroutine a(p,t)
> integer, pointer,intent(in) :: p
> @@ -60,12 +64,14 @@
> subroutine foo(comp)
> type(myT), intent(inout) :: comp
> if(comp%x /= -15) call abort()
> - !if(comp%point /= 27) call abort()
> + if(comp%point /= 27) call abort()
> comp%x = 32
> comp%point = -98
> end subroutine foo
> subroutine nonpointer(t)
> type(myT), intent(in) :: t
> + if(t%x /= 5 ) call abort()
> + if(t%point /= 42) call abort()
> t%point = 7
> end subroutine nonpointer
> end program
>
>
OK
Jerry
More information about the Gcc-patches
mailing list