[Patch, mips] Fix compiler abort with -mips32r2 -mips16 -msynci
Richard Sandiford
rdsandiford@googlemail.com
Wed Jul 18 17:30:00 GMT 2012
"Steve Ellcey " <sellcey@mips.com> writes:
> While working on my favorite mips option (-msynci) I noticed an odd thing.
> If I compile with '-mips32 -mips16 -msynci' I got a warning about synci not
> being supported but if I compiled with '-mips32r2 -mips16 -msynci' I did not
> get a warning, even though -mips16 mode does not support synci. Furthermore
> if I compiled a program that called __builtin___clear_cache with '-mips32r2
> -mips16 -msynci', the compiler would abort.
The abort sounds like the bug here. It's deliberate that things like
-msynci, -mbranch-likely, etc., are OK with -mips16. On the one hand,
you could compile with -mips16 but have an __attribute__((nomips16))
function that could benefit from using SYNCI. On the other, you could
compile without -mips16 but have an __attribute__((mips16)) function
that needs to avoid SYNCI.
-mips16 really just sets the default ISA mode for functions that don't
specify one. That's why override_options hides mips16ness so early on,
like you say.
Richard
More information about the Gcc-patches
mailing list