From: Steven Bosscher Date: Sat, 9 Feb 2008 00:30:13 +0000 (+0000) Subject: re PR middle-end/34627 (Incorrect branching with -Ox on hppa) X-Git-Tag: releases/gcc-4.3.0~227 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e37f6a497d5c1c0489f3fac12884f9a71fdc7147;p=thirdparty%2Fgcc.git re PR middle-end/34627 (Incorrect branching with -Ox on hppa) PR middle-end/34627 combine.c (simplify_if_then_else): Make sure the comparison is against const0_rtx when simplifying to (abs x) or (neg (abs X)). From-SVN: r132193 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 910417b73f12..918ff4b80268 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-02-08 Steven Bosscher + + PR middle-end/34627 + combine.c (simplify_if_then_else): Make sure the comparison is + against const0_rtx when simplifying to (abs x) or (neg (abs X)). + 2008-02-08 Richard Sandiford PR bootstrap/35051 diff --git a/gcc/combine.c b/gcc/combine.c index 5cfa3051b0d9..b812b33ac41d 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -5393,9 +5393,10 @@ simplify_if_then_else (rtx x) /* Look for cases where we have (abs x) or (neg (abs X)). */ if (GET_MODE_CLASS (mode) == MODE_INT + && comparison_p + && XEXP (cond, 1) == const0_rtx && GET_CODE (false_rtx) == NEG && rtx_equal_p (true_rtx, XEXP (false_rtx, 0)) - && comparison_p && rtx_equal_p (true_rtx, XEXP (cond, 0)) && ! side_effects_p (true_rtx)) switch (true_code)