+2002-01-08 Jakub Jelinek <jakub@redhat.com>
+
+ * expr.c (store_expr): Convert VOIDmode constants back to target's
+ mode.
+
2002-01-08 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/invoke.texi: Markup gcc as @command. Refer to
target. Otherwise, the caller might get confused by a result whose
mode is larger than expected. */
- if (want_value && GET_MODE (temp) != GET_MODE (target)
- && GET_MODE (temp) != VOIDmode)
+ if (want_value && GET_MODE (temp) != GET_MODE (target))
{
- temp = gen_lowpart_SUBREG (GET_MODE (target), temp);
- SUBREG_PROMOTED_VAR_P (temp) = 1;
- SUBREG_PROMOTED_UNSIGNED_P (temp)
- = SUBREG_PROMOTED_UNSIGNED_P (target);
+ if (GET_MODE (temp) != VOIDmode)
+ {
+ temp = gen_lowpart_SUBREG (GET_MODE (target), temp);
+ SUBREG_PROMOTED_VAR_P (temp) = 1;
+ SUBREG_PROMOTED_UNSIGNED_P (temp)
+ = SUBREG_PROMOTED_UNSIGNED_P (target);
+ }
+ else
+ temp = convert_modes (GET_MODE (target),
+ GET_MODE (SUBREG_REG (target)),
+ temp, SUBREG_PROMOTED_UNSIGNED_P (target));
}
return want_value ? temp : NULL_RTX;
+2002-01-08 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/20020108-1.c: New test.
+
2002-01-08 H.J. Lu <hjl@gnu.org>
* objc.dg/special/special.exp: Add -I${srcdir}/../../libobjc
--- /dev/null
+/* This testcase failed on i686 because (const_int -1) was changed into
+ (const_int 0xffff) when storing it into SImode pseudo, but was not
+ converted back to (const_int -1) when returning from store_expr,
+ eventhough target was (subreg:HI (reg/v:SI indx)). But (const_int 0xffff)
+ is not valid general_operand in HImode. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mcpu=i686" { target i?86-*-* } } */
+
+void
+foo (unsigned short *cp)
+{
+ unsigned short indx;
+
+ *cp = indx = 0xFFFF;
+}