------- Comment #1 from fxcoudert at gcc dot gnu dot org  2007-01-29 21:55 
-------
What's funny is that we create the temporary well (see original dump):

  static char date[1][1:12] = {"200612231200"};
  {
    char A.2[1][1:4];
    struct array1_unknown atmp.1;

    atmp.1.dim[0].stride = 1;
    atmp.1.dim[0].lbound = 0;
    atmp.1.dim[0].ubound = 0;
    atmp.1.data = (void *) &A.2;
    atmp.1.offset = 0;

And we 
But then we don't translate the assignment well:

    {
      int4 S.3;

      S.3 = 0;
      while (1)
        {
          if (S.3 > 0) goto L.1;
          (*(char[0:][1:4] *) atmp.1.data)[S.3] = date[NON_LVALUE_EXPR
<S.3>][1]{lb: 1 sz: 1};
          S.3 = S.3 + 1;
        }
      L.1:;
    }

The above should be date[1][S.3] instead of date[S.3][1], and the S.3 loop
should have 4 elements.


PS: Slightly modified testcase that ICEs on i686-linux:

$ cat a.f90
  character(len=12) :: date(1) = (/ '200612231200' /)
  integer :: foo

  read (date(:)(1:12),'(i4)') foo
  print *, foo
  end
$ ./bin/gfortran -static a.f90 -fdump-tree-original
a.f90: In function ‘MAIN__’:
a.f90:4: internal compiler error: in operand_subword_force, at emit-rtl.c:1352


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code


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

Reply via email to