On 8 Apr 2012, at 15:54, H.J. Lu wrote:
Despite the fact that bootstrap is restored, there remain problems
patch and some more work is needed.
(a) [trivial] the option 'mx32' is in i386.opt, which means it is
all sub-targets, even if they don't support it.
$ ./gcc/xgcc -Bgcc ../tests/hello.c -mx32 -o hc
register name `%rbp'
register name `%rsi'
It is useful for bootstrap and allows you check out what
X32 code looks like even if your OS doesn't support it.
well, OK, but I'd have thought that to be something for developers to
experiment with, rather than an 'end user' flag.
However, it is, as stated 'trivial' I'm not going to lose sleep over
(b) [serious] the m64 ObjC multi-lib is broken on i?86-darwin* (and
there are other more subtle effects).
This is because the code in config/darwin.c that Joseph pointed out
in this thread) is called for SUBSUBTARGET_OVERRIDE_OPTIONS.
That code sets defaults for, and checks errors for, flags that
*-*-darwin* (and are needed for LTO as well as c-family).
In the case of the ObjC ABI (fobjc-abi-version=) we need to default
"2" @ m64 (and default it to 0 or 1 depending on the darwin version
I accept that some of this could possibly be done in driver-self-
however, we allow m32/m64 to be unspecified on the c/l and to
the target. I'm also not yet sure whether %:version-compare()
applicable to fobjc-abi-version.
Thus, the current trunk implementation is broken by your patch and
to address that pending other solutions (I'm also very short of
for Darwin right now - to experiment with the specs solution).
Please try this
This is not enough to solve the problem, because there are decisions
made earlier (e.g. in c-family/c-opts.c re. exceptions) that depend on
It would be possible to move/repeat some of those (which I did in the
proposed fix attached to my last post).
It is possible that there is an options handling issue, (although I
also have misunderstood) viz:
;; ISA support
Target RejectNegative Negative(m64) Report InverseMask(ISA_64BIT)
Generate 32bit i386 code
Target RejectNegative Negative(mx32) Report Mask(ABI_64)
Generate 64bit x86-64 code
Target RejectNegative Negative(m32) Report Mask(ABI_X32)
Generate 32bit x86-64 code
from gccint.pdf (section 8.2):
The option will turn oﬀ another option othername, which is the
with the leading “-” removed. This chain action will propagate
Negative property of the option to be turned oﬀ.
As a consequence, if you have a group of mutually-exclusive
Negative properties should form a circular chain. For example, if
‘-a ’, ‘-b ’ and ‘-c ’ are mutually exclusive, their
should be ‘Negative(b )’, ‘Negative(c )’ and
I read this as "if the User specifies -a on the command line the
-b *and* the inverse of -c will be applied".
so that when -m64 is issued, the *inverse* of Mask(ABI_X32) should be
applied and then the *inverse* of InverseMask(ISA_64BIT) - which
(correctly, for the case we're considering) set MASK_ISA_64BIT.
However, in the example above this does NOT happen - if I set a
at the entry of x86_internal_override_options - ISA_64BIT ends up
as 0 when
-m64 is specified on the c/l for i?86-darwin*.
The x86_isa_explicit stuff doesn't appear to get set either, although
global_options_set.x_x86_isa... does, which I've used in the
so is this an options bug or misunderstanding on my part?
There is no problem here. ISA_64BIT is turned on by ABI_64:
Well, I accept that your code in i386.c enforces the assumption above
- my point is that the documentation implies (at least to me) that the
enforcement should be done in options processing.
The i386.c enforcement happens *after* some points in the code that
(currently) assume the behavior as I describe above (or as per the
code before your patch).
I am sure that a hybrid of the two patches can be made to work - my
concern is to be clear about what is *supposed* to happen at options