OSDN Git Service

2005-09-18 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 18 Sep 2005 14:15:19 +0000 (14:15 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 18 Sep 2005 14:15:19 +0000 (14:15 +0000)
PR middle-end/23944
* gimplify.c (fold_indirect_ref_rhs): Fix thinko in
fallback.

* gcc.c-torture/compile/pr23944.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104402 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr23944.c [new file with mode: 0644]

index 131c3b7..eb03f70 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-18  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/23944
+       * gimplify.c (fold_indirect_ref_rhs): Fix thinko in
+       fallback.
+
 2005-09-18  Paul Brook  <paul@codesourcery.com>
 
        * config/m68k/fpgnuib.c (__floatsidf): Don't rely on signed overflow.
index cdb8a33..cba1704 100644 (file)
@@ -2950,9 +2950,10 @@ fold_indirect_ref_rhs (tree t)
     {
       tree type_domain;
       tree min_val = size_zero_node;
+      tree osub = sub;
       sub = fold_indirect_ref_rhs (sub);
       if (! sub)
-       sub = build1 (INDIRECT_REF, TREE_TYPE (subtype), sub);
+       sub = build1 (INDIRECT_REF, TREE_TYPE (subtype), osub);
       type_domain = TYPE_DOMAIN (TREE_TYPE (sub));
       if (type_domain && TYPE_MIN_VALUE (type_domain))
         min_val = TYPE_MIN_VALUE (type_domain);
index 4424bd8..b02eaa6 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-18  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/23944
+       * gcc.c-torture/compile/pr23944.c: New testcase.
+
 2005-09-18  Erik Edelmann  <erik.edelmann@iki.fi>
 
        PR fortran/15975
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr23944.c b/gcc/testsuite/gcc.c-torture/compile/pr23944.c
new file mode 100644 (file)
index 0000000..45bed7e
--- /dev/null
@@ -0,0 +1,4 @@
+float f(float src[][4])
+{
+ return *(src[3]);
+}