public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/47893] New: [4.6 Regression] 4.6 miscompiles mesa on i686
@ 2011-02-25 12:48 jakub at gcc dot gnu.org
  2011-02-25 12:56 ` [Bug middle-end/47893] " jakub at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-02-25 12:48 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.6 Regression] 4.6 miscompiles mesa on i686
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: blocker
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
            Target: i686-linux


Created attachment 23466
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23466
mesa.c

The following testcase (distilled from http://bugzilla.redhat.com/679924 )
is miscompiled on i?86 (and x86_64 -m32).

The problem is that struct S is 20 bytes long (why doesn't mesa pack the
bitfield structs better is beyond me) and is returned indirectly via caller
provided memory.  The assembly shows:
        call    fn1     #
        testl   %eax, %eax      #
        movl    %eax, -4664(%ebp)       #, %sfp
...
        leal    -4680(%ebp), %eax       #,
        call    fn2     #
...
        cmpl    %ebx, -4664(%ebp)       # i, %sfp
i.e. the return value from fn1 (variable c) is spilled into %ebp-4664, but
fn2 is given as struct S return slot %ebp-4680, so when it returns it
overwrites
some 16 bytes reserved for the return value and the variable c as well.


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-02-28 17:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-25 12:48 [Bug middle-end/47893] New: [4.6 Regression] 4.6 miscompiles mesa on i686 jakub at gcc dot gnu.org
2011-02-25 12:56 ` [Bug middle-end/47893] " jakub at gcc dot gnu.org
2011-02-25 13:07 ` rguenth at gcc dot gnu.org
2011-02-25 13:15 ` jakub at gcc dot gnu.org
2011-02-25 16:06 ` jakub at gcc dot gnu.org
2011-02-25 16:41 ` jakub at gcc dot gnu.org
2011-02-25 16:41 ` bernds at gcc dot gnu.org
2011-02-25 16:43 ` law at redhat dot com
2011-02-25 17:31 ` bernds at gcc dot gnu.org
2011-02-25 17:36 ` bernds at gcc dot gnu.org
2011-02-25 18:31 ` jakub at gcc dot gnu.org
2011-02-25 19:04 ` jakub at gcc dot gnu.org
2011-02-25 19:26 ` jakub at gcc dot gnu.org
2011-02-26 14:33 ` jakub at gcc dot gnu.org
2011-02-28 17:11 ` jakub at gcc dot gnu.org
2011-02-28 17:30 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).