public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/18008] New: Duplicate mask on bitfield insertion
@ 2004-10-15  9:17 nathan at gcc dot gnu dot org
  2004-10-15 12:46 ` [Bug middle-end/18008] [4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: nathan at gcc dot gnu dot org @ 2004-10-15  9:17 UTC (permalink / raw)
  To: gcc-bugs

This code
  struct B { unsigned b : 2; };
  void store (struct B *b, int v)
  { b->b = v;}
produces this assembler
store:
        pushl  %ebp
        movl %esp, %ebp
        movl 8(%ebp), %ecx
        movb 12(%ebp), %dl
        andl $3, %edx
        andl $3, %edx
        movl (%ecx), %eax
        andl $-4, %eax
        orl  %edx, %eax
        movl %eax, (%ecx)
        leave
        ret

Those two andl $3's get inserted becuase rtl expansion generates somethine
daft. Here's the bits of rtl
(insn 13 11 14 1 (parallel [
            (set (reg:QI 60)
                (and:QI (subreg:QI (reg/v:SI 59 [ v ]) 0)
                    (const_int 3 [0x3])))
            (clobber (reg:CC 17 flags))
        ]) -1 (nil)
    (nil))

(insn 15 14 16 1 (parallel [
            (set (reg:SI 62)
                (zero_extend:SI (reg:QI 60)))
            (clobber (reg:CC 17 flags))
        ]) -1 (nil)
    (nil))

(insn 16 15 17 1 (parallel [
            (set (reg:SI 63)
                (and:SI (reg:SI 62)
                    (const_int 3 [0x3])))
            (clobber (reg:CC 17 flags))
        ]) -1 (nil)
    (nil))

huh?

-- 
           Summary: Duplicate mask on bitfield insertion
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nathan at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2005-01-27  0:13 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-15  9:17 [Bug c/18008] New: Duplicate mask on bitfield insertion nathan at gcc dot gnu dot org
2004-10-15 12:46 ` [Bug middle-end/18008] [4.0 Regression] " pinskia at gcc dot gnu dot org
2004-10-15 15:03 ` bangerth at dealii dot org
2004-10-15 16:42 ` kazu at cs dot umass dot edu
2004-10-15 16:55 ` kazu at cs dot umass dot edu
2004-10-15 21:18 ` kazu at cs dot umass dot edu
2004-10-16  3:46 ` kazu at cs dot umass dot edu
2004-10-16  3:50 ` kazu at cs dot umass dot edu
2004-10-16  4:05 ` pinskia at gcc dot gnu dot org
2004-10-17 19:02 ` roger at eyesopen dot com
2004-12-23 16:05 ` pinskia at gcc dot gnu dot org
2005-01-22 10:05 ` bonzini at gcc dot gnu dot org
2005-01-26  1:55 ` steven at gcc dot gnu dot org
2005-01-26  2:13 ` steven at gcc dot gnu dot org
2005-01-26 18:11 ` rth at gcc dot gnu dot org
2005-01-26 20:30 ` cvs-commit at gcc dot gnu dot org
2005-01-26 23:18 ` cvs-commit at gcc dot gnu dot org
2005-01-27  0:08 ` cvs-commit at gcc dot gnu dot org
2005-01-27  0:13 ` rth at gcc dot gnu dot 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).