public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/22146] ICE when calling ELEMENTAL subroutines
[not found] <20050622174040.22146.erik.edelmann@iki.fi>
@ 2005-07-01 9:49 ` erik dot edelmann at iki dot fi
2005-07-28 11:50 ` erik dot edelmann at iki dot fi
1 sibling, 0 replies; 10+ messages in thread
From: erik dot edelmann at iki dot fi @ 2005-07-01 9:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From erik dot edelmann at iki dot fi 2005-07-01 09:49 -------
A discussion on the mailing list on this bug here:
http://gcc.gnu.org/ml/fortran/2005-06/msg00485.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22146
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/22146] ICE when calling ELEMENTAL subroutines
[not found] <20050622174040.22146.erik.edelmann@iki.fi>
2005-07-01 9:49 ` [Bug fortran/22146] ICE when calling ELEMENTAL subroutines erik dot edelmann at iki dot fi
@ 2005-07-28 11:50 ` erik dot edelmann at iki dot fi
1 sibling, 0 replies; 10+ messages in thread
From: erik dot edelmann at iki dot fi @ 2005-07-28 11:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From erik dot edelmann at iki dot fi 2005-07-28 11:46 -------
(In reply to comment #2)
> A discussion on the mailing list on this bug here:
> http://gcc.gnu.org/ml/fortran/2005-06/msg00485.html
Sorry about the above. That mailing list discussion is about a different bug.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22146
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/22146] ICE when calling ELEMENTAL subroutines
[not found] <bug-22146-9741@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2006-01-14 7:24 ` pault at gcc dot gnu dot org
@ 2006-01-23 16:30 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-23 16:30 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22146
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/22146] ICE when calling ELEMENTAL subroutines
[not found] <bug-22146-9741@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2006-01-14 6:31 ` pault at gcc dot gnu dot org
@ 2006-01-14 7:24 ` pault at gcc dot gnu dot org
2006-01-23 16:30 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-01-14 7:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pault at gcc dot gnu dot org 2006-01-14 07:24 -------
Fixed on mainline and 4.1 - note that argument conformity checking has still to
be done.
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22146
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/22146] ICE when calling ELEMENTAL subroutines
[not found] <bug-22146-9741@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2006-01-07 14:14 ` pault at gcc dot gnu dot org
@ 2006-01-14 6:31 ` pault at gcc dot gnu dot org
2006-01-14 7:24 ` pault at gcc dot gnu dot org
2006-01-23 16:30 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-01-14 6:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from pault at gcc dot gnu dot org 2006-01-14 06:31 -------
Subject: Bug 22146
Author: pault
Date: Sat Jan 14 06:31:08 2006
New Revision: 109698
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109698
Log:
2006-01-14 Paul Thomas <pault@gcc.gnu.org>
PR fortran/22146
* trans-array.c (gfc_reverse_ss): Remove static attribute.
(gfc_walk_elemental_function_args): Replace gfc_expr * argument for
the function call with the corresponding gfc_actual_arglist*. Change
code accordingly.
(gfc_walk_function_expr): Call to gfc_walk_elemental_function_args
now requires the actual argument list instead of the expression for
the function call.
* trans-array.h: Modify the prototype for
gfc_walk_elemental_function_args
and provide a prototype for gfc_reverse_ss.
* trans-stmt.h (gfc_trans_call): Add the scalarization code for the
case
where an elemental subroutine has array valued actual arguments.
PR fortran/25029
PR fortran/21256
PR fortran/20868
PR fortran/20870
* resolve.c (check_assumed_size_reference): New function to check for
upper
bound in assumed size array references.
(resolve_assumed_size_actual): New function to do a very restricted
scan
of actual argument expressions of those procedures for which incomplete
assumed size array references are not allowed.
(resolve_function, resolve_call): Switch off assumed size checking of
actual arguments, except for elemental procedures and intrinsic
inquiry functions, in some circumstances.
(resolve_variable): Call check_assumed_size_reference.
2006-01-14 Paul Thomas <pault@gcc.gnu.org>
PR fortran/22146
* gfortran.dg/elemental_subroutine_1.f90: New test.
* gfortran.dg/elemental_subroutine_2.f90: New test.
PR fortran/25029
PR fortran/21256
* gfortran.dg/assumed_size_refs_1.f90: New test.
PR fortran/20868
PR fortran/20870
* gfortran.dg/assumed_size_refs_2.f90: New test.
* gfortran.dg/initialization_1.f90: Change warning message.
* gfortran.dg/pr15140.f90: Add bound to assumed size reference.
Added:
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/assumed_size_refs_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/assumed_size_refs_2.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/elemental_subroutine_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/elemental_subroutine_2.f90
Modified:
branches/gcc-4_1-branch/MAINTAINERS
branches/gcc-4_1-branch/gcc/fortran/ChangeLog
branches/gcc-4_1-branch/gcc/fortran/resolve.c
branches/gcc-4_1-branch/gcc/fortran/trans-array.c
branches/gcc-4_1-branch/gcc/fortran/trans-array.h
branches/gcc-4_1-branch/gcc/fortran/trans-intrinsic.c
branches/gcc-4_1-branch/gcc/fortran/trans-stmt.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/initialization_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/pr15140.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22146
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/22146] ICE when calling ELEMENTAL subroutines
[not found] <bug-22146-9741@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2006-01-06 13:40 ` pinskia at gcc dot gnu dot org
@ 2006-01-07 14:14 ` pault at gcc dot gnu dot org
2006-01-14 6:31 ` pault at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-01-07 14:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pault at gcc dot gnu dot org 2006-01-07 14:14 -------
Subject: Bug 22146
Author: pault
Date: Sat Jan 7 14:14:08 2006
New Revision: 109449
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109449
Log:
2006-01-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/22146
* trans-array.c (gfc_reverse_ss): Remove static attribute.
(gfc_walk_elemental_function_args): Replace gfc_expr * argument for
the function call with the corresponding gfc_actual_arglist*. Change
code accordingly.
(gfc_walk_function_expr): Call to gfc_walk_elemental_function_args
now requires the actual argument list instead of the expression for
the function call.
* trans-array.h: Modify the prototype for
gfc_walk_elemental_function_args
and provide a prototype for gfc_reverse_ss.
* trans-stmt.h (gfc_trans_call): Add the scalarization code for the
case
where an elemental subroutine has array valued actual arguments.
PR fortran/25029
PR fortran/21256
PR fortran/20868
PR fortran/20870
* resolve.c (check_assumed_size_reference): New function to check for
upper
bound in assumed size array references.
(resolve_assumed_size_actual): New function to do a very restricted
scan
of actual argument expressions of those procedures for which incomplete
assumed size array references are not allowed.
(resolve_function, resolve_call): Switch off assumed size checking of
actual arguments, except for elemental procedures and intrinsic
inquiry functions, in some circumstances.
(resolve_variable): Call check_assumed_size_reference.
2006-01-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/22146
* gfortran.dg/elemental_subroutine_1.f90: New test.
* gfortran.dg/elemental_subroutine_2.f90: New test.
PR fortran/25029
PR fortran/21256
* gfortran.dg/assumed_size_refs_1.f90: New test.
PR fortran/20868
PR fortran/20870
* gfortran.dg/assumed_size_refs_2.f90: New test.
* gfortran.dg/initialization_1.f90: Change warning message.
Added:
trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_1.f90 (with props)
trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_2.f90 (with props)
trunk/gcc/testsuite/gfortran.dg/elemental_subroutine_1.f90
trunk/gcc/testsuite/gfortran.dg/elemental_subroutine_2.f90
Modified:
trunk/MAINTAINERS
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/fortran/trans-array.c
trunk/gcc/fortran/trans-array.h
trunk/gcc/fortran/trans-intrinsic.c
trunk/gcc/fortran/trans-stmt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/initialization_1.f90
Added: trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_1.f90
URL:
http://gcc.gnu.org/viewcvs/trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_1.f90?root=gcc&view=auto&rev=109449
==============================================================================
--- trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_1.f90 (added)
+++ trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_1.f90 Sat Jan 7 14:14:08
2006
@@ -1,0 +1,64 @@
+!==================assumed_size_refs_1.f90==================
+! { dg-do compile }
+! Test the fix for PR25029, PR21256 in which references to
+! assumed size arrays without an upper bound to the last
+! dimension were generating no error. The first version of
+! the patch failed in DHSEQR, as pointed out by Toon Moene
+! in http://gcc.gnu.org/ml/fortran/2005-12/msg00466.html
+!
+! Contributed by Paul Thomas <pault@gcc.gnu.org>
+!
+program assumed_size_test_1
+ implicit none
+ real a(2, 4)
+
+ a = 1.0
+ call foo (a)
+
+contains
+ subroutine foo(m)
+ real, target :: m(1:2, *)
+ real x(2,2,2)
+ real, external :: bar
+ real, pointer :: p(:,:), q(:,:)
+ allocate (q(2,2))
+
+! PR25029
+ p => m ! { dg-error "upper bound in the last
dimension" }
+ q = m ! { dg-error "upper bound in the last
dimension" }
+
+! PR21256( and PR25060)
+ m = 1 ! { dg-error "upper bound in the last
dimension" }
+
+ m(1,1) = 2.0
+ x = bar (m)
+ x = fcn (m) ! { dg-error "upper bound in the last
dimension" }
+ m(:, 1:2) = fcn (q)
+ call sub (m, x) ! { dg-error "upper bound in the last
dimension" }
+ call sub (m(1:2, 1:2), x)
+ print *, p
+
+ call DHSEQR(x)
+
+ end subroutine foo
+
+ elemental function fcn (a) result (b)
+ real, intent(in) :: a
+ real :: b
+ b = 2.0 * a
+ end function fcn
+
+ elemental subroutine sub (a, b)
+ real, intent(inout) :: a, b
+ b = 2.0 * a
+ end subroutine sub
+
+ SUBROUTINE DHSEQR( WORK )
+ REAL WORK( * )
+ EXTERNAL DLARFX
+ INTRINSIC MIN
+ WORK( 1 ) = 1.0
+ CALL DLARFX( MIN( 1, 8 ), WORK )
+ END SUBROUTINE DHSEQR
+
+end program assumed_size_test_1
Propchange: trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_1.f90
('svn:executable' added)
Added: trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_2.f90
URL:
http://gcc.gnu.org/viewcvs/trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_2.f90?root=gcc&view=auto&rev=109449
==============================================================================
--- trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_2.f90 (added)
+++ trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_2.f90 Sat Jan 7 14:14:08
2006
@@ -1,0 +1,44 @@
+!==================assumed_size_refs_1.f90==================
+! { dg-do compile }
+! Test the fix for PR20868 & PR20870 in which references to
+! assumed size arrays without an upper bound to the last
+! dimension were generating no error.
+!
+! Contributed by Paul Thomas <pault@gcc.gnu.org>
+!
+program assumed_size_test_2
+ implicit none
+ real a(2, 4)
+
+ a = 1.0
+ call foo (a)
+
+contains
+ subroutine foo(m)
+ real, target :: m(1:2, *)
+ real x(2,2,2)
+ real, pointer :: q(:,:)
+ integer :: i
+ allocate (q(2,2))
+
+ q = cos (1.0 + abs(m)) ! { dg-error "upper bound in the last
dimension" }
+
+ x = reshape (m, (/2,2,2/)) ! { dg-error "upper bound in the last
dimension" }
+
+! PR20868
+ print *, ubound (m) ! { dg-error "upper bound in the last
dimension" }
+ print *, lbound (m)
+
+! PR20870
+ print *, size (m) ! { dg-error "upper bound in the last
dimension" }
+
+! Check non-array valued intrinsics
+ print *, ubound (m, 1)
+ print *, ubound (m, 2) ! { dg-error "not a valid dimension index" }
+
+ i = 2
+ print *, size (m, i)
+
+ end subroutine foo
+
+end program assumed_size_test_2
Propchange: trunk/gcc/testsuite/gfortran.dg/assumed_size_refs_2.f90
('svn:executable' added)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22146
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/22146] ICE when calling ELEMENTAL subroutines
[not found] <bug-22146-9741@http.gcc.gnu.org/bugzilla/>
2005-11-22 12:40 ` eedelman at gcc dot gnu dot org
2006-01-02 3:31 ` pinskia at gcc dot gnu dot org
@ 2006-01-06 13:40 ` pinskia at gcc dot gnu dot org
2006-01-07 14:14 ` pault at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-06 13:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2006-01-06 13:40 -------
*** Bug 25691 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |Heiko dot Klein at gmx dot
| |net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22146
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/22146] ICE when calling ELEMENTAL subroutines
[not found] <bug-22146-9741@http.gcc.gnu.org/bugzilla/>
2005-11-22 12:40 ` eedelman at gcc dot gnu dot org
@ 2006-01-02 3:31 ` pinskia at gcc dot gnu dot org
2006-01-06 13:40 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-02 3:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2006-01-02 03:31 -------
formal->sym->as is null in:
1606 f = (formal != NULL)
1607 && !formal->sym->attr.pointer
1608 && formal->sym->as->type != AS_ASSUMED_SHAPE;
1609 f = f || !sym->attr.always_explicit;
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2005-11-03 19:58:08 |2006-01-02 03:31:21
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22146
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/22146] ICE when calling ELEMENTAL subroutines
[not found] <bug-22146-9741@http.gcc.gnu.org/bugzilla/>
@ 2005-11-22 12:40 ` eedelman at gcc dot gnu dot org
2006-01-02 3:31 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: eedelman at gcc dot gnu dot org @ 2005-11-22 12:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from eedelman at gcc dot gnu dot org 2005-11-22 12:40 -------
*** Bug 24966 has been marked as a duplicate of this bug. ***
--
eedelman at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |schnetter at aei dot mpg dot
| |de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22146
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/22146] ICE when calling ELEMENTAL subroutines
2005-06-22 17:40 [Bug fortran/22146] New: " eedelman at acclab dot helsinki dot fi
@ 2005-06-22 17:52 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-22 17:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-22 17:52 -------
Confirmed. here is the backtrace:
#0 0x080a7931 in gfc_conv_function_call (se=0xbfe81c08, sym=0xa52cf80, arg=0xa52d5b8)
at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/trans-expr.c:1287
#1 0x080b5842 in gfc_trans_call (code=0xa52d760) at /home/peshtigo/pinskia/src/gnu/gcc/src/
gcc/fortran/trans-stmt.c:217
#2 0x08096c88 in gfc_trans_code (code=0xa52d760) at /home/peshtigo/pinskia/src/gnu/gcc/src/
gcc/fortran/trans.c:533
#3 0x080a64a8 in gfc_generate_function_code (ns=0xa52d1c8) at /home/peshtigo/pinskia/src/gnu/
gcc/src/gcc/fortran/trans-decl.c:2358
#4 0x08096fb2 in gfc_generate_module_code (ns=0xa52c858) at /home/peshtigo/pinskia/src/gnu/
gcc/src/gcc/fortran/trans.c:706
#5 0x0807cc76 in gfc_parse_file () at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/parse.c:
2629
#6 0x08094085 in gfc_be_parse_file (set_yydebug=0) at /home/peshtigo/pinskia/src/gnu/gcc/src/
gcc/fortran/f95-lang.c:263
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-06-22 17:52:52
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22146
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-01-23 16:30 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20050622174040.22146.erik.edelmann@iki.fi>
2005-07-01 9:49 ` [Bug fortran/22146] ICE when calling ELEMENTAL subroutines erik dot edelmann at iki dot fi
2005-07-28 11:50 ` erik dot edelmann at iki dot fi
[not found] <bug-22146-9741@http.gcc.gnu.org/bugzilla/>
2005-11-22 12:40 ` eedelman at gcc dot gnu dot org
2006-01-02 3:31 ` pinskia at gcc dot gnu dot org
2006-01-06 13:40 ` pinskia at gcc dot gnu dot org
2006-01-07 14:14 ` pault at gcc dot gnu dot org
2006-01-14 6:31 ` pault at gcc dot gnu dot org
2006-01-14 7:24 ` pault at gcc dot gnu dot org
2006-01-23 16:30 ` pinskia at gcc dot gnu dot org
2005-06-22 17:40 [Bug fortran/22146] New: " eedelman at acclab dot helsinki dot fi
2005-06-22 17:52 ` [Bug fortran/22146] " pinskia 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).