From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29010 invoked by alias); 9 Apr 2007 18:21:50 -0000 Received: (qmail 28959 invoked by uid 48); 9 Apr 2007 18:21:40 -0000 Date: Mon, 09 Apr 2007 18:21:00 -0000 Message-ID: <20070409182140.28958.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/31513] [4.2/4.3 Regression] Miscompilation of Function Passing Bit Field Value to Function In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-04/txt/msg00620.txt.bz2 ------- Comment #2 from rguenth at gcc dot gnu dot org 2007-04-09 19:21 ------- struct tree_type { unsigned int precision : 9; }; void bork(unsigned int Subpart); void foo(struct tree_type *t) { bork(t->precision); } we miss the zero extension of the argument (comparing cc1 to cc1plus output) - movzwl %ax, %eax - movl %eax, (%esp) - call bork + movw %ax, (%esp) + call _Z4borkj but it's also different on the tree level in that C uses int and C++ a bitfield type. This is related to PR30332, but unlike that one, this one works with 4.1.x. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu dot | |org OtherBugsDependingO| |30332 nThis| | Status|UNCONFIRMED |NEW Component|c |c++ Ever Confirmed|0 |1 Keywords| |wrong-code Last reconfirmed|0000-00-00 00:00:00 |2007-04-09 19:21:39 date| | Summary|Miscompilation of Function |[4.2/4.3 Regression] |Passing Bit Field Value to |Miscompilation of Function |Function |Passing Bit Field Value to | |Function Target Milestone|--- |4.2.0 Version|unknown |4.2.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31513