+2004-11-11  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR target/16458
+       * config/rs6000/rs6000.c (rs6000_generate_compare): Generate an
+       unsigned equality compare when we know the operands are unsigned.
+
 2004-11-10  Peter S. Mazinger  <ps.m@gmx.net>
 
        * config/mips/linux.h (LINUX_TARGET_OS_CPP_BUILTINS): Define
        them static.
        * expr.h: Remove the corresponding prototypes.
 
+>>>>>>> 2.6266
 2004-11-08  Richard Earnshaw  <rearnsha@arm.com>
 
        * arm.c (arm_handle_notshared_attribute): Wrap declaration and use
 
   else if (code == GTU || code == LTU
           || code == GEU || code == LEU)
     comp_mode = CCUNSmode;
+  else if ((code == EQ || code == NE)
+          && GET_CODE (rs6000_compare_op0) == SUBREG
+          && GET_CODE (rs6000_compare_op1) == SUBREG
+          && SUBREG_PROMOTED_UNSIGNED_P (rs6000_compare_op0)
+          && SUBREG_PROMOTED_UNSIGNED_P (rs6000_compare_op1))
+    /* These are unsigned values, perhaps there will be a later
+       ordering compare that can be shared with this one.
+       Unfortunately we cannot detect the signedness of the operands
+       for non-subregs.  */
+    comp_mode = CCUNSmode;
   else
     comp_mode = CCmode;
 
 
+2004-11-11  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR target/16458
+       * gcc.dg/ppc-compare-1.c: New.
+
 2004-11-10  Joseph S. Myers  <joseph@codesourcery.com>
 
        * objc.dg/desig-init-2.m: New test.
 
--- /dev/null
+/* { dg-do compile { target powerpc64-*-* } } */
+/* { dg-options "-m64 -O2" } */
+
+/* { dg-final { scan-assembler-not "cmpw" } } */
+
+/* Origin:Pete Steinmetz <steinmtz@us.ibm.com> */
+
+/* PR 16458: Extraneous compare.  */
+
+int foo (unsigned a, unsigned b)
+{
+  if (a == b) return 1;
+  if (a > b)  return 2;
+  if (a < b)  return 3;
+  return 0;
+}