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]

[PATCH] Re: ref_contains_indirect_ref always false?


On Fri, 4 Nov 2005, Richard Guenther wrote:

> Hi!
> 
> it seems that
> 
> 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;
> }
> 
> always returns false, because handled_component_p (ref) returns
> false for INDIRECT_REF.

The following patch "fixes" this by imitating ref_contains_array_ref
semantics.  Bootstrapped on x86_64-unknonw-linux-gnu, regtest in 
progress, ok for mainline if it succeeds?

Thanks,
Richard.


2005-11-04  Richard Guenther  <rguenther@suse.de>

	* tree-flow-inline.h (ref_contains_indirect_ref): Deal
	with INDIRECT_REF not in handled_component_p.

Index: tree-flow-inline.h
===================================================================
--- tree-flow-inline.h	(revision 106485)
+++ tree-flow-inline.h	(working copy)
@@ -1413,11 +1413,13 @@
 static inline bool
 ref_contains_indirect_ref (tree ref)
 {
+  if (TREE_CODE (ref) == INDIRECT_REF)
+    return true;
   while (handled_component_p (ref))
     {
+      ref = TREE_OPERAND (ref, 0);
       if (TREE_CODE (ref) == INDIRECT_REF)
 	return true;
-      ref = TREE_OPERAND (ref, 0);
     }
   return false;
 }


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