This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/45397] [4.5/4.6/4.7 Regression] Issues with integer narrowing conversions
- From: "ktietz at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 02 Jan 2012 13:09:09 +0000
- Subject: [Bug tree-optimization/45397] [4.5/4.6/4.7 Regression] Issues with integer narrowing conversions
- Auto-submitted: auto-generated
- References: <bug-45397-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45397
Kai Tietz <ktietz at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ktietz at gcc dot gnu.org
--- Comment #6 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-01-02 13:09:09 UTC ---
Hmm, we could solve this via forward-propagation in gimple, too.
I have a patch which does this, but not sure if it is material for current
stage. The missing patterns in forward-propagation are:
- X ==/!= X -> true/false,
- (type) X ==/!= (type) X -> true/false
- X code Y ==/!= X code Z -> Y ==/!= Z (with code +, -, or ^).
- (type) X ==/!= Y & CST -> X ==/!= (type-of-X) (Y & CST) if type-of-X has
smaller, or equal precision as type and is unsigned, and type-of-x and type are
of integral kind,
and CST fits into type-of-X.
- (type) (X op CST) -> (type) X op CST' with CST' = (type) X; and type has
smaller or equal precision to type-of-x and both types are of integral kind.
(for op = +,-,&,|,^)
- (type) ((type2) X op Y) -> X op (type) Y, if type has smaller or equal
precision to type2 and type-of-x is compatible to type, all types are of
integral kind, and op is a +,-,&,|,or ^ expression.