Bug 29567 - [4.3 regression] ICE in build2_stat, at tree.c:2963
Summary: [4.3 regression] ICE in build2_stat, at tree.c:2963
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Richard Biener
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code, patch
: 29590 (view as bug list)
Depends on:
Reported: 2006-10-23 18:09 UTC by Martin Reinecke
Modified: 2006-10-25 14:39 UTC (History)
4 users (show)

See Also:
Target: x86_64-unknown-linux-gnu
Known to work: 4.2.0
Known to fail: 4.3.0
Last reconfirmed: 2006-10-23 21:37:54


Note You need to log in before you can comment on or make changes to this bug.
Description Martin Reinecke 2006-10-23 18:09:19 UTC
When compiling the following code with current gfortran 4.3, the compiler ICEs

module test

  function gn_lc2uc1(string_lc) result(string_uc)
    character(len = *), intent(in) :: string_lc
    character(len = len(string_lc)) :: string_uc

    integer :: ch, nch, i
    logical :: found

    nch = len(string_lc)

    found = .false.
    do ch = 1, nch
      i = ichar(string_lc(ch: ch))
      if (((i >= 97) .and. (i <= 122)) .and. (.not. found)) then
        string_uc(ch: ch) = char(i - 32)
        found = .true.
      else if ((i >= 65) .and. (i <= 92)) then
        string_uc(ch: ch) = char(i)
        found = .true.
        string_uc(ch: ch) = char(i)
      end if
    end do
  end function gn_lc2uc1

end module test

martin@linux:~/tmp> gfortran -O2 -v test.f90
Driving: gfortran -O2 -v test.f90 -lgfortranbegin -lgfortran -lm -shared-libgcc
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /home/martin/software/gcc/configure --disable-multilib --with-gmp=/home/martin/software/mygmp --with-mpfr=/home/martin/software/mympfr --prefix=/home/martin/software/ugcc --enable-languages=c++,fortran --enable-checking=release
Thread model: posix
gcc version 4.3.0 20061023 (experimental)
 /home/martin/software/ugcc/libexec/gcc/x86_64-unknown-linux-gnu/4.3.0/f951 test.f90 -quiet -dumpbase test.f90 -mtune=generic -auxbase test -O2 -version -I /home/martin/software/ugcc/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/finclude -o /tmp/ccsOQohf.s
GNU F95 version 4.3.0 20061023 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.3.0 20061023 (experimental).
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=128005
test.f90: In function ‘gn_lc2uc1’:
test.f90:4: internal compiler error: in build2_stat, at tree.c:2963
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

The ICE does not occur with the head ov the 4.2 branch, so the probelm must be very new. It does not appear at lower optimisation levels either.
Comment 1 Andrew Pinski 2006-10-23 18:13:36 UTC
Can you try the patch in:
Comment 2 Martin Reinecke 2006-10-23 19:50:08 UTC
(In reply to comment #1)
> Can you try the patch in:
> http://gcc.gnu.org/ml/gcc-patches/2006-10/msg01168.html
> ?

Yes, this patch fixes the problem. Thanks for the prompt reply!
Comment 3 Richard Biener 2006-10-24 08:12:13 UTC
Subject: Bug 29567

Author: rguenth
Date: Tue Oct 24 08:12:04 2006
New Revision: 117997

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117997
2006-10-24  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/29567
	* tree-vrp.c (register_edge_assert_for_1): Fix wrong logic
	for TRUTH_NOT_EXPR.  Clarify comments.

	* gfortran.fortran-torture/compile/vrp_1.f90: New testcase.


Comment 4 Richard Biener 2006-10-24 08:20:17 UTC
Comment 5 Richard Biener 2006-10-25 14:39:36 UTC
*** Bug 29590 has been marked as a duplicate of this bug. ***