aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoern Rennecke <amylaar@spamcop.net>2010-11-09 17:23:05 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2010-11-09 17:23:05 +0000
commitf4a88680ab308f951699bdfb7b181013d434d151 (patch)
tree796b44e040d150a09cf135b323d42346cf3b8d87
parent959fc02c27caefe184137ff482a34608e1ff64b9 (diff)
downloadgcc-f4a88680ab308f951699bdfb7b181013d434d151.zip
gcc-f4a88680ab308f951699bdfb7b181013d434d151.tar.gz
gcc-f4a88680ab308f951699bdfb7b181013d434d151.tar.bz2
re PR target/44759 (mn10300.md signed/unsigned comparisons)
PR target/44759 * config/mn10300/mn10300.c (SIZE_FMOV_LIMIT): Promote all arms of conditional to type of S. (mn10300_function_arg): Remove unused variable align. (mn10300_arg_partial_bytes): Likewise. * config/mn10300/mn10300.md (attribute cpu): Cast value to enum attr_cpu. From-SVN: r166500
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/mn10300/mn10300.c17
-rw-r--r--gcc/config/mn10300/mn10300.md2
3 files changed, 16 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0a80209..254ffb0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -52,6 +52,14 @@
(schedType): Cast result of picochip_schedule_type to
enum attr_schedType.
+ PR target/44759
+ * config/mn10300/mn10300.c (SIZE_FMOV_LIMIT): Promote all arms of
+ conditional to type of S.
+ (mn10300_function_arg): Remove unused variable align.
+ (mn10300_arg_partial_bytes): Likewise.
+ * config/mn10300/mn10300.md (attribute cpu): Cast value to
+ enum attr_cpu.
+
2010-11-09 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/46392
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index c0f1180..78d7aa2 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -735,11 +735,14 @@ mn10300_expand_prologue (void)
: (((S) >= (1 << 7)) || ((S) < -(1 << 7))) ? 4 : 2)
#define SIZE_ADD_SP(S) ((((S) >= (1 << 15)) || ((S) < -(1 << 15))) ? 6 \
: (((S) >= (1 << 7)) || ((S) < -(1 << 7))) ? 4 : 3)
+
+/* We add 0 * (S) in two places to promote to the type of S,
+ so that all arms of the conditional have the same type. */
#define SIZE_FMOV_LIMIT(S,N,L,SIZE1,SIZE2,ELSE) \
- (((S) >= (L)) ? (SIZE1) * (N) \
+ (((S) >= (L)) ? 0 * (S) + (SIZE1) * (N) \
: ((S) + 4 * (N) >= (L)) ? (((L) - (S)) / 4 * (SIZE2) \
+ ((S) + 4 * (N) - (L)) / 4 * (SIZE1)) \
- : (ELSE))
+ : 0 * (S) + (ELSE))
#define SIZE_FMOV_SP_(S,N) \
(SIZE_FMOV_LIMIT ((S), (N), (1 << 24), 7, 6, \
SIZE_FMOV_LIMIT ((S), (N), (1 << 8), 6, 4, \
@@ -1459,7 +1462,7 @@ mn10300_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type, bool named ATTRIBUTE_UNUSED)
{
rtx result = NULL_RTX;
- int size, align;
+ int size;
/* We only support using 2 data registers as argument registers. */
int nregs = 2;
@@ -1470,9 +1473,6 @@ mn10300_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
else
size = GET_MODE_SIZE (mode);
- /* Figure out the alignment of the object to be passed. */
- align = size;
-
cum->nbytes = (cum->nbytes + 3) & ~3;
/* Don't pass this arg via a register if all the argument registers
@@ -1521,7 +1521,7 @@ static int
mn10300_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
tree type, bool named ATTRIBUTE_UNUSED)
{
- int size, align;
+ int size;
/* We only support using 2 data registers as argument registers. */
int nregs = 2;
@@ -1532,9 +1532,6 @@ mn10300_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
else
size = GET_MODE_SIZE (mode);
- /* Figure out the alignment of the object to be passed. */
- align = size;
-
cum->nbytes = (cum->nbytes + 3) & ~3;
/* Don't pass this arg via a register if all the argument registers
diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md
index 26126a7..9f2fc9f 100644
--- a/gcc/config/mn10300/mn10300.md
+++ b/gcc/config/mn10300/mn10300.md
@@ -44,7 +44,7 @@
;; Processor type. This attribute must exactly match the processor_type
;; enumeration in mn10300.h.
(define_attr "cpu" "mn10300,am33,am33_2,am34"
- (const (symbol_ref "mn10300_tune_cpu")))
+ (const (symbol_ref "(enum attr_cpu) mn10300_tune_cpu")))
;; Pipeline description.