This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] more mudflap documentation


Hi -

The following patch adds a bit more information about
the mudflap instrumentation into doc/passes.texi.


2004-03-01  Frank Ch. Eigler  <fche@redhat.com>

	* doc/passes.texi: Add information about mudflap.


Index: passes.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/passes.texi,v
retrieving revision 1.9.2.14
diff -u -r1.9.2.14 passes.texi
--- passes.texi	24 Feb 2004 10:45:59 -0000	1.9.2.14
+++ passes.texi	1 Mar 2004 20:19:08 -0000
@@ -189,11 +189,17 @@
 
 @item Mudflap declaration registration
 
-If mudflap (CROSSREF) is enabled, we generate code to register all
-declarations with the mudflap runtime.  This pass generates new 
-exception handling constructs, and so must run before those are lowered.
-The pass is located in @file{tree-mudflap.c} and is described by 
-@code{pass_mudflap_1}.
+If mudflap (@pxref{Optimize Options,,-fmudflap -fmudflapth
+-fmudflapir,gcc.info,Using the GNU Compiler Collection (GCC)}) is
+enabled, we generate code to register some variable declarations with
+the mudflap runtime.  Specifically, the runtime tracks the lifetimes of
+those variable declarations that have their addresses taken, or whose
+bounds are unknown at compile time (@code{extern}).  This pass generates
+new exception handling constructs (@code{try}/@code{finally}), and so
+must run before those are lowered.  In addition, the pass enqueues
+declarations of static variables whose lifetimes extend to the entire
+program.  The pass is located in @file{tree-mudflap.c} and is described
+by @code{pass_mudflap_1}.
 
 @item Lower control flow
 
@@ -399,9 +405,15 @@
 
 @item Mudflap statement annotation
 
-If mudflap is enabled, we rewrite all memory accesses with code to
-validate that the memory access is correct.  The pass is located
-in @file{tree-mudflap.c} and is described by @code{pass_mudflap_2}.
+If mudflap is enabled, we rewrite some memory accesses with code to
+validate that the memory access is correct.  In particular, expressions
+involving pointer dereferences (@code{INDIRECT_REF}, @code{ARRAY_REF},
+etc.) are replaced by code that checks the selected address range
+against the mudflap runtime's database of valid regions.  This check
+includes an inline lookup into a direct-mapped cache, based on
+shift/mask operations of the pointer value, with a fallback function
+call into the runtime.  The pass is located in @file{tree-mudflap.c} and
+is described by @code{pass_mudflap_2}.
 
 @item Leave static single assignment form
 
@@ -654,11 +666,14 @@
 
 @item Final
 
-This pass outputs the assembler code for the function.
-The source files are @file{final.c} plus @file{insn-output.c}; the
-latter is generated automatically from the machine description by the
-tool @file{genoutput}.  The header file @file{conditions.h} is used
-for communication between these files.
+This pass outputs the assembler code for the function.  The source files
+are @file{final.c} plus @file{insn-output.c}; the latter is generated
+automatically from the machine description by the tool @file{genoutput}.
+The header file @file{conditions.h} is used for communication between
+these files.  If mudflap is enabled, the queue of deferred declarations
+and any addressed constants (e.g., string literals) is processed by
+@code{mudflap_finish_file} into a synthetic constructor function
+containing calls into the mudflap runtime.
 
 @item Debugging information output
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]