* gcc.dg/pr14092-1.c: New testcase.
* fold-const.c (fold) <NEGATE_EXPR>: Convert result of
negate_expr back to the original type.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77602
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
+
2004-02-10 Alan Modra <amodra@bigpond.net.au>
* config/rs6000/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Don't
case NEGATE_EXPR:
if (negate_expr_p (arg0))
- return negate_expr (arg0);
+ return fold_convert (type, negate_expr (arg0));
return t;
case ABS_EXPR:
+2004-02-10 Paolo Bonzini <bonzini@gnu.org>
+
+ PR c/14092
+
+ * gcc.dg/pr14092-1.c: New testcase.
+
2004-02-10 Alan Modra <amodra@bigpond.net.au>
* gcc.dg/cpp/assert4.c: Fix typo last change.
--- /dev/null
+/* PR c/14092
+ * Origin: bonzini@gnu.org
+ * rejects-valid
+ */
+/* { dg-do compile } */
+
+typedef struct _PLCI {
+ unsigned char x;
+ unsigned char buf[1];
+} PLCI;
+
+
+void nl_ind(PLCI * plci)
+{
+ plci->x = -((int)(plci->buf)) & 3;
+}
+