User account creation filtered due to spam.

Bug 25528 - missed LIM on the tree level (complex types)
Summary: missed LIM on the tree level (complex types)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.2.0
: P3 enhancement
Target Milestone: 4.2.0
Assignee: Andrew Pinski
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: alias, missed-optimization, patch, TREE
Depends on:
Blocks:
 
Reported: 2005-12-22 04:46 UTC by Andrew Pinski
Modified: 2006-01-06 15:01 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-12-25 01:09:23


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-12-22 04:46:16 UTC
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.
Comment 1 Andrew Pinski 2005-12-25 01:09:23 UTC
there are other stuff which is missed by not having SFTs for complex types.

Confirmed, if I get sometime, I will see what I can do about adding them.
Comment 2 Andrew Pinski 2005-12-28 21:18:25 UTC
I have a fix.
Comment 3 Andrew Pinski 2005-12-29 17:21:12 UTC
Patch here: http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01906.html
Comment 4 Andrew Pinski 2006-01-06 15:00:56 UTC
Subject: Bug 25528

Author: pinskia
Date: Fri Jan  6 15:00:50 2006
New Revision: 109419

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109419
Log:
2006-01-06  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/25528
        * tree-ssa-alias.c (find_used_portions): Handle REALPART_EXPR
        and IMAGPART_EXPR.
        * tree-flow-inline.h (var_can_have_subvars): Handle complex types
        on non gimple variables.  Also add checks at the top for decls and
        mtags.
        * tree-ssa-structalias.c (push_fields_onto_fieldstack): Handle
        complex types.
        * tree-ssa-operands.c (parse_ssa_operands): Handle REALPART_EXPR
        and IMAGPART_EXPR for creating MUST_DEFs.
        (get_expr_operands): Handle SSA_NAME, STRUCT_FIELD_TAG, TYPE_MEMORY_TAG,
        and NAME_MEMORY_TAG separately from the DECLs.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-flow-inline.h
    trunk/gcc/tree-ssa-alias.c
    trunk/gcc/tree-ssa-operands.c
    trunk/gcc/tree-ssa-structalias.c

Comment 5 Andrew Pinski 2006-01-06 15:01:08 UTC
Fixed.