[Bug middle-end/23477] [4.1 Regression] default-initializing array new expression uses makes stack usage go way up
--- Comment #7 from pinskia at gcc dot gnu dot org 2006-01-20 20:51 --- *** Bug 23631 has been marked as a duplicate of this bug. *** -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23477
[Bug middle-end/23477] [4.1 Regression] default-initializing array new expression uses makes stack usage go way up
--- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-08-31 11:21 --- Subject: Bug 23477 CVSROOT:/cvs/gcc Module name:gcc Changes by: [EMAIL PROTECTED] 2005-08-31 11:20:48 Modified files: gcc: ChangeLog expr.c Log message: 2005-08-31 Richard Guenther [EMAIL PROTECTED] PR middle-end/23477 * expr.c (all_zeros_p): New function. (expand_expr_real_1): Handle the case of an all-zero non-addressable constructor separately. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gccr1=2.9855r2=2.9856 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/expr.c.diff?cvsroot=gccr1=1.811r2=1.812 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23477
[Bug middle-end/23477] [4.1 Regression] default-initializing array new expression uses makes stack usage go way up
--- Additional Comments From rguenth at gcc dot gnu dot org 2005-08-31 11:21 --- Fixed. -- What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23477
[Bug middle-end/23477] [4.1 Regression] default-initializing array new expression uses makes stack usage go way up
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-30 10:39 --- *** Bug 23631 has been marked as a duplicate of this bug. *** -- What|Removed |Added CC||etienne_lorrain at yahoo dot ||fr http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23477
[Bug middle-end/23477] [4.1 Regression] default-initializing array new expression uses makes stack usage go way up
--- Additional Comments From rguenth at gcc dot gnu dot org 2005-08-30 13:16 --- Patch submitted. -- What|Removed |Added URL||http://gcc.gnu.org/ml/gcc- ||patches/2005- ||08/msg01747.html Keywords||patch http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23477
[Bug middle-end/23477] [4.1 Regression] default-initializing array new expression uses makes stack usage go way up
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-19 11:28 --- This has been semi fixed on the mainline: main: pushl %ebp movl%esp, %ebp pushl %esi pushl %ebx subl$4000, %esp pushl $4000 call_Znaj leal-4008(%ebp), %ebx pushl $4000 pushl $0 pushl %ebx movl%eax, %esi callmemset pushl $4000 pushl %ebx pushl %esi callmemcpy leal-8(%ebp), %esp xorl%eax, %eax popl%ebx popl%esi popl%ebp ret But in fact this is worse as the reason for the heap allocation is to avoid the stack usage at all and now there is 40MB allocated on the stack. The problem is in the middle-end: *(int[1000] *) D.1731 = {}; Note the memcpy is an improvement over what before 4.0.0 had of writting out element by element. 4.1's problem is a regression in terms of stack usage which should not have happen. -- What|Removed |Added Status|UNCONFIRMED |NEW Component|c++ |middle-end Ever Confirmed||1 GCC build triplet|i386-redhat-linux | GCC host triplet|i386-redhat-linux | GCC target triplet|i386-redhat-linux | Keywords||missed-optimization Last reconfirmed|-00-00 00:00:00 |2005-08-19 11:28:34 date|| Summary|default-initializing array |[4.1 Regression] default- |new expression uses memcpy()|initializing array new |instead of memset(), bloats |expression uses makes stack |executable |usage go way up Target Milestone|--- |4.1.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23477