diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2003-01-21 04:10:38 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2003-01-21 04:10:38 +0000 |
commit | 9ac7ebba1c097d331bac2b9b47811740030fa7be (patch) | |
tree | 0438168b3fcdde3fe01412cd5cdd8bbd2e7ca657 /gcc | |
parent | 309c52b51ba698b2a9b9baa025fcb07a5b067fcf (diff) | |
download | gcc-9ac7ebba1c097d331bac2b9b47811740030fa7be.zip gcc-9ac7ebba1c097d331bac2b9b47811740030fa7be.tar.gz gcc-9ac7ebba1c097d331bac2b9b47811740030fa7be.tar.bz2 |
h8300.c (const_costs): Remove a warning.
* config/h8300/h8300.c (const_costs): Remove a warning.
(output_plussi): Likewise.
(compute_plussi_length): Likewise.
(compute_plussi_cc): Likewise.
From-SVN: r61531
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.c | 48 |
2 files changed, 34 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8800acb..294e106 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2003-01-20 Kazu Hirata <kazu@cs.umass.edu> + * config/h8300/h8300.c (const_costs): Remove a warning. + (output_plussi): Likewise. + (compute_plussi_length): Likewise. + (compute_plussi_cc): Likewise. + +2003-01-20 Kazu Hirata <kazu@cs.umass.edu> + * config/h8300/h8300.md (addsi_h8300): Remove the last alternative. diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 937e76b..3282698 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -1106,24 +1106,30 @@ const_costs (r, c, outer_code) switch (c) { case CONST_INT: - switch (INTVAL (r)) - { - case 0: - return 0; - case 1: - case 2: - case -1: - case -2: - return 0 + (outer_code == SET); - case 4: - case -4: - if (TARGET_H8300H || TARGET_H8300S) - return 0 + (outer_code == SET); - else - return 1; - default: - return 1; - } + { + HOST_WIDE_INT n = INTVAL (r); + + if (-4 <= n || n <= 4) + { + switch ((int) n) + { + case 0: + return 0; + case 1: + case 2: + case -1: + case -2: + return 0 + (outer_code == SET); + case 4: + case -4: + if (TARGET_H8300H || TARGET_H8300S) + return 0 + (outer_code == SET); + else + return 1; + } + } + return 1; + } case CONST: case LABEL_REF: @@ -1908,7 +1914,7 @@ output_plussi (operands) /* See if we can finish with 2 bytes. */ - switch (intval & 0xffffffff) + switch ((unsigned int) intval & 0xffffffff) { case 0x00000001: case 0x00000002: @@ -1968,7 +1974,7 @@ compute_plussi_length (operands) /* See if we can finish with 2 bytes. */ - switch (intval & 0xffffffff) + switch ((unsigned int) intval & 0xffffffff) { case 0x00000001: case 0x00000002: @@ -2023,7 +2029,7 @@ compute_plussi_cc (operands) /* See if we can finish with 2 bytes. */ - switch (intval & 0xffffffff) + switch ((unsigned int) intval & 0xffffffff) { case 0x00000001: case 0x00000002: |