This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add save_expr langhook (PR c/68513)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: Richard Biener <rguenther at suse dot de>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 30 Nov 2015 23:49:54 +0000
- Subject: Re: [PATCH] Add save_expr langhook (PR c/68513)
- Authentication-results: sourceware.org; auth=none
- References: <20151127185531 dot GA28072 at redhat dot com> <43651703-7ABE-491D-8D5B-863E921EA365 at suse dot de> <20151130154143 dot GF28072 at redhat dot com>
On Mon, 30 Nov 2015, Marek Polacek wrote:
> On Sat, Nov 28, 2015 at 08:50:12AM +0100, Richard Biener wrote:
> > Different approach: after the FE folds (unexpectedly?), scan the result for
> > SAVE_EXPRs and if found, drop the folding.
>
> Neither this fixes this problem completely, because we simply don't know where
> those SAVE_EXPRs might be introduced: it might be convert(), but e.g. when I
> changed the original testcase a tiny bit (added -), then those SAVE_EXPRs were
> introduced in a different spot (via c_process_stmt_expr -> c_fully_fold).
Well, c_fully_fold should eliminate all C_MAYBE_CONST_EXPRs in its
argument and never pass anything containing them to the
language-independent folders. So it shouldn't matter if something called
by c_fully_fold introduces a SAVE_EXPR. If it does matter, that indicates
the problem was earlier (something earlier putting a tree that
c_fully_fold doesn't fold around a tree containing a C_MAYBE_CONST_EXPR,
without folding first).
--
Joseph S. Myers
joseph@codesourcery.com