* combine.c (simplify_set): Build a new src pattern instead of
substituting its operands in the COMPARE case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124797
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-05-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR rtl-optimization/31691
+ * combine.c (simplify_set): Build a new src pattern instead of
+ substituting its operands in the COMPARE case.
+
2007-05-17 Zdenek Dvorak <dvorakz@suse.cz>
* tree-vrp.c (finalize_jump_threads): Do not care about dominance info.
}
else if (GET_MODE (op0) == compare_mode && op1 == const0_rtx)
{
- SUBST(SET_SRC (x), op0);
+ SUBST (SET_SRC (x), op0);
src = SET_SRC (x);
}
- else
+ /* Otherwise, update the COMPARE if needed. */
+ else if (XEXP (src, 0) != op0 || XEXP (src, 1) != op1)
{
- /* Otherwise, update the COMPARE if needed. */
- SUBST (XEXP (src, 0), op0);
- SUBST (XEXP (src, 1), op1);
+ SUBST (SET_SRC (x), gen_rtx_COMPARE (compare_mode, op0, op1));
+ src = SET_SRC (x);
}
}
else
+2007-05-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.c-torture/execute/20070517-1.c: New test.
+
2007-05-17 Daniel Franke <franke.daniel@gmail.com>
PR fortran/31919
--- /dev/null
+/* PR rtl-optimization/31691 */
+/* Origin: Chi-Hua Chen <stephaniechc-gccbug@yahoo.com> */
+
+extern void abort (void);
+
+static int get_kind(int) __attribute__ ((noinline));
+
+static int get_kind(int v)
+{
+ volatile int k = v;
+ return k;
+}
+
+static int some_call(void) __attribute__ ((noinline));
+
+static int some_call(void)
+{
+ return 0;
+}
+
+static void example (int arg)
+{
+ int tmp, kind = get_kind (arg);
+
+ if (kind == 9 || kind == 10 || kind == 5)
+ {
+ if (some_call() == 0)
+ {
+ if (kind == 9 || kind == 10)
+ tmp = arg;
+ else
+ abort();
+ }
+ }
+}
+
+int main(void)
+{
+ example(10);
+ return 0;
+}