public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jjcogliati-r1 at yahoo dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/42665] Internal compiler exception in with gfortran when using  -fwhole-program -flto -fopenmp
Date: Tue, 12 Jan 2010 21:14:00 -0000	[thread overview]
Message-ID: <20100112211409.5073.qmail@sourceware.org> (raw)
In-Reply-To: <bug-42665-12362@http.gcc.gnu.org/bugzilla/>



------- Comment #12 from jjcogliati-r1 at yahoo dot com  2010-01-12 21:14 -------
(In reply to comment #10)
> Subject: Re:  Internal compiler exception in with gfortran
>  when using  -fwhole-program -flto -fopenmp
> 
> On Mon, 11 Jan 2010, jjcogliati-r1 at yahoo dot com wrote:
> 
> > 
> > 
> > ------- Comment #9 from jjcogliati-r1 at yahoo dot com  2010-01-11 17:15 -------
> > My hunch, (and I could be wrong since my knowledge of gcc's tree code was zero
> > as of Friday morning) is that it is trying to find the array's min and max
> > size, but that only the min location is available, and that the max value is
> > undefined.  Since this is fortran code, there are a number of places that I do
> > that.  Is that plausible, and if so, how would I check this hunch?
> 
> It should never be error_mark_node ...
> 
> > Getting permission for me to get you the full code would involve a lot of
> > bureaucracy (weeks to months).  
> 
> Oh, I see ...
> 
> You could try putting an assert in 
> lto-streamer-out.c:lto_output_ts_type_tree_pointers so that
> the TYPE_MIN/MAXVAL are not error_mark_node.
> 
> That would point you to the file and function.
> 
> Richard.
> 

That did the trick.  Thank you.  

Added lto-streamer-out.c:lto_output_ts_type_tree_pointers:
  else if (TREE_CODE (expr) == ARRAY_TYPE) {
+    gcc_assert(TYPE_MAX_VALUE (TYPE_DOMAIN (expr) ) == NULL || 
+              TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (expr) )) != ERROR_MARK
);
    lto_output_tree_or_ref (ob, TYPE_DOMAIN (expr), ref_p);
  }


I can now trigger the original ice with the following valid (I think) code:
!list_use.f90
program list_use
  use list_test
  implicit none

  integer, dimension(10) :: a_list

  a_list = 1
  call loop_list(a_list)
end program list_use

!list_test.f90
module list_test
  !$ use omp_lib
  implicit none

contains

  subroutine loop_list(list)
    integer, intent(in), dimension(:) :: list
    integer :: ii
    !$ integer :: chunk_size
    !$ chunk_size = 4
    !$OMP PARALLEL DO SCHEDULE(dynamic,chunk_size)
    do ii=1,size(list)
       call do_things(list, ii)
    end do

  end subroutine loop_list

  subroutine do_things(list, index)
    integer, intent(in),dimension(:) :: list
    integer, intent(in) :: index
    print *,size(list),index
  end subroutine do_things

end module list_test



$ ~/gcc/old4_gcc45/bin/gfortran -Wall -o list_use -fopenmp -fwhole-program
-flto  list_test.f90 list_use.f90
lto1: internal compiler error: in iterative_hash_expr, at tree.c:6592
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: /home/jjc/gcc/old4_gcc45/bin/gfortran returned 1 exit status
collect2: lto-wrapper returned 1 exit status


-- 


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


  parent reply	other threads:[~2010-01-12 21:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-08 21:07 [Bug lto/42665] New: " jjcogliati-r1 at yahoo dot com
2010-01-08 21:10 ` [Bug lto/42665] " rguenth at gcc dot gnu dot org
2010-01-08 21:27 ` jjcogliati-r1 at yahoo dot com
2010-01-08 21:39 ` jjcogliati-r1 at yahoo dot com
2010-01-08 21:42 ` rguenther at suse dot de
2010-01-08 22:29 ` jjcogliati-r1 at yahoo dot com
2010-01-08 22:45 ` rguenther at suse dot de
2010-01-11 15:50 ` jjcogliati-r1 at yahoo dot com
2010-01-11 15:54 ` rguenther at suse dot de
2010-01-11 17:15 ` jjcogliati-r1 at yahoo dot com
2010-01-11 17:23 ` rguenther at suse dot de
2010-01-11 18:58 ` jjcogliati-r1 at yahoo dot com
2010-01-12 21:14 ` jjcogliati-r1 at yahoo dot com [this message]
2010-01-13 11:37 ` rguenth at gcc dot gnu dot org
2010-01-13 16:22 ` rguenth at gcc dot gnu dot org
2010-01-13 23:27 ` jjcogliati-r1 at yahoo dot com
2010-01-14  9:39 ` rguenth at gcc dot gnu dot org
2010-01-14  9:46 ` rguenth at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100112211409.5073.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).