From: J"orn Rennecke Date: Tue, 16 Aug 2005 11:57:07 +0000 (+0000) Subject: re PR middle-end/20396 (TRULY_NOOP_TRUNCATION ignored) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28f52a4d8eb0703eadd9eb19df729c69a6b5cd23;p=platform%2Fupstream%2Fgcc.git re PR middle-end/20396 (TRULY_NOOP_TRUNCATION ignored) 2005-08-16 J"orn Rennecke Richard Shann PR middle-end/20396: * optabs.c (expand_binop): Take TRULY_NOOP_TRUNCATION into account. Co-Authored-By: Richard Shann From-SVN: r103153 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c9df105..9d613e4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-08-16 J"orn Rennecke + Richard Shann + + PR middle-end/20396: + * optabs.c (expand_binop): Take TRULY_NOOP_TRUNCATION into account. + 2005-08-16 Sebastian Pop * tree-ssa-loop-niter.c (scev_probably_wraps_p): Reword a comment. 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);