powerpc: Restore bootstrap for PPC Darwin.

Message ID 77F388BB-7D66-4871-ABE1-C12EBB4CFDC1@sandoe.co.uk
State New
Headers show
Series
  • powerpc: Restore bootstrap for PPC Darwin.
Related show

Commit Message

Iain Sandoe June 24, 2020, 3:15 p.m.
Hi,

Darwin has signed chars and the fields in the insn_data
struct are const char, which leads to a bootstrap fail with

"error: comparison of integer expressions of different signedness: 'unsigned int' and 'const char' [-Werror=sign-compare]”

OK for master?
Iain

gcc/ChangeLog:

	* config/rs6000/rs6000-call.c (mma_init_builtins): Cast
	the insn_data n_operands value to unsigned.
---
 gcc/config/rs6000/rs6000-call.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.8.1

Comments

Segher Boessenkool June 24, 2020, 5:35 p.m. | #1
Hi!

On Wed, Jun 24, 2020 at 04:15:53PM +0100, Iain Sandoe wrote:
> Darwin has signed chars and the fields in the insn_data

> struct are const char, which leads to a bootstrap fail with

> 

> "error: comparison of integer expressions of different signedness: 'unsigned int' and 'const char' [-Werror=sign-compare]”

> 

> OK for master?


Of course, pretty much trivial :-)  Thanks Iain!


Segher

Patch

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 81816a5..8d9be44 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -13435,7 +13435,7 @@  mma_init_builtins (void)
 	{
 	  /* This is a normal MMA built-in function.  */
 	  unsigned j = (attr & RS6000_BTC_QUAD) ? 1 : 0;
-	  for (; j < insn_data[icode].n_operands; j++)
+	  for (; j < (unsigned) insn_data[icode].n_operands; j++)
 	    {
 	      machine_mode mode = insn_data[icode].operand[j].mode;
 	      if (gimple_func && mode == PXImode)