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 optimization/11855] New: aliasing problem


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

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

           Summary: aliasing problem
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fabdouze at caramail dot com
                CC: gcc-bugs at gcc dot gnu dot org

I have the following code

typedef struct _LSPESn  
{ 
    struct _LSPESn *esnext;          /* next ES neighbour in LSP chain */ 
     
    X               esdefm;          /* ES neighbour default metric    */ 
    X               esdlym;          /* ES neighbour delay metric      */ 
    X               esexpm;          /* ES neighbour expense metric    */ 
    X               eserrm;          /* ES neighbour error metric      */ 
    X               esid[LGSYSID];   /* ES neighbour system ID         */ 
} LSPESnT, *LSPESnTp; 

typedef struct STC
{
  struct STC *stnext ;
}
ST, *STp;



   LSPESnTp es2, esn; 

   for ( esn = ent->lspesn ; 0!=esn ; esn = es2 )
   {
      es2 = esn->esnext;
      (((STp)(  (STp)esn  ))->stnext)  = ( &(((SATenTp)( E2Ispp ))->sat_i2i. fr
eeLspESn )  )->prp_first; 
      ( & (((SATenTp)( E2Ispp ))->sat_i2i.reeLspESn )  )->prp_first = ((STp)( 
(STp)esn )); ;
   }

It causes an infinit loop when compiling with -O2 option. 
Apperently, gcc considere esn->esnext and (((STp)(  (STp)esn  ))->stnext) as
two different memory area and skip es2 in the generated library.

Isn't it a gcc bug?
It seems to be the same case than in bug 9902. But I do not see
which aliasing rules is not respected.

Thanks,
Fabien


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