RISC-V: Fix __riscv_compressed regression.
authorJim Wilson <jimw@sifive.com>
Fri, 29 Mar 2019 21:51:58 +0000 (21:51 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Fri, 29 Mar 2019 21:51:58 +0000 (14:51 -0700)
commit76d4accffd19a094761bf25b2d66435ce6642105
tree25679b323cfe11e1cf4d4467072deab3944f32be
parent54ae50ac4532b2a0d72cc03639b8179b500ec043
RISC-V: Fix __riscv_compressed regression.

This was accidentally broken by the patch adding ELF attribute support.
The __riscv_compressed predefined macro is not being defined when the
target supports the C extension.  The fix adds testcases to verify that
all of the predefined macros are correct for various option combinations.

gcc/
* common/config/riscv/riscv-common.c (riscv_parse_arch_string):
Clear MASK_RVC and then set if C subset supported.

gcc/testsuite/
* gcc.target/riscv/predef-1.c: New.
* gcc.target/riscv/predef-2.c: New.
* gcc.target/riscv/predef-3.c: New.
* gcc.target/riscv/predef-4.c: New.
* gcc.target/riscv/predef-5.c: New.
* gcc.target/riscv/predef-6.c: New.
* gcc.target/riscv/predef-7.c: New.
* gcc.target/riscv/predef-8.c: New.

From-SVN: r270026
gcc/ChangeLog
gcc/common/config/riscv/riscv-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/riscv/predef-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-7.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-8.c [new file with mode: 0644]