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 target/16407] New: [3.3/3.4 Regression] Unaligned access to local variables


The following testcase causes an unaligned access when compiled with
mips64-elf-gcc.

struct s { char c1, c2; };
void foo (struct s s)
{
  static struct s s1;
  s1 = s;
}
int main ()
{
  static struct s s2;
  foo (s2);
  exit (0);
}

The problem is that s1 and s2 are supposed to get word alignment,
but their asm declarations don't guarantee this.

The bug dates back to at least 3.2.3, but not 3.0.4, which didn't
take advantage of the extra alignment.

-- 
           Summary: [3.3/3.4 Regression] Unaligned access to local variables
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rsandifo at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: mips64-elf


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


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