public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gcc bug
@ 2000-01-14 12:44 Alexey Voinov
  0 siblings, 0 replies; 8+ messages in thread
From: Alexey Voinov @ 2000-01-14 12:44 UTC (permalink / raw)
  To: cygwin; +Cc: gcc-bugs

Hello,

$ gcc -v
Reading specs from /diskc/CYGNUS/CYGWIN~1/USR/BIN/../lib/gcc-lib/i586-cygwin32/2.95.2/specs
gcc version 2.95.2 19991024 (release)

$ uname -a
CYGWIN_98-4.10 VOINS 1.1.0(0.16/3/2) 2000-01-06 12:55:43 i586 unknown

$ gcc -O3 err.c
err.c: In function `main':
err.c:8: warning: asm operand 0 probably doesn't match constraints
err.c:10: Internal compiler error in `fixup_var_refs_1', at function.c:2071
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.

$ cat err.c
int main( void )
{
  unsigned a;
  __asm__ (
           "mov %0, %%eax\n\t"
           :
           : "m" (&a)
           );
}

$ gcc err.c
All works without optimization.
Simple workaround is to use "g" constraint instead of "m".

Best regards,
Alexey Voinov
voins@caravan.ru



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* Re: gcc bug
  2007-11-21 16:07         ` Dave Korn
@ 2007-11-21 16:25           ` Samuel Thibault
  0 siblings, 0 replies; 8+ messages in thread
From: Samuel Thibault @ 2007-11-21 16:25 UTC (permalink / raw)
  To: cygwin

Dave Korn, le Wed 21 Nov 2007 15:57:15 -0000, a écrit :
> On 21 November 2007 15:43, Samuel Thibault wrote:
> 
> > Ok, so cygwin has it too. It's fixed in HEAD, see
> >
> http://www.nabble.com/-Bug-c-34130---New%3A-the-builtin-abs%28%29-gives-wrong-
> result-when-used-in-some-expression-tf4824981.html#a13808833
> 
>   Now why didn't you just say "PR34130" in the first place?

Simply because I didn't know that URL in that first place :)

Samuel

--
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/

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

* RE: gcc bug
  2007-11-21 16:05       ` Samuel Thibault
@ 2007-11-21 16:07         ` Dave Korn
  2007-11-21 16:25           ` Samuel Thibault
  0 siblings, 1 reply; 8+ messages in thread
From: Dave Korn @ 2007-11-21 16:07 UTC (permalink / raw)
  To: cygwin

On 21 November 2007 15:43, Samuel Thibault wrote:

> Ok, so cygwin has it too. It's fixed in HEAD, see
>
http://www.nabble.com/-Bug-c-34130---New%3A-the-builtin-abs%28%29-gives-wrong-
result-when-used-in-some-expression-tf4824981.html#a13808833

  Now why didn't you just say "PR34130" in the first place?  Yep, fixed on
HEAD certainly wouldn't mean "fixed in a couple of years' old release
version"!

  Interesting:

http://gcc.gnu.org/viewcvs/trunk/gcc/fold-const.c?view=log&pathrev=130258

Revision 91373 - (view) (download) - [select for diffs]
Modified Sat Nov 27 10:13:56 2004 UTC (2 years, 11 months ago) by jakub
File length: 352911 byte(s)
Diff to previous 91170 (colored)

	* fold-const.c (extract_muldiv_1) <case ABS_EXPR>: If ctype is
	unsigned and type signed, build ABS_EXPR with signed_type (ctype)
	and only afterwards convert to ctype.


  That's probably where it got introduced.  I could always backport the fix to
3.4.4 and spin a fresh release, and to be fair, I wasn't planning to, but
that's a scary enough bug that I feel like I want to.

    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/

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

* Re: gcc bug
  2007-11-21 15:43     ` Dave Korn
@ 2007-11-21 16:05       ` Samuel Thibault
  2007-11-21 16:07         ` Dave Korn
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel Thibault @ 2007-11-21 16:05 UTC (permalink / raw)
  To: cygwin

Dave Korn, le Wed 21 Nov 2007 15:38:55 -0000, a écrit :
> 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.

Ok, so cygwin has it too. It's fixed in HEAD, see http://www.nabble.com/-Bug-c-34130---New%3A-the-builtin-abs%28%29-gives-wrong-result-when-used-in-some-expression-tf4824981.html#a13808833

Samuel

--
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/

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

* RE: gcc bug
  2007-11-21 15:40   ` Samuel Thibault
@ 2007-11-21 15:43     ` Dave Korn
  2007-11-21 16:05       ` Samuel Thibault
  0 siblings, 1 reply; 8+ messages in thread
From: Dave Korn @ 2007-11-21 15:43 UTC (permalink / raw)
  To: cygwin

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/

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

* Re: gcc bug
  2007-11-21 15:39 ` Dave Korn
@ 2007-11-21 15:40   ` Samuel Thibault
  2007-11-21 15:43     ` Dave Korn
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel Thibault @ 2007-11-21 15:40 UTC (permalink / raw)
  To: cygwin

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

Samuel

--
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/

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

* RE: gcc bug
  2007-11-21 15:30 Samuel Thibault
@ 2007-11-21 15:39 ` Dave Korn
  2007-11-21 15:40   ` Samuel Thibault
  0 siblings, 1 reply; 8+ messages in thread
From: Dave Korn @ 2007-11-21 15:39 UTC (permalink / raw)
  To: cygwin

On 21 November 2007 15:02, Samuel Thibault wrote:

> Can someone test http://dept-info.labri.fr/~thibault/tmp/test.c ?


/win/t/artimi/chips $ wget 'http://dept-info.labri.fr/~thi
bault/tmp/test.c'
--15:20:18--  http://dept-info.labri.fr/~thibault/tmp/test.c
           => `test.c'
Resolving dept-info.labri.fr... 147.210.9.83
Connecting to dept-info.labri.fr|147.210.9.83|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 204 [text/plain]

100%[====================================>] 204           --.--K/s

15:20:18 (2.18 MB/s) - `test.c' saved [204/204]

@_______. .
(       /"\
 ||--||(___)
 '"  '"'---'
/win/t/artimi/chips $


  Yep, the URL works fine.



  Perhaps you'd like to expand on that request?

    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/

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

* gcc bug
@ 2007-11-21 15:30 Samuel Thibault
  2007-11-21 15:39 ` Dave Korn
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel Thibault @ 2007-11-21 15:30 UTC (permalink / raw)
  To: cygwin

Can someone test http://dept-info.labri.fr/~thibault/tmp/test.c ?

Samuel

--
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/

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

end of thread, other threads:[~2007-11-21 16:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-14 12:44 gcc bug Alexey Voinov
2007-11-21 15:30 Samuel Thibault
2007-11-21 15:39 ` Dave Korn
2007-11-21 15:40   ` Samuel Thibault
2007-11-21 15:43     ` Dave Korn
2007-11-21 16:05       ` Samuel Thibault
2007-11-21 16:07         ` Dave Korn
2007-11-21 16:25           ` Samuel Thibault

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).