First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 12366
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: tcc@sentex.net
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 12366 depends on: Show dependency tree
Show dependency graph
Bug 12366 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2005-06-28 01:19 Opened: 2003-09-22 13:15
This bug was encountered using the precompiled biaries recently uploaded to
Sourceforge. "Internal compiler error" occurs in following code:

program testg
real, dimension(5) :: a
real, dimension(3) :: b
a=(/ 1.5,2.1,3.2,4.6,5.3 /)
b=a((/ 2,3,1 /))  !fails
print *, b
end

------- Comment #1 From Toon Moene 2003-09-26 05:59 -------
Confirmed with tree-ssa gfortran 20030925:

f951: ../../gcc/gcc/fortran/trans-array.c:1076: gfc_conv_ss_descriptor:
Assertion ss->expr->expr_type == EXPR_VARIABLE failed.
12366.f95: In function `MAIN__':

12366.f95:5: internal compiler error: Aborted.

Toon Moene

------- Comment #2 From Tobias Schlüter 2004-04-22 11:23 -------
The current tree seems to ignore the assignment which failed before. I'll see
if
I can find out what's happening. Compiler output below:

[tobi@marktplatz src]$ gcc/build/gcc/f951 testg.f90 -fdump-parse-tree

        Namespace: A-H: (REAL 4) I-N: (INTEGER 4) O-Z: (REAL 4)
        symtree: a  Ambig 0
        symbol a (REAL 4)(VARIABLE UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC
DIMENSION)
        Array spec:(1 AS_EXPLICIT 1 5 )

        symtree: b  Ambig 0
        symbol b (REAL 4)(VARIABLE UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC
DIMENSION)
        Array spec:(1 AS_EXPLICIT 1 3 )

        symtree: testg  Ambig 0
        symbol testg (UNKNOWN 0)(PROGRAM UNKNOWN-INTENT UNKNOWN-ACCESS
UNKNOWN-PROC)


      ASSIGN a(FULL) (/ 0.15e1 , 0.21e1 , 0.32e1 , 0.46e1 , 0.53e1 /)
      WRITE UNIT=6 FMT=-1
      TRANSFER b(FULL)
      DT_END

 MAIN__

Execution times (seconds)
 life analysis         :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 (20%) wall
 parser                :   0.01 (20%) usr   0.00 ( 0%) sys   0.01 (20%) wall
 expand                :   0.01 (20%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
 TOTAL                 :   0.05             0.00             0.05
Extra diagnostic checks enabled; compiler may run slowly.
Configure with --disable-checking to disable checks.
[tobi@marktplatz src]$

------- Comment #3 From Tobias Schlüter 2004-05-05 16:25 -------
(In reply to comment #2)
> The current tree seems to ignore the assignment which failed before. I'll see if
Looks like I had messed up the testcase. Seems like even cut'n'paste ain't
foolproof.

What is happening is this:
[tobi@marktplatz tests]$ gfortran pr12366.f90 -fdump-parse-tree

        Namespace: A-H: (REAL 4) I-N: (INTEGER 4) O-Z: (REAL 4)
        symtree: a  Ambig 0
        symbol a (REAL 4)(VARIABLE UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC
DIMENSION)
        Array spec:(1 AS_EXPLICIT 1 5 )
 
        symtree: b  Ambig 0
        symbol b (REAL 4)(VARIABLE UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC
DIMENSION)
        Array spec:(1 AS_EXPLICIT 1 3 )
 
        symtree: testg  Ambig 0
        symbol testg (UNKNOWN 0)(PROGRAM UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC)
 
 
      ASSIGN a(FULL) (/ 0.15e1 , 0.21e1 , 0.32e1 , 0.46e1 , 0.53e1 /)
      ASSIGN b(FULL) a((/ 2 , 3 , 1 /):)
      WRITE UNIT=6 FMT=-1
      TRANSFER b(FULL)
      DT_END
 
f951: ../../gcc/gcc/fortran/trans-array.c:1067: gfc_conv_ss_descriptor:
Assertion `ss->expr->expr_type == EXPR_VARIABLE' failed.
pr12366.f90: In function `MAIN__':
pr12366.f90:5: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
[tobi@marktplatz tests]$

Note the assignment to b:
      ASSIGN b(FULL) a((/ 2 , 3 , 1 /):)
                                      ^ this is probably our bug

An array index of the form (/.../) should not be matched as an open-ended range.
(It could also be that the parse-tree dumper is at fault, and the problem is
somewhere else.) I'll see if can cook up a patch.

------- Comment #4 From Tobias Schlüter 2004-05-05 16:57 -------
(In reply to comment #3)
> Note the assignment to b:
>       ASSIGN b(FULL) a((/ 2 , 3 , 1 /):)
>                                       ^ this is probably our bug
> 
> An array index of the form (/.../) should not be matched as an open-ended range.
> (It could also be that the parse-tree dumper is at fault, and the problem is
> somewhere else.) I'll see if can cook up a patch.

That was the result of an omission in the dumper. So no, I can't cook up a patch.

------- Comment #5 From Andrew Pinski 2004-06-13 09:06 -------
*** Bug 15961 has been marked as a duplicate of this bug. ***

------- Comment #6 From Andrew Pinski 2004-10-05 18:08 -------
*** Bug 17847 has been marked as a duplicate of this bug. ***

------- Comment #7 From Andrew Pinski 2004-10-08 21:36 -------
*** Bug 17899 has been marked as a duplicate of this bug. ***

------- Comment #8 From Andrew Pinski 2004-11-08 18:11 -------
*** Bug 18379 has been marked as a duplicate of this bug. ***

------- Comment #9 From Paul Thomas 2004-12-10 09:54 -------
For what it is worth:

program testg
real, dimension(5) :: a=(/ 1.5,2.1,3.2,4.6,5.3 /)
integer,dimension(3) :: i
i=(/ 2,3,1 /)
print *, a((/ 2,3,1 /))       ! ICEs
! print *, a(i)                               !works fine
end

------- Comment #10 From Thomas Koenig 2004-12-13 13:52 -------
*** Bug 18955 has been marked as a duplicate of this bug. ***

------- Comment #11 From Andrew Pinski 2005-03-26 22:02 -------
*** Bug 20651 has been marked as a duplicate of this bug. ***

------- Comment #12 From Andrew Pinski 2005-03-29 15:38 -------
*** Bug 20686 has been marked as a duplicate of this bug. ***

------- Comment #13 From Andrew Pinski 2005-09-18 05:06 -------
Fixed for 4.1.0 and above.  I did not try 4.0.2 though.

------- Comment #14 From Thomas Koenig 2005-09-18 09:51 -------
This is not fixed in 4.0.2:

$ cat pr12366.f90
program testg
  real, dimension(5) :: a=(/ 1.5,2.1,3.2,4.6,5.3 /)
  integer,dimension(3) :: i
  i=(/ 2,3,1 /)
  print *, a((/ 2,3,1 /))       ! ICEs
  ! print *, a(i)                               !works fine
end program testg
$ gfortran pr12366.f90
pr12366.f90: In function 'MAIN__':
pr12366.f90:5: internal compiler error: in gfc_conv_ss_descriptor, at
fortran/trans-array.c:1235
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0/configure --prefix=/home/ig25
--enable-languages=c,fortran
Thread model: posix
gcc version 4.0.2 20050917 (prerelease)

------- Comment #15 From Andrew Pinski 2005-09-18 20:27 -------
All of these are fixed in 4.1.0. Since 4.0.2 is the last 4.0 release before a
4.1.0 release will be made, 
4.0.2 and 4.0.1 were special releases for gfrotran.  4.0.3 should be a normal
release for GCC and 
gfortran in that regressions are the only changes.

First Last Prev Next    No search results available      Search page      Enter new bug