public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31218]  New: ICE on valid code with gfortran
@ 2007-03-16 11:45 jv244 at cam dot ac dot uk
  2007-03-17 15:42 ` [Bug fortran/31218] " tkoenig at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jv244 at cam dot ac dot uk @ 2007-03-16 11:45 UTC (permalink / raw)
  To: gcc-bugs

A recent gfortran ICEs on the following code:

 integer, parameter :: i=1
 real, parameter :: k=TRANSFER(i,1.0)
 integer ::  j=TRANSFER(k,i)
 character(LEN=2), parameter :: a="a "
 real, dimension(2,2), parameter :: r=1.0
 character(LEN=4) :: b=REPEAT(a,2)
 real, dimension(4) :: l=RESHAPE(r,(/4/))
 character(LEN=3) :: c=TRIM("a ")

 IF (b.NE."a a ") CALL ABORT()
 IF (ANY(l.NE.1.0)) CALL ABORT()
 IF (c.NE."a  ") CALL ABORT()
 IF (j.NE.i) CALL ABORT()
 END


-- 
           Summary: ICE on valid code with gfortran
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31218


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/31218] ICE on valid code with gfortran
  2007-03-16 11:45 [Bug fortran/31218] New: ICE on valid code with gfortran jv244 at cam dot ac dot uk
@ 2007-03-17 15:42 ` tkoenig at gcc dot gnu dot org
  2007-04-06 22:06 ` brooks at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-03-17 15:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tkoenig at gcc dot gnu dot org  2007-03-17 15:42 -------
Confirmed.


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |31237
              nThis|                            |
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-03-17 15:42:32
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31218


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/31218] ICE on valid code with gfortran
  2007-03-16 11:45 [Bug fortran/31218] New: ICE on valid code with gfortran jv244 at cam dot ac dot uk
  2007-03-17 15:42 ` [Bug fortran/31218] " tkoenig at gcc dot gnu dot org
@ 2007-04-06 22:06 ` brooks at gcc dot gnu dot org
  2007-04-16 13:15 ` tobi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-04-06 22:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from brooks at gcc dot gnu dot org  2007-04-06 23:06 -------
The following code repeats the ICE:

 character(LEN=2), parameter :: a="a "
 real, dimension(2,2), parameter :: r=1.0
 character(LEN=4) :: b=REPEAT(a,2)
 real, dimension(4) :: l=RESHAPE(r,(/4/))
 character(LEN=3) :: c=TRIM("a ")

 IF (b.NE."a a ") CALL ABORT()
 IF (ANY(l.NE.1.0)) CALL ABORT()
 IF (c.NE."a  ") CALL ABORT()
 END

This is thus not something coming from the lack of transfer constant-folding.


-- 

brooks at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brooks at gcc dot gnu dot
                   |                            |org
OtherBugsDependingO|31237                       |
              nThis|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31218


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/31218] ICE on valid code with gfortran
  2007-03-16 11:45 [Bug fortran/31218] New: ICE on valid code with gfortran jv244 at cam dot ac dot uk
  2007-03-17 15:42 ` [Bug fortran/31218] " tkoenig at gcc dot gnu dot org
  2007-04-06 22:06 ` brooks at gcc dot gnu dot org
@ 2007-04-16 13:15 ` tobi at gcc dot gnu dot org
  2007-05-04  1:48 ` jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-04-16 13:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tobi at gcc dot gnu dot org  2007-04-16 14:14 -------
Reduced testcase:
 real, dimension(1), parameter :: r=1.0
 real, dimension(1) :: s=RESHAPE(r,(/1/))

 IF (ANY(s.NE.1.0)) CALL ABORT()
 END


-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tobi at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31218


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/31218] ICE on valid code with gfortran
  2007-03-16 11:45 [Bug fortran/31218] New: ICE on valid code with gfortran jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2007-04-16 13:15 ` tobi at gcc dot gnu dot org
@ 2007-05-04  1:48 ` jvdelisle at gcc dot gnu dot org
  2007-05-04 11:31 ` fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-05-04  1:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2007-05-04 02:47 -------
The ice is happening here:

/* Create an array constructor from an initialization expression.
   We assume the frontend already did any expansions and conversions.  */

tree
gfc_conv_array_initializer (tree type, gfc_expr * expr)
{
  gfc_constructor *c;
  tree tmp;
  mpz_t maxval;
  gfc_se se;
  HOST_WIDE_INT hi;
  unsigned HOST_WIDE_INT lo;
  tree index, range;
  VEC(constructor_elt,gc) *v = NULL;
gfc_show_expr (expr);
  switch (expr->expr_type)
    {
    case EXPR_CONSTANT:
    case EXPR_STRUCTURE:

The comment indicates that the initialization expression should already be
expanded.  For the test case given, expr->expr_type is FUNCTION for which there
is no case.  The function needs to be evaluated before getting here.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31218


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/31218] ICE on valid code with gfortran
  2007-03-16 11:45 [Bug fortran/31218] New: ICE on valid code with gfortran jv244 at cam dot ac dot uk
                   ` (3 preceding siblings ...)
  2007-05-04  1:48 ` jvdelisle at gcc dot gnu dot org
@ 2007-05-04 11:31 ` fxcoudert at gcc dot gnu dot org
  2007-05-30 13:23 ` pault at gcc dot gnu dot org
  2007-06-14 12:13 ` pault at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-05-04 11:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from fxcoudert at gcc dot gnu dot org  2007-05-04 12:31 -------
RESHAPE is not simplified, because "x" has type EXPR_CONSTANT (scalar constant)
which is not accepted by the simplification routine gfc_simplify_reshape,
because it wants arguments to be EXPR_ARRAY (ie array constructor). Thus, the
following code fails to compile:
  integer, parameter :: x(1) = 1, y(1) = reshape(x,(/1/))
  print *, y
  end
while that other one works fine:
  integer, parameter :: x(1) = (/1/), y(1) = reshape(x,(/1/))
  print *, y
  end

I don't know if it's OK for x to have type EXPR_CONSTANT, but I think it is. In
that case, gfc_simplify_reshape should be modified to account for this
possibility.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org
   Last reconfirmed|2007-03-17 15:42:32         |2007-05-04 12:31:41
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31218


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/31218] ICE on valid code with gfortran
  2007-03-16 11:45 [Bug fortran/31218] New: ICE on valid code with gfortran jv244 at cam dot ac dot uk
                   ` (4 preceding siblings ...)
  2007-05-04 11:31 ` fxcoudert at gcc dot gnu dot org
@ 2007-05-30 13:23 ` pault at gcc dot gnu dot org
  2007-06-14 12:13 ` pault at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-05-30 13:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2007-05-30 13:23 -------
This seems to have fixed itself - all three testcases run fine on  4.3.0
20070525.  I'll check it out tonight on x86_ia64 and, if all is well, I'll
clear the PR.

Paul


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31218


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/31218] ICE on valid code with gfortran
  2007-03-16 11:45 [Bug fortran/31218] New: ICE on valid code with gfortran jv244 at cam dot ac dot uk
                   ` (5 preceding siblings ...)
  2007-05-30 13:23 ` pault at gcc dot gnu dot org
@ 2007-06-14 12:13 ` pault at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-06-14 12:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pault at gcc dot gnu dot org  2007-06-14 12:13 -------
As reported in comment#6, this cleared itself.

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=31218


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-06-14 12:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-16 11:45 [Bug fortran/31218] New: ICE on valid code with gfortran jv244 at cam dot ac dot uk
2007-03-17 15:42 ` [Bug fortran/31218] " tkoenig at gcc dot gnu dot org
2007-04-06 22:06 ` brooks at gcc dot gnu dot org
2007-04-16 13:15 ` tobi at gcc dot gnu dot org
2007-05-04  1:48 ` jvdelisle at gcc dot gnu dot org
2007-05-04 11:31 ` fxcoudert at gcc dot gnu dot org
2007-05-30 13:23 ` pault at gcc dot gnu dot org
2007-06-14 12:13 ` 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).