On Fri, Mar 30, 2012 at 11:05 AM, Jack Howarth <howa...@bromo.med.uc.edu> wrote:
> On Fri, Mar 30, 2012 at 09:18:13AM -0700, H.J. Lu wrote:
>> On Fri, Mar 30, 2012 at 8:11 AM, Rainer Orth
>> <r...@cebitec.uni-bielefeld.de> wrote:
>> > Mike Stump <mikest...@comcast.net> writes:
>> >
>> >>> Here is the new patch.  OK for trunk if there are no regressions on
>> >>> Linux/ia32 and Linux/x86-64?
>> >>
>> >> Too bad you didn't test 32-bit darwin, causes:
>> >>
>> >>   http://gcc.gnu.org/PR52784
>> >>
>> >> Could you please revert or fix, thanks.
>> >
>> > Same problem on Solaris 10 and 11/x86.
>> >
>> >        Rainer
>> >
>>
>> When i[34567]86-*-* targets are configured with --enable-targets=all,
>> TARGET_BI_ARCH is defined as 1, but TARGET_64BIT_DEFAULT
>> isn't defined.  It leads to
>>
>>    if (!TARGET_64BIT)
>>      ix86_isa_flags &= ~(OPTION_MASK_ABI_64 | OPTION_MASK_ABI_X32);
>>
>> Since TARGET_64BIT is false by default, -m64 and -mx32 don't work
>> correctly.  This patch changes TARGET_BI_ARCH to 3 for
>> i[34567]86-*-* targets configured with --enable-targets=all.  Tested on
>> Linux/ia32 with bootstrap and Linux/ia32 with --enable-targets=all
>> --disable-bootstrap.  Please try on other OSes.
>
> H.J.,
>   This patch solves the bootstrap of current gcc trunk on
> i386-apple-darwin10. Thanks.
>          Jack
>

Here is a smaller patch.


-- 
H.J.
2012-03-30  H.J. Lu  <hongjiu...@intel.com>

	PR bootstrap/52784
	* config/i386/i386.c (ix86_option_override_internal): Don't
	check OPTION_MASK_ABI_64 nor OPTION_MASK_ABI_X32 if
	TARGET_BI_ARCH isn't defined or TARGET_64BIT_DEFAULT is 0.

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 42746e4..3905287 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3117,11 +3117,13 @@ ix86_option_override_internal (bool main_args_p)
   SUBSUBTARGET_OVERRIDE_OPTIONS;
 #endif
 
-  /* Turn off both OPTION_MASK_ABI_64 and OPTION_MASK_ABI_X32 if
-     TARGET_64BIT is false.  */
+#if defined TARGET_BI_ARCH && TARGET_64BIT_DEFAULT
+  /* When TARGET_64BIT_DEFAULT isn't defined, TARGET_64BIT is false by
+     default and there is no need to check OPTION_MASK_ABI_64 nor
+     OPTION_MASK_ABI_X32.  Turn off both OPTION_MASK_ABI_64 and
+     OPTION_MASK_ABI_X32 if TARGET_64BIT is false.  */
   if (!TARGET_64BIT)
     ix86_isa_flags &= ~(OPTION_MASK_ABI_64 | OPTION_MASK_ABI_X32);
-#ifdef TARGET_BI_ARCH
   else
     {
 #if TARGET_BI_ARCH == 1

Reply via email to