re PR c/5615 (ICE in size_binop, at fold-const.c:1914)
authorRichard Henderson <rth@redhat.com>
Wed, 20 Feb 2002 18:34:28 +0000 (10:34 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 20 Feb 2002 18:34:28 +0000 (10:34 -0800)
        PR c/5615
        * expr.h (ARGS_SIZE_TREE): Convert size.var to ssizetype.

From-SVN: r49904

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

index 2b0a2b51989fed80c28997a799e3a6b9994595d3..879ebbd6ce4d33b95727db6fd99f2b253d279d53 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-20  Richard Henderson  <rth@redhat.com>
+
+       PR c/5615
+       * expr.h (ARGS_SIZE_TREE): Convert size.var to ssizetype.
+
 2002-02-20  Tom Tromey  <tromey@redhat.com>
 
        * config/fr30/fr30.h (DWARF_LINE_MIN_INSTR_LENGTH): Removed.
index e5b488aec33047a301d78313de470b65fd0cdf2d..c1ee7f4e1e84f65cc634c0d46c618da72a5d9573 100644 (file)
@@ -97,7 +97,8 @@ struct args_size
    of type ssizetype.  */
 #define ARGS_SIZE_TREE(SIZE)                                   \
 ((SIZE).var == 0 ? ssize_int ((SIZE).constant)                 \
- : size_binop (PLUS_EXPR, (SIZE).var, ssize_int ((SIZE).constant)))
+ : size_binop (PLUS_EXPR, convert (ssizetype, (SIZE).var),     \
+              ssize_int ((SIZE).constant)))
 
 /* Convert the implicit sum in a `struct args_size' into an rtx.  */
 #define ARGS_SIZE_RTX(SIZE)                                    \
diff --git a/gcc/testsuite/gcc.c-torture/compile/20020210-1.c b/gcc/testsuite/gcc.c-torture/compile/20020210-1.c
new file mode 100644 (file)
index 0000000..5ca27f4
--- /dev/null
@@ -0,0 +1,2 @@
+/* PR c/5615 */
+void f(int a, struct {int b[a];} c) {}