While debugging something completely unrelated I ran into this...
SSA_OP_VMAYUSE hasn't been around for a looong time. For that matter, I think it was even me that got rid of it, so this was an sloppy oversight on my part.
I also noticed that the SSA_OP* definitions in the documentation have diverged from the source. I'm not a big fan of source embedded in the documentation, but if we must, then at least let's put a `NOTE' in the source to keep the .texi file up to date. I've done this.
I also cleaned up a small inconsistency in the comment preceding the macro definition of FOR_EACH_IMM_USE_STMT.
Tested on x86-64 Linux. OK?
commit feede3bf8c0dc55c86565bb18bf29543cf9dfd17 Author: Aldy Hernandez <al...@redhat.com> Date: Fri Dec 13 11:59:58 2013 -0800 * doc/tree-ssa.texi (SSA Operands): Remove reference to SSA_OP_VMAYUSE. Synchronize SSA_OP* definitions with source. * ssa-iterators.h: Fix comment for FOR_EACH_IMM_USE_STMT. Add not to SSA_OP* macro definitions. diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2417642..df87dbb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2013-12-13 Aldy Hernandez <al...@redhat.com> + * doc/tree-ssa.texi (SSA Operands): Remove reference to + SSA_OP_VMAYUSE. + Synchronize SSA_OP* definitions with source. + * ssa-iterators.h: Fix comment for FOR_EACH_IMM_USE_STMT. + Add not to SSA_OP* macro definitions. + +2013-12-13 Aldy Hernandez <al...@redhat.com> + * passes.c (pass_init_dump_file): Call clean_graph_dump_file regardless of cfun. diff --git a/gcc/doc/tree-ssa.texi b/gcc/doc/tree-ssa.texi index 93f596d..17c1b0c 100644 --- a/gcc/doc/tree-ssa.texi +++ b/gcc/doc/tree-ssa.texi @@ -265,15 +265,15 @@ those you are interested in. They are documented in #define SSA_OP_USE 0x01 /* @r{Real USE operands.} */ #define SSA_OP_DEF 0x02 /* @r{Real DEF operands.} */ #define SSA_OP_VUSE 0x04 /* @r{VUSE operands.} */ -#define SSA_OP_VMAYUSE 0x08 /* @r{USE portion of VDEFS.} */ -#define SSA_OP_VDEF 0x10 /* @r{DEF portion of VDEFS.} */ +#define SSA_OP_VDEF 0x08 /* @r{VDEF operands.} */ /* @r{These are commonly grouped operand flags.} */ -#define SSA_OP_VIRTUAL_USES (SSA_OP_VUSE | SSA_OP_VMAYUSE) -#define SSA_OP_VIRTUAL_DEFS (SSA_OP_VDEF) -#define SSA_OP_ALL_USES (SSA_OP_VIRTUAL_USES | SSA_OP_USE) -#define SSA_OP_ALL_DEFS (SSA_OP_VIRTUAL_DEFS | SSA_OP_DEF) -#define SSA_OP_ALL_OPERANDS (SSA_OP_ALL_USES | SSA_OP_ALL_DEFS) +#define SSA_OP_VIRTUAL_USES (SSA_OP_VUSE) +#define SSA_OP_VIRTUAL_DEFS (SSA_OP_VDEF) +#define SSA_OP_ALL_VIRTUALS (SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_DEFS) +#define SSA_OP_ALL_USES (SSA_OP_VIRTUAL_USES | SSA_OP_USE) +#define SSA_OP_ALL_DEFS (SSA_OP_VIRTUAL_DEFS | SSA_OP_DEF) +#define SSA_OP_ALL_OPERANDS (SSA_OP_ALL_USES | SSA_OP_ALL_DEFS) @end smallexample @end enumerate @@ -307,25 +307,10 @@ aren't using operand pointers, use and defs flags can be mixed. @code{VDEF}s are broken into two flags, one for the @code{DEF} portion (@code{SSA_OP_VDEF}) and one for the USE portion -(@code{SSA_OP_VMAYUSE}). If all you want to look at are the -@code{VDEF}s together, there is a fourth iterator macro for this, -which returns both a def_operand_p and a use_operand_p for each -@code{VDEF} in the statement. Note that you don't need any flags for -this one. +(@code{SSA_OP_VUSE}). -@smallexample - use_operand_p use_p; - def_operand_p def_p; - ssa_op_iter iter; - - FOR_EACH_SSA_MAYDEF_OPERAND (def_p, use_p, stmt, iter) - @{ - my_code; - @} -@end smallexample - -There are many examples in the code as well, as well as the -documentation in @file{tree-ssa-operands.h}. +There are many examples in the code, in addition to the documentation +in @file{tree-ssa-operands.h} and @file{ssa-iterators.h}. There are also a couple of variants on the stmt iterators regarding PHI nodes. diff --git a/gcc/ssa-iterators.h b/gcc/ssa-iterators.h index af486b6..24a05c9 100644 --- a/gcc/ssa-iterators.h +++ b/gcc/ssa-iterators.h @@ -98,7 +98,7 @@ typedef struct immediate_use_iterator_d get access to each occurrence of ssavar on the stmt returned by that iterator.. for instance: - FOR_EACH_IMM_USE_STMT (stmt, iter, var) + FOR_EACH_IMM_USE_STMT (stmt, iter, ssavar) { FOR_EACH_IMM_USE_ON_STMT (use_p, iter) { @@ -142,13 +142,13 @@ typedef struct ssa_operand_iterator_d gimple stmt; } ssa_op_iter; +/* NOTE: Keep these in sync with doc/tree-ssa.texi. */ /* These flags are used to determine which operands are returned during execution of the loop. */ #define SSA_OP_USE 0x01 /* Real USE operands. */ #define SSA_OP_DEF 0x02 /* Real DEF operands. */ #define SSA_OP_VUSE 0x04 /* VUSE operands. */ #define SSA_OP_VDEF 0x08 /* VDEF operands. */ - /* These are commonly grouped operand flags. */ #define SSA_OP_VIRTUAL_USES (SSA_OP_VUSE) #define SSA_OP_VIRTUAL_DEFS (SSA_OP_VDEF)