aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChristopher D. Rickett <crickett@lanl.gov>2007-07-19 06:14:19 +0000
committerTobias Burnus <burnus@gcc.gnu.org>2007-07-19 08:14:19 +0200
commit972345f2c98204eb030568cf15b023d15adad345 (patch)
tree535259e91e0fedbc67e86254b4f1684dbabc21f8 /gcc
parent2211d9eae7c06cf47bbd32a0e0e04ec50f39fcbe (diff)
downloadgcc-972345f2c98204eb030568cf15b023d15adad345.zip
gcc-972345f2c98204eb030568cf15b023d15adad345.tar.gz
gcc-972345f2c98204eb030568cf15b023d15adad345.tar.bz2
re PR fortran/32600 ([ISO Bind C] C_F_POINTER w/o SHAPE should not be a library function)
2007-07-19 Christopher D. Rickett <crickett@lanl.gov> PR fortran/32600 * trans-expr.c (gfc_conv_function_call): Inline C_LOC. 2007-07-19 Christopher D. Rickett <crickett@lanl.gov> PR fortran/32600 * libgfortran/intrinsics/iso_c_binding.c: Remove C_LOC. * libgfortran/intrinsics/iso_c_binding.h: Ditto. * libgfortran/gfortran.map: Ditto. From-SVN: r126744
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/trans-expr.c27
2 files changed, 32 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 0c46c5b..476b73e 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-19 Christopher D. Rickett <crickett@lanl.gov>
+
+ PR fortran/32600
+ * trans-expr.c (gfc_conv_function_call): Inline C_LOC.
+
2007-07-18 Christopher D. Rickett <crickett@lanl.gov>
PR fortran/32801
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index fce6159..16148cb 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -2060,6 +2060,33 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
var = NULL_TREE;
len = NULL_TREE;
+ if (sym->from_intmod == INTMOD_ISO_C_BINDING
+ && sym->intmod_sym_id == ISOCBINDING_LOC)
+ {
+ if (arg->expr->rank == 0)
+ {
+ gfc_conv_expr_reference (se, arg->expr);
+ }
+ else
+ {
+ int f;
+ /* This is really the actual arg because no formal arglist is
+ created for C_LOC. */
+ fsym = arg->expr->symtree->n.sym;
+
+ /* We should want it to do g77 calling convention. */
+ f = (fsym != NULL)
+ && !(fsym->attr.pointer || fsym->attr.allocatable)
+ && fsym->as->type != AS_ASSUMED_SHAPE;
+ f = f || !sym->attr.always_explicit;
+
+ argss = gfc_walk_expr (arg->expr);
+ gfc_conv_array_parameter (se, arg->expr, argss, f);
+ }
+
+ return 0;
+ }
+
if (se->ss != NULL)
{
if (!sym->attr.elemental)