Hello Ian, Tuesday, July 3, 2007, 6:23:02 PM, you wrote:
> Adding a new field to mem_attrs could be a problem. You'll have to > measure to see how much the memory usage changes. We have tested that previously with alias-export patch, which uses the same mechanism for saving original exprs for rtl. It showed that the change in cc1-i-files compile time was less than 1%, memory usage change was negligible. We'll do the test again with the new patch, though I don't think the memory consumption will increase. >> +/* If EXPR contains conversions at the root of the tree, all of them >> + will be removed. */ >> + >> +static tree >> +skip_conversions (tree expr) >> +{ >> + tree inner = expr; >> + /* Remove any conversions: they don't change what the underlying >> + object is. Likewise for SAVE_EXPR. */ >> + while (TREE_CODE (inner) == NOP_EXPR || TREE_CODE (inner) == CONVERT_EXPR >> + || TREE_CODE (inner) == NON_LVALUE_EXPR >> + || TREE_CODE (inner) == VIEW_CONVERT_EXPR >> + || TREE_CODE (inner) == SAVE_EXPR) >> + inner = TREE_OPERAND (inner, 0); >> + return inner; >> +} > I don't understand why it's OK to throw all these away. Some of them > change the meaning of the expression. I also don't understand why you > want to throw them away. This piece of code was actually derived from alias-export branch, and is not needed for this project. In alias-export we also used original expression trees to disambiguate memory references. E.g. two mems with orig_exprs (t1) x and (t2 *) p can be disambiguated if points-to for p doesn't contain x. Here it doesn't matter what types x and p have, so we used skip_conversions to simplify disambiguation routines logic. The cleanup from conversions worked for alias-export, because when we later searched for the base variable to take it's points-to, we never went through INDIRECT_REFs. >> @@ -1401,27 +1456,36 @@ component_ref_for_mem_expr (tree ref) ... >> } > The handling of INDIRECT_REF here seems clearly wrong. You definitely > can't discard conversions for an INDIRECT_REF. I agree. This code should have been removed in early versions of alias-export. We don't modify MEM_EXPR at all since MEM_ORIG_EXPR was introduced. -- Best regards, Dmitry mailto:[EMAIL PROTECTED]