This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix trunk bootstrap on darwin following the commit for PR16302


Hi all,

Following http://gcc.gnu.org/ml/gcc-cvs/2009-05/msg00572.html, bootstrap
fails on i386-apple-darwin9.7.0 with the following error during stage 2:

../../src/gcc/config/darwin.c: In function
'machopic_indirect_data_reference':
../../src/gcc/config/darwin.c:579: error: logical 'and' of mutually
exclusive tests is always false

due to "if (MACHOPIC_JUST_INDIRECT && GET_CODE (base) == MEM)" with
MACHOPIC_JUST_INDIRECT being 0.

The attached patch fixes this by turning this into two ifs. It's been
successfully bootstrapped on i386-apple-darwin9.7.0. Is it OK for the trunk?

Best regards,
Simon







2009-05-16  Simon Martin  <simartin@users.sourceforge.net>

	* config/darwin.c (machopic_indirect_data_reference): Split the
	condition into two to avoid a warning.




Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c	(revision 147604)
+++ gcc/config/darwin.c	(working copy)
@@ -576,18 +576,19 @@ machopic_indirect_data_reference (rtx or
       else
 	result = gen_rtx_PLUS (Pmode, base, orig);
 
-      if (MACHOPIC_JUST_INDIRECT && GET_CODE (base) == MEM)
-	{
-	  if (reg)
-	    {
-	      emit_move_insn (reg, result);
-	      result = reg;
-	    }
-	  else
-	    {
-	      result = force_reg (GET_MODE (result), result);
-	    }
-	}
+      if (MACHOPIC_JUST_INDIRECT)
+	if (GET_CODE (base) == MEM)
+	  {
+	    if (reg)
+	      {
+		emit_move_insn (reg, result);
+		result = reg;
+	      }
+	    else
+	      {
+		result = force_reg (GET_MODE (result), result);
+	      }
+	  }
 
       return result;
 





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]