Zdenek Dvorak - Re: [patch] (-fstrict-overflow) optimize counted loops on signed iv (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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]

Hello,

But of course the following is the problem:

Index: fold-const.c

*** fold-const.c (revision 121992) --- fold-const.c (working copy) *************** tree_swap_operands_p (tree arg0, tree ar *** 6668,6676 **** && (TREE_SIDE_EFFECTS (arg0) || TREE_SIDE_EFFECTS (arg1))) return 0;

! if (DECL_P (arg1)) return 0; ! if (DECL_P (arg0)) return 1;

/* It is preferable to swap two SSA_NAME to ensure a canonical form --- 6668,6676 ---- && (TREE_SIDE_EFFECTS (arg0) || TREE_SIDE_EFFECTS (arg1))) return 0;

! if (DECL_P (arg1) || TREE_CODE (arg1) == SSA_NAME) return 0; ! if (DECL_P (arg0) || TREE_CODE (arg0) == SSA_NAME) return 1;

/* It is preferable to swap two SSA_NAME to ensure a canonical form

I'll bootstrap and test it.

makes sense, although it won't fix the problem in general (e.g., 2 * a < 2 * a + 4 still would not be folded).

Zdenek


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