User account creation filtered due to spam.

Bug 35302 - Missing partial dead store elimination
Summary: Missing partial dead store elimination
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: unknown
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization
Depends on:
Blocks:
 
Reported: 2008-02-23 05:07 UTC by davidxl
Modified: 2016-12-08 19:31 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-12-29 06:41:09


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description davidxl 2008-02-23 05:07:03 UTC
This is a known problem -- file it to keep track of it.

In the following example, stores at (1) -- the array initializers are partially dead -- not sinked.

struct A{
  int a[100];
};

const struct A aa = {1,1,1};

int foo(int i)
{
     int s = 0;
     struct A a = {1,1,1}; // (1)

     if (i)
     {
       a  =  aa;

       s += a.a[i];
     }
     s += a.a[i];

     return s;
}
Comment 1 Andrew Pinski 2008-12-29 06:41:09 UTC
Confirmed.
Comment 2 Jeffrey A. Law 2016-12-08 19:31:48 UTC
Richi fixed this back in 2009:

    2009-11-23  Richard Guenther  <rguenther@suse.de>
    
        * tree-dfa.c (get_ref_base_and_extent): Adjust maximum access
        size for DECL bases.