X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org From: "Dave Korn" To: References: <20071121150206 DOT GH4195 AT implementation DOT uk DOT xensource DOT com> <000601c82c52$4d310de0$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <20071121153012 DOT GI4195 AT implementation DOT uk DOT xensource DOT com> Subject: RE: gcc bug Date: Wed, 21 Nov 2007 15:38:55 -0000 Message-ID: <000701c82c54$a18bae20$2e08a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <20071121153012.GI4195@implementation.uk.xensource.com> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id lALFdB7e029384 On 21 November 2007 15:30, Samuel Thibault wrote: > Dave Korn, le Wed 21 Nov 2007 15:22:15 -0000, a écrit : >> On 21 November 2007 15:02, Samuel Thibault wrote: >> >>> Can someone test http://dept-info.labri.fr/~thibault/tmp/test.c ? >> Yep, the URL works fine. >> Perhaps you'd like to expand on that request? > > Yes: please run make test and ./test Yeh, I knew you meant that really. Odd. Is there something we're forgetting about size-vs-sign preservation in size extension going on here? /win/t/artimi/chips/earn/block/rom/.save $ cat test.c #include #include int main( void ) { int i=2; int x, y; if( (-10*abs (i-1)) == (10*abs(i-1)) ) printf ("OMG,-10==10! %d %d\n", (-10*abs (i-1)), (10*abs(i-1))); else printf ("nothing special here\n") ; printf ("%d * %d = %d\n", (-10), (abs (i-1)), (-10*abs (i-1))); printf ("%d * %d = %d\n", (-10), ((int)abs (i-1)), (-10*(int)abs (i-1))); printf ("%d * %d = %d\n", (-10), (1), (-10*(int)1)); printf ("??? %d == %d ? %d\n", (-10*(int)abs (i-1)), (-10*(int)1), (-10*(int)a bs (i-1)) == (-10*(int)1)); x = (-10); y = (abs (i-1)); printf ("x, y = %d, %d - prod %d\n", x, y, x * y); return 0 ; } @_______. . ( /"\ ||--||(___) '" '"'---' /win/t/artimi/chips/earn/block/rom/.save $ gcc -g -O0 test.c -o test --save-tem ps @_______. . ( /"\ ||--||(___) '" '"'---' /win/t/artimi/chips/earn/block/rom/.save $ ./test.exe OMG,-10==10! 10 10 -10 * 1 = 10 -10 * 1 = 10 -10 * 1 = -10 ??? 10 == -10 ? 0 x, y = -10, 1 - prod -10 @_______. . ( /"\ ||--||(___) '" '"'---' /win/t/artimi/chips/earn/block/rom/.save $ cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/