aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Koning <ni1d@arrl.net>2018-07-14 15:15:47 -0400
committerPaul Koning <pkoning@gcc.gnu.org>2018-07-14 15:15:47 -0400
commitba8d277ab0053f5ccae84081343f791c15a36452 (patch)
tree5b87dcd11cc3958f0159796a6b6559ce00654f86
parent025acb59146aa0f25a9ff4d86dd53e2421ed0a09 (diff)
downloadgcc-ba8d277ab0053f5ccae84081343f791c15a36452.zip
gcc-ba8d277ab0053f5ccae84081343f791c15a36452.tar.gz
gcc-ba8d277ab0053f5ccae84081343f791c15a36452.tar.bz2
* config/pdp11/pdp11.c (pdp11_rtx_costs): Bugfixes.
From-SVN: r262659
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/pdp11/pdp11.c18
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 14bfd9e..776a3c4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2018-07-14 Paul Koning <ni1d@arrl.net>
+
+ * config/pdp11/pdp11.c (pdp11_rtx_costs): Bugfixes.
+
2018-07-13 Jan Hubicka <hubicka@ucw.cz>
* lto-streamer-out.c (copy_function_or_variable): Dump info about
diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c
index 834c4ea..1bcdaed 100644
--- a/gcc/config/pdp11/pdp11.c
+++ b/gcc/config/pdp11/pdp11.c
@@ -1014,6 +1014,7 @@ pdp11_rtx_costs (rtx x, machine_mode mode, int outer_code,
const int code = GET_CODE (x);
const int asize = (mode == QImode) ? 2 : GET_MODE_SIZE (mode);
rtx src, dest;
+ const char *fmt;
switch (code)
{
@@ -1035,12 +1036,29 @@ pdp11_rtx_costs (rtx x, machine_mode mode, int outer_code,
*total = pdp11_addr_cost (x, mode, ADDR_SPACE_GENERIC, speed);
return true;
}
+ if (GET_RTX_LENGTH (code) == 0)
+ {
+ if (speed)
+ *total = 0;
+ else
+ *total = 2;
+ return true;
+ }
/* Pick up source and dest. We don't necessarily use the standard
recursion in rtx_costs to figure the cost, because that would
count the destination operand twice for three-operand insns.
Also, this way we can catch special cases like move of zero, or
add one. */
+ fmt = GET_RTX_FORMAT (code);
+ if (fmt[0] != 'e' || (GET_RTX_LENGTH (code) > 1 && fmt[1] != 'e'))
+ {
+ if (speed)
+ *total = 0;
+ else
+ *total = 2;
+ return true;
+ }
if (GET_RTX_LENGTH (code) > 1)
src = XEXP (x, 1);
dest = XEXP (x, 0);