[Bug optimization/12268] New: Miscompilation of fortran/match.c

pbrook at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Sep 13 18:50:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Miscompilation of fortran/match.c
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: 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-unknown-linux-gnu
  GCC host triplet: i686-unknown-linux-gnu
GCC target triplet: i686-unknown-linux-gnu

The following testcase fails when compiled with -O. Somewhere along the line 
the assignment in test() gets removed. Code derived from fortran/match.c. 
 
 
int glob; 
 
void 
fn2(int ** q) 
{ 
  *q = &glob; 
} 
 
void test() 
{ 
  int *p; 
 
  fn2(&p); 
 
  *p=42; 
} 
 
int main() 
{ 
  test(); 
  if (glob != 42) abort(); 
  exit (0); 
}



More information about the Gcc-bugs mailing list