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]

Re: [PATCH] Fix PR tree-opt/18040



On Dec 10, 2004, at 8:08 PM, Richard Henderson wrote:


On Fri, Dec 10, 2004 at 11:49:40AM -0500, Andrew Pinski wrote:
	* expr.c (handled_component_p): Remove NON_LVALUE_EXPR, NOP_EXPR,
	CONVERT_EXPR cases.

If you're going to remove these from handled_component_p, it seems
like you should be removing the associated code from get_inner_reference
as well.

Here is the updated patch which updates to the patch to remove also the associated code from get_inner_reference.

Tested again on powerpc-darwin with no regressions. And the Ada with again
no regressions.


OK?

Thanks,
Andrew Pinski

ChangeLog:
	* expr.c (get_inner_reference): Remove NON_LVALUE_EXPR, NOP_EXPR,
	CONVERT_EXPR cases.
	(handled_component_p): Likewise.

Testcase (because I had forgot to attach it last time):
int PyObject_IsTrue();
struct object_base
{
  void ptr() const;
  void ptr1() const;
};
struct object : public object_base
{
  typedef void (object::*bool_type)() const;
  inline operator bool_type() const
    { return PyObject_IsTrue()
       ? &object_base::ptr : &object::ptr1; }
};
void f();
void g (void)
{
    for (unsigned n = 0; n < 100; ++n)
    {
        object kv;
        if (kv)
          f();
    }
}


Attachment: fix18040.diff.txt
Description: Text document


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