combine.c (setup_incoming_promotions): Ensure that arguments that have not undergone...
authorMark Shinwell <shinwell@codesourcery.com>
Mon, 8 Oct 2007 15:28:56 +0000 (15:28 +0000)
committerMark Shinwell <shinwell@gcc.gnu.org>
Mon, 8 Oct 2007 15:28:56 +0000 (15:28 +0000)
gcc/
* combine.c (setup_incoming_promotions): Ensure that
arguments that have not undergone mode promotions do not
incorrectly get marked as being sign- or zero-extended.

From-SVN: r129131

gcc/ChangeLog
gcc/combine.c

index b03f6d0f5893ea1744e85348a51cf68dd2041502..1cbfa8cc1cc26e3994f06b76252e7addbf7cb0fc 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-08  Mark Shinwell  <shinwell@codesourcery.com>
+
+       * combine.c (setup_incoming_promotions): Ensure that
+       arguments that have not undergone mode promotions do not
+       incorrectly get marked as being sign- or zero-extended.
+
 2007-10-08  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/33693
index 392dedb3da547abdc858c463f0529d4849cfaea7..ca378bd1c897bb7263b7c422f4908a1f7201b2d7 100644 (file)
@@ -1363,15 +1363,17 @@ setup_incoming_promotions (rtx first)
 
       /* Eliminate sign extensions in the callee when possible.  Only
          do this when:
-        (a) the mode of the register is the same as the mode of
+        (a) a mode promotion has occurred;
+        (b) the mode of the register is the same as the mode of
             the argument as it is passed; and
-        (b) the signedness does not change across any of the promotions; and
-        (c) when no language-level promotions (which we cannot guarantee
+        (c) the signedness does not change across any of the promotions; and
+        (d) when no language-level promotions (which we cannot guarantee
             will have been done by an external caller) are necessary,
             unless we know that this function is only ever called from
             the current compilation unit -- all of whose call sites will
             do the mode1 --> mode2 promotion.  */
-      if (mode3 == mode4
+      if (mode1 != mode3
+          && mode3 == mode4
           && uns1 == uns3
          && (mode1 == mode2 || strictly_local))
         {