> 1", vbulletin,jelsoft,forum,bbs,discussion,bulletin board" /> > 1" Debian GCC" /> Bug#600888: g++-4.4: gcc may miscompile "x >> 1" - Linux Archive
FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian GCC

 
 
LinkBack Thread Tools
 
Old 10-20-2010, 11:43 PM
Nick Lewycky
 
Default Bug#600888: g++-4.4: gcc may miscompile "x >> 1"

Package: g++-4.4Version: 4.4.5-4Severity: normal

This version of gcc has a bug where code that does a shift-right by�literal�one

may be miscompiled, even at -O0. This is breaking my build of llvm and even agcc bootstrap.
Fortunately, there's an unintrusive patch for the problem:
��http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01070.html


which has already been accepted into gcc head, but I didn't see it get appliedto the release branches. Please add this patch as a debian-local change.
Thanks!


Nick Lewycky
-- System Informationebian Release: squeeze/sid��APT prefers unstable��APT policy: (500, 'unstable'), (1, 'experimental')

Architecture: armel (armv7l)
Kernel: Linux 2.6.32.9 (SMP w/2 CPU cores; PREEMPT)Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)Shell: /bin/sh linked to /bin/dash


Versions of packages g++-4.4 depends on:ii �gcc-4.4 � � � � � � � � � 4.4.5-4 � � � �The GNU C compilerii �gcc-4.4-base � � � � � � �4.4.5-4 � � � �The GNU Compiler Collection (base�

ii �libc6 � � � � � � � � � � 2.11.2-6 � � � Embedded GNU C Library: Shared libii �libgcc1 � � � � � � � � � 1:4.4.5-4 � � �GCC support libraryii �libgmp3c2 � � � � � � � � 2:4.3.2+dfsg-1 Multiprecision arithmetic library

ii �libmpfr4 � � � � � � � � �3.0.0-2 � � � �multiple precision floating-point�ii �libstdc++6-4.4-dev � � � �4.4.5-4 � � � �The GNU Standard C++ Library v3 (d
g++-4.4 recommends no packages.


Versions of packages g++-4.4 suggestsn �gcc-4.4-doc � � � � � � � � � <none> � � (no description available)pn �libstdc++6-4.4-dbg � � � � � �<none> � � (no description available)


-- no debconf information
 
Old 10-21-2010, 04:32 AM
Matthias Klose
 
Default Bug#600888: g++-4.4: gcc may miscompile "x >> 1"

On 21.10.2010 01:43, Nick Lewycky wrote:

Package: g++-4.4
Version: 4.4.5-4
Severity: normal


This version of gcc has a bug where code that does a shift-right
by literal one
may be miscompiled, even at -O0. This is breaking my build of llvm and even
a
gcc bootstrap.

>

Fortunately, there's an unintrusive patch for the problem:

http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01070.html

which has already been accepted into gcc head, but I didn't see it get
applied
to the release branches. Please add this patch as a debian-local change.


when does this trigger? the testcase succeeds in the debian builds og gcc-4.4
and gcc-4.5, and llvm-2.7 did build too.




--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4CBFC253.7040402@debian.org">http://lists.debian.org/4CBFC253.7040402@debian.org
 
Old 10-21-2010, 04:44 AM
Nick Lewycky
 
Default Bug#600888: g++-4.4: gcc may miscompile "x >> 1"

On 20 October 2010 21:32, Matthias Klose <doko@debian.org> wrote:


On 21.10.2010 01:43, Nick Lewycky wrote:


Package: g++-4.4

Version: 4.4.5-4

Severity: normal





This version of gcc has a bug where code that does a shift-right

by literal one

may be miscompiled, even at -O0. This is breaking my build of llvm and even

a

gcc bootstrap.


>


Fortunately, there's an unintrusive patch for the problem:



* http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01070.html



which has already been accepted into gcc head, but I didn't see it get

applied

to the release branches. Please add this patch as a debian-local change.




when does this trigger? *the testcase succeeds in the debian builds og gcc-4.4 and gcc-4.5, and llvm-2.7 did build too.
I'm using llvm from svn. There's a "make check" failure in test/Assembler/alignstack.ll due to this code in lib/Bitcode/Reader/BitcodeReader.cpp:1192 does:


** * *bool IsAlignStack = Record[0] >> 1;
where Record[0] is an unsigned long & equal to 3. The resulting IsAlignStack is set to false. While that one instance could be fixed by replacing it with & 2, there's a bunch of other places in the code which also use >> 1 to actually mean shift right, and the clang that's built out of this doesn't work very well at all.


Note that due to the nature of the bug, small changes in the code could affect register layout such that this problem does not manifest. It's entirely possible that a build of llvm 2.8 might not show the same testcase failure but still have problems in other cases.


Nick
 

Thread Tools




All times are GMT. The time now is 09:43 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org