https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45410

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #7)
> I think the real issue is we don't know that printf does not change the
> value of ss.j

Yes and that be shown by:
```
struct s {int i;int j;};
struct s static ss={77,2};
void g() __attribute__((leaf));
int
main() 
{
        ss.j += 88;
        g();
        return ss.i+ss.j;
};
``` 

Where ss.j is not reloaded after the call to g.

Since printf is not declared as leaf as there glibc's printf has an extension
which allows call backs.

Except in some languages main cannot be called more than once ...

Reply via email to