Dave Korn - RE: [PATCH] Re: ref_contains_indirect_ref always false? (original) (raw)
This is the mail archive of the gcc@gcc.gnu.orgmailing 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] |
- From: "Dave Korn"
- To: "'Richard Kenner'" ,
- Cc: ,
- Date: Fri, 4 Nov 2005 15:07:55 -0000
- Subject: RE: [PATCH] Re: ref_contains_indirect_ref always false?
Richard Kenner wrote:
#if defined ENABLE_CHECKING gcc_assert (handled_component_p (ref)) #endifIf the comment says it has to be an ARRAY_REF, why not just check for that?
Given that we're supposed to be passing in an ARRAY_REF and we don't want it to return true if passed in an INDIRECT_REF, why not just reverse the order of the two statements in the body of the original while loop?
Before:
static inline bool ref_contains_indirect_ref (tree ref) { while (handled_component_p (ref)) { if (TREE_CODE (ref) == INDIRECT_REF) return true; ref = TREE_OPERAND (ref, 0); } return false; }
After:
static inline bool ref_contains_indirect_ref (tree ref) { while (handled_component_p (ref)) { ref = TREE_OPERAND (ref, 0); if (TREE_CODE (ref) == INDIRECT_REF) return true; } return false; }
cheers,
DaveK-- Can't think of a witty .sigline today....
- References:
- Re: [PATCH] Re: ref_contains_indirect_ref always false?
* From: Richard Kenner
- Re: [PATCH] Re: ref_contains_indirect_ref always false?
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |