This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/38822] Compile-time simplification of x**(real) / ICE in in gfc_target_encode_expr
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jan 2009 19:41:39 -0000
- Subject: [Bug fortran/38822] Compile-time simplification of x**(real) / ICE in in gfc_target_encode_expr
- References: <bug-38822-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from kargl at gcc dot gnu dot org 2009-01-20 19:41 -------
(In reply to comment #7)
> I have a patch that not only fixes the ICE, but it will issue an
> error for a program of the form
>
> troutmask:sgk[203] cat a.f90
> program a
> real z(int(transfer(2.e0**2.e0, 1.e0)) + 1)
> z = 1.
> print '(5ES12.5)', z
> end program a
> troutmask:sgk[204] gfc4x -o z a.f90
> troutmask:sgk[205] ./z
> 1.00000E+00 1.00000E+00 1.00000E+00 1.00000E+00 1.00000E+00
> troutmask:sgk[206] gfc4x -o z -std=f95 a.f90
> a.f90:2.32:
>
> real z(int(transfer(2.e0**2.e0, 1.e0)) + 1)
> 1
> Error: Fortran 2003: Noninteger exponent in an initialization expression at (1)
>
> Note, I plan to change the word initialization to restricted.
>
Dang, I got this wrong. There is a distinction between an initialization
and specification expressions where a non-integer exponent is indeed allowed
in the latter and prohibited in the former. I, at least, still have the
ICE fixed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38822