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]

Re: [Patch, x86, Darwin] update darwin's x86 output.



On 31 Oct 2010, at 23:38, Richard Henderson wrote:


@@ -11478,8 +11479,25 @@ legitimate_constant_p (rtx x)
...
+    case PLUS:
+      {
+	rtx left = XEXP (x, 0);
+	rtx right = XEXP (x, 1);
+	bool left_is_constant = legitimate_constant_p (left);
+	bool right_is_constant = legitimate_constant_p (right);
+	return left_is_constant && right_is_constant;
+      }
+     /* mdynamic-no-pic */
+ #endif
+      break;

This is very inkorrekt.


PLUS is RTX_COMM_ARITH. A constant must be RTX_CONST_OBJ.

The correct way to handle this is to wrap a PLUS inside of
a CONST, which means this code is in the wrong place, and
the thing that's generating this is also incorrect.


thanks, will try and figure out what's happened here (and why it seems to work).
Iain



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