Message ID | trinity-3e3e52c2-0bed-45f6-a6a6-4ae473861eb5-1611783058046@3c-app-gmx-bs28 |
---|---|
State | New |
Headers | show |
Series | None | expand |
Hello Harald, > OK for master / backports? OK. It is indeed fairly obvious, as you write. > Should the testcase be moved to the gomp/ subdirectory? Yes. It's a compile-time test, and it will then only be run if the the compiler can do OpenMP. You will not need the +! { dg-options "-fopenmp" } line, then. Thanks for the patch! Best regards Thomas
Hi Thomas, > > Should the testcase be moved to the gomp/ subdirectory? > Yes. It's a compile-time test, and it will then only be run > if the the compiler can do OpenMP. > > You will not need the > > +! { dg-options "-fopenmp" } > > line, then. Adjusted and committed as r11-6950-g33a7a93218b1393d0135e3c4a9ad9ced87808f5e > Thanks for the patch! Thanks, Harald
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index a2376917635..ab53fc5f441 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -689,6 +689,9 @@ gfc_call_malloc (stmtblock_t * block, tree type, tree size) /* Call malloc. */ gfc_start_block (&block2); + if (size == NULL_TREE) + size = build_int_cst (size_type_node, 1); + size = fold_convert (size_type_node, size); size = fold_build2_loc (input_location, MAX_EXPR, size_type_node, size, build_int_cst (size_type_node, 1)); diff --git a/gcc/testsuite/gfortran.dg/pr86470.f90 b/gcc/testsuite/gfortran.dg/pr86470.f90 new file mode 100644 index 00000000000..4021e5d655c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr86470.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } +! { dg-options "-fopenmp" } +! PR fortran/86470 - ICE with OpenMP, class(*) + +program p + implicit none + class(*), allocatable :: val +!$OMP PARALLEL private(val) + allocate(integer::val) + val = 1 + deallocate(val) +!$OMP END PARALLEL +end