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/49444] New: IV-OPTs changes an unaligned loads into aligned loads incorrectly


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

           Summary: IV-OPTs changes an unaligned loads into aligned loads
                    incorrectly
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pinskia@gcc.gnu.org


Take:
/* { dg-do compile { target mips*-*-* } } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler "uld\\t|ldr\\t|lwr\\t" } } */


struct s
{
  unsigned int l;
  unsigned int z[2];
};

struct r
{
  char c;
  struct s s;
} __attribute__ ((packed));

struct s *ss;

f (struct r *p, int l)
{
  int i;
  for (i = 0; i < l; i++)
    {
      *ss = p[i].s;
      g ();
    }
}
--- CUT ---
Currently this fails and the load from p[i].s is turned into an aligned load.


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