This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Too conservative optimization with global variables??
- From: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 16 Jun 2003 12:59:51 +0200
- Subject: [tree-ssa] Too conservative optimization with global variables??
Consider:
extern int c;
void fubar (void)
{
int a, b;
a = 1; b = 2; c = 3;
c = a * b * c;
}
With -O1 and -O2 this optimizes to (t15.optimized dump):
;; Function fubar (fubar)
fubar()
{
int T.1;
int a;
int b;
c = 3;
c = c * 2;
}
Why can't this just be folded to "c = 6;"?
Gr.
Steven