This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR c/14092
- From: Bonzini <bonzini at gnu dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: roger at eyesopen dot com, akpm at osdl dot org
- Date: Tue, 10 Feb 2004 04:57:38 -0500
- Subject: [PATCH] Fix PR c/14092
This is a thinko in fold <NEGATE_EXPR>, which did not convert the
result of negate_expr back to the original type.
2004-02-10 Paolo Bonzini <bonzini@gnu.org>
PR c/14092
* fold-const.c (fold) (NEGATE_EXPR): Convert result of
negate_expr back to the original type.
Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.328
diff -u -r1.328 fold-const.c
--- fold-const.c 7 Feb 2004 18:57:29 -0000 1.328
+++ fold-const.c 10 Feb 2004 09:52:59 -0000
@@ -5785,7 +5785,7 @@
case NEGATE_EXPR:
if (negate_expr_p (arg0))
- return negate_expr (arg0);
+ return fold_convert (type, negate_expr (arg0));
return t;
case ABS_EXPR:
typedef struct _PLCI {
unsigned char x;
unsigned char buf[1];
} PLCI;
void nl_ind(PLCI * plci)
{
plci->x = -((int)(plci->buf)) & 3;
}