------- Comment #1 from burnus at gcc dot gnu dot org  2010-02-11 18:56 -------
Created an attachment (id=19848)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19848&action=view)
Testsuite patch ("char"->"unsigned char") to fix the last two ICEs on the input
side

Note: It works with  -O1  and fails with  -O2.

Analogously for:

gfortran -O2 -flto gfortran.dg/bind_c_usage_17.f90
gfortran.dg/bind_c_usage_17_c.c

In file included from :1:0:
gfortran.dg/bind_c_usage_17.f90: In function 'test':
gfortran.dg/bind_c_usage_17.f90:17:0: error: non-trivial conversion at
assignment
<unnamed-unsigned:8>
<unnamed-signed:8>
D.2124_1 = D.2125_53;
[...]

And for:

$ gfortran -O2 -flto gfortran.dg/bind_c_usage_16.f03
gfortran.dg/bind_c_usage_16_c.c

In file included from gfortran.dg/bind_c_usage_16.f03:23:0,
                 from :3:
gfortran.dg/bind_c_usage_16_c.c: In function 'main':
gfortran.dg/bind_c_usage_16_c.c:12:5: error: non-trivial conversion at
assignment
<unnamed-signed:8>
<unnamed-unsigned:8>
c.0_1 = D.2210_12;

 * * *

Actually, for the last two ICEs, one can simply fix the test suite by using the
attached patch, which changes "char" into "unsigned char".

But for the first failure one cannot do much as the Fortran standard has just a
  type(c_funptr)
which is a C-compatible function pointer. As this is a general black box, it is
defined by the front end as:
  <unnamed type> (*<T499>) (void)
even though in this case an  <int:32> (*<T4a0>)(<int:32>)  type is needed.

(For Fortran-internal function pointers, one can give an interface and thus
create the proper function-pointer type.)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43045

Reply via email to