aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <joern.rennecke@st.com>2005-08-16 11:57:07 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2005-08-16 12:57:07 +0100
commit28f52a4d8eb0703eadd9eb19df729c69a6b5cd23 (patch)
tree404fca0a018cd944cf88b31b1982060b87e4d818 /gcc/optabs.c
parent546ad2d9fce6b9ed05b0634a9731db3609414c9d (diff)
downloadgcc-28f52a4d8eb0703eadd9eb19df729c69a6b5cd23.zip
gcc-28f52a4d8eb0703eadd9eb19df729c69a6b5cd23.tar.gz
gcc-28f52a4d8eb0703eadd9eb19df729c69a6b5cd23.tar.bz2
re PR middle-end/20396 (TRULY_NOOP_TRUNCATION ignored)
2005-08-16 J"orn Rennecke <joern.rennecke@st.com> Richard Shann <rshann@superh.com> PR middle-end/20396: * optabs.c (expand_binop): Take TRULY_NOOP_TRUNCATION into account. Co-Authored-By: Richard Shann <rshann@superh.com> From-SVN: r103153
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 466a56c..9f73ac1 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -1184,7 +1184,9 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
if (temp != 0)
{
- if (GET_MODE_CLASS (mode) == MODE_INT)
+ if (GET_MODE_CLASS (mode) == MODE_INT
+ && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
+ GET_MODE_BITSIZE (GET_MODE (temp))))
return gen_lowpart (mode, temp);
else
return convert_to_mode (mode, temp, unsignedp);
@@ -1231,7 +1233,9 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
unsignedp, OPTAB_DIRECT);
if (temp)
{
- if (class != MODE_INT)
+ if (class != MODE_INT
+ || !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
+ GET_MODE_BITSIZE (wider_mode)))
{
if (target == 0)
target = gen_reg_rtx (mode);
@@ -1759,7 +1763,9 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
unsignedp, methods);
if (temp)
{
- if (class != MODE_INT)
+ if (class != MODE_INT
+ || !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
+ GET_MODE_BITSIZE (wider_mode)))
{
if (target == 0)
target = gen_reg_rtx (mode);