+2011-04-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2011-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/47473
+ * c-lex.c (interpret_float): If CPP_N_IMAGINARY, ensure
+ EXCESS_PRECISION_EXPR is created with COMPLEX_TYPE instead of
+ REAL_TYPE.
+
2011-04-07 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/47391
/* Create a node with determined type and value. */
value = build_real (const_type, real);
if (flags & CPP_N_IMAGINARY)
- value = build_complex (NULL_TREE, convert (const_type, integer_zero_node),
- value);
+ {
+ value = build_complex (NULL_TREE, convert (const_type,
+ integer_zero_node), value);
+ if (type != const_type)
+ {
+ const_type = TREE_TYPE (value);
+ type = build_complex_type (type);
+ }
+ }
if (type != const_type)
value = build1 (EXCESS_PRECISION_EXPR, type, value);
2011-04-07 Jakub Jelinek <jakub@redhat.com>
- Backport from mainline
+ Backported from mainline
+ 2011-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/47473
+ * gcc.dg/torture/pr47473.c: New test.
+
2011-01-21 Jakub Jelinek <jakub@redhat.com>
-
+
PR tree-optimization/47391
* gcc.dg/pr47391.c: New test.
--- /dev/null
+/* PR c/47473 */
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+int
+main (void)
+{
+ long double _Complex w = 0.2L - 0.3iL;
+ w = w * (0.3L - (0.0F + 1.0iF) * 0.9L);
+ if (__builtin_fabsl (__real__ w + 0.21L) > 0.001L
+ || __builtin_fabsl (__imag__ w + 0.27L) > 0.001L)
+ __builtin_abort ();
+ return 0;
+}