public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19448] New: Different value representation for bitfield width exceeding its type size.
@ 2005-01-14 18:19 yanliu at ca dot ibm dot com
  2005-01-14 18:22 ` [Bug c++/19448] " yanliu at ca dot ibm dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 21+ messages in thread
From: yanliu at ca dot ibm dot com @ 2005-01-14 18:19 UTC (permalink / raw)
  To: gcc-bugs

The gcc compiler information: 
Reading specs from /usr/lib/gcc/ppc64-redhat-linux/3.4.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-
checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-
exceptions --enable-languages=c,c++,objc,java,f77 --enable-java-awt=gtk --
host=ppc64-redhat-linux --build=ppc64-redhat-linux --target=ppc64-redhat-linux -
-with-cpu=default32
Thread model: posix
gcc version 3.4.3 20041125 (Red Hat 3.4.3-6.EL4)

In the attached testcase, the bitfield width is bigger than its type size, and 
the bitfield is initialized with a value greater than 127.  

When c1.m1 is assigned with different value, the result is different using 
g++3.4.3 and g++ 4.0.0 compilers:

c1.m1=128, g++ 3.4.3's result: 128, g++ 4.0.0's result: -128.
c1.m1=400, g++ 3.4.3's result: 144, g++ 4.0.0's result: -112.
c1.m1=500, g++ 3.4.3's result: 244, g++ 4.0.0's result: -12.

Could you tell me which compiler version gives the correct result, and why?

-- 
           Summary: Different value representation for bitfield width
                    exceeding its type size.
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yanliu at ca dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2013-07-08 23:25 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-19448-4@http.gcc.gnu.org/bugzilla/>
2013-07-08 15:35 ` [Bug c++/19448] Different value representation for bitfield width exceeding its type size janis at gcc dot gnu.org
2013-07-08 15:43 ` paolo.carlini at oracle dot com
2013-07-08 16:00 ` paolo.carlini at oracle dot com
2013-07-08 23:13 ` dje at gcc dot gnu.org
2013-07-08 23:23 ` janis at gcc dot gnu.org
2013-07-08 23:25 ` paolo.carlini at oracle dot com
2005-01-14 18:19 [Bug c++/19448] New: " yanliu at ca dot ibm dot com
2005-01-14 18:22 ` [Bug c++/19448] " yanliu at ca dot ibm dot com
2005-01-14 19:01 ` pinskia at gcc dot gnu dot org
2005-01-14 19:06 ` pinskia at gcc dot gnu dot org
2005-01-14 20:10 ` yanliu at ca dot ibm dot com
2005-01-15  1:24 ` janis187 at us dot ibm dot com
2005-01-15  1:28 ` janis187 at us dot ibm dot com
2005-01-15  1:29 ` janis187 at us dot ibm dot com
2005-01-17 15:24 ` yanliu at ca dot ibm dot com
2005-01-17 18:14 ` janis187 at us dot ibm dot com
2005-01-19  2:01 ` janis187 at us dot ibm dot com
2005-01-19  2:06 ` janis187 at us dot ibm dot com
2005-01-19  2:11 ` mmitchel at gcc dot gnu dot org
2005-01-19 17:04 ` janis187 at us dot ibm dot com
2005-01-19 23:08 ` janis at gcc dot gnu dot org
2005-01-28  1:36 ` janis 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).