delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/11/21/10:39:21

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
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
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
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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 <stdlib.h>
#include <stdio.h>
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/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019