aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2007-06-22 20:51:28 +0200
committerUros Bizjak <uros@gcc.gnu.org>2007-06-22 20:51:28 +0200
commit58f7fcc3628dbe04c9cfd53da71351c21e6bf03c (patch)
tree6600ebacfc0a26ca7afe0a15a806c900c5ca85bd
parent23bc73b56313bcae5095f1258710bd1485ead15d (diff)
downloadgcc-58f7fcc3628dbe04c9cfd53da71351c21e6bf03c.zip
gcc-58f7fcc3628dbe04c9cfd53da71351c21e6bf03c.tar.gz
gcc-58f7fcc3628dbe04c9cfd53da71351c21e6bf03c.tar.bz2
re PR middle-end/32374 (internal compiler error: in reload_cse_simplify_operands, at postreload.c:396)
PR middle-end/32374 * expr.c (store_constructor): Do not clobber non-zeroed memory. testsuite/ChangeLog: PR middle-end/32374 * gcc.dg/pr32374.c: New test. From-SVN: r125955
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expr.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr32374.c20
4 files changed, 31 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 349272b..09f2576 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-19 Uros Bizjak <ubizjak@gmail.com>
+
+ PR middle-end/32374
+ * expr.c (store_constructor): Do not clobber non-zeroed memory.
+
2007-06-22 Uros Bizjak <ubizjak@gmail.com>
PR target/32413
diff --git a/gcc/expr.c b/gcc/expr.c
index 3f0caf1..0739b05 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5062,7 +5062,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
cleared = 1;
}
- if (! cleared)
+ if (REG_P (target) && !cleared)
emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
/* Store each element of the constructor into the
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 658ac0c..d8ae75c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-22 Uros Bizjak <ubizjak@gmail.com>
+
+ PR middle-end/32374
+ * gcc.dg/pr32374.c: New test.
+
2007-06-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/32360
diff --git a/gcc/testsuite/gcc.dg/pr32374.c b/gcc/testsuite/gcc.dg/pr32374.c
new file mode 100644
index 0000000..de15d55
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr32374.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern int *stderr;
+
+void f (int *, const char *, ...);
+
+void g (const char *conf_name)
+{
+ typedef struct
+ {
+ const char *label;
+ const int value;
+ } Section;
+
+ const Section sections[2] = { {"", 0}, {"", 1} };
+
+ f (stderr, "", "", conf_name, 0, sections[0]);
+ f (stderr, "", "", conf_name, 0, sections[0]);
+}