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 ACATS failures in GCC 3.4


    Ahh!  Then I believe that its the code in fold that swaps commutative
    operands that's at fault.  I think those lines should be modified to
    read (around 5454 of fold-const.c):

      if (commutative_tree_code (code)
          && tree_swap_operands_p (arg0, arg1, true))
        return fold (build (code, type, TREE_OPERAND (t, 1),
                            TREE_OPERAND (t, 0)));

    i.e. using "TREE_OPERAND (t, x)" instead of "argx", and therefore
    avoiding the problematic loss of type conversions.

Yes, most certainly!

    Could you try with this change (and reverting your proposed fix) and
    see if it also resolves the ACATS failures?

Indeed, you are probably correct that the code there need only test for
comparisons, not RSHIFT either ...

    Of course, you're probably right that there's also an issue with
    the MAX_EXPR and MIN_EXPR RTL expanders, 

I don't see one: if the tree has inconsistent types, it's a garbage-in,
garbage-out situation.


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