[ARM] Fix PR target/79239 - unrecognized insn after pragma gcc pop_options
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 27 Jan 2017 11:22:30 +0000 (11:22 +0000)
committerRamana Radhakrishnan <ramana@gcc.gnu.org>
Fri, 27 Jan 2017 11:22:30 +0000 (11:22 +0000)
commit6ca513f9b24dacf47db395f4dc41d11037810706
tree1fd60ff0eee31a4f0c215b265fb2431ef590d8c3
parentc7181f1393788572fa451bfd8d45d62c8889dd50
[ARM] Fix PR target/79239 - unrecognized insn after pragma gcc pop_options

{committed for rearnsha}

It turns out that because the compiler uses a hash table to save the
cl_target_option structures it is unsafe to modify the result of
build_target_option_node() (doing so will cause the hash lookup to
fail).  This PR was due to not properly understanding this limitation.

The fix is to create temporary copies of the cl_target_option nodes for
use during target option processing and then only creating the tree node
once the options have been suitably modified.

gcc:
        PR target/79239
        * arm.c (arm_option_override): Don't call build_target_option_node
        until after doing all option overrides.
        (arm_valid_target_attribute_tree): Likewise.

gcc/testsuite:
        * gcc.target/arm/pr79239.c: New test.

From-SVN: r244965
gcc/ChangeLog
gcc/config/arm/arm.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr79239.c [new file with mode: 0644]