This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/33288] ICE (segfault) in mpfr_cmp2 when evaluating array initializers containing addition

------- 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

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


fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]