This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/17064] New: -falias-noargument-global doesn't eliminate dead stores


When the following example is compiled with -fargument-noalias-global, the 
store *p=1 is dead and should be removed. 
-fargument-noalias-global is the default for Fortran. 
 
#include <stdlib.h> 
int i; 
int j; 
 
void bar(void) 
{ 
  i = 42; 
} 
 
void foo(int * p) 
{ 
  *p = 1;/* This store is dead with -fargument-noalias-global.  */ 
  bar (); 
  *p = 2; 
} 
 
int main() 
{ 
  i = 0; 
  j = 0; 
  foo(&j); 
  if (i != 42 || j != 2) 
    abort(); 
  return 0; 
}

-- 
           Summary: -falias-noargument-global doesn't eliminate dead stores
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pbrook at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17064


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]