On Tue, 24 Apr 2018, Michael Matz wrote:
> Sure but even for that we need to decide if we want to go that or the 
> opposite way, and that's not easy when a deadline is lurking behind you.

I am surprised there is any question. Even gcc-3.4 optimizes reg vars over asms,
on a testcase not unlike the very one you've used I see:

register int foo asm("ebx");

void g(void);

void f(void)
{
    foo=0;
    asm("foo=1");
    if (foo) g();
}

.globl f
        .type   f, @function
f:
.LFB2:
        xorl    %ebx, %ebx
#APP
        foo=1
#NO_APP
        ret


(here GCSE makes the propagation)

Besides, I don't really understand the objection about changing the docs for
gcc-8.1. Even if there's a doubt about future development, improving the
documentation to explain the behavior of a released compiler should be good.
Right now the docs are simply wrong.

Alexander

Reply via email to