This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33288] ICE (segfault) in mpfr_cmp2 when evaluating array initializers containing addition
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Sep 2007 11:31:46 -0000
- Subject: [Bug fortran/33288] ICE (segfault) in mpfr_cmp2 when evaluating array initializers containing addition
- References: <bug-33288-9404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from fxcoudert at gcc dot gnu dot org 2007-09-03 11:31 -------
(In reply to comment #4)
> Seemingly, the array range x0(n0-1:1:-1) does not get properly simplified and
> thus ->value.real points to the nirvana.
Nope. I get an ICE for the following testcase:
real, parameter :: x0(1) = 0
real, parameter :: x(1) = (/ x0 /) + 1
end
The problem is that we come into gfc_arith_plus() with one operand being an
EXPR_ARRAY, so looking at its value.real is wrong (if you want to do something
with it, it's value.constructor that should be looked at). I guess
reduce_binary_ac() should really look deeper: in the loop "for (c = head; c; c
= c->next)", we should see whether c->expr is an EXPR_CONSTANT before calling
eval(), and look deeper into it if it's an EXPR_ARRAY. (Though it's the first
time I look at this code and array constructors, I might be misunderstanding it
all.)
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33288