[PATCH,fortran]: partial fix for PR 32600 - OK for GCC 4.3.0/stage 3

Tobias Burnus burnus@net-b.de
Mon Oct 15 19:20:00 GMT 2007


Mark,

Stage 3: "the only changes that may be made are changes that fix bugs
[...] New functionality may not be introduced during this period."

The following patch does not introduce new functionality, but is not a
real bugfix either. It moves functionality from the library to the front
end, removes dead code, does some cleanup, improves the performance and
code size a tiny bit and the changes are very localized.

One reason we would like to have it in GCC 4.3 and not in GCC 4.4 is
that starting with GCC 4.3.0 we will have symbol versioning and can
therefore not remove the library function in 4.4.0. As the function
belongs to Fortran 2003 (ISO C Binding), it is still not widely used and
thus most GCC 4.3.0-pre-patch-compiled programs will be unaffected by
this change.

Do you think that the patch can go in GCC 4.3.0 or has it to wait for
GCC 4.4.0?

The patch itself was oked by Tobias Schlüter and me; it also survived
several bootstraps, regtests and real-world program builds.


Steve Kargl wrote:
> With 4.3.0 being the first release of gfortran with symbol versioning,
> I think your observation of clean up and dead code removal are 
> sufficient to ask markm for his opinion/approval.
>   

Christopher D. Rickett wrote:
> the attached patch is a partial fix for PR 32600; it generates code to
> inline c_associated rather than call a library routine.  PR 32600 is
> an enhancement pr, so if it is too late into 4.3 for this patch to be
> applied, i can hold off on it until later.
>
> there are two main parts to the patch; one is mostly in trans-expr.c
> and it generates the inlined code and the other is simply removing
> c_associated from libgfortran.  the part for the frontend does not
> depend on the changes to libgfortran, so it is compatible with
> existing versions of the library for gcc 4.3.0 if it is too late to
> change the library.
>
> bootstrapped and regtested on x86 linux with no new failures.
>
> thanks.
> Chris
>
> :ADDPATCH fortran:
>
> ChangeLog entry:
>
> 2007-10-12  Christopher D. Rickett  <crickett@lanl.gov>
>
>     PR fortran/32600
>     * trans-expr.c (gfc_conv_function_call): Generate code to inline
>     c_associated.
>     * symbol.c (get_iso_c_sym): Preserve from_intmod and intmod_sym_id
>     attributes in the resolved symbol.
>     * resolve.c (gfc_iso_c_sub_interface): Remove dead code.
>
> 2007-10-12  Christopher D. Rickett  <crickett@lanl.gov>
>
>     PR fortran/32600
>     * libgfortran/intrinsics/iso_c_binding.c: Remove c_associated_1
>     and c_associated_2.
>     * libgfortran/intrinsics/iso_c_binding.h: Ditto.
>     * libgfortran/gfortran.map: Ditto.

Tobias
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: icb.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20071015/8ee14e6d/attachment.ksh>


More information about the Gcc-patches mailing list