[Bug c++/91895] Compile the code with -O1 or -O2 is slower than with -O3 and -Os
marxin at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Sep 25 09:22:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91895
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |marxin at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
With GCC 9 we end up with the following code with -O and higher optimization
levels:
$ gcc pr91895.c -O -fdump-tree-optimized=/dev/stdout
;; Function foo (foo, funcdef_no=0, decl_uid=1915, cgraph_uid=1,
symbol_order=5)
foo ()
{
<bb 2> [local count: 222998]:
d = 17;
c = 17;
b = 17;
a = 17;
return;
}
;; Function main (main, funcdef_no=1, decl_uid=1930, cgraph_uid=2,
symbol_order=6) (executed once)
main ()
{
<bb 2> [local count: 1073741824]:
foo ();
return 0;
}
More information about the Gcc-bugs
mailing list