From patchwork Tue Jul 20 18:38:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [rs6000,committed] fix abs_isel patterns Date: Tue, 20 Jul 2010 08:38:53 -0000 From: Nathan Froyd X-Patchwork-Id: 59352 Message-Id: <20100720183853.GK26037@codesourcery.com> To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com While debugging other problems, I noticed that my isel patch: http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01298.html was causing ICEs when compiling libgcc. After making the isel patterns only accept lt/eq/gt comparison codes, the *abs2_isel splitters split to RTL that's not recognizable. (This should have shown up when compiling libgcc for powerpc-eabispe, but doesn't because the default processor for that target isn't an isel-capable processor...patch forthcoming.) Fixed with the below patch, which reverses the sense of the condition in the patterns, along with the operands. Applied as obvious after testing on powerpc-eabispe. -Nathan * config/rs6000/rs6000.md (abs2_isel, nabs2_isel): Reverse sense of if_then_else condition. Index: config/rs6000/rs6000.md =================================================================== --- config/rs6000/rs6000.md (revision 162343) +++ config/rs6000/rs6000.md (working copy) @@ -2105,10 +2105,10 @@ (define_insn_and_split "abs2_isel" (compare:CC (match_dup 1) (const_int 0))) (set (match_dup 0) - (if_then_else:GPR (ge (match_dup 3) + (if_then_else:GPR (lt (match_dup 3) (const_int 0)) - (match_dup 1) - (match_dup 2)))] + (match_dup 2) + (match_dup 1)))] "") (define_insn_and_split "nabs2_isel" @@ -2124,10 +2124,10 @@ (define_insn_and_split "nabs2_isel (compare:CC (match_dup 1) (const_int 0))) (set (match_dup 0) - (if_then_else:GPR (ge (match_dup 3) + (if_then_else:GPR (lt (match_dup 3) (const_int 0)) - (match_dup 2) - (match_dup 1)))] + (match_dup 1) + (match_dup 2)))] "") (define_insn_and_split "abssi2_nopower"