gcc.dg/tree-ssa/vrp17.c contains:

  arf (({
          if (3 >= tree_code_length[stmt->common.code])
            abort ();
          stmt->exp.operands[3];
        }),
       ({
          if (2 >= tree_code_length[stmt->common.code])
            abort ();
          stmt->exp.operands[2];
        }));

scan-tree-dump-times assumes an argument evaluation order.
If we evaluate the second argument and then the first (that is, right to left),
then VRP generates a "== 3" comparison.  This happens on x86_64 for example.

If we evaluate arguments in the opposite order, VRP simply removes "2 >="
as that is redundant.  This happens on arm-none-eabi for example.

I've got a patch to remove the dependency on the argument evaluation order.

-- 
           Summary: gcc.dg/tree-ssa/vrp17.c assumes an argument evaluation
                    order
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: testsuite
        AssignedTo: kazu at gcc dot gnu dot org
        ReportedBy: kazu at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,law at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22357

Reply via email to