public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/28118] New: ICE calling subroutine defined via explicit interface
@ 2006-06-21 8:05 anlauf at gmx dot de
2006-06-21 8:10 ` [Bug fortran/28118] " anlauf at gmx dot de
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: anlauf at gmx dot de @ 2006-06-21 8:05 UTC (permalink / raw)
To: gcc-bugs
Howdy,
the attached code ICE's in the subroutine call:
gfcbug33.f90: In function 'MAIN__':
gfcbug33.f90:17: internal compiler error: Segmentation fault
Cheers,
-ha
--
Summary: ICE calling subroutine defined via explicit interface
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: anlauf at gmx dot de
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28118
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/28118] ICE calling subroutine defined via explicit interface
2006-06-21 8:05 [Bug fortran/28118] New: ICE calling subroutine defined via explicit interface anlauf at gmx dot de
@ 2006-06-21 8:10 ` anlauf at gmx dot de
2006-06-21 10:27 ` paul dot richard dot thomas at cea dot fr
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gmx dot de @ 2006-06-21 8:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from anlauf at gmx dot de 2006-06-21 08:05 -------
Created an attachment (id=11718)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11718&action=view)
Code provoking the ICE
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28118
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/28118] ICE calling subroutine defined via explicit interface
2006-06-21 8:05 [Bug fortran/28118] New: ICE calling subroutine defined via explicit interface anlauf at gmx dot de
2006-06-21 8:10 ` [Bug fortran/28118] " anlauf at gmx dot de
@ 2006-06-21 10:27 ` paul dot richard dot thomas at cea dot fr
2006-06-21 20:37 ` pault at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: paul dot richard dot thomas at cea dot fr @ 2006-06-21 10:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from paul dot richard dot thomas at cea dot fr 2006-06-21 10:24 -------
This reduced version produces the same error
character(12) :: a(2)
call foo (a(:)(7:11))
end
(gdb) run PR28118.f90
Starting program: /irun/libexec/gcc/i686-pc-cygwin/4.2.0/f951.exe PR28118.f90
MAIN__
Program received signal SIGSEGV, Segmentation fault.
0x0048a297 in gfc_conv_expr_descriptor (se=0x22eb70, expr=0x101ff150,
ss=0x1020f730) at ../../trunk/gcc/fortran/trans-array.c:4203
4203 loop.temp_ss->string_length = expr->ts.cl->backend_decl;
(gdb) backtrace
#0 0x0048a297 in gfc_conv_expr_descriptor (se=0x22eb70, expr=0x101ff150,
ss=0x1020f730) at ../../trunk/gcc/fortran/trans-array.c:4203
#1 0x0048a682 in gfc_conv_array_parameter (se=0x22eb70, expr=0x101ff150,
ss=0x1020f730, g77=1) at ../../trunk/gcc/fortran/trans-array.c:4485
#2 0x0049924a in gfc_conv_function_call (se=0x22ed20, sym=0x101ff018,
arg=0x101ff0b8) at ../../trunk/gcc/fortran/trans-expr.c:1953
#3 0x004ad94c in gfc_trans_call (code=0x101ff418, dependency_check=0 '\0')
at ../../trunk/gcc/fortran/trans-stmt.c:336
#4 0x00480d05 in gfc_trans_code (code=0x101ff418)
at ../../trunk/gcc/fortran/trans.c:509
#5 0x004954f6 in gfc_generate_function_code (ns=0x101feb40)
at ../../trunk/gcc/fortran/trans-decl.c:2990
#6 0x00451cfd in gfc_parse_file () at ../../trunk/gcc/fortran/parse.c:3206
#7 0x00474530 in gfc_be_parse_file (set_yydebug=0)
at ../../trunk/gcc/fortran/f95-lang.c:303
#8 0x0051eab0 in compile_file () at ../../trunk/gcc/toplev.c:999
#9 0x00520b8b in do_compile () at ../../trunk/gcc/toplev.c:1970
#10 0x00520c15 in toplev_main (argc=2, argv=0x10102068)
at ../../trunk/gcc/toplev.c:2002
#11 0x004b7637 in main (argc=2, argv=0x10102068) at ../../trunk/gcc/main.c:35
I will confirm it tonight.
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28118
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/28118] ICE calling subroutine defined via explicit interface
2006-06-21 8:05 [Bug fortran/28118] New: ICE calling subroutine defined via explicit interface anlauf at gmx dot de
2006-06-21 8:10 ` [Bug fortran/28118] " anlauf at gmx dot de
2006-06-21 10:27 ` paul dot richard dot thomas at cea dot fr
@ 2006-06-21 20:37 ` pault at gcc dot gnu dot org
2006-06-24 13:50 ` pault at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-06-21 20:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pault at gcc dot gnu dot org 2006-06-21 20:35 -------
Here is a patch that regtests OK. I need to check it out, get it ready for
submission, write a formal testcase and check what else it fixes.
Paul
Index: gcc/fortran/trans-array.c
===================================================================
*** gcc/fortran/trans-array.c (revision 114823)
--- gcc/fortran/trans-array.c (working copy)
*************** gfc_conv_expr_descriptor (gfc_se * se, g
*** 4198,4203 ****
--- 4198,4224 ----
}
else
{
+ gfc_ref *char_ref = expr->ref;
+
+ if (expr->ts.cl == NULL)
+ for (; char_ref; char_ref = char_ref->next)
+ if (char_ref->type == REF_SUBSTRING)
+ {
+ mpz_t char_len;
+ expr->ts.cl = char_ref->u.ss.length;
+ mpz_init_set_ui (char_len, 1);
+ mpz_add (char_len, char_len,
+ char_ref->u.ss.end->value.integer);
+ mpz_sub (char_len, char_len,
+ char_ref->u.ss.start->value.integer);
+ expr->ts.cl->backend_decl
+ = convert (gfc_charlen_type_node,
+ gfc_conv_mpz_to_tree (char_len,
+ gfc_default_character_kind));
+ mpz_clear (char_len);
+ break;
+ }
+
loop.temp_ss->data.temp.type
= gfc_typenode_for_spec (&expr->ts);
loop.temp_ss->string_length = expr->ts.cl->backend_decl;
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pault at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-06-21 20:35:25
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28118
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/28118] ICE calling subroutine defined via explicit interface
2006-06-21 8:05 [Bug fortran/28118] New: ICE calling subroutine defined via explicit interface anlauf at gmx dot de
` (2 preceding siblings ...)
2006-06-21 20:37 ` pault at gcc dot gnu dot org
@ 2006-06-24 13:50 ` pault at gcc dot gnu dot org
2006-06-24 14:26 ` pault at gcc dot gnu dot org
2006-06-24 14:55 ` pault at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-06-24 13:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pault at gcc dot gnu dot org 2006-06-24 13:04 -------
Subject: Bug 28118
Author: pault
Date: Sat Jun 24 13:04:37 2006
New Revision: 114964
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114964
Log:
2006-06-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28118
* trans-array.c (gfc_conv_expr_descriptor): When building temp,
use the substring reference to calculate the length if the
expression does not have a charlen.
2006-06-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28118
* gfortran.dg/actual_array_substr_1.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/actual_array_substr_1.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-array.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28118
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/28118] ICE calling subroutine defined via explicit interface
2006-06-21 8:05 [Bug fortran/28118] New: ICE calling subroutine defined via explicit interface anlauf at gmx dot de
` (3 preceding siblings ...)
2006-06-24 13:50 ` pault at gcc dot gnu dot org
@ 2006-06-24 14:26 ` pault at gcc dot gnu dot org
2006-06-24 14:55 ` pault at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-06-24 14:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pault at gcc dot gnu dot org 2006-06-24 14:25 -------
Subject: Bug 28118
Author: pault
Date: Sat Jun 24 14:25:24 2006
New Revision: 114965
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114965
Log:
2006-06-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28118
* trans-array.c (gfc_conv_expr_descriptor): When building temp,
use the substring reference to calculate the length if the
expression does not have a charlen.
2006-06-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28118
* gfortran.dg/actual_array_substr_1.f90: New test.
Added:
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/actual_array_substr_1.f90
Modified:
branches/gcc-4_1-branch/gcc/fortran/ChangeLog
branches/gcc-4_1-branch/gcc/fortran/trans-array.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28118
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/28118] ICE calling subroutine defined via explicit interface
2006-06-21 8:05 [Bug fortran/28118] New: ICE calling subroutine defined via explicit interface anlauf at gmx dot de
` (4 preceding siblings ...)
2006-06-24 14:26 ` pault at gcc dot gnu dot org
@ 2006-06-24 14:55 ` pault at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-06-24 14:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pault at gcc dot gnu dot org 2006-06-24 14:26 -------
Fixed on trunk and 4.1
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28118
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-06-24 14:26 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-21 8:05 [Bug fortran/28118] New: ICE calling subroutine defined via explicit interface anlauf at gmx dot de
2006-06-21 8:10 ` [Bug fortran/28118] " anlauf at gmx dot de
2006-06-21 10:27 ` paul dot richard dot thomas at cea dot fr
2006-06-21 20:37 ` pault at gcc dot gnu dot org
2006-06-24 13:50 ` pault at gcc dot gnu dot org
2006-06-24 14:26 ` pault at gcc dot gnu dot org
2006-06-24 14:55 ` pault at gcc dot gnu dot 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).