Summary: | [4.3 Regression] Miscompilation of Function Passing Bit Field Value to Function | ||
---|---|---|---|
Product: | gcc | Reporter: | Bill Wendling <isanbard> |
Component: | c++ | Assignee: | Mark Mitchell <mark> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | davek, fang, gcc-bugs, ismail, mmitchel, pinskia, rguenth, sabre |
Priority: | P1 | Keywords: | wrong-code |
Version: | 4.2.0 | ||
Target Milestone: | 4.2.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2007-04-09 19:21:39 | |
Bug Depends on: | 32346 | ||
Bug Blocks: | 30332 |
Description
Bill Wendling
2007-04-09 07:56:50 UTC
Among other things, this bug causes GCC 4.2 to miscompile LLVM. 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. radr://5076058 Subject: Bug 31513 Author: mmitchel Date: Tue Apr 17 00:28:21 2007 New Revision: 123902 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123902 Log: PR c++/31513 * call.c (convert_for_arg_passing): Convert bitfields to their declared types. PR c++/31513 * g++.dg/expr/bitfield8.C: New test. Added: branches/gcc-4_2-branch/gcc/testsuite/g++.dg/expr/bitfield8.C Modified: branches/gcc-4_2-branch/gcc/cp/ChangeLog branches/gcc-4_2-branch/gcc/cp/call.c branches/gcc-4_2-branch/gcc/testsuite/ChangeLog Fixed in 4.2.0. Subject: Bug 31513 Author: mmitchel Date: Wed Apr 18 04:36:18 2007 New Revision: 123939 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123939 Log: PR c++/31513 * call.c (convert_for_arg_passing): Convert bitfields to their declared types. PR c++/31513 * g++.dg/expr/bitfield8.C: New test. Added: trunk/gcc/testsuite/g++.dg/expr/bitfield8.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/testsuite/ChangeLog Fixed in 4.3.0. |