This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)
- From: Olga Golovanevsky <OLGA at il dot ibm dot com>
- To: "Bingfeng Mei" <bmei at broadcom dot com>
- Cc: gcc at gcc dot gnu dot org, "Kenneth Zadeck" <zadeck at naturalbridge dot com>
- Date: Thu, 1 May 2008 22:31:45 +0300
- Subject: RE: Redundant malloc in structure optimization? (testsuite/gcc.dg/struct/wo_prof_global_var.c)
"Bingfeng Mei" <bmei@broadcom.com> 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. Am I right?
>
Yes, the other file cannot use p, it would be incorrect.
The tests in gcc.dg/struct are running under specific flags
-fwhole-program and -combine, which say the compiler that all program
files are given in one compilation line. You can see it in struct-reorg.exp
file. Only under this flags struct-reorg optimization is activated.
Olga.