[LLVMbugs] [Bug 5995] New: Strange/incorrect field access code

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Jan 11 11:42:44 PST 2010


           Summary: Strange/incorrect field access code
           Product: tools
           Version: trunk
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: llvm-gcc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: av1474 at comtv.ru
                CC: llvmbugs at cs.uiuc.edu

~$ uname -a               
Linux linmac 2.6.23-exp #1 Thu Oct 11 07:23:51 MSD 2007 ppc GNU/Linux

~$ ~/x/dev/llvm/bin/gcc -v
Using built-in specs.
Target: powerpc-unknown-linux-gnu
Configured with: ../../llvm-gcc-4.2/configure --prefix=/home/malc/x/dev/llvm
--enable-languages=c --enable-llvm=/home/malc/x/rcs/svn/llvm/build/llvm/
--disable-bootstrap --disable-multilib : (reconfigured)
../../llvm-gcc-4.2/configure --prefix=/home/malc/x/dev/llvm
--enable-languages=c --enable-llvm=/home/malc/x/rcs/svn/llvm/build/llvm/
--disable-bootstrap --disable-multilib --disable-libgomp
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build)

produces unusual code in response to:
struct s {
    int word;
    struct {
        int filler __attribute__ ((aligned (8)));

void func (struct s *s)
    s->word = 0;

        .ident  "GCC: (GNU) 4.2.1 (Based on Apple Inc. build 5658) (LLVM
        .file   "a.c"

        .global func
        .type   func, @function
        .align  2
        li 4, 0
        stb 4, 2(3)
        stb 4, 1(3)
        stb 4, 3(3)
        stb 4, 0(3)
        .size   func,.-func

[ If one substitutes `int word' with `volatile sig_atomic_t word' the code
  becomes incorrect AFAICS ]

P.S. This is reduced test-cases for the problem encountered with QEMU which
     has jmp_buf[1] inside important structure along with a word-sized field
     accessed from the signal handler.

[1] jmp_buf has similar aligned field within a structure layout which seems
    to be required for this issue to trigger

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list