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
This commit is contained in:
J"orn Rennecke 2005-08-16 11:57:07 +00:00 committed by Joern Rennecke
parent 546ad2d9fc
commit 28f52a4d8e
2 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,9 @@
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.
2005-08-16 Sebastian Pop <pop@cri.ensmp.fr>
* tree-ssa-loop-niter.c (scev_probably_wraps_p): Reword a comment.

View File

@ -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);