+2003-02-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (general_operand_src): Always check
+ MODE.
+ (general_operand_dst): Likewise.
+
2003-02-18 Roger Sayle <roger@eyesopen.com>
* convert.c (convert_to_real): Also optimize (float)log(x) into
rtx op;
enum machine_mode mode;
{
- if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == POST_INC)
+ if (GET_MODE (op) == mode
+ && GET_CODE (op) == MEM
+ && GET_CODE (XEXP (op, 0)) == POST_INC)
return 1;
return general_operand (op, mode);
}
rtx op;
enum machine_mode mode;
{
- if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == PRE_DEC)
+ if (GET_MODE (op) == mode
+ && GET_CODE (op) == MEM
+ && GET_CODE (XEXP (op, 0)) == PRE_DEC)
return 1;
return general_operand (op, mode);
}
+2003-02-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcc.c-torture/execute/20030218-1.c: New.
+
2003-02-18 Aldy Hernandez <aldyh@redhat.com>
* gcc.dg/20030218-1.c: New.
--- /dev/null
+/* On H8, the predicate general_operand_src(op,mode) used to ignore
+ mode when op is a (mem (post_inc ...)). As a result, the pattern
+ for extendhisi2 was recognized as extendqisi2. */
+
+extern void abort ();
+extern void exit (int);
+
+short *q;
+
+long
+foo (short *p)
+{
+ long b = *p;
+ q = p + 1;
+ return b;
+}
+
+int
+main ()
+{
+ short a = 0xff00;
+ if (foo (&a) != (long) (short) 0xff00)
+ abort ();
+ exit (0);
+}