* [Bug fortran/34848] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
@ 2008-01-18 12:05 ` pinskia at gcc dot gnu dot org
2008-01-18 12:59 ` [Bug fortran/34848] [4.3 Regression] " burnus at gcc dot gnu dot org
` (15 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-18 12:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-01-18 11:48 -------
Reduced testcase:
module krmod
contains
function doit()
implicit none
real :: doit1(100)
real :: doit
doit1 = tm_doit()
return
end function doit
function tm_doit(genloc)
implicit none
character, optional :: genloc
real :: tm_doit(100)
end function tm_doit
end module krmod
----
The optional argument has to be a character type and the return type has to be
an array
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|major |normal
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC host triplet|x86_64-unknown-linux-gnu |
GCC target triplet|x86_64-unknown-linux-gnu |
Keywords| |ice-on-invalid-code
Last reconfirmed|0000-00-00 00:00:00 |2008-01-18 11:48:37
date| |
Summary|internal compiler error: |internal compiler error with
|Segmentation fault/optional |optional argument of
|arguments |character type and array
| |return type
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
2008-01-18 12:05 ` [Bug fortran/34848] internal compiler error with optional argument of character type and array return type pinskia at gcc dot gnu dot org
@ 2008-01-18 12:59 ` burnus at gcc dot gnu dot org
2008-01-20 5:40 ` pinskia at gcc dot gnu dot org
` (14 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-18 12:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from burnus at gcc dot gnu dot org 2008-01-18 12:45 -------
It's a regression - and I might be guilty of it with my Bind(C) patches...
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
Summary|internal compiler error with|[4.3 Regression] internal
|optional argument of |compiler error with optional
|character type and array |argument of character type
|return type |and array return type
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
2008-01-18 12:05 ` [Bug fortran/34848] internal compiler error with optional argument of character type and array return type pinskia at gcc dot gnu dot org
2008-01-18 12:59 ` [Bug fortran/34848] [4.3 Regression] " burnus at gcc dot gnu dot org
@ 2008-01-20 5:40 ` pinskia at gcc dot gnu dot org
2008-01-20 11:11 ` tkoenig at gcc dot gnu dot org
` (13 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-20 5:40 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (2 preceding siblings ...)
2008-01-20 5:40 ` pinskia at gcc dot gnu dot org
@ 2008-01-20 11:11 ` tkoenig at gcc dot gnu dot org
2008-01-20 14:56 ` krefson at googlemail dot com
` (12 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-01-20 11:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from tkoenig at gcc dot gnu dot org 2008-01-20 09:59 -------
(In reply to comment #2)
> It's a regression - and I might be guilty of it with my Bind(C) patches...
Well, if it's a regression, there's a bigger chance for it to
be fixed before 4.3 comes out :-)
--
tkoenig at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tkoenig at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (3 preceding siblings ...)
2008-01-20 11:11 ` tkoenig at gcc dot gnu dot org
@ 2008-01-20 14:56 ` krefson at googlemail dot com
2008-01-20 15:21 ` burnus at gcc dot gnu dot org
` (11 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: krefson at googlemail dot com @ 2008-01-20 14:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from krefson at googlemail dot com 2008-01-20 13:53 -------
(In reply to comment #3)
> (In reply to comment #2)
> > It's a regression - and I might be guilty of it with my Bind(C) patches...
>
> Well, if it's a regression, there's a bigger chance for it to
> be fixed before 4.3 comes out :-)
>
It would be a milestone if this was fixed, as this would be the first version
of gfortran I will be able to recommend to our users for compiling the CASTEP
electronic structure code. No previous release version has worked - 4.2.3
and earlier all fail to compile CASTEP due to bug # 30095, but snapshots of
4.3.0 from late Nov 2007 appear to work very well indeed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (4 preceding siblings ...)
2008-01-20 14:56 ` krefson at googlemail dot com
@ 2008-01-20 15:21 ` burnus at gcc dot gnu dot org
2008-01-20 15:58 ` burnus at gcc dot gnu dot org
` (10 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-20 15:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from burnus at gcc dot gnu dot org 2008-01-20 14:34 -------
I have a patch. Actually, I do not understand why it worked before.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |burnus at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2008-01-18 11:48:37 |2008-01-20 14:34:44
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (5 preceding siblings ...)
2008-01-20 15:21 ` burnus at gcc dot gnu dot org
@ 2008-01-20 15:58 ` burnus at gcc dot gnu dot org
2008-01-20 17:08 ` jakub at gcc dot gnu dot org
` (9 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-20 15:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from burnus at gcc dot gnu dot org 2008-01-20 15:36 -------
Created an attachment (id=14978)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14978&action=view)
First draft of the patch
The patch works for the test case, but it fails for auto_char_dummy_array_1.f90
(ICE) and for bind_c_usage_13.f03 (string length is passed, but should not for
Bind(C)).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (6 preceding siblings ...)
2008-01-20 15:58 ` burnus at gcc dot gnu dot org
@ 2008-01-20 17:08 ` jakub at gcc dot gnu dot org
2008-01-22 19:52 ` burnus at gcc dot gnu dot org
` (8 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-01-20 17:08 UTC (permalink / raw)
To: gcc-bugs
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (7 preceding siblings ...)
2008-01-20 17:08 ` jakub at gcc dot gnu dot org
@ 2008-01-22 19:52 ` burnus at gcc dot gnu dot org
2008-01-22 20:09 ` burnus at gcc dot gnu dot org
` (7 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-22 19:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from burnus at gcc dot gnu dot org 2008-01-22 19:36 -------
Subject: Bug 34848
Author: burnus
Date: Tue Jan 22 19:35:49 2008
New Revision: 131738
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131738
Log:
2008-01-22 Tobias Burnus <burnus@net-b.de>
PR fortran/34848
* interface.c (compare_actual_formal): Fix adding type
to missing_arg_type for absent optional arguments.
2008-01-22 Tobias Burnus <burnus@net-b.de>
PR fortran/34848
* gfortran.dg/missing_optional_dummy_4.f90
Added:
trunk/gcc/testsuite/gfortran.dg/missing_optional_dummy_4.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/interface.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (8 preceding siblings ...)
2008-01-22 19:52 ` burnus at gcc dot gnu dot org
@ 2008-01-22 20:09 ` burnus at gcc dot gnu dot org
2008-01-26 20:46 ` burnus at gcc dot gnu dot org
` (6 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-22 20:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from burnus at gcc dot gnu dot org 2008-01-22 19:59 -------
I only want to point out that the patch above only fixes a minor problem (which
was part of the draft patch): Before, for absent optional character strings no
string length was passed. Now "0" is passed. I don't know whether this could
causes problems in practice or not.
Patch: See above or http://gcc.gnu.org/ml/fortran/2008-01/msg00276.html
Next task: To fix the actual problem of this PR.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (9 preceding siblings ...)
2008-01-22 20:09 ` burnus at gcc dot gnu dot org
@ 2008-01-26 20:46 ` burnus at gcc dot gnu dot org
2008-01-26 22:01 ` burnus at gcc dot gnu dot org
` (5 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-26 20:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from burnus at gcc dot gnu dot org 2008-01-26 20:06 -------
The following does no longer fix PR34868 but it seems to have no regressions.
"e" is the expression holding the actual argument; if it is NULL it means the
argument is absent. (This is handled before, including passing then the string
length "0".)
Index: trans-expr.c
===================================================================
--- trans-expr.c (Revision 131874)
+++ trans-expr.c (Arbeitskopie)
@@ -2506,7 +2506,7 @@ gfc_conv_function_call (gfc_se * se, gfc
}
}
- if (fsym && need_interface_mapping)
+ if (fsym && need_interface_mapping && e)
gfc_add_interface_mapping (&mapping, fsym, &parmse, e);
gfc_add_block_to_block (&se->pre, &parmse.pre);
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (10 preceding siblings ...)
2008-01-26 20:46 ` burnus at gcc dot gnu dot org
@ 2008-01-26 22:01 ` burnus at gcc dot gnu dot org
2008-01-26 22:21 ` burnus at gcc dot gnu dot org
` (4 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-26 22:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from burnus at gcc dot gnu dot org 2008-01-26 20:45 -------
Subject: Bug 34848
Author: burnus
Date: Sat Jan 26 20:44:49 2008
New Revision: 131876
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131876
Log:
2008-01-26 Tobias Burnus <burnus@net-b.de>
PR fortran/34848
* trans-expr.c (gfc_conv_function_call): Don't call
gfc_add_interface_mapping if the expression is NULL.
2008-01-26 Tobias Burnus <burnus@net-b.de>
PR fortran/34848
* gfortran.dg/missing_optional_dummy_5.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/missing_optional_dummy_5.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-expr.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (11 preceding siblings ...)
2008-01-26 22:01 ` burnus at gcc dot gnu dot org
@ 2008-01-26 22:21 ` burnus at gcc dot gnu dot org
2008-01-27 11:45 ` dominiq at lps dot ens dot fr
` (3 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-26 22:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from burnus at gcc dot gnu dot org 2008-01-26 20:47 -------
FIXED on the trunk (4.3.0).
Hooray - we managed to fix this before 4.3.0 was released :-)
Thanks for the bug report!
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (12 preceding siblings ...)
2008-01-26 22:21 ` burnus at gcc dot gnu dot org
@ 2008-01-27 11:45 ` dominiq at lps dot ens dot fr
2008-01-27 12:03 ` dominiq at lps dot ens dot fr
` (2 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: dominiq at lps dot ens dot fr @ 2008-01-27 11:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from dominiq at lps dot ens dot fr 2008-01-27 10:32 -------
It seems that this patch breaks the original test case of pr33998:
pr33998.f90: In function 'my_string':
pr33998.f90:7: internal compiler error: in gfc_typenode_for_spec, at
fortran/trans-types.c:842
but not the reduced ones of comment #1.
Sould I reopen pr33998?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (13 preceding siblings ...)
2008-01-27 11:45 ` dominiq at lps dot ens dot fr
@ 2008-01-27 12:03 ` dominiq at lps dot ens dot fr
2008-01-27 12:22 ` dominiq at lps dot ens dot fr
2008-01-27 12:49 ` dominiq at lps dot ens dot fr
16 siblings, 0 replies; 18+ messages in thread
From: dominiq at lps dot ens dot fr @ 2008-01-27 12:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from dominiq at lps dot ens dot fr 2008-01-27 10:41 -------
Following comment #12, I also see an ICE for pr34897:
pr34897.f90: In function 'my_string':
pr34897.f90:1: warning: Function does not return a value
pr34897.f90:4: internal compiler error: in gfc_typenode_for_spec, at
fortran/trans-types.c:842
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (14 preceding siblings ...)
2008-01-27 12:03 ` dominiq at lps dot ens dot fr
@ 2008-01-27 12:22 ` dominiq at lps dot ens dot fr
2008-01-27 12:49 ` dominiq at lps dot ens dot fr
16 siblings, 0 replies; 18+ messages in thread
From: dominiq at lps dot ens dot fr @ 2008-01-27 12:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from dominiq at lps dot ens dot fr 2008-01-27 11:26 -------
Note that I am not sure to blame the right patch. What I can tell for sure is
that pr33998.f90 started to fail between the 19th (working, rev. 131656) and
the 20th (ICE, rev. 131679), and pr34897.f90 between the 20th (working, rev.
131679) and the 21st (ICE, rev. 131700).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug fortran/34848] [4.3 Regression] internal compiler error with optional argument of character type and array return type
2008-01-18 11:57 [Bug fortran/34848] New: internal compiler error: Segmentation fault/optional arguments krefson at googlemail dot com
` (15 preceding siblings ...)
2008-01-27 12:22 ` dominiq at lps dot ens dot fr
@ 2008-01-27 12:49 ` dominiq at lps dot ens dot fr
16 siblings, 0 replies; 18+ messages in thread
From: dominiq at lps dot ens dot fr @ 2008-01-27 12:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from dominiq at lps dot ens dot fr 2008-01-27 12:02 -------
> Note that I am not sure to blame the right patch.
I was correct, pr33998.f90 started to fail after rev. 131676 and pr34897.f90
after rev. 131679.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34848
^ permalink raw reply [flat|nested] 18+ messages in thread