public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33810]  New: gcc 4.1.2 mangles results on x86_64 in bitfield operations
@ 2007-10-18 10:33 satyaakam at yahoo dot co dot in
  2008-01-13  6:51 ` [Bug c++/33810] " bangerth at dealii dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: satyaakam at yahoo dot co dot in @ 2007-10-18 10:33 UTC (permalink / raw)
  To: gcc-bugs

Run the test case on a x86_64 bit machine to see how gcc 4.1.2 mangles results
in under Linux

We have tested the test case using 3.2.3 Compiler on RHEL 3 on both 32 as well
as 64 bit OS it works well.

Compile the test case provided with the following steps

$gcc -g -I. -Wall -m64 -c bar.c
$g++ -g -I. -Wall -m64 -o foo foo.c bar.o

Actual results: once you run the program foo you will see the following result

foo: i is 3.
bar: i is 3221205968.

Expected results:

foo: i is 3.
bar: i is 3.

Additional info: Test Case follows


----- bar.h -----

typedef struct {

 unsigned b1:16;

 unsigned b2:16;

} foo;



#ifdef   __cplusplus

extern "C"

{

#endif



foo bar(unsigned);



#ifdef   __cplusplus

}

#endif




----- bar.c -----

#include <stdio.h>

#include <bar.h>



foo bar(unsigned i)

{

 foo myfoo;

 myfoo.b1=myfoo.b2=0;

 printf("bar: i is %u.\n",i);

 return(myfoo);

}





----- foo.c -----

#include <stdio.h>
#include <bar.h>

int main(void)

{

 foo myfoo;

 unsigned i = 3;

 printf("foo: i is %u.\n",i);

 myfoo = bar(i);

 return 0;

}


-- 
           Summary: gcc 4.1.2 mangles results on x86_64 in bitfield
                    operations
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: satyaakam at yahoo dot co dot in


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


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

end of thread, other threads:[~2008-07-04 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-18 10:33 [Bug c++/33810] New: gcc 4.1.2 mangles results on x86_64 in bitfield operations satyaakam at yahoo dot co dot in
2008-01-13  6:51 ` [Bug c++/33810] " bangerth at dealii dot org
2008-01-13 17:00 ` mmitchel at gcc dot gnu dot org
2008-01-13 18:23 ` [Bug c++/33810] [4.1 Regression] " rguenth at gcc dot gnu dot org
2008-07-04 16:16 ` jsm28 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).