aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2015-09-30 18:51:31 +0000
committerBernd Edlinger <edlinger@gcc.gnu.org>2015-09-30 18:51:31 +0000
commit9a9fe2b4d216494a9992a354c337c8b2279c43b8 (patch)
treeea16b69240bd8a87433b37ab3b9bacde0c5c69b1 /gcc
parentdc0ccbb3a3e60f0423ac69d82f6cb78ff9b10800 (diff)
downloadgcc-9a9fe2b4d216494a9992a354c337c8b2279c43b8.zip
gcc-9a9fe2b4d216494a9992a354c337c8b2279c43b8.tar.gz
gcc-9a9fe2b4d216494a9992a354c337c8b2279c43b8.tar.bz2
re PR rtl-optimization/67037 (Wrong code at -O1 and above on ARM)
2015-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de> PR rtl-optimization/67037 * lra-constraints.c (process_addr_reg): Use copy_rtx when necessary. testsuite: 2015-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de> PR rtl-optimization/67037 * gcc.c-torture/execute/pr67037.c: New test. From-SVN: r228303
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/lra-constraints.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr67037.c49
4 files changed, 60 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dd723b8..b60a3e6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR rtl-optimization/67037
+ * lra-constraints.c (process_addr_reg): Use copy_rtx when necessary.
+
2015-09-30 Bernd Schmidt <bernds@redhat.com>
* gimple-ssa.h (gimple_df): Add free_ssanames_queue field.
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index c6afa7a..7764f29 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1339,7 +1339,7 @@ process_addr_reg (rtx *loc, bool check_only_p, rtx_insn **before, rtx_insn **aft
if (after != NULL)
{
start_sequence ();
- lra_emit_move (reg, new_reg);
+ lra_emit_move (before_p ? copy_rtx (reg) : reg, new_reg);
emit_insn (*after);
*after = get_insns ();
end_sequence ();
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9cddbef..ece4ad1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR rtl-optimization/67037
+ * gcc.c-torture/execute/pr67037.c: New test.
+
2015-09-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* lib/target-supports.exp (check_effective_target_sync_int_128):
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr67037.c b/gcc/testsuite/gcc.c-torture/execute/pr67037.c
new file mode 100644
index 0000000..3119d32
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr67037.c
@@ -0,0 +1,49 @@
+long (*extfunc)();
+
+static inline void lstrcpynW( short *d, const short *s, int n )
+{
+ unsigned int count = n;
+
+ while ((count > 1) && *s)
+ {
+ count--;
+ *d++ = *s++;
+ }
+ if (count) *d = 0;
+}
+
+int __attribute__((noinline,noclone))
+badfunc(int u0, int u1, int u2, int u3,
+ short *fsname, unsigned int fsname_len)
+{
+ static const short ntfsW[] = {'N','T','F','S',0};
+ char superblock[2048+3300];
+ int ret = 0;
+ short *p;
+
+ if (extfunc())
+ return 0;
+ p = (void *)extfunc();
+ if (p != 0)
+ goto done;
+
+ extfunc(superblock);
+
+ lstrcpynW(fsname, ntfsW, fsname_len);
+
+ ret = 1;
+done:
+ return ret;
+}
+
+static long f()
+{
+ return 0;
+}
+
+int main()
+{
+ short buf[6];
+ extfunc = f;
+ return !badfunc(0, 0, 0, 0, buf, 6);
+}