Re: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)

2008-05-01 Thread Olga Golovanevsky
[EMAIL PROTECTED] wrote on 28/04/2008 12:36:44: Hello, I am looking at a testsuite failure (wo_prof_global_var.c) in my porting. Somehow, I found GCC 4.3.0 seems to generate unnecessary malloc during structure optimization. In the code, the structure is split into two individual fields

Re: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)

2008-05-01 Thread Richard Guenther
On Thu, May 1, 2008 at 2:19 PM, Olga Golovanevsky [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote on 28/04/2008 12:36:44: Hello, I am looking at a testsuite failure (wo_prof_global_var.c) in my porting. Somehow, I found GCC 4.3.0 seems to generate unnecessary malloc during

RE: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)

2008-05-01 Thread Bingfeng Mei
To: Bingfeng Mei Cc: gcc@gcc.gnu.org; Kenneth Zadeck Subject: Re: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c) [EMAIL PROTECTED] wrote on 28/04/2008 12:36:44: Hello, I am looking at a testsuite failure (wo_prof_global_var.c) in my porting

Re: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)

2008-05-01 Thread Kenneth Zadeck
: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c) [EMAIL PROTECTED] wrote on 28/04/2008 12:36:44: Hello, I am looking at a testsuite failure (wo_prof_global_var.c) in my porting. Somehow, I found GCC 4.3.0 seems to generate unnecessary malloc

RE: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)

2008-05-01 Thread Bingfeng Mei
:19 To: Bingfeng Mei Cc: gcc@gcc.gnu.org; Kenneth Zadeck Subject: Re: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c) [EMAIL PROTECTED] wrote on 28/04/2008 12:36:44: Hello, I am looking at a testsuite failure (wo_prof_global_var.c) in my

RE: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)

2008-05-01 Thread Olga Golovanevsky
Bingfeng Mei [EMAIL PROTECTED] wrote on 01/05/2008 16:02:16: Olga, Yes, I agree the p is global. But how p is going to be accessed if another file uses p? D.2215 represents the original p, but it is not initialized as p.0.4 and p.0.3 do. It won't be correct if other file tried to use it.

Re: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)

2008-05-01 Thread Olga Golovanevsky
Richard Guenther [EMAIL PROTECTED] wrote on 01/05/2008 16:00:44: On Thu, May 1, 2008 at 2:19 PM, Olga Golovanevsky [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote on 28/04/2008 12:36:44: Hello, I am looking at a testsuite failure (wo_prof_global_var.c) in my porting.

Re: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)

2008-05-01 Thread Richard Guenther
On Thu, May 1, 2008 at 10:42 PM, Olga Golovanevsky [EMAIL PROTECTED] wrote: Richard Guenther [EMAIL PROTECTED] wrote on 01/05/2008 16:00:44: On Thu, May 1, 2008 at 2:19 PM, Olga Golovanevsky [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote on 28/04/2008 12:36:44:

Re: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)

2008-05-01 Thread Daniel Berlin
Sure, a malloc call has side-effects, so a DCE pass cannot just remove it. Only struct-reorg knows that it has replaced all side-effects with others. Malloc only has side effects if the result is used. For example, LLVM will transform int main(int argc, char** argv){

Re: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)

2008-05-01 Thread Daniel Berlin
On Thu, May 1, 2008 at 5:10 PM, Daniel Berlin [EMAIL PROTECTED] wrote: Sure, a malloc call has side-effects, so a DCE pass cannot just remove it. Only struct-reorg knows that it has replaced all side-effects with others. Malloc only has side effects if the result is used. For

Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)

2008-04-28 Thread Bingfeng Mei
Hello, I am looking at a testsuite failure (wo_prof_global_var.c) in my porting. Somehow, I found GCC 4.3.0 seems to generate unnecessary malloc during structure optimization. In the code, the structure is split into two individual fields (D.2240 and D.2242) and they are allocated separately. But