re PR bootstrap/48161 (hppa*-*-* will not bootstrap on 4.6 branch with release checking)
authorJakub Jelinek <jakub@gcc.gnu.org>
Fri, 18 Mar 2011 08:35:17 +0000 (09:35 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 18 Mar 2011 08:35:17 +0000 (09:35 +0100)
PR bootstrap/48161
* expr.c (expand_expr_addr_expr_1): Use simplify_gen_binary
instead of gen_rtx_PLUS if EXPAND_SUM or EXPAND_INITIALIZER.

* gcc.c-torture/compile/pr48161.c: New test.

From-SVN: r171126

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

index b96cadb8b31f1d76df1cc61ea2e31826ef5de71f..792dfb3a31067f95d0963972c5c13e7864240d4c 100644 (file)
@@ -1,3 +1,10 @@
+2011-03-18  Richard Henderson  <rth@redhat.com>
+           Jakub Jelinek  <jakub@redhat.com>
+
+       PR bootstrap/48161
+       * expr.c (expand_expr_addr_expr_1): Use simplify_gen_binary
+       instead of gen_rtx_PLUS if EXPAND_SUM or EXPAND_INITIALIZER.
+
 2011-03-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR middle-end/47725
index 6a5f74b42105a77ef61553da64c7b23178c008e2..3295156e139e6a13dbb3ae2f8a9616fe1183dee1 100644 (file)
@@ -6971,7 +6971,7 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
       tmp = convert_memory_address_addr_space (tmode, tmp, as);
 
       if (modifier == EXPAND_SUM || modifier == EXPAND_INITIALIZER)
-       result = gen_rtx_PLUS (tmode, result, tmp);
+       result = simplify_gen_binary (PLUS, tmode, result, tmp);
       else
        {
          subtarget = bitpos ? NULL_RTX : target;
index 51f748c2e227a6b4c648d27a1af458f87681ea5b..59d736a71f8bd8e572b4788863ef5aedaf187114 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-18  Jakub Jelinek  <jakub@redhat.com>
+
+       PR bootstrap/48161
+       * gcc.c-torture/compile/pr48161.c: New test.
+
 2011-03-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR middle-end/47725
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr48161.c b/gcc/testsuite/gcc.c-torture/compile/pr48161.c
new file mode 100644 (file)
index 0000000..c454efc
--- /dev/null
@@ -0,0 +1,24 @@
+/* PR bootstrap/48161 */
+
+struct T { int u; };
+struct G { int l; int t; int r; };
+struct V { struct G v[10]; };
+struct { struct V b; } *h;
+void bar (void);
+
+struct G *
+baz (struct V *x, unsigned y)
+{
+  return &x->v[y];
+}
+
+int
+foo (struct T *x, struct T *y)
+{
+  if ((baz (&h->b, y->u)->t ? baz (&h->b, y->u)->t : 0)
+      - baz (h ? &h->b : 0, x->u)->r
+      - (baz (h ? &h->b : 0, x->u)->t > 0 ? 5 : 0))
+    return 1;
+  bar ();
+  return 0;
+}