1 Mar 07:17
[vta, trunk] don't leak uninitialized stack state into output
Alexandre Oliva <aoliva <at> redhat.com>
2009-03-01 06:17:25 GMT
2009-03-01 06:17:25 GMT
When building certain initializers, the Fortran front-end allocates a buffer on the stack, sets up some elements of it from the source of the initialization, and then proceeds to use the entire buffer to initialize a larger destination. The result is that the uninitialized portion of the buffer leaks into the program output. I figured zero-initializing the entire buffer would often be pointless, so I decided to initialize only the portion that wasn't covered by the source. I'm pretty sure this was caught in a testsuite run with -fcompare-debug, but I don't recall the exact testcaseI'm installing this in the branch. Ok for trunk?
for gcc/ChangeLog.vta from Alexandre Oliva <aoliva <at> redhat.com> * fortran/simplify.c (gfc_simplify_transfer): Zero-initialize unused portions of the buffer. Index: gcc/fortran/simplify.c =================================================================== --- gcc/fortran/simplify.c.orig 2008-12-10 03:13:26.000000000 -0200 +++ gcc/fortran/simplify.c 2008-12-15 03:54:04.000000000 -0200 @@ -4432,6 +4432,7 @@ gfc_simplify_transfer (gfc_expr *source, size_t result_size; size_t result_elt_size;(Continue reading)
I'm installing this in the branch. Ok for trunk?
I've CC:'d my
reply there.
> I am dealing with the gcc 4.3.x sources in a new port and I have a small
> issue with libgfortan :
>
> In gcc-4.3.x/libgfrotran/generated all fuction arguments seem to have a
>
> const restrict
>
> prefix. My compilation fails due to that no defined. What it should be and
> where it should be defined?
This is standard C99. Libgfortran is supposed to be compiled with
-std=gnu99, and it is also supposed to be built by the recently built
gcc/gfortran. You can check for -std=gnu99 in the generated Makefile.
If this isn't happening, there is an error in the build machinery for
your system. Could you maybe supply us with some more details?
Thomas
RSS Feed