]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/23944 (segv in fold_indirect_ref_1 in fold-const.c:11505)
authorRichard Guenther <rguenther@suse.de>
Sun, 18 Sep 2005 14:15:19 +0000 (14:15 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sun, 18 Sep 2005 14:15:19 +0000 (14:15 +0000)
2005-09-18  Richard Guenther  <rguenther@suse.de>

PR middle-end/23944
* gimplify.c (fold_indirect_ref_rhs): Fix thinko in
fallback.

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

From-SVN: r104402

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

index 131c3b7934bbb4b55b61cea596fe7d54b6062158..eb03f70d6ed58c062e692ce4992741004929657e 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 cdb8a33e46dfdbfd9539ef08ceda2b341e6dca87..cba1704e8a0a9199fabd6197a78d7a7d0e50c995 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 4424bd8ec92e615e4b8a64eb3b08776fbdbd931d..b02eaa619a295c507a64a783a0a015d3d98edcd3 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]);
+}