This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/40969] [4.5 regression] Revision 150465 failed gfortran.dg/c_by_val_1.f



------- Comment #12 from burnus at gcc dot gnu dot org  2009-08-05 20:03 -------
(In reply to comment #10)
> It failed at a different place:
> 61        if ( c1 != *c2    ) abort();
> (gdb) p c1
> $1 = 43 + 0 * I
> (gdb) p *c2
> $2 = -1 + 2 * I

Hmm, I honestly have no idea why this fails. In my understanding, it should
have failed before and should now be working. The reason is that for

      call  f_to_f (b, %VAL (a), %REF (c), %LOC (c))

using "external f_to_f" generates a prototype

      void f_to_f(...)

which my previous patch in PR 40949 wrongly modified to "void f_to_f(void)".
However, for

      v = c_to_c (%VAL (u), %REF (w), %LOC (w))
with
      external c_to_c
      complex  c_to_c
and call by reference (-ff2c), the prototype should be

      void c_to_c(complex*, ...)

In my opinion that's what my patch in comment 9 does, while  pre-PR40949
gfortran appended a void node, leading to

      void c_to_c(complex *) // misses ", ..."

I think I miss something "obvious" here.

 * * *

At the end, gfortran should produce a proper prototype, which is useful to have
to provide better diagnostics and needed to fix some LTO issues. I filled PR
40976 to track this.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]