aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog34
-rw-r--r--gcc/fortran/decl.cc14
-rw-r--r--gcc/fortran/primary.cc8
-rw-r--r--gcc/fortran/resolve.cc3
-rw-r--r--gcc/fortran/trans-expr.cc3
5 files changed, 58 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index c0a5710..bf828fe 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,37 @@
+2025-10-29 Yuao Ma <c8ef@outlook.com>
+
+ * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Remove unreachable
+ code.
+
+2025-10-29 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/122165
+ * primary.cc (gfc_match_varspec): If the previous component ref
+ was a type specification parameter, a type inquiry ref cannot
+ follow.
+
+2025-10-29 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/122433
+ PR fortran/122434
+ * decl.cc (gfc_get_pdt_instance): Prevent a PDT component of
+ the same type as the template from being converted into an
+ instance.
+ * resolve.cc (gfc_impure_variable): The result of a pure
+ function is a valid allocate object since it is pure.
+
+2025-10-28 Yuao Ma <c8ef@outlook.com>
+
+ PR fortran/122342
+ * trans-const.cc (gfc_conv_constant): Create a variable for the
+ non-char pointer.
+
+2025-10-28 Paul-Antoine Arras <parras@baylibre.com>
+
+ PR fortran/122439
+ * openmp.cc (gfc_resolve_omp_context_selector): Skip selectors that have
+ OMP_TRAIT_INVALID.
+
2025-10-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/922290
diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc
index 569786a..5b222cd 100644
--- a/gcc/fortran/decl.cc
+++ b/gcc/fortran/decl.cc
@@ -3938,6 +3938,20 @@ gfc_get_pdt_instance (gfc_actual_arglist *param_list, gfc_symbol **sym,
actual_param = param_list;
sprintf (name, "Pdt%s", pdt->name);
+ /* Prevent a PDT component of the same type as the template from being
+ converted into an instance. Doing this results in the component being
+ lost. */
+ if (gfc_current_state () == COMP_DERIVED
+ && !(gfc_state_stack->previous
+ && gfc_state_stack->previous->state == COMP_DERIVED)
+ && gfc_current_block ()->attr.pdt_template
+ && !strcmp (gfc_current_block ()->name, (*sym)->name))
+ {
+ if (ext_param_list)
+ *ext_param_list = gfc_copy_actual_arglist (param_list);
+ return MATCH_YES;
+ }
+
/* Run through the parameter name list and pick up the actual
parameter values or use the default values in the PDT declaration. */
for (; type_param_name_list;
diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc
index 2d2c664..0722c76d 100644
--- a/gcc/fortran/primary.cc
+++ b/gcc/fortran/primary.cc
@@ -2690,6 +2690,14 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
else
component = NULL;
+ if (previous && inquiry
+ && (previous->attr.pdt_kind || previous->attr.pdt_len))
+ {
+ gfc_error_now ("R901: A type parameter ref is not a designtor and "
+ "cannot be followed by the type inquiry ref at %C");
+ return MATCH_ERROR;
+ }
+
if (intrinsic && !inquiry)
{
if (previous)
diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index 117a51c..ecd2ada 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -18956,7 +18956,8 @@ gfc_impure_variable (gfc_symbol *sym)
{
if (ns == sym->ns)
break;
- if (ns->proc_name->attr.flavor == FL_PROCEDURE && !sym->attr.function)
+ if (ns->proc_name->attr.flavor == FL_PROCEDURE
+ && !(sym->attr.function || sym->attr.result))
return 1;
}
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index 67b60c7..2e88e65 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -6090,9 +6090,6 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym)
se.want_pointer = 1;
gfc_conv_expr (&se, e);
gfc = se.expr;
- /* gfc_conv_constant ignores se.want_poiner, e.g. for string_cst. */
- if (!POINTER_TYPE_P (TREE_TYPE (gfc)))
- gfc = gfc_build_addr_expr (NULL, gfc);
}
else
{