This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52469] [4.6/4.7/4.8 Regression] -fwhole-file bug: Wrong backend_decl for result of PPC function
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 05 Mar 2012 08:19:15 +0000
- Subject: [Bug fortran/52469] [4.6/4.7/4.8 Regression] -fwhole-file bug: Wrong backend_decl for result of PPC function
- Auto-submitted: auto-generated
- References: <bug-52469-4@http.gcc.gnu.org/bugzilla/>
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.