[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread eskil at obsession dot se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #16 from Eskil Steenberg 2010-11-23 22:31:14 UTC --- Hi again! > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 > > --- Comment #15 from Andrew Pinski 2010-11-23 > 22:09:44 UTC --- >>Not true. it is not undefined, it is implement

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #15 from Andrew Pinski 2010-11-23 22:09:44 UTC --- >Not true. it is not undefined, it is implementation specific. Huh? Why do you think that is true? The C standard is explicit when it comes to signed integer overflow is undefined

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread eskil at obsession dot se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #14 from Eskil Steenberg 2010-11-23 22:06:39 UTC --- Hi again! > because the c standard has specific rules about integral types smaller > than > int; they are all promoted to int. promoting a value to one type in order to do an oper

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #13 from Andrew Pinski 2010-11-23 21:34:35 UTC --- Oh overflow != wrapping.

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #12 from Andrew Pinski 2010-11-23 21:34:11 UTC --- >double is also bigger then unsigned short, why not promote it to double if we are bringing in random types? because the c standard has specific rules about integral types smaller t

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread eskil at obsession dot se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #11 from Eskil Steenberg 2010-11-23 21:29:12 UTC --- Hi Again! > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 > > --- Comment #10 from Andrew Pinski 2010-11-23 > 20:24:00 UTC --- >uv = (unsigned int)((int)x[1 + j] * (int)x[

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #10 from Andrew Pinski 2010-11-23 20:24:00 UTC --- uv = (unsigned int)((int)x[1 + j] * (int)x[1 + i]); Is what the C standard says should be done as unsigned short is smaller than int so it is promoted to int. So we have a 16x16

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread eskil at obsession dot se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #9 from Eskil Steenberg 2010-11-23 20:20:51 UTC --- Hi > typedef unsigned short VBigDig; >uv = x[1 + j] * x[1 + i]; >high = (uv & 0x8000u) != 0; > > Is really >uv = (int)x[1 + j] * (int)x[1 + i]; >high = (uv & 0x8

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 Andrew Pinski changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread eskil at obsession dot se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #7 from Eskil Steenberg 2010-11-23 19:07:23 UTC --- Created attachment 22502 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22502 full test case. Test case that should run the code (sorry i dont have gcc on the machine om on). S

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #6 from H.J. Lu 2010-11-23 18:41:05 UTC --- (In reply to comment #5) > > You will find them in v_randgen.c > > Here you find (among other things) the entire verse lib: > > http://www.quelsolaar.com/files/verse_apps.zip > Please u

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread eskil at obsession dot se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #5 from Eskil Steenberg 2010-11-23 18:13:23 UTC --- Hi > /tmp/ccaJLFo2.o: In function `v_bignum_set_random': > v_bignum.c:(.text+0x25c): undefined reference to `v_randgen_new' > v_bignum.c:(.text+0x276): undefined reference to `v_ran

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #4 from H.J. Lu 2010-11-23 18:06:37 UTC --- (In reply to comment #3) > (In reply to comment #2) > > Do you have a run-time testcase? > > There is a test you can run in v_prime.c , it should fail to set the high bit It won't link: [

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread eskil at obsession dot se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #3 from Eskil Steenberg 2010-11-23 17:55:56 UTC --- (In reply to comment #2) > Do you have a run-time testcase? There is a test you can run in v_prime.c , it should fail to set the high bit and therefor should not ever find a prime.

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 H.J. Lu changed: What|Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed|

[Bug c/46619] gcc thinks line of code can be removed.

2010-11-23 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619 --- Comment #1 from Andrew Pinski 2010-11-23 13:01:42 UTC --- What happens if -fwrapv is used as an option to GCC?