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] simplify-rtx.c: start adding selftests


David Malcolm <dmalcolm@redhat.com> writes:
> This patch starts adding selftests to simplify-rtx.c, to ensure that
> RTL expressions are simplified as we expect.
>
> It adds a new ASSERT_RTX_EQ macro that checks for pointer equality
> of two rtx values.  If they're non-equal, it aborts, printing both
> expressions.

This might be a bit confusing when more tests are added, since pointer
equality is only useful in certain specific cases (e.g. when you know
you're dealing with CONST_INTs or pseudo registers).  How about making
ASSERT_RTX_EQ check for rtx_equal_p equality and have something like
ASSERT_RTX_PTR_EQ for cases where pointer equality really is needed?

Also, how about using LAST_VIRTUAL_REGISTER + 1 as the base for
register numbers?  DImode might not be valid for register 0 on
all targets.

Thanks,
Richard


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