public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30284]  New: ICE in gfc_add_modify, at fortran/trans.c:159
@ 2006-12-23 21:22 anlauf at gmx dot de
  2006-12-24  5:25 ` [Bug fortran/30284] ICE in gfc_add_modify with internal reads pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: anlauf at gmx dot de @ 2006-12-23 21:22 UTC (permalink / raw)
  To: gcc-bugs

Hi,

here's another one:

% cat gfcbug51.f90
program gfcbug51
  implicit none

  type date_t
     character(len=12) :: date = '200612231200' ! yyyymmddhhmm
  end type date_t
  type year_t
    integer :: year = 0
  end type year_t

  type(date_t) :: file(1)
  type(year_t) :: time(1)

  read (file% date(1:4),'(i4)')  time% year
  print *, time% year
end program gfcbug51
% gfc gfcbug51.f90
gfcbug51.f90: In function 'MAIN__':
gfcbug51.f90:1: internal compiler error: in gfc_add_modify, at
fortran/trans.c:1
59

Cheers,
-ha


-- 
           Summary: ICE in gfc_add_modify, at fortran/trans.c:159
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anlauf at gmx dot de
  GCC host triplet: i686-pc-linux-gnu


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


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

* [Bug fortran/30284] ICE in gfc_add_modify with internal reads
  2006-12-23 21:22 [Bug fortran/30284] New: ICE in gfc_add_modify, at fortran/trans.c:159 anlauf at gmx dot de
@ 2006-12-24  5:25 ` pinskia at gcc dot gnu dot org
  2006-12-24 17:52 ` kargl at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-24  5:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-12-24 05:25 -------
Reduced testcase:
program gfcbug51
  type date_t
     character(len=12) :: date
  end type date_t
  type(date_t) :: file(1)
  read (file%date(1:4),'(i4)') a
end program gfcbug51
------------------------------
Here is a patch which fixes the issue too:
Index: trans-io.c
===================================================================
--- trans-io.c  (revision 120165)
+++ trans-io.c  (working copy)
@@ -635,7 +635,7 @@ set_internal_unit (stmtblock_t * block,
   /* The cast is needed for character substrings and the descriptor
      data.  */
   gfc_add_modify_expr (&se.pre, io, fold_convert (TREE_TYPE (io), tmp));
-  gfc_add_modify_expr (&se.pre, len, se.string_length);
+  gfc_add_modify_expr (&se.pre, len, fold_convert (TREE_TYPE (len),
se.string_length));
   gfc_add_modify_expr (&se.pre, desc, se.expr);

   gfc_add_block_to_block (block, &se.pre);


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2006-12-24 05:25:13
               date|                            |
            Summary|ICE in gfc_add_modify, at   |ICE in gfc_add_modify with
                   |fortran/trans.c:159         |internal reads


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


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

* [Bug fortran/30284] ICE in gfc_add_modify with internal reads
  2006-12-23 21:22 [Bug fortran/30284] New: ICE in gfc_add_modify, at fortran/trans.c:159 anlauf at gmx dot de
  2006-12-24  5:25 ` [Bug fortran/30284] ICE in gfc_add_modify with internal reads pinskia at gcc dot gnu dot org
@ 2006-12-24 17:52 ` kargl at gcc dot gnu dot org
  2006-12-27  2:33 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: kargl at gcc dot gnu dot org @ 2006-12-24 17:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from kargl at gcc dot gnu dot org  2006-12-24 17:52 -------
(In reply to comment #1)
>
> Here is a patch which fixes the issue too:
> Index: trans-io.c
> 

The patch moves the ICE to eimt-rtl.c.

laptop:kargl[218] gfc4x -o z -fdump-tree-original -O internal_io.f90
internal_io.f90: In function 'MAIN__':
internal_io.f90:8: internal compiler error: in operand_subword_force, at
emit-rtl.c:1352

The dump suggest that a temporary array has not been properly sized.


-- 


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


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

* [Bug fortran/30284] ICE in gfc_add_modify with internal reads
  2006-12-23 21:22 [Bug fortran/30284] New: ICE in gfc_add_modify, at fortran/trans.c:159 anlauf at gmx dot de
  2006-12-24  5:25 ` [Bug fortran/30284] ICE in gfc_add_modify with internal reads pinskia at gcc dot gnu dot org
  2006-12-24 17:52 ` kargl at gcc dot gnu dot org
@ 2006-12-27  2:33 ` pinskia at gcc dot gnu dot org
  2007-02-01 10:19 ` pault at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-27  2:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-12-27 02:32 -------
(In reply to comment #2)
> The dump suggest that a temporary array has not been properly sized.

We get:
  char[0:][1:12] * D.972;


{
      int4 S.3;

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


So yes we have the incorrect type for the temp array, we have char[1:12]
instead of just char.

So my patch fixes one problem and we run into the next issue.


-- 


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


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

* [Bug fortran/30284] ICE in gfc_add_modify with internal reads
  2006-12-23 21:22 [Bug fortran/30284] New: ICE in gfc_add_modify, at fortran/trans.c:159 anlauf at gmx dot de
                   ` (2 preceding siblings ...)
  2006-12-27  2:33 ` pinskia at gcc dot gnu dot org
@ 2007-02-01 10:19 ` pault at gcc dot gnu dot org
  2007-02-01 22:46 ` patchapp at dberlin dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-02-01 10:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2007-02-01 10:19 -------
A fix is on its way, this weekend.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-12-24 05:25:13         |2007-02-01 10:19:09
               date|                            |


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


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

* [Bug fortran/30284] ICE in gfc_add_modify with internal reads
  2006-12-23 21:22 [Bug fortran/30284] New: ICE in gfc_add_modify, at fortran/trans.c:159 anlauf at gmx dot de
                   ` (3 preceding siblings ...)
  2007-02-01 10:19 ` pault at gcc dot gnu dot org
@ 2007-02-01 22:46 ` patchapp at dberlin dot org
  2007-02-02 12:36 ` pault at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: patchapp at dberlin dot org @ 2007-02-01 22:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from patchapp at dberlin dot org  2007-02-01 22:45 -------
Subject: Bug number PR30284

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-02/msg00112.html


-- 


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


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

* [Bug fortran/30284] ICE in gfc_add_modify with internal reads
  2006-12-23 21:22 [Bug fortran/30284] New: ICE in gfc_add_modify, at fortran/trans.c:159 anlauf at gmx dot de
                   ` (4 preceding siblings ...)
  2007-02-01 22:46 ` patchapp at dberlin dot org
@ 2007-02-02 12:36 ` pault at gcc dot gnu dot org
  2007-02-12  7:35 ` [Bug fortran/30284] [4.2 and 4.1 only] " pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-02-02 12:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2007-02-02 12:36 -------
Subject: Bug 30284

Author: pault
Date: Fri Feb  2 12:35:57 2007
New Revision: 121500

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121500
Log:
2007-02-02  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/30284
        PR fortran/30626
        * trans-expr.c (gfc_conv_aliased_arg): Remove static attribute
        from function and make sure that substring lengths are
        translated.
        (is_aliased_array): Remove static attribute.
        * trans.c : Add prototypes for gfc_conv_aliased_arg and
        is_aliased_array.
        * trans-io.c (set_internal_unit): Add the post block to the
        arguments of the function.  Use is_aliased_array to check if
        temporary is needed; if so call gfc_conv_aliased_arg.
        (build_dt): Pass the post block to set_internal_unit and
        add to the block after all io activiy is done.

2007-02-02  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/30284
        PR fortran/30626
        * io/transfer.c (init_loop_spec, next_array_record): Change to
        lbound rather than unity base.

2007-02-02  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/30284
        * gfortran.dg/arrayio_11.f90.f90: New test.

        PR fortran/30626
        * gfortran.dg/arrayio_12.f90.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/arrayio_11.f90
    trunk/gcc/testsuite/gfortran.dg/arrayio_12.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/fortran/trans-io.c
    trunk/gcc/fortran/trans.h
    trunk/gcc/testsuite/ChangeLog
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/transfer.c


-- 


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


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

* [Bug fortran/30284] [4.2 and 4.1 only] ICE in gfc_add_modify with internal reads
  2006-12-23 21:22 [Bug fortran/30284] New: ICE in gfc_add_modify, at fortran/trans.c:159 anlauf at gmx dot de
                   ` (5 preceding siblings ...)
  2007-02-02 12:36 ` pault at gcc dot gnu dot org
@ 2007-02-12  7:35 ` pault at gcc dot gnu dot org
  2007-02-12  7:36 ` [Bug fortran/30284] [4.1 " pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-02-12  7:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pault at gcc dot gnu dot org  2007-02-12 07:35 -------
Subject: Bug 30284

Author: pault
Date: Mon Feb 12 07:34:51 2007
New Revision: 121841

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121841
Log:
2007-02-12  Paul Thomas  <pault@gcc.gnu.org>

        BACKPORTS FROM TRUNK

        PR fortran/30284
        PR fortran/30626
        * trans-expr.c (gfc_conv_aliased_arg): Remove static attribute
        from function and make sure that substring lengths are
        translated.
        (is_aliased_array): Remove static attribute.
        * trans.c : Add prototypes for gfc_conv_aliased_arg and
        is_aliased_array.
        * trans-io.c (set_internal_unit): Add the post block to the
        arguments of the function.  Use is_aliased_array to check if
        temporary is needed; if so call gfc_conv_aliased_arg.
        (build_dt): Pass the post block to set_internal_unit and
        add to the block after all io activiy is done.

        PR fortran/30407
        * trans-expr.c (gfc_conv_operator_assign): New function.
        * trans.h : Add prototype for gfc_conv_operator_assign.
        * trans-stmt.c (gfc_trans_where_assign): Add a gfc_symbol for
        a potential operator assignment subroutine.  If it is non-NULL
        call gfc_conv_operator_assign instead of the first assignment.
        ( gfc_trans_where_2): In the case of an operator assignment,
        extract the argument expressions from the code for the
        subroutine call and pass the symbol to gfc_trans_where_assign.
        resolve.c (resolve_where, gfc_resolve_where_code_in_forall,
        gfc_resolve_forall_body): Resolve the subroutine call for
        operator assignments.

        PR fortran/30514
        * array.c (match_array_element_spec): If the length of an array is
        negative, adjust the upper limit to make it zero length.

2007-02-12  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/30284
        * gfortran.dg/arrayio_11.f90: New test.

        PR fortran/30626
        * gfortran.dg/arrayio_12.f90: New test.

        PR fortran/30407
        * gfortran.dg/where_operator_assign_1.f90: New test.
        * gfortran.dg/where_operator_assign_2.f90: New test.
        * gfortran.dg/where_operator_assign_3.f90: New test.

        PR fortran/30514
        * gfortran.dg/zero_sized_2.f90: New test.

2007-02-12  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/30284
        PR fortran/30626
        * io/transfer.c (init_loop_spec, next_array_record): Change to
        lbound rather than unity base.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/arrayio_11.f90
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/arrayio_12.f90
   
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/where_operator_assign_1.f90
   
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/where_operator_assign_2.f90
   
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/where_operator_assign_3.f90
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/zero_sized_2.f90
Modified:
    branches/gcc-4_2-branch/gcc/fortran/ChangeLog
    branches/gcc-4_2-branch/gcc/fortran/array.c
    branches/gcc-4_2-branch/gcc/fortran/resolve.c
    branches/gcc-4_2-branch/gcc/fortran/trans-expr.c
    branches/gcc-4_2-branch/gcc/fortran/trans-io.c
    branches/gcc-4_2-branch/gcc/fortran/trans-stmt.c
    branches/gcc-4_2-branch/gcc/fortran/trans.h
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_2-branch/libgfortran/ChangeLog
    branches/gcc-4_2-branch/libgfortran/io/transfer.c


-- 


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


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

* [Bug fortran/30284] [4.1 only] ICE in gfc_add_modify with internal reads
  2006-12-23 21:22 [Bug fortran/30284] New: ICE in gfc_add_modify, at fortran/trans.c:159 anlauf at gmx dot de
                   ` (6 preceding siblings ...)
  2007-02-12  7:35 ` [Bug fortran/30284] [4.2 and 4.1 only] " pault at gcc dot gnu dot org
@ 2007-02-12  7:36 ` pault at gcc dot gnu dot org
  2007-06-30 13:08 ` pault at gcc dot gnu dot org
  2007-06-30 13:09 ` pault at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-02-12  7:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pault at gcc dot gnu dot org  2007-02-12 07:36 -------
Fixed on trunk and 4.2.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
            Summary|[4.2 and 4.1 only] ICE in   |[4.1 only] ICE in
                   |gfc_add_modify with internal|gfc_add_modify with internal
                   |reads                       |reads


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


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

* [Bug fortran/30284] [4.1 only] ICE in gfc_add_modify with internal reads
  2006-12-23 21:22 [Bug fortran/30284] New: ICE in gfc_add_modify, at fortran/trans.c:159 anlauf at gmx dot de
                   ` (7 preceding siblings ...)
  2007-02-12  7:36 ` [Bug fortran/30284] [4.1 " pault at gcc dot gnu dot org
@ 2007-06-30 13:08 ` pault at gcc dot gnu dot org
  2007-06-30 13:09 ` pault at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-06-30 13:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pault at gcc dot gnu dot org  2007-06-30 13:08 -------
Subject: Bug 30284

Author: pault
Date: Sat Jun 30 13:08:19 2007
New Revision: 126147

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126147
Log:
2007-06-30  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/32472
        * simplify.c (gfc_simplify_repeat): Add handling of character
        literal for first argument.

2007-06-30  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/30284
        * gfortran.dg/repeat_f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/repeat_5.f90
Modified:
    trunk/gcc/fortran/simplify.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/30284] [4.1 only] ICE in gfc_add_modify with internal reads
  2006-12-23 21:22 [Bug fortran/30284] New: ICE in gfc_add_modify, at fortran/trans.c:159 anlauf at gmx dot de
                   ` (8 preceding siblings ...)
  2007-06-30 13:08 ` pault at gcc dot gnu dot org
@ 2007-06-30 13:09 ` pault at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-06-30 13:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pault at gcc dot gnu dot org  2007-06-30 13:09 -------
Subject: Bug 30284

Author: pault
Date: Sat Jun 30 13:09:14 2007
New Revision: 126148

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126148
Log:
2007-06-30  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/32472
        * simplify.c (gfc_simplify_repeat): Add handling of character
        literal for first argument.

2007-06-30  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/30284
        * gfortran.dg/repeat_f90: New test.

Modified:
    trunk/gcc/fortran/ChangeLog


-- 


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


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

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

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-23 21:22 [Bug fortran/30284] New: ICE in gfc_add_modify, at fortran/trans.c:159 anlauf at gmx dot de
2006-12-24  5:25 ` [Bug fortran/30284] ICE in gfc_add_modify with internal reads pinskia at gcc dot gnu dot org
2006-12-24 17:52 ` kargl at gcc dot gnu dot org
2006-12-27  2:33 ` pinskia at gcc dot gnu dot org
2007-02-01 10:19 ` pault at gcc dot gnu dot org
2007-02-01 22:46 ` patchapp at dberlin dot org
2007-02-02 12:36 ` pault at gcc dot gnu dot org
2007-02-12  7:35 ` [Bug fortran/30284] [4.2 and 4.1 only] " pault at gcc dot gnu dot org
2007-02-12  7:36 ` [Bug fortran/30284] [4.1 " pault at gcc dot gnu dot org
2007-06-30 13:08 ` pault at gcc dot gnu dot org
2007-06-30 13:09 ` 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).