Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

type(c_ptr), openmp

13 views
Skip to first unread message

Pascal

unread,
Nov 7, 2011, 4:53:40 PM11/7/11
to
Hi,

Am I allowed to use type(C_PTR) inside openmp (test case below)?
It gives me a segfault of the compiler :(

[pascal@vinci trunk]$ gfortran -fopenmp truc.F90 -o test
truc.F90: In function 'test':
truc.F90:7:0: internal compiler error: Segmentation fault
Please submit a full bug report,

[pascal@vinci trunk]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/src/gcc-4.6.2/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --enable-gnu-unique-object --enable-linker-build-id --with-ppl --enable-cloog-backend=isl --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --disable-multilib --disable-libssp --disable-libstdcxx-pch --enable-checking=release
Thread model: posix
gcc version 4.6.2 (GCC)


program test
use, intrinsic :: iso_c_binding
implicit none
type(C_PTR) :: alloc_fftinout

!$OMP PARALLEL default(none) &
!$OMP& private(alloc_fftinout)

!$OMP END PARALLEL

end program

Thanks,
Pascal

glen herrmannsfeldt

unread,
Nov 7, 2011, 5:01:31 PM11/7/11
to
Pascal <pasc...@parois.net> wrote:

> Am I allowed to use type(C_PTR) inside openmp (test case below)?
> It gives me a segfault of the compiler :(

> [pascal@vinci trunk]$ gfortran -fopenmp truc.F90 -o test
> truc.F90: In function 'test':
> truc.F90:7:0: internal compiler error: Segmentation fault
> Please submit a full bug report,

Whether or not it is allowed, it should not ICE.

I can imagine that using C_PTR that you could write something
that would fail when used with OpenMP. That is, make assumptions
on what pointers are pointing to that are not compatible with the
OpenMP assumptions. That shouldn't matter if you don't actually
use the variable, though.

-- glen

Richard Maine

unread,
Nov 7, 2011, 5:43:04 PM11/7/11
to
Pascal <pasc...@parois.net> wrote:

> Am I allowed to use type(C_PTR) inside openmp (test case below)?
> It gives me a segfault of the compiler :(
>
> [pascal@vinci trunk]$ gfortran -fopenmp truc.F90 -o test
> truc.F90: In function 'test':
> truc.F90:7:0: internal compiler error: Segmentation fault
> Please submit a full bug report,

I suppose it has been a while since it has been repeated in the
newsgroup that...

When the compiler says it has an internal error (as gfortran does
above), it is provably *ALWAYS* correct. After all, if there was no
internal compiler error, then it would be an internal compiler error to
generate a message saying that there was. Q.E.D.

It doesn't make any difference whether the code is valid or not. I don't
see anythnig in particular that looks invalid to me (not that I know
enough about openmp to really know), but it doesn't matter.

--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain

Pascal

unread,
Nov 8, 2011, 4:31:36 AM11/8/11
to
On 11/07/2011 11:43 PM, Richard Maine wrote:

> When the compiler says it has an internal error (as gfortran does
> above), it is provably *ALWAYS* correct. After all, if there was no
> internal compiler error, then it would be an internal compiler error to
> generate a message saying that there was. Q.E.D.

I was going to report the bug this morning but someone did it before me,
thanks to Tobias.

>
> It doesn't make any difference whether the code is valid or not. I don't
> see anythnig in particular that looks invalid to me (not that I know
> enough about openmp to really know), but it doesn't matter.
>

Well, I guess I'll know for sure when the bug will be fixed. I can try
an other compiler though.

Pascal

0 new messages