This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33810] gcc 4.1.2 mangles results on x86_64 in bitfield operations
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jan 2008 03:10:24 -0000
- Subject: [Bug c++/33810] gcc 4.1.2 mangles results on x86_64 in bitfield operations
- References: <bug-33810-12095@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from bangerth at dealii dot org 2008-01-13 03:10 -------
Confirmed. Here's a slightly simplified testcase:
-----------bar.h------------
typedef struct {
unsigned : 16;
unsigned : 16;
} foo;
-----------bar.c------------
#include <stdio.h>
#include <bar.h>
foo bar(unsigned i)
{
printf("bar: i is %u.\n",i);
foo myfoo;
return myfoo;
}
-------------foo.cc------------
#include <stdio.h>
#include <bar.h>
extern "C" foo bar(unsigned int);
int main(void)
{
foo myfoo;
unsigned i = 3;
printf("foo: i is %u.\n",i);
myfoo = bar(i);
return 0;
}
-------------------
tmp/g> gcc -I. -c bar.c
tmp/g> g++ -I. -o foo foo.c bar.o
tmp/g> ./foo
foo: i is 3.
bar: i is 1289971520.
Something appears to go wrong when calling the extern "C" function...
This is a wrong-code regression on valid code.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org,
| |mmitchel at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |wrong-code
Last reconfirmed|0000-00-00 00:00:00 |2008-01-13 03:10:24
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33810