+2007-11-29 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/34262
+ * intrinsic.c (gfc_get_intrinsic_sub_symbol): Add comment.
+ (gfc_intrinsic_sub_interface): Copy elemental state if needed.
+ * iresolve.c (gfc_resolve_mvbits): Mark procedure as elemental.
+
2007-11-28 Jakub Jelinek <jakub@redhat.com>
* trans-expr.c (gfc_trans_string_copy): Convert both dest and
}
-/* Get a symbol for a resolved name. */
+/* Get a symbol for a resolved name. Note, if needed be, the elemental
+ attribute has be added afterwards. */
gfc_symbol *
gfc_get_intrinsic_sub_symbol (const char *name)
if (isym->resolve.s1 != NULL)
isym->resolve.s1 (c);
else
- c->resolved_sym = gfc_get_intrinsic_sub_symbol (isym->lib_name);
+ {
+ c->resolved_sym = gfc_get_intrinsic_sub_symbol (isym->lib_name);
+ c->resolved_sym->attr.elemental = isym->elemental;
+ }
if (gfc_pure (NULL) && !isym->elemental)
{
name = gfc_get_string (PREFIX ("mvbits_i%d"),
c->ext.actual->expr->ts.kind);
c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
+ /* Mark as elemental subroutine as this does not happen automatically. */
+ c->resolved_sym->attr.elemental = 1;
}
+2007-11-29 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/34262
+ * gfortran.dg/mvbits_3.f90: New.
+
2007-11-28 Bob Wilson <bob.wilson@acm.org>
* lib/target-supports.exp (check_effective_target_mips_soft_float):
--- /dev/null
+! { dg-do run }
+!
+! PR fortran/
+!
+! The trans-*.c part of the compiler did no know
+! that mvbits is an elemental function.
+!
+! Test case contributed by P.H. Lundow.
+!
+program main
+ implicit none
+ integer :: a( 2 ), b( 2 )
+ integer :: x, y
+
+ a = 1
+ b = 0
+ x = 1
+ y = 0
+
+ call mvbits (a, 0, 1, b, 1)
+ call mvbits (x, 0, 1, y, 1)
+
+! write (*, *) 'a: ', a
+! write (*, *) 'x: ', x
+! write (*, *)
+! write (*, *) 'b: ', b
+! write (*, *) 'y: ', y
+! write (*, *)
+
+ if ( any (b /= y) ) call abort()
+end program main