This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [c++-delayed-folding] Introduce convert_to_real_nofold
- From: Marek Polacek <polacek at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Wed, 4 Nov 2015 15:03:16 +0100
- Subject: Re: [c++-delayed-folding] Introduce convert_to_real_nofold
- Authentication-results: sourceware.org; auth=none
- References: <20151103165334 dot GN3185 at redhat dot com> <CAFiYyc0wewQ_zCL7C-SqB9_2q6wsh6UBBfJ_ihcK5gn-2oF42Q at mail dot gmail dot com>
On Wed, Nov 04, 2015 at 10:32:52AM +0100, Richard Biener wrote:
> On Tue, Nov 3, 2015 at 5:53 PM, Marek Polacek <polacek@redhat.com> wrote:
> > The last piece for convert.c. Since convert_to_real uses fold ()
> > rather than fold_buildN, I defined a new macro to keep the code
> > more compact.
> >
> > With this committed, convert.c should be dealt with. If there's
> > anything else I could help with, please let me know.
> >
> > Bootstrapped/regtested on x86_64-linux, ok for branch?
>
> I wonder what happens (on trunk) when you just remove the fold () calls.
Nothing much, at least the following patch passes testing.
Bootstrapped/regtested on x86_64-linux.
2015-11-04 Marek Polacek <polacek@redhat.com>
* convert.c (convert_to_real): Remove calls to fold.
diff --git gcc/convert.c gcc/convert.c
index 113c11f..8ef1949 100644
--- gcc/convert.c
+++ gcc/convert.c
@@ -211,7 +211,7 @@ convert_to_real (tree type, tree expr)
if (fn)
{
- tree arg = fold (convert_to_real (newtype, arg0));
+ tree arg = convert_to_real (newtype, arg0);
expr = build_call_expr (fn, 1, arg);
if (newtype == type)
return expr;
@@ -235,8 +235,7 @@ convert_to_real (tree type, tree expr)
&& FLOAT_TYPE_P (itype)
&& TYPE_PRECISION (type) < TYPE_PRECISION (itype))
return build1 (TREE_CODE (expr), type,
- fold (convert_to_real (type,
- TREE_OPERAND (expr, 0))));
+ convert_to_real (type, TREE_OPERAND (expr, 0)));
break;
/* Convert (outertype)((innertype0)a+(innertype1)b)
into ((newtype)a+(newtype)b) where newtype
@@ -272,8 +271,8 @@ convert_to_real (tree type, tree expr)
|| newtype == dfloat128_type_node)
{
expr = build2 (TREE_CODE (expr), newtype,
- fold (convert_to_real (newtype, arg0)),
- fold (convert_to_real (newtype, arg1)));
+ convert_to_real (newtype, arg0),
+ convert_to_real (newtype, arg1));
if (newtype == type)
return expr;
break;
@@ -312,8 +311,8 @@ convert_to_real (tree type, tree expr)
&& !excess_precision_type (newtype))))
{
expr = build2 (TREE_CODE (expr), newtype,
- fold (convert_to_real (newtype, arg0)),
- fold (convert_to_real (newtype, arg1)));
+ convert_to_real (newtype, arg0),
+ convert_to_real (newtype, arg1));
if (newtype == type)
return expr;
}
Marek