[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-10 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 --- Comment #1 from Paul Eggert --- Created attachment 42149 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42149&action=edit assembly-language output for poorly-optimized code

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-10 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 --- Comment #2 from Marc Glisse --- Note that n==(int)n (gcc documents that this must work) may work with more gcc versions and is more readable.

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-10 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 --- Comment #3 from Paul Eggert --- (In reply to Marc Glisse from comment #2) > Note that n==(int)n (gcc documents that this must work) may work with more > gcc versions and is more readable. Thanks, good point, I'll suggest switching to that in

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-10 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 Paul Eggert changed: What|Removed |Added Attachment #42148|0 |1 is obsolete|

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-10 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 Paul Eggert changed: What|Removed |Added Attachment #42149|0 |1 is obsolete|

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #6

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 --- Comment #7 from Jakub Jelinek --- More complete testcase: extern inline int f1 (long long n) { return -__INT_MAX__ - 1 <= n && n <= __INT_MAX__; } extern inline int f2 (long long n) { return n == (int) n; } extern inline int f3 (unsigned long

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 --- Comment #8 from Jakub Jelinek --- To summarize IRC discussions about this, the first step should be to introduce SEXT_EXPR (split from Prathamesh's patch, improve), then add match.pd canonicalization of these range testing to SEXT_EXPR + EQ_E

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-14 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 Segher Boessenkool changed: What|Removed |Added Target|x86_64-*-* |x86_64-*-*, powerpc*-*-*

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2019-03-18 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 Paul Eggert changed: What|Removed |Added Version|7.1.1 |8.3.1 --- Comment #10 from Paul Eggert --