diff mbox

[wwwdocs] Document -fstack-usage and -fstack-check improvements

Message ID 201009181852.16281.ebotcazou@adacore.com
State New
Headers show

Commit Message

Eric Botcazou Sept. 18, 2010, 4:52 p.m. UTC
The subject tells it all.  OK to install?

Comments

Gerald Pfeifer Sept. 18, 2010, 11:03 p.m. UTC | #1
On Sat, 18 Sep 2010, Eric Botcazou wrote:
> The subject tells it all.  OK to install?

Yes, thank you!

Please give David a day or two to chime in whether RS/6000 is best to 
refer or he has some other preference.  (I think I recall some discussion 
on this, but no details.)

Gerald
Eric Botcazou Sept. 19, 2010, 10:07 a.m. UTC | #2
> Please give David a day or two to chime in whether RS/6000 is best to
> refer or he has some other preference.  (I think I recall some discussion
> on this, but no details.)

I just copied http://gcc.gnu.org/gcc-4.5/changes.html
Florian Weimer Sept. 19, 2010, 4:15 p.m. UTC | #3
* Eric Botcazou:

> The subject tells it all.  OK to install?

Are the -fstack-check fixes really Ada-specific?
Eric Botcazou Sept. 19, 2010, 4:21 p.m. UTC | #4
> Are the -fstack-check fixes really Ada-specific?

I didn't mention -fstack-check in the patch, only stack checking in Ada.
Florian Weimer Sept. 19, 2010, 7:19 p.m. UTC | #5
* Eric Botcazou:

>> Are the -fstack-check fixes really Ada-specific?
>
> I didn't mention -fstack-check in the patch, only stack checking in Ada.

There have been general improvements in this area (compared to 4.4 at
least, where stack probes for VLAs were spaced too far apart).

Looking at the generated assembly, I think the initial probe is still
too far off (on GNU/Linux i386 and amd64).  The stack pointer is
decremented by the page size plus the size of 8 words, which could
miss the guard page.  This is visible in both C and Ada code.
Eric Botcazou Sept. 20, 2010, 10:15 a.m. UTC | #6
> Looking at the generated assembly, I think the initial probe is still
> too far off (on GNU/Linux i386 and amd64).  The stack pointer is
> decremented by the page size plus the size of 8 words, which could
> miss the guard page.  This is visible in both C and Ada code.

This is as designed, we don't really probe the first few pages, except where 
this is required (Windows).
diff mbox

Patch

Index: htdocs/gcc-4.6/changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.6/changes.html,v
retrieving revision 1.41
diff -u -r1.41 changes.html
--- htdocs/gcc-4.6/changes.html	17 Sep 2010 10:20:58 -0000	1.41
+++ htdocs/gcc-4.6/changes.html	18 Sep 2010 16:52:33 -0000
@@ -79,6 +79,9 @@ 
 	  </li>
       </ul>
       </li>
+      <li>A new switch <code>-fstack-usage</code> has been added.  It makes
+      the compiler output stack usage information for the program, on a
+      per-function basis, in an auxiliary file.</li>
   </ul>
 
 <h2>Compile time and memory usage improvements</h2>
@@ -95,6 +98,12 @@ 
 
 <h3>Ada</h3>
 
+  <ul>
+    <li>Stack checking has been improved on selected architectures (Alpha,
+    IA-32/x86-64, RS/6000 and SPARC): it now will detect stack overflows
+    in all cases on these architectures.</li>
+  </ul>
+
 <h3>C family</h3>
 
 <h3 id="Cxx">C++</h3>