aboutsummaryrefslogtreecommitdiff
path: root/gcc/genrecog.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-10-26 19:13:47 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-10-26 19:13:47 -0400
commitb030d598109a6a7060cd00c7422ae4564ede0f0c (patch)
treef51b19f732227bc65781de072f9e75e8f801b50d /gcc/genrecog.c
parentf3d723e9ef64584d6cf05847d058dc9099a1b20f (diff)
downloadgcc-b030d598109a6a7060cd00c7422ae4564ede0f0c.zip
gcc-b030d598109a6a7060cd00c7422ae4564ede0f0c.tar.gz
gcc-b030d598109a6a7060cd00c7422ae4564ede0f0c.tar.bz2
(write_tree_1): Avoid emitting '-2147483648'.
From-SVN: r10523
Diffstat (limited to 'gcc/genrecog.c')
-rw-r--r--gcc/genrecog.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index afde2e6..21f1c06 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -1,5 +1,5 @@
/* Generate code from machine description to recognize rtl as insns.
- Copyright (C) 1987, 1988, 1992, 1993, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 92, 93, 94, 1995 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -1343,13 +1343,22 @@ write_tree_1 (tree, prevpos, afterward, type)
if (p->test_elt_one_int)
printf ("XINT (x%d, 1) == %d && ", depth, p->elt_one_int);
if (p->test_elt_zero_wide)
- printf (
+ {
+ /* Set offset to 1 iff the number might get propagated to
+ unsigned long by ANSI C rules, else 0.
+ Prospective hosts are required to have at least 32 bit
+ ints, and integer constants in machine descriptions
+ must fit in 32 bit, thus it suffices to check only
+ for 1 << 31 . */
+ HOST_WIDE_INT offset = p->elt_zero_wide == -2147483647 - 1;
+ printf (
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
- "XWINT (x%d, 0) == %d && ",
+ "XWINT (x%d, 0) == %d%s && ",
#else
- "XWINT (x%d, 0) == %ld && ",
+ "XWINT (x%d, 0) == %ld%s && ",
#endif
- depth, p->elt_zero_wide);
+ depth, p->elt_zero_wide + offset, offset ? "-1" : "");
+ }
if (p->veclen)
printf ("XVECLEN (x%d, 0) == %d && ", depth, p->veclen);
if (p->dupno >= 0)