I plan to commit the following patch that was provided by Steve in PR on
Bugzilla. Simple. I will also backport to 7. Without patch we get a segfault
when -Warray-temporaries is used on several existing test cases. I will prepare
a test case based on one of those.
Regards,
Jerry
2017-06-27 Jerry DeLisle <jvdeli...@gcc.gnu.org>
PR fortran/80164
* trans-stmt.c (gfc_trans_call): If no code expr, use code->loc
as warning/error locus.
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index e4f1da54..a1e1dff7 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -452,7 +452,11 @@ gfc_trans_call (gfc_code * code, bool dependency_check,
subscripts. This could be prevented in the elemental case
as temporaries are handled separatedly
(below in gfc_conv_elemental_dependencies). */
- gfc_conv_loop_setup (&loop, &code->expr1->where);
+ if (code->expr1)
+ gfc_conv_loop_setup (&loop, &code->expr1->where);
+ else
+ gfc_conv_loop_setup (&loop, &code->loc);
+
gfc_mark_ss_chain_used (ss, 1);
/* Convert the arguments, checking for dependencies. */