This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/50721] [4.6/4.7 Regression] Segfault of -O0 compiled program on x86_64 related to register allocator
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 14 Oct 2011 13:39:29 +0000
- Subject: [Bug target/50721] [4.6/4.7 Regression] Segfault of -O0 compiled program on x86_64 related to register allocator
- Auto-submitted: auto-generated
- References: <bug-50721-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50721
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #10 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-10-14 13:39:29 UTC ---
(In reply to comment #8)
> It looks like gsl_poly_dd_taylor overwrites part of the caller's stack frame.
> Specifically, this statement
> w[size - 1] = 1.0;
> appears to go out of bounds. Can someone who understands Fortran check the
> source whether it's actually valid?
Well, in this example "size" is 3, hence, w[size -1] == w[2]. In Fortran, the
"w" is the last argument, which is 2 and thus "d(2)" == "d(1:2)" has two
elements. And indeed, accessing w[2] is a bit dangerous if one has just two
elements ...
I think you are right that it is invalid, even if it appeared to work
flawlessly and without valgrind errors with other compilers (gfortran 4.5, g95,
ifort, NAG, ...).
Sorry for not being able to debug properly at 2 a.m. And thanks for checking!
Close as INVALID.