Take the following code: int f(void) { static _Complex double t; int i, j; for(i = 0;i<2;i++) for(j = 0;j<2;j++) t *= .5 * 1.0; return t; }
--- At -O1, we get on the tree level for the loop: <L7>:; CI.33 = IMAGPART_EXPR <t> * 5.0e-1; REALPART_EXPR <t> = REALPART_EXPR <t> * 5.0e-1; IMAGPART_EXPR <t> = CI.33; REALPART_EXPR <t> = REALPART_EXPR <t> * 5.0e-1; IMAGPART_EXPR <t> = CI.33 * 5.0e-1; i = i + 1; if (i != 2) goto <L7>; else goto <L5>; The stores to t is not pulled at all out of the loop. -- Summary: missed LIM on the tree level (complex types) Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: missed-optimization, TREE Severity: enhancement Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25528