* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
@ 2006-02-01 14:46 ` pinskia at gcc dot gnu dot org
2006-02-01 16:36 ` sven dot buijssen at math dot uni-dortmund dot de
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-01 14:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-02-01 14:45 -------
This looks related to PR 26041.
Can you try the patch at
http://gcc.gnu.org/ml/gcc-patches/2006-01/msg02261.html
?
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |26041
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
2006-02-01 14:46 ` [Bug fortran/26064] " pinskia at gcc dot gnu dot org
@ 2006-02-01 16:36 ` sven dot buijssen at math dot uni-dortmund dot de
2006-02-01 16:49 ` hjl at lucon dot org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: sven dot buijssen at math dot uni-dortmund dot de @ 2006-02-01 16:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from sven dot buijssen at math dot uni-dortmund dot de 2006-02-01 16:36 -------
The patch fixes the regression, but introduces a new internal compiler error
for the following testcase:
--- cut here ---
% cat > ice.f90 <<EOF
module ice
implicit none
contains
subroutine foo()
contains
subroutine bar(baz)
integer :: baz
if (present(baz)) then
endif
end subroutine bar
end subroutine foo
end module
EOF
--- cut here ---
% gfortran -c ice.f90
ice.f90: In function 'bar':
ice.f90:8: internal compiler error: in gfc_typenode_for_spec, at
fortran/trans-types.c:651
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
2006-02-01 14:46 ` [Bug fortran/26064] " pinskia at gcc dot gnu dot org
2006-02-01 16:36 ` sven dot buijssen at math dot uni-dortmund dot de
@ 2006-02-01 16:49 ` hjl at lucon dot org
2006-02-01 17:00 ` hjl at lucon dot org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hjl at lucon dot org @ 2006-02-01 16:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from hjl at lucon dot org 2006-02-01 16:49 -------
It is the same bug.
*** This bug has been marked as a duplicate of 26041 ***
--
hjl at lucon dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
` (2 preceding siblings ...)
2006-02-01 16:49 ` hjl at lucon dot org
@ 2006-02-01 17:00 ` hjl at lucon dot org
2006-02-01 20:01 ` sven dot buijssen at math dot uni-dortmund dot de
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hjl at lucon dot org @ 2006-02-01 17:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from hjl at lucon dot org 2006-02-01 17:00 -------
I didn't see it:
[hjl@gnu-16]$ cat xxx.f90
module ice
implicit none
contains
subroutine foo()
contains
subroutine bar(baz)
integer :: baz
if (present(baz)) then
endif
end subroutine bar
end subroutine foo
end module
[hjl@gnu-16]$ /export/build/gnu/gcc/build-x86_64-linux/gcc/gfortran
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -S xxx.f90
In file xxx.f90:10
if (present(baz)) then
1
Error: 'a' argument of 'present' intrinsic at (1) must be of an OPTIONAL dummy
variable
[hjl@gnu-16]$
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
` (3 preceding siblings ...)
2006-02-01 17:00 ` hjl at lucon dot org
@ 2006-02-01 20:01 ` sven dot buijssen at math dot uni-dortmund dot de
2006-02-01 21:20 ` hjl at lucon dot org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: sven dot buijssen at math dot uni-dortmund dot de @ 2006-02-01 20:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from sven dot buijssen at math dot uni-dortmund dot de 2006-02-01 20:01 -------
I'm sorry. I had been experimenting which circumstances trigger the ice and
accidentally deleted the "optional" argument. To be valid the code needs to be
like
% cat > ice.f90 <<EOF
module ice
implicit none
contains
subroutine foo()
contains
subroutine bar(baz)
integer, optional :: baz
if (present(baz)) then
endif
end subroutine bar
end subroutine foo
end module
EOF
Just to be clear: gfortran revision 110475 does not complain about this
testcase. Only when I followed the advise of Andrew and integrated the patch
you suggested yesterday, H.J., then gfortran gives an ice.
% svn update -r HEAD
At revision 110475.
% svn diff
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 110475)
+++ gcc/fortran/resolve.c (working copy)
@@ -5771,21 +5771,14 @@
}
-/* This function is called after a complete program unit has been compiled.
- Its purpose is to examine all of the expressions associated with a program
- unit, assign types to all intermediate expressions, make sure that all
- assignments are to compatible types and figure out which names refer to
- which functions or subroutines. */
-
-void
-gfc_resolve (gfc_namespace * ns)
+static void
+gfc_resolve_type (gfc_namespace * ns)
{
- gfc_namespace *old_ns, *n;
+ gfc_namespace *n;
gfc_charlen *cl;
gfc_data *d;
gfc_equiv *eq;
- old_ns = gfc_current_ns;
gfc_current_ns = ns;
resolve_entries (ns);
@@ -5803,7 +5796,7 @@
"also be PURE", n->proc_name->name,
&n->proc_name->declared_at);
- gfc_resolve (n);
+ gfc_resolve_type (n);
}
forall_flag = 0;
@@ -5827,12 +5820,37 @@
for (eq = ns->equiv; eq; eq = eq->next)
resolve_equivalence (eq);
- cs_base = NULL;
- resolve_code (ns->code, ns);
-
/* Warn about unused labels. */
if (gfc_option.warn_unused_labels)
warn_unused_label (ns->st_labels);
+}
+
+/* This function is called after a complete program unit has been compiled.
+ Its purpose is to examine all of the expressions associated with a program
+ unit, assign types to all intermediate expressions, make sure that all
+ assignments are to compatible types and figure out which names refer to
+ which functions or subroutines. */
+
+void
+gfc_resolve (gfc_namespace * ns)
+{
+ gfc_namespace *old_ns, *n;
+
+ old_ns = gfc_current_ns;
+
+ gfc_resolve_type (ns);
+
+ for (n = ns->contained; n; n = n->sibling)
+ {
+ gfc_current_ns = n;
+ cs_base = NULL;
+ resolve_code (n->code, n);
+ }
+
+ gfc_current_ns = ns;
+ cs_base = NULL;
+ resolve_code (ns->code, ns);
+
gfc_current_ns = old_ns;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
` (4 preceding siblings ...)
2006-02-01 20:01 ` sven dot buijssen at math dot uni-dortmund dot de
@ 2006-02-01 21:20 ` hjl at lucon dot org
2006-02-02 1:19 ` hjl at lucon dot org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hjl at lucon dot org @ 2006-02-01 21:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from hjl at lucon dot org 2006-02-01 21:20 -------
I got
Breakpoint 3, gfc_sym_type (sym=0xb5b800)
at /net/gnu-13/export/gnu/src/gcc-last/gcc/gcc/fortran/trans-types.c:1301
1301 type = gfc_typenode_for_spec (&sym->ts);
$8 = {name = 0xb51b46 "present", module = 0x0, declared_at = {
nextc = 0xb53bbf "(baz)) then", lb = 0xb53b90}, ts = {type = BT_UNKNOWN,
kind = 0, derived = 0x0, cl = 0x0}, attr = {allocatable = 0,
dimension = 0, external = 0, intrinsic = 0, optional = 0, pointer = 0,
save = 0, target = 0, dummy = 0, result = 0, assign = 0, data = 0,
use_assoc = 0, in_namelist = 0, in_common = 0, in_equivalence = 0,
function = 1, subroutine = 0, generic = 0, implicit_type = 0, untyped = 0,
sequence = 0, elemental = 0, pure = 0, recursive = 0, unmaskable = 0,
masked = 0, contained = 0, noreturn = 0, entry = 0, entry_master = 0,
mixed_entry_master = 0, always_explicit = 0, referenced = 1,
is_main_program = 0, access = ACCESS_UNKNOWN, intent = INTENT_UNKNOWN,
flavor = FL_PROCEDURE, if_source = IFSRC_UNKNOWN, proc = PROC_UNKNOWN,
cray_pointer = 0, cray_pointee = 0}, generic = 0x0,
component_access = ACCESS_UNKNOWN, formal = 0x0, formal_ns = 0x0,
value = 0x0, as = 0x0, result = 0xb5b800, components = 0x0,
cp_pointer = 0x0, common_next = 0x0, common_head = 0x0, dummy_order = 0,
namelist = 0x0, namelist_tail = 0x0, old_symbol = 0x0, tlink = 0x0,
mark = 1, new = 0, equiv_built = 0, refs = 1, ns = 0xb5b170,
---Type <return> to continue, or q <return> to quit---
backend_decl = 0x0}
(gdb)
Is "present" an intrinsic? Why isn't it marked so?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
` (5 preceding siblings ...)
2006-02-01 21:20 ` hjl at lucon dot org
@ 2006-02-02 1:19 ` hjl at lucon dot org
2006-02-02 11:30 ` sven dot buijssen at math dot uni-dortmund dot de
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hjl at lucon dot org @ 2006-02-02 1:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from hjl at lucon dot org 2006-02-02 01:19 -------
Please try this one
http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00102.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
` (6 preceding siblings ...)
2006-02-02 1:19 ` hjl at lucon dot org
@ 2006-02-02 11:30 ` sven dot buijssen at math dot uni-dortmund dot de
2006-02-02 14:49 ` hjl at lucon dot org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: sven dot buijssen at math dot uni-dortmund dot de @ 2006-02-02 11:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from sven dot buijssen at math dot uni-dortmund dot de 2006-02-02 11:30 -------
I tested the patch and encountered another internal compiler error. The
problem, however, is that this new error so far only occurs with a code
consisting of several thousand code lines and disappears as soon as I try to
remove some complexity. Nevertheless, I'm trying to deduce a reasonably sized
test case. I recon the error message I get does not help you to much in the
meantime:
internal compiler error: tree check: expected record_type or union_type or
qual_union_type, have omp_clause in gfc_get_derived_type, at fortran/trans-
types.c:1458
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
` (7 preceding siblings ...)
2006-02-02 11:30 ` sven dot buijssen at math dot uni-dortmund dot de
@ 2006-02-02 14:49 ` hjl at lucon dot org
2006-02-02 16:12 ` sven dot buijssen at math dot uni-dortmund dot de
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hjl at lucon dot org @ 2006-02-02 14:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from hjl at lucon dot org 2006-02-02 14:49 -------
If you back out the change for bug 18197, does several thousand lines of
code compile?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
` (8 preceding siblings ...)
2006-02-02 14:49 ` hjl at lucon dot org
@ 2006-02-02 16:12 ` sven dot buijssen at math dot uni-dortmund dot de
2006-02-05 19:52 ` hjl at gcc dot gnu dot org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: sven dot buijssen at math dot uni-dortmund dot de @ 2006-02-02 16:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from sven dot buijssen at math dot uni-dortmund dot de 2006-02-02 16:12 -------
They did with gfortran < Revision 108555. With current revision 110515 backing
out only the patch for 18197 (and not applying your patch) they do not.
The error message I get with revision 110515 backing out only the patch for
18197 is exactly the same as with revision 110515 integrating your patch. So,
it's probably a separate regression. I'll continue to distillate a test case
and file a separate bug report.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
` (9 preceding siblings ...)
2006-02-02 16:12 ` sven dot buijssen at math dot uni-dortmund dot de
@ 2006-02-05 19:52 ` hjl at gcc dot gnu dot org
2006-02-05 19:53 ` hjl at gcc dot gnu dot org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hjl at gcc dot gnu dot org @ 2006-02-05 19:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from hjl at gcc dot gnu dot org 2006-02-05 19:52 -------
Subject: Bug 26064
Author: hjl
Date: Sun Feb 5 19:52:35 2006
New Revision: 110618
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110618
Log:
2006-02-05 H.J. Lu <hongjiu.lu@intel.com>
PR fortran/26041
PR fortran/26064
* gfortran.dg/sibling_dummy_procedure_1.f90: New file.
* gfortran.dg/sibling_dummy_procedure_2.f90: Likewise.
* gfortran.dg/sibling_dummy_procedure_3.f90: Likewise.
Added:
trunk/gcc/testsuite/gfortran.dg/sibling_dummy_procedure_1.f90
trunk/gcc/testsuite/gfortran.dg/sibling_dummy_procedure_2.f90
trunk/gcc/testsuite/gfortran.dg/sibling_dummy_procedure_3.f90
Modified:
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
` (10 preceding siblings ...)
2006-02-05 19:52 ` hjl at gcc dot gnu dot org
@ 2006-02-05 19:53 ` hjl at gcc dot gnu dot org
2006-03-07 22:29 ` hjl at gcc dot gnu dot org
2006-03-07 22:31 ` hjl at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: hjl at gcc dot gnu dot org @ 2006-02-05 19:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from hjl at gcc dot gnu dot org 2006-02-05 19:53 -------
Subject: Bug 26064
Author: hjl
Date: Sun Feb 5 19:53:00 2006
New Revision: 110619
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110619
Log:
2006-02-05 H.J. Lu <hongjiu.lu@intel.com>
PR fortran/26041
PR fortran/26064
* resolve.c (resolve_types): New function.
(resolve_codes): Likewise.
(gfc_resolve): Use them.
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
` (11 preceding siblings ...)
2006-02-05 19:53 ` hjl at gcc dot gnu dot org
@ 2006-03-07 22:29 ` hjl at gcc dot gnu dot org
2006-03-07 22:31 ` hjl at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: hjl at gcc dot gnu dot org @ 2006-03-07 22:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from hjl at gcc dot gnu dot org 2006-03-07 22:29 -------
Subject: Bug 26064
Author: hjl
Date: Tue Mar 7 22:29:32 2006
New Revision: 111821
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111821
Log:
2006-03-07 H.J. Lu <hongjiu.lu@intel.com>
PR fortran/26041
PR fortran/26064
Backport from mainline
* resolve.c (resolve_types): New function.
(resolve_codes): Likewise.
(gfc_resolve): Use them.
Modified:
branches/gcc-4_1-branch/gcc/fortran/ChangeLog
branches/gcc-4_1-branch/gcc/fortran/resolve.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/26064] 4.1 regression introduced with patch for bug 18197
2006-02-01 14:27 [Bug fortran/26064] New: 4.1 regression introduced with patch for bug 18197 sven dot buijssen at math dot uni-dortmund dot de
` (12 preceding siblings ...)
2006-03-07 22:29 ` hjl at gcc dot gnu dot org
@ 2006-03-07 22:31 ` hjl at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: hjl at gcc dot gnu dot org @ 2006-03-07 22:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from hjl at gcc dot gnu dot org 2006-03-07 22:31 -------
Subject: Bug 26064
Author: hjl
Date: Tue Mar 7 22:30:58 2006
New Revision: 111822
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111822
Log:
2006-03-07 H.J. Lu <hongjiu.lu@intel.com>
PR fortran/26041
PR fortran/26064
Backport from mainline
* gfortran.dg/sibling_dummy_procedure_1.f90: New file.
* gfortran.dg/sibling_dummy_procedure_2.f90: Likewise.
* gfortran.dg/sibling_dummy_procedure_3.f90: Likewise.
Added:
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/sibling_dummy_procedure_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/sibling_dummy_procedure_2.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/sibling_dummy_procedure_3.f90
Modified:
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26064
^ permalink raw reply [flat|nested] 15+ messages in thread