aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-03-25 08:46:20 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-03-25 08:46:20 +0000
commitc09a3914dc36c1046280b591cb468712b0782ea8 (patch)
tree4e0c8b30d949da9e9093bf3be324751c70b54aca /gcc
parent0341335e616995e7e07902c0f49ded9f1cb4be80 (diff)
downloadgcc-c09a3914dc36c1046280b591cb468712b0782ea8.zip
gcc-c09a3914dc36c1046280b591cb468712b0782ea8.tar.gz
gcc-c09a3914dc36c1046280b591cb468712b0782ea8.tar.bz2
re PR middle-end/65519 (unable to coalesce ssa_names 2 and 87 which are marked as MUST COALESCE)
2015-03-25 Richard Biener <rguenther@suse.de> PR middle-end/65519 * genmatch.c (expr::gen_transform): Re-write to avoid using gimple_build. * gnat.dg/specs/opt2.ads: New testcase. From-SVN: r221654
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/genmatch.c28
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gnat.dg/specs/opt2.ads11
4 files changed, 34 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e04cf2f..3ae855b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-25 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/65519
+ * genmatch.c (expr::gen_transform): Re-write to avoid
+ using gimple_build.
+
2015-03-25 Bin Cheng <bin.cheng@arm.com>
* doc/sourcebuild.texi (arm_tune_string_ops_prefer_neon): New.
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index 6723c29..560a371 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -1742,22 +1742,18 @@ expr::gen_transform (FILE *f, const char *dest, bool gimple, int depth,
if (gimple)
{
- /* ??? Have another helper that is like gimple_build but may
- fail if seq == NULL. */
- fprintf (f, " if (!seq)\n"
- " {\n"
- " res = gimple_simplify (%s, %s", opr, type);
+ /* ??? Building a stmt can fail for various reasons here, seq being
+ NULL or the stmt referencing SSA names occuring in abnormal PHIs.
+ So if we fail here we should continue matching other patterns. */
+ fprintf (f, " code_helper tem_code = %s;\n"
+ " tree tem_ops[3] = { ", opr);
for (unsigned i = 0; i < ops.length (); ++i)
- fprintf (f, ", ops%d[%u]", depth, i);
- fprintf (f, ", seq, valueize);\n");
- fprintf (f, " if (!res) return false;\n");
- fprintf (f, " }\n");
- fprintf (f, " else\n");
- fprintf (f, " res = gimple_build (seq, UNKNOWN_LOCATION, %s, %s",
- opr, type);
- for (unsigned i = 0; i < ops.length (); ++i)
- fprintf (f, ", ops%d[%u]", depth, i);
- fprintf (f, ", valueize);\n");
+ fprintf (f, "ops%d[%u]%s", depth, i,
+ i == ops.length () - 1 ? " };\n" : ", ");
+ fprintf (f, " gimple_resimplify%d (seq, &tem_code, %s, tem_ops, valueize);\n",
+ ops.length (), type);
+ fprintf (f, " res = maybe_push_res_to_seq (tem_code, %s, tem_ops, seq);\n"
+ " if (!res) return false;\n", type);
}
else
{
@@ -1771,7 +1767,7 @@ expr::gen_transform (FILE *f, const char *dest, bool gimple, int depth,
fprintf (f, ", ops%d[%u]", depth, i);
fprintf (f, ");\n");
}
- fprintf (f, " %s = res;\n", dest);
+ fprintf (f, "%s = res;\n", dest);
fprintf (f, "}\n");
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a93a880..fe8092a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-25 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/65519
+ * gnat.dg/specs/opt2.ads: New testcase.
+
2015-03-25 Bin Cheng <bin.cheng@arm.com>
* lib/target-supports.exp (arm_tune_string_ops_prefer_neon): New.
diff --git a/gcc/testsuite/gnat.dg/specs/opt2.ads b/gcc/testsuite/gnat.dg/specs/opt2.ads
new file mode 100644
index 0000000..9ea333d
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/opt2.ads
@@ -0,0 +1,11 @@
+-- { dg-do compile }
+-- { dg-options "-O2" }
+
+with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
+with Interfaces; use Interfaces;
+
+package Opt2 is
+
+ type Arr is array (Unsigned_32 range <>) of Unbounded_String;
+
+end P;