re PR target/67400 (-fno-plt doesn't work with function pointers)
authorUros Bizjak <uros@gcc.gnu.org>
Wed, 22 Jun 2016 22:06:56 +0000 (00:06 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 22 Jun 2016 22:06:56 +0000 (00:06 +0200)
commite3d62871c36f7209a18a20e52b245672a45bf81b
tree218b567e6839bc92c4214e608198c378c7df8cd5
parent37c467c0a543e4df3c09da8e327cccbda9e45477
re PR target/67400 (-fno-plt doesn't work with function pointers)

PR target/67400
* config/i386/i386-protos.h (ix86_force_load_from_GOT_p): New.
* config/i386/i386.c (ix86_force_load_from_GOT_p): New function.
(ix86_legitimate_constant_p): Do not allow UNSPEC_GOTPCREL if
ix86_force_load_from_GOT_p returns true.
(ix86_legitimate_address_p): Allow UNSPEC_GOTPCREL if
ix86_force_load_from_GOT_p returns true.
(ix86_print_operand_address_as): Support UNSPEC_GOTPCREL if
ix86_force_load_from_GOT_p returns true.
(ix86_expand_move): Load the external function address via the
GOT slot if ix86_force_load_from_GOT_p returns true.
* config/i386/predicates.md (x86_64_immediate_operand): Return
false for SYMBOL_REFs where ix86_force_load_from_GOT_p returns true.
(x86_64_zext_immediate_operand): Ditto.

testsuite/ChangeLog:

PR target/67400
        * gcc.target/i386/pr67400-1.c: New test.
        * gcc.target/i386/pr67400-2.c: Likewise.
        * gcc.target/i386/pr67400-3.c: Likewise.
        * gcc.target/i386/pr67400-4.c: Likewise.
        * gcc.target/i386/pr67400-5.c: Likewise.
        * gcc.target/i386/pr67400-6.c: Likewise.
        * gcc.target/i386/pr67400-7.c: Likewise.

From-SVN: r237720
12 files changed:
gcc/ChangeLog
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/predicates.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr67400-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr67400-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr67400-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr67400-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr67400-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr67400-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr67400-7.c [new file with mode: 0644]