public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, vrp] Allow VRP type conversion folding only for widenings upto word mode
@ 2015-11-14  7:12 Senthil Kumar Selvaraj
  2015-11-14  8:13 ` Marc Glisse
  0 siblings, 1 reply; 13+ messages in thread
From: Senthil Kumar Selvaraj @ 2015-11-14  7:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: rguenther, law

This patch came out of a discussion held in the gcc mailing list
(https://gcc.gnu.org/ml/gcc/2015-11/msg00067.html).

The patch restricts folding of conditional exprs with lhs previously
set by a type conversion to occur only if the source of the type 
conversion's mode is word mode or smaller.

Bootstrapped and reg tested on x86_64 (with --enable-languages=c,c++).

If ok, could you commit please? I don't have commit access.

Regards
Senthil

gcc/ChangeLog

2015-11-11  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* tree-vrp.c (simplify_cond_using_ranges): Fold only
	if innerop's mode is word_mode or smaller.


diff --git gcc/tree-vrp.c gcc/tree-vrp.c
index e2393e4..c139bc6 100644
--- gcc/tree-vrp.c
+++ gcc/tree-vrp.c
@@ -9467,6 +9467,8 @@ simplify_cond_using_ranges (gcond *stmt)
       innerop = gimple_assign_rhs1 (def_stmt);
 
       if (TREE_CODE (innerop) == SSA_NAME
+         && (GET_MODE_SIZE(TYPE_MODE(TREE_TYPE(innerop))) 
+           <= GET_MODE_SIZE(word_mode))
 	  && !POINTER_TYPE_P (TREE_TYPE (innerop)))
 	{
 	  value_range *vr = get_value_range (innerop);

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-11-23  9:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-14  7:12 [Patch, vrp] Allow VRP type conversion folding only for widenings upto word mode Senthil Kumar Selvaraj
2015-11-14  8:13 ` Marc Glisse
2015-11-14  8:50   ` Senthil Kumar Selvaraj
2015-11-14  8:57     ` Richard Biener
2015-11-14 18:11       ` Senthil Kumar Selvaraj
2015-11-16  9:02         ` Richard Biener
2015-11-17 19:53           ` Senthil Kumar Selvaraj
2015-11-18  8:36             ` Richard Biener
2015-11-19  6:20               ` Senthil Kumar Selvaraj
2015-11-19 17:31                 ` Jeff Law
2015-11-20 17:04                   ` Senthil Kumar Selvaraj
2015-11-20 17:34                     ` Jeff Law
2015-11-23  9:54                       ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).