This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34837] gfortran crashes and asks for bug report
- 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: 18 Jan 2008 01:32:29 -0000
- Subject: [Bug fortran/34837] gfortran crashes and asks for bug report
- References: <bug-34837-15656@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from kargl at gcc dot gnu dot org 2008-01-18 01:32 -------
(In reply to comment #2)
> I have installed
> gcc version 4.3.0 20071231 (experimental) [trunk revision 131236] (GCC)
> and the error goes away. I can turn it on and off by switching between
> the two, though it is not conclusive that the problem has been solved
> because it appeared to depend in some complex way on how the program
> was arranged, as if it was an overwriting/ buffer-overflow/memory leak
> sort of problem. So its disappearance could be a chance of how memory is
> allocated.
Add -Wall -fbounds-check to your command line. Fix all warnings and
errors.
> Incidentally the new version does indeed warn about **-2.0 . I agree
> it is bad practice but without looking carefully at the rules I am not
> sure that it is ungrammatical. -2.0 is after all a constant, so the
> expression is of the form [variable] [operator] [constant]
It doesn't matter. The ** operator has higher precedence than the
- operator. In fact, you have [variable][operator][operator][constant].
You should also change the 2.0 to simply 2. Why? Because x**-2.0 may
be to a function call of pow(x, -2.0) whereas x**2 becomes x*x.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34837