public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/8224: Incorrect joining of signed and unsigned division
@ 2003-03-23 23:06 mmitchel
  0 siblings, 0 replies; 6+ messages in thread
From: mmitchel @ 2003-03-23 23:06 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mikulas, nobody

Synopsis: Incorrect joining of signed and unsigned division

State-Changed-From-To: analyzed->closed
State-Changed-By: mmitchel
State-Changed-When: Sun Mar 23 22:57:43 2003
State-Changed-Why:
    Fixed in GCC 3.3, GCC 3.4.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8224


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

* Re: c/8224: Incorrect joining of signed and unsigned division
@ 2003-03-23 19:16 Glen Nakamura
  0 siblings, 0 replies; 6+ messages in thread
From: Glen Nakamura @ 2003-03-23 19:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/8224; it has been noted by GNATS.

From: Glen Nakamura <glen@imodulo.com>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Cc:  
Subject: Re: c/8224: Incorrect joining of signed and unsigned division
Date: Sun, 23 Mar 2003 18:33:20 +0000

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8224
 
 Adding link to test case:
 http://gcc.gnu.org/ml/gcc-patches/2003-03/txt00029.txt


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

* Re: c/8224: Incorrect joining of signed and unsigned division
@ 2003-03-22  8:56 Glen Nakamura
  0 siblings, 0 replies; 6+ messages in thread
From: Glen Nakamura @ 2003-03-22  8:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/8224; it has been noted by GNATS.

From: Glen Nakamura <glen@imodulo.com>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Cc:  
Subject: Re: c/8224: Incorrect joining of signed and unsigned division
Date: Fri, 21 Mar 2003 22:48:01 -1000

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8224
 
 I'll need someone with CVS write access to commit the following patch:
 http://gcc.gnu.org/ml/gcc-bugs/2003-03/msg00949.html
 Approval is here:
 http://gcc.gnu.org/ml/gcc-patches/2003-03/msg01966.html
 
 FYI, the patch I submitted to gcc-patches is equivalent to the one above
 except I mistakenly forgot the "or modulus" part of the comment.
 Hence, I think the patch sent to gcc-bugs should be committed.
 
 Thanks!
 
 -glen


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

* Re: c/8224: Incorrect joining of signed and unsigned division
@ 2003-03-15 21:56 Glen Nakamura
  0 siblings, 0 replies; 6+ messages in thread
From: Glen Nakamura @ 2003-03-15 21:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/8224; it has been noted by GNATS.

From: Glen Nakamura <glen@imodulo.com>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
	mikulas@artax.karlin.mff.cuni.cz
Cc:  
Subject: Re: c/8224: Incorrect joining of signed and unsigned division
Date: Sat, 15 Mar 2003 21:50:10 +0000

 I'm testing the following patch as a fix to PR c/8224:
 
 	* fold-const.c (extract_muldiv_1): Don't pass through type conversions
 	when signedness changes for division or modulus.
 
 diff -Nru3p gcc-3.3.orig/gcc/fold-const.c gcc-3.3/gcc/fold-const.c
 --- gcc-3.3.orig/gcc/fold-const.c	2003-02-16 08:25:20.000000000 +0000
 +++ gcc-3.3/gcc/fold-const.c	2003-02-16 08:25:20.000000000 +0000
 @@ -4117,7 +4117,12 @@ extract_muldiv_1 (t, c, code, wide_type)
  	      /* ... or its type is larger than ctype,
  		 then we cannot pass through this truncation.  */
  	      || (GET_MODE_SIZE (TYPE_MODE (ctype))
 -		  < GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0))))))
 +		  < GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0))))
 +	      /* ... or signedness changes for division or modulus,
 +		 then we cannot pass through this conversion.  */
 +	      || (code != MULT_EXPR
 +		  && (TREE_UNSIGNED (ctype)
 +		      != TREE_UNSIGNED (TREE_TYPE (op0))))))
  	break;
  
        /* Pass the constant down and see if we can make a simplification.  If


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

* Re: c/8224: Incorrect joining of signed and unsigned division
@ 2003-02-02 23:15 bangerth
  0 siblings, 0 replies; 6+ messages in thread
From: bangerth @ 2003-02-02 23:15 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mikulas, nobody

Synopsis: Incorrect joining of signed and unsigned division

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Sun Feb  2 23:15:06 2003
State-Changed-Why:
    Same behavior still present with 3.4. Indeed strange.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8224


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

* c/8224: Incorrect joining of signed and unsigned division
@ 2002-10-14  7:36 mikulas
  0 siblings, 0 replies; 6+ messages in thread
From: mikulas @ 2002-10-14  7:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8224
>Category:       c
>Synopsis:       Incorrect joining of signed and unsigned division
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 14 07:36:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Mikulas Patocka
>Release:        gcc-2.7.2.3, gcc-2.95.4, gcc-3.0.4, gcc-3.2
>Organization:
>Environment:
Bug present in almost all gcc releases, tested on Linux and OS/2.
>Description:
When evaluating expressions like (unsigned)((int)x/2)/2,
gcc incorrectly merges these two divisions into one signed
(or unsigned in 2.7.2.3) division by 4, producing incorrect
result.
>How-To-Repeat:
Compile and run the file. The bug can be seen with or
without optimizations.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bug-div.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug-div.c"

dW5zaWduZWQgZihpbnQgeCkNCnsNCglyZXR1cm4gKHVuc2lnbmVkKSgoaW50KXgvMikvMjsNCn0N
Cg0KdW5zaWduZWQgZjEoaW50IHgpDQp7DQoJdW5zaWduZWQgeHggPSB4LzI7DQoJcmV0dXJuIHh4
LzI7DQp9DQoNCm1haW4oKQ0Kew0KCXByaW50ZigiJWQgLSAlMDh4XG4iLCAtNSwgZjEoLTUpKTsN
CglwcmludGYoIiVkIC0gJTA4eFxuIiwgLTUsIGYoLTUpKTsNCglyZXR1cm4gMDsNCn0NCg==


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

end of thread, other threads:[~2003-03-23 22:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-23 23:06 c/8224: Incorrect joining of signed and unsigned division mmitchel
  -- strict thread matches above, loose matches on Subject: below --
2003-03-23 19:16 Glen Nakamura
2003-03-22  8:56 Glen Nakamura
2003-03-15 21:56 Glen Nakamura
2003-02-02 23:15 bangerth
2002-10-14  7:36 mikulas

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