The XXX in boolean context warning is now triggering on a bit of code in the iq2000 backend. I'm trying to guess Stan's intent from 2003. If I've got it wrong, the worst that happens in an incorrect cost computation.

Installing on the trunk.

Jeff
commit 6ed89ddbdbbde3ffd42b2ab6fad61a76e85918f8
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Nov 23 18:10:53 2016 +0000

        * config/iq2000/iq2000.c (iq2000_rtx_costs): Avoid multiplication
        in boolean context warning.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242787 
138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index db002f7..b8a968e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -7,6 +7,9 @@
 
 2016-11-23  Jeff Law  <l...@redhat.com>
 
+       * config/iq2000/iq2000.c (iq2000_rtx_costs): Avoid multiplication
+       in boolean context warning.
+
        * config/ia64/ia64.c (ia64_emit_insn_before): Fix prototype.
 
 2016-11-23  James Greenhalgh  <james.greenha...@arm.com>
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 2c936da..a3195db 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -3309,7 +3309,7 @@ iq2000_rtx_costs (rtx x, machine_mode mode, int 
outer_code ATTRIBUTE_UNUSED,
        int num_words = (GET_MODE_SIZE (mode) > UNITS_PER_WORD) ? 2 : 1;
 
        if (simple_memory_operand (x, mode))
-         return COSTS_N_INSNS (num_words);
+         return COSTS_N_INSNS (num_words) != 0;
 
        * total = COSTS_N_INSNS (2 * num_words);
        break;

Reply via email to