* c-typeck.c (build_unary_op): Use omit_one_operand for
IMAGPART_EXPR of real argument.
testsuite:
* gcc.dg/imag-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141176
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-10-16 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/33192
+ * c-typeck.c (build_unary_op): Use omit_one_operand for
+ IMAGPART_EXPR of real argument.
+
2008-10-16 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/37664
else if (TREE_CODE (TREE_TYPE (arg)) == COMPLEX_TYPE)
ret = fold_build1 (IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (arg)), arg);
else
- ret = convert (TREE_TYPE (arg), integer_zero_node);
+ ret = omit_one_operand (TREE_TYPE (arg), integer_zero_node, arg);
goto return_build_unary_op;
case PREINCREMENT_EXPR:
+2008-10-16 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/33192
+ * gcc.dg/imag-1.c: New test.
+
2008-10-16 Daniel Kraft <d@domob.eu>
* gfortran.dg/elemental_intrinsic_1.f03: New test.
--- /dev/null
+/* Test for __imag__ side effects; see PR 33192. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int i, j;
+ i = 1;
+ j = __imag__ ++i;
+ if (i != 2 || j != 0)
+ abort ();
+ return 0;
+}