https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44547
--- Comment #7 from CVS Commits ---
The master branch has been updated by Martin Sebor :
https://gcc.gnu.org/g:1b229a305091f0a9c64e5be3c1af5ef62b75e3cb
commit r11-7839-g1b229a305091f0a9c64e5be3c1af5ef62b75e3cb
Author: Martin Sebor
Date: Thu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44547
Martin Sebor changed:
What|Removed |Added
Resolution|--- |FIXED
CC|
--- Comment #3 from manu at gcc dot gnu dot org 2010-06-17 07:18 ---
You are right. The issue occurs in VRP but not because of the disjoint ranges.
Pass vrp1 is able to optimize your first example (nested if) but not the second
(nested switch). I think this is a missed optimization. Not
--- Comment #4 from anthony dot penniston at hotmail dot com 2010-06-17
08:16 ---
It seems that optimizing is what's causing the problem: the example compiles
fine with -O0, but not -On=1. It also compiles fine when the case values are
consecutive, which seems telling. My first guess
--- Comment #5 from manu at gcc dot gnu dot org 2010-06-17 08:37 ---
(In reply to comment #4)
It seems that optimizing is what's causing the problem: the example compiles
fine with -O0, but not -On=1. It also compiles fine when the case values are
consecutive, which seems telling. My
--- Comment #1 from manu at gcc dot gnu dot org 2010-06-16 11:54 ---
Value range-propagation (VRP) does not work on disjoint ranges, so the compiler
does not actually know that argc can only be 1, 2 or 4. I think there is
already a PR about this but I cannot find it right now.
--
--- Comment #2 from anthony dot penniston at hotmail dot com 2010-06-17
01:14 ---
(In reply to comment #1)
Value range-propagation (VRP) does not work on disjoint ranges, so the
compiler
does not actually know that argc can only be 1, 2 or 4. I think there is
already a PR about