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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid, wrong-code
   Target Milestone|---                         |4.8.0
            Summary|[4.6/4.7/4.8 Regression]    |[4.6/4.7/4.8 Regression]
                   |Defining function pointer   |-fwhole-file bug: Wrong
                   |interface                   |backend_decl for result of
                   |                            |PPC function

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-03-05 
08:19:15 UTC ---
The following is mishandled:

  write (6, *)  NewType(2) % my_f_ptr (3.0)

That generates the following code (dump of the internal format:
-fdump-tree-original):

      real(kind=4) <T4aa> (real(kind=4) & restrict) D.1870;
      static real(kind=4) C.1869 = 3.0e+0;

      D.1870 = newtype[1].my_f_ptr (&C.1869);
      _gfortran_transfer_real_write (&dt_parm.0, &D.1870, 4);

The problem is that the temporary variable "D.1870" is a function pointer
instead of a "real(kind=4)".


That seems to be one bug in the -fwhole-file handling. Seemingly, for the
result the backend_decl of the symbol and not its result value is pulled in.

Reply via email to