h8300.c (general_operand_src): Always check MODE.
* config/h8300/h8300.c (general_operand_src): Always check MODE. (general_operand_dst): Likewise. * gcc.c-torture/execute/20030218-1.c: New. From-SVN: r63091
This commit is contained in:
parent
2104fa743d
commit
ff6e1a2f26
4 changed files with 41 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
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
|
||||
|
|
|
@ -723,7 +723,9 @@ general_operand_src (op, mode)
|
|||
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);
|
||||
}
|
||||
|
@ -736,7 +738,9 @@ general_operand_dst (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);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
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.
|
||||
|
|
25
gcc/testsuite/gcc.c-torture/execute/20030218-1.c
Normal file
25
gcc/testsuite/gcc.c-torture/execute/20030218-1.c
Normal file
|
@ -0,0 +1,25 @@
|
|||
/* 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);
|
||||
}
|
Loading…
Add table
Reference in a new issue