public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/66969] Internal compiler error, segmentation fault
[not found] <bug-66969-4@http.gcc.gnu.org/bugzilla/>
@ 2015-08-30 13:36 ` dominiq at lps dot ens.fr
2015-10-02 22:01 ` kargl at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-08-30 13:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66969
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-08-30
Ever confirmed|0 |1
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed from 4.8 up to trunk (6.0), backtrace
* thread #1: tid = 0x3763a43, 0x000000010098b77a f951`get_chain_decl at
tree-nested.c:240, queue = 'com.apple.main-thread', stop reason =
EXC_BAD_ACCESS (code=1, address=0x50)
frame #0: 0x000000010098b77a f951`get_chain_decl at tree-nested.c:240
237 static tree
238 get_frame_type (struct nesting_info *info)
239 {
-> 240 tree type = info->frame_type;
241 if (!type)
242 {
243 char *name;
(lldb) bt
* thread #1: tid = 0x3763a43, 0x000000010098b77a f951`get_chain_decl at
tree-nested.c:240, queue = 'com.apple.main-thread', stop reason =
EXC_BAD_ACCESS (code=1, address=0x50)
* frame #0: 0x000000010098b77a f951`get_chain_decl at tree-nested.c:240
frame #1: 0x000000010098b77a f951`get_chain_decl(info=0x0000000144000b30) +
10
frame #2: 0x000000010098dc53
f951`get_nonlocal_debug_decl(info=0x0000000144000b30, decl=0x000000014350b990)
+ 723 at tree-nested.c:858
frame #3: 0x000000010098dd79
f951`convert_nonlocal_reference_op(tp=0x00000001436d6108,
walk_subtrees=<unavailable>, data=0x00007fff5fbfeef0) + 265 at
tree-nested.c:941
frame #4: 0x0000000100b3e6a3 f951`walk_tree_1(tp=0x00000001436d6108,
func=0x000000010098dc70, data=0x00007fff5fbfeef0, pset=0x0000000000000000,
lh=0x0000000000000000)(tree_node**, int*, void*), void*, hash_set<tree_node*,
default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*,
default_hash_traits<tree_node*> >*)) + 371 at tree.c:11296
frame #5: 0x000000010098de38
f951`convert_nonlocal_reference_op(tp=0x00000001436d6108,
walk_subtrees=<unavailable>, data=0x00007fff5fbfeef0) + 456 at
tree-nested.c:1037
frame #6: 0x0000000100b3e6a3 f951`walk_tree_1(tp=0x00000001436d4d18,
func=0x000000010098dc70, data=0x00007fff5fbfeef0, pset=0x0000000000000000,
lh=0x0000000000000000)(tree_node**, int*, void*), void*, hash_set<tree_node*,
default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*,
default_hash_traits<tree_node*> >*)) + 371 at tree.c:11296
frame #7: 0x0000000100686063 f951`walk_gimple_op(stmt=0x00000001436d4cd0,
callback_op=0x000000010098dc70, wi=0x00007fff5fbfeef0)(tree_node**, int*,
void*), walk_stmt_info*) + 1539 at gimple-walk.c:204
frame #8: 0x00000001006863d4 f951`walk_gimple_stmt(gsi=0x00007fff5fbfeab0,
callback_stmt=0x000000010098e560, callback_op=0x000000010098dc70,
wi=0x00007fff5fbfeef0)(gimple_stmt_iterator*, bool*, walk_stmt_info*),
tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) + 148 at
gimple-walk.c:562
frame #9: 0x0000000100686621 f951`walk_gimple_seq_mod(pseq=<unavailable>,
callback_stmt=0x000000010098e560, callback_op=0x000000010098dc70,
wi=0x00007fff5fbfeef0)(gimple_stmt_iterator*, bool*, walk_stmt_info*),
tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) + 81 at
gimple-walk.c:54
frame #10: 0x0000000100686543 f951`walk_gimple_stmt(gsi=0x00007fff5fbfeb40,
callback_stmt=0x000000010098e560, callback_op=0x000000010098dc70,
wi=0x00007fff5fbfeef0)(gimple_stmt_iterator*, bool*, walk_stmt_info*),
tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) + 515 at
gimple-walk.c:608
frame #11: 0x0000000100686621 f951`walk_gimple_seq_mod(pseq=<unavailable>,
callback_stmt=0x000000010098e560, callback_op=0x000000010098dc70,
wi=0x00007fff5fbfeef0)(gimple_stmt_iterator*, bool*, walk_stmt_info*),
tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) + 81 at
gimple-walk.c:54
frame #12: 0x0000000100686513 f951`walk_gimple_stmt(gsi=0x00007fff5fbfebd0,
callback_stmt=0x000000010098e560, callback_op=0x000000010098dc70,
wi=0x00007fff5fbfeef0)(gimple_stmt_iterator*, bool*, walk_stmt_info*),
tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) + 467 at
gimple-walk.c:572
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/66969] Internal compiler error, segmentation fault
[not found] <bug-66969-4@http.gcc.gnu.org/bugzilla/>
2015-08-30 13:36 ` [Bug fortran/66969] Internal compiler error, segmentation fault dominiq at lps dot ens.fr
@ 2015-10-02 22:01 ` kargl at gcc dot gnu.org
2023-10-12 20:39 ` anlauf at gcc dot gnu.org
2023-10-15 20:23 ` anlauf at gcc dot gnu.org
3 siblings, 0 replies; 4+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-10-02 22:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66969
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #2 from kargl at gcc dot gnu.org ---
I believe the code is invalid. Here a small rewrite
program bug
implicit none
real, target, allocatable :: a(:,:)
allocate(a(10,10))
a = 1.0
print*, f(a)
contains
function f(b) result(x)
real, target, intent(in):: b(:,:)
real, pointer :: c(:,:)
real :: x(size(c(1,:)))
c => b(1:2,:)
x = c(2,:)
end function f
end program bug
The line 'real :: x(size(c(1,:))' is referencing an
unassociated pointer. If I add the 'integer :: n = size(c(1,:))
I get
% gfc6 -c bug.f90
bug.f90:15:29:
integer :: n = size(c(1,:))
1
Error: Deferred array 'c' at (1) is not permitted in an initialization
expression
A similar error should probably occur here.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/66969] Internal compiler error, segmentation fault
[not found] <bug-66969-4@http.gcc.gnu.org/bugzilla/>
2015-08-30 13:36 ` [Bug fortran/66969] Internal compiler error, segmentation fault dominiq at lps dot ens.fr
2015-10-02 22:01 ` kargl at gcc dot gnu.org
@ 2023-10-12 20:39 ` anlauf at gcc dot gnu.org
2023-10-15 20:23 ` anlauf at gcc dot gnu.org
3 siblings, 0 replies; 4+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-10-12 20:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66969
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |simon.kluepfel at gmail dot com
--- Comment #3 from anlauf at gcc dot gnu.org ---
*** Bug 86120 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/66969] Internal compiler error, segmentation fault
[not found] <bug-66969-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2023-10-12 20:39 ` anlauf at gcc dot gnu.org
@ 2023-10-15 20:23 ` anlauf at gcc dot gnu.org
3 siblings, 0 replies; 4+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-10-15 20:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66969
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gcc dot gnu.org
Keywords| |accepts-invalid
--- Comment #4 from anlauf at gcc dot gnu.org ---
We might need to tighten the check of restricted expressions:
diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc
index 663fe63dea6..6996e1e93d1 100644
--- a/gcc/fortran/expr.cc
+++ b/gcc/fortran/expr.cc
@@ -2849,6 +2852,21 @@ check_inquiry (gfc_expr *e, int not_restricted)
&& ap->expr->expr_type == EXPR_VARIABLE
&& asym->attr.dummy && asym->attr.optional)
return MATCH_NO;
+
+ if (not_restricted == 0
+ && ap->expr->expr_type == EXPR_VARIABLE
+ && !(asym->attr.flavor == FL_PARAMETER)
+ && !asym->attr.dummy
+ && !asym->attr.in_common
+ && !asym->attr.use_assoc
+ && !asym->attr.host_assoc
+ && !asym->attr.implied_index
+ && (asym->attr.allocatable
+ || asym->attr.pointer
+ || (asym->as && asym->as->type == AS_DEFERRED)))
+ {
+ return MATCH_ERROR;
+ }
}
return MATCH_YES;
This needs to be refined further.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-15 20:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-66969-4@http.gcc.gnu.org/bugzilla/>
2015-08-30 13:36 ` [Bug fortran/66969] Internal compiler error, segmentation fault dominiq at lps dot ens.fr
2015-10-02 22:01 ` kargl at gcc dot gnu.org
2023-10-12 20:39 ` anlauf at gcc dot gnu.org
2023-10-15 20:23 ` anlauf at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).