[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-11-30 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 Andrew Pinski changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-11-30 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 H.J. Lu changed: What|Removed |Added Status|RESOLVED|REOPENED Last reconfirmed|

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-14 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 Richard Guenther changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #15 from Andrew Pinski 2011-08-13 19:00:48 UTC --- (In reply to comment #13) > We should consider our users. GMP has been working with > GCC for a long time. Now it fails with GCC 4.7. It is > a very bad GCC 4.7 experience for user.

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #14 from H.J. Lu 2011-08-13 18:32:53 UTC --- What possible optimization do we gain by not checking range overflow? Does anyone have a testcase to show it?

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #13 from H.J. Lu 2011-08-13 18:23:14 UTC --- We should consider our users. GMP has been working with GCC for a long time. Now it fails with GCC 4.7. It is a very bad GCC 4.7 experience for user.

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #12 from Andrew Pinski 2011-08-13 18:17:24 UTC --- (In reply to comment #11) > Created attachment 25006 [details] > A patch > > GMP code may be buggy. But it works with all other compilers, > including GCC 4.6.0 and older. Is there

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #11 from H.J. Lu 2011-08-13 18:11:56 UTC --- Created attachment 25006 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25006 A patch GMP code may be buggy. But it works with all other compilers, including GCC 4.6.0 and older. Is

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #10 from Andrew Pinski 2011-08-13 17:51:33 UTC --- HJL, the code as written in comment #0 is undefined. Does the rewrite in comment #6 work? Also does adding -fwrapv work too?

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #9 from H.J. Lu 2011-08-13 16:33:19 UTC --- Shouldn't we check TREE_OVERFLOW: diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index df7a9a2..4ec7e5b 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -7263,6 +7263,8 @@ simplify_convers

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #8 from H.J. Lu 2011-08-13 15:56:22 UTC --- make_overflow_infinity sets to TYPE_MAX_VALUE/TYPE_MIN_VALUE. Shouldn't it set to TYPE_MAX_VALUE + 1/TYPE_MIN_VALUE - 1?

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread joseph at codesourcery dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #7 from joseph at codesourcery dot com 2011-08-13 15:31:05 UTC --- (The original code is of course valid if you use -fwrapv, so hopefully the problem optimization does not occur in that case.)

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread joseph at codesourcery dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #6 from joseph at codesourcery dot com 2011-08-13 15:28:22 UTC --- On Sat, 13 Aug 2011, hjl.tools at gmail dot com wrote: > --- Comment #4 from H.J. Lu 2011-08-13 12:09:16 > UTC --- > This code comes from mpz/set_si.c in gmp: > > v

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #5 from H.J. Lu 2011-08-13 14:27:58 UTC --- Does this patch --- diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index df7a9a2..f5e0a30 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -2065,6 +2065,12 @@ vrp_int_const_binop (enum tre

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #4 from H.J. Lu 2011-08-13 12:09:16 UTC --- This code comes from mpz/set_si.c in gmp: void mpz_set_si (mpz_ptr dest, signed long int val) { mp_size_t size; mp_limb_t vl; vl = (mp_limb_t) (unsigned long int) (val >= 0 ? val : -

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-13 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #3 from Paolo Carlini 2011-08-13 08:53:47 UTC --- Indeed. Seems invalid to me.

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-12 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 --- Comment #2 from Andrew Pinski 2011-08-13 04:32:16 UTC --- - LONG_MIN is undefined.

[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion

2011-08-12 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066 H.J. Lu changed: What|Removed |Added CC||rguenth at gcc dot gnu.org Summary|[