This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: extended asm and input parameters
- From: dw <limegreensocks at yahoo dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 04 Jul 2013 03:07:48 -0700
- Subject: Re: extended asm and input parameters
- References: <51D38159 dot 5000907 at yahoo dot com> <51D4D327 dot 6080803 at yahoo dot com> <51D53E30 dot 5010103 at redhat dot com>
Hey Andrew, thanks for the response.
> main:
> .LFB1:
> leaq -32(%rsp), %rdi
> movl $32, %ecx
> xorl %eax, %eax
> #APP
> # 2 "z.c" 1
> rep stosb
> # 0 "" 2
> # 2 "z.c" 1
> rep stosb
> # 0 "" 2
> #NO_APP
> xorl %eax, %eax
> ret
Interesting. So, you are getting the duplicate zeroing of eax, but not
the duplicate loading of rdi. That's certainly an improvement.
I'm using 4.8.0. You? If this is something that was improved in 4.8.1,
perhaps it's time for me to upgrade.
Any special compile switches other than -Os?
> By the way, your asm is wrong: stosb modifies its registers, and you
> must tell GCC that.
I'll assume this was intended to be humorous. Having just
discovered/concluded that the compiler must be informed if I change the
contents of input-only parameters, you may safely assume I made the
appropriate change. However, the optimization issues I observed while
experimenting with this are still of some interest.
Thanks,
dw