aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-02-20 10:34:28 -0800
committerRichard Henderson <rth@gcc.gnu.org>2002-02-20 10:34:28 -0800
commitf322b423194007ef5a08daa69a8301739b63fa88 (patch)
tree18e8651a6e8f8be265ac3185709457f1450f6c4f /gcc
parentd94084f79a5fa26e76b3b7697c6674b4223f51f7 (diff)
downloadgcc-f322b423194007ef5a08daa69a8301739b63fa88.zip
gcc-f322b423194007ef5a08daa69a8301739b63fa88.tar.gz
gcc-f322b423194007ef5a08daa69a8301739b63fa88.tar.bz2
re PR c/5615 (ICE in size_binop, at fold-const.c:1914)
PR c/5615 * expr.h (ARGS_SIZE_TREE): Convert size.var to ssizetype. From-SVN: r49904
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expr.h3
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20020210-1.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2b0a2b5..879ebbd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/expr.h b/gcc/expr.h
index e5b488a..c1ee7f4 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -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
index 0000000..5ca27f4
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20020210-1.c
@@ -0,0 +1,2 @@
+/* PR c/5615 */
+void f(int a, struct {int b[a];} c) {}