[PATCH 5/5] x86: Disallow -mindirect-branch=/-mfunction-return= with -mcmodel=large

H.J. Lu hjl.tools@gmail.com
Sun Jan 14 14:20:00 GMT 2018


On Sun, Jan 14, 2018 at 2:47 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
>> Since the thunk function may not be reachable in large code model,
>> -mcmodel=large is incompatible with -mindirect-branch=thunk,
>> -mindirect-branch=thunk-extern, -mfunction-return=thunk and
>> -mfunction-return=thunk-extern.  Issue an error when they are used with
>> -mcmodel=large.
>>
>> gcc/
>>
>>       * config/i386/i386.c (ix86_set_indirect_branch_type): Disallow
>>       -mcmodel=large with -mindirect-branch=thunk,
>>       -mindirect-branch=thunk-extern, -mfunction-return=thunk and
>>       -mfunction-return=thunk-extern.
>>       * doc/invoke.texi: Document -mcmodel=large is incompatible with
>>       -mindirect-branch=thunk, -mindirect-branch=thunk-extern,
>>       -mfunction-return=thunk and -mfunction-return=thunk-extern.
>>
>> gcc/testsuite/
>>
>>       * gcc.target/i386/indirect-thunk-10.c: New test.
>>       * gcc.target/i386/indirect-thunk-8.c: Likewise.
>>       * gcc.target/i386/indirect-thunk-9.c: Likewise.
>>       * gcc.target/i386/indirect-thunk-attr-10.c: Likewise.
>>       * gcc.target/i386/indirect-thunk-attr-11.c: Likewise.
>>       * gcc.target/i386/indirect-thunk-attr-9.c: Likewise.
>>       * gcc.target/i386/ret-thunk-17.c: Likewise.
>>       * gcc.target/i386/ret-thunk-18.c: Likewise.
>>       * gcc.target/i386/ret-thunk-19.c: Likewise.
>>       * gcc.target/i386/ret-thunk-20.c: Likewise.
>>       * gcc.target/i386/ret-thunk-21.c: Likewise.
>
> OK.
> Honza

This is the patch I am checking in to only run tests on LP64 since
-mcmodel=large doesn't work with -mx32.

Thanks.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-x86-Disallow-mindirect-branch-mfunction-return-with-.patch
Type: text/x-patch
Size: 11918 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180114/da452fe8/attachment.bin>


More information about the Gcc-patches mailing list