Skip to content
Snippets Groups Projects
Commit 4479f1dc authored by YunQiang Su's avatar YunQiang Su
Browse files

MIPS: Not trigger error for pre-R6 and -mcompact-branches=always

For MIPSr6, we may wish to use compact-branches only.
Currently, we have to use `always' option, while it is mark as conflict
with pre-R6.
  cc1: error: unsupported combination: ‘mips32r2’ -mcompact-branches=always
Just ignore -mcompact-branches=always for pre-R6.

This patch also defines
    __mips_compact_branches_never
    __mips_compact_branches_always
    __mips_compact_branches_optimal
predefined macros

gcc/ChangeLog:
	* config/mips/mips.cc (mips_option_override): not trigger error
	for compact-branches=always for pre-R6.
	* config/mips/mips.h (TARGET_RTP_PIC): not trigger error for
	compact-branches=always for pre-R6.
	(TARGET_CB_NEVER): Likewise.
	(TARGET_CB_ALWAYS): Likewise.
	(struct mips_cpu_info): define macros for compact branch policy.
	* doc/invoke.texi: Document "always" with pre-R6.

gcc/testsuite/ChangeLog:
	* gcc.target/mips/compact-branches-1.c: add isa_rev>=6.
	* gcc.target/mips/mips.exp: don't add -mipsXXr6 option for
	-mcompact-branches=always. It is usable for pre-R6 now.
	* gcc.target/mips/compact-branches-8.c: New test.
	* gcc.target/mips/compact-branches-9.c: New test.
parent 7d888535
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment