summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-05 07:39:36 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-05 07:39:36 +0000
commitb213bda0fae118fb6fae17dac2e4eb754e905db6 (patch)
tree8c105d00e5373f1940aedef04dcc607a83fdb1fa
parentb649d922c276fdc643ef4a1ea5b0ceb056c5ba45 (diff)
downloadgcc-b213bda0fae118fb6fae17dac2e4eb754e905db6.tar.gz
* ipa-inline-analysis.c (set_cond_stmt_execution_predicate): Check that
parameter is SSA name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178524 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ipa-inline-analysis.c2
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20110902.c14
4 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b106227f2c4..d82f1e7e092 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-04 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline-analysis.c (set_cond_stmt_execution_predicate): Check that
+ parameter is SSA name.
+
2011-09-04 Richard Guenther <rguenther@suse.de>
Revert
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index b56c66944e5..63737535008 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -1187,6 +1187,8 @@ set_cond_stmt_execution_predicate (struct ipa_node_params *info,
|| gimple_call_num_args (set_stmt) != 1)
return;
op2 = gimple_call_arg (set_stmt, 0);
+ if (TREE_CODE (op2) != SSA_NAME)
+ return;
if (!SSA_NAME_IS_DEFAULT_DEF (op2))
return;
index = ipa_get_param_decl_index (info, SSA_NAME_VAR (op2));
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1b465cecaff..21628f8b250 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2011-09-04 Jan Hubicka <jh@suse.cz>
+
+ * gcc.c-torture/compile/20110902.c: new testcase.
+
2011-09-04 Jason Merrill <jason@redhat.com>
PR c++/49267
diff --git a/gcc/testsuite/gcc.c-torture/compile/20110902.c b/gcc/testsuite/gcc.c-torture/compile/20110902.c
new file mode 100644
index 00000000000..1556e4a3673
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20110902.c
@@ -0,0 +1,14 @@
+static inline __attribute__((always_inline)) int f (unsigned int n, unsigned int size)
+{
+ return (__builtin_constant_p (size != 0 && n > ~0 / size)
+ ? !!(size != 0 && n > ~0 / size)
+ : ({ static unsigned int count[2] = { 0, 0 };
+ int r = !!(size != 0 && n > ~0 / size);
+ count[r]++;
+ r; }));
+}
+
+int g (unsigned int size)
+{
+ return f (size / 4096, 4);
+}