This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/38823] Diagnose and treat (-2.0)**2.0 properly
- From: "dominiq at lps dot ens dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jan 2009 11:30:40 -0000
- Subject: [Bug fortran/38823] Diagnose and treat (-2.0)**2.0 properly
- References: <bug-38823-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from dominiq at lps dot ens dot fr 2009-01-13 11:30 -------
> The question is whether one needs to reject it completely or only with -std=f95.
I vote for "only with -std=f95" with may be a warning otherwise. I think it is
a legitimate optimization to replace A**B by A**I (with I=B) when B is known to
be an integer, hence to accept negative values for A in this case. I find
upsetting to have to cheat with variables when constant folding does not give
the same result as a similar code with variables.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38823