public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51302] New: ICE with VOLATILE loop variable
@ 2011-11-25 13:10 burnus at gcc dot gnu.org
  2011-11-25 14:08 ` [Bug fortran/51302] " burnus at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-25 13:10 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51302
           Summary: ICE with VOLATILE loop variable
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


The following program ICEs for me with GCC 4.4 and 4.7. It does not ICE for me
with 4.3, 4.4, 4.5 and 4.6 though I think that's because those do not have tree
checking enabled.

$ gfortran foo.f90 # << 4.7
foo.f90: In function ‘MAIN__’:
foo.f90:3:0: internal compiler error: in gfc_add_modify_loc, at
fortran/trans.c:161

That's a check whether:
  t1 = TREE_TYPE (rhs);
  t2 = TREE_TYPE (lhs);
  gcc_assert (t1 == t2
              || AGGREGATE_TYPE_P (TREE_TYPE (lhs)));

Seemingly, the problem arises as one type is volatile and the other is not,
i.e., one probably needs to add a fold_convert which strips off the volatile.
As no one may modify the loop variable in the loop, stripping off should be
perfectly valid.

integer, volatile :: i
integer :: n = 1
do i = 1, n
end do
end


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

end of thread, other threads:[~2011-11-25 15:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-25 13:10 [Bug fortran/51302] New: ICE with VOLATILE loop variable burnus at gcc dot gnu.org
2011-11-25 14:08 ` [Bug fortran/51302] " burnus at gcc dot gnu.org
2011-11-25 15:56 ` burnus at gcc dot gnu.org
2011-11-25 15:59 ` burnus at gcc dot gnu.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).