>>> On 31.10.14 at 20:02, <l...@redhat.com> wrote: > On 10/31/14 02:07, Jan Beulich wrote: >> While it always seemed wrong to me that there's no way to avoid the >> default "flags" and "fpsr" clobbers, the regression the fix for >> PR/60663 introduced (see PR/63637) makes it even more desirable to have >> such a mechanism: This way, at least asm()s with a single output and no >> explicit clobbers can again be made subject to CSE. >> >> gcc: >> 2014-10-31 Jan Beulich <jbeul...@suse.com> >> >> * config/i386/i386.c (ix86_target_string): Add >> -mno-default-asm-clobbers. >> (ix86_valid_target_attribute_inner_p): Handle >> -m{,no-}default-asm-clobbers. >> (ix86_md_asm_clobbers): Handle "inverse" clobbers. >> * config/i386/i386.h (NOCC_REGNUM, NOFPSR_REGNUM): Define. >> (ADDITIONAL_REGISTER_NAMES): Add "cc", "!cc", "!flags", and >> "!fpsr". >> * config/i386/i386.opt: Add mdefault-asm-clobbers and >> mno-default-asm-clobbers. >> * varasm.c (decode_reg_name_and_count): Permit negative >> register numbers in ADDITIONAL_REGISTER_NAMES. >> >> gcc/testsuite: >> 2014-10-31 Jan Beulich <jbeul...@suse.com> >> >> * gcc.target/i386/20060218-1.c: Adjust expected error. >> * gcc.target/i386/invclbr[123].c: New. > I really don't like having an option that's globally applied for this > feature. THough I am OK with having a mechanism to avoid implicit > clobbers on specific ASMs.
Why not? That way, for projects/components knowing all their asm()s have all clobbers explicitly specified they could avoid having to touch all of them and instead just pass the new option. That said - if the option isn't being liked, I'm fine dropping it. > Why use negative numbers for the hard register numbers? I wouldn't be > at all surprised if lots of random code assumes register numbers are > always positive. I think I want through all relevant places, and fixed the one where the assumption was wrongly made. The nice thing about using negative numbers here is that there is already at least one place where negative numbers aren't valid, and we want them to not be valid there. > I don't like adding new registers with special names like !foo. Instead > I think that listing "!cc" or something similar in the asm itself if it > doesn't clobber the cc register would be better. You mean interpreting the ! in generic code? Doable, but not very nice imo considering that the default addition of clobbers is limited to very few architectures, plus dealing with this in a generic way would - afaict - make the change quite a bit more intrusive. Jan