[Patch, Fortran] PR34262 - Fix MVBITS with arrays

Tobias Burnus burnus@net-b.de
Wed Nov 28 22:41:00 GMT 2007


:ADDPATCH fortran:

MVBITS is an elemental function, but trans-*.c regarded it as normal,
non-elemental function, which gave wrong results with arrays.

The reason is that the function symbol was created as follows:

  /* TO and FROM are guaranteed to have the same kind parameter.  */
  name = gfc_get_string (PREFIX ("mvbits_i%d"),
                         c->ext.actual->expr->ts.kind);
  c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);

I added now an argument to gfc_get_intrinsic_sub_symbol to set
optionally the elemental attribute.

I find my method rather clumsy. Has someone a better idea? If not, OK
for the trunk?

(Build and regression tested on x86-64.)

Tobias
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mvbits.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071128/3a2d03b1/attachment.ksh>


More information about the Fortran mailing list