public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ PATCH to remove WITH_CLEANUP_EXPR handling
@ 2017-06-29 21:44 Jason Merrill
  2017-06-30 12:39 ` Nathan Sidwell
  2017-07-03  9:35 ` Marek Polacek
  0 siblings, 2 replies; 4+ messages in thread
From: Jason Merrill @ 2017-06-29 21:44 UTC (permalink / raw)
  To: gcc-patches List

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

The C++ front end hasn't generated WITH_CLEANUP_EXPR in a very long
time (20+ years?), so there's no need to handle it.

Tested x86_64-pc-linux-gnu, applying to trunk.

[-- Attachment #2: wce.diff --]
[-- Type: text/plain, Size: 2121 bytes --]

commit 8ce76bba3bf7866a2338125b4c55b0a1e3ce9221
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Jun 29 15:56:20 2017 -0400

            * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.

diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 5a57452..32180a7 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -4519,7 +4519,6 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
       /* GCC internal stuff.  */
     case VA_ARG_EXPR:
     case OBJ_TYPE_REF:
-    case WITH_CLEANUP_EXPR:
     case NON_DEPENDENT_EXPR:
     case BASELINK:
     case OFFSET_REF:
@@ -5533,7 +5532,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
     case BIND_EXPR:
       return RECUR (BIND_EXPR_BODY (t), want_rval);
 
-    case WITH_CLEANUP_EXPR:
     case CLEANUP_POINT_EXPR:
     case MUST_NOT_THROW_EXPR:
     case TRY_CATCH_EXPR:
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 86fa804..43b5cec 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2664,7 +2664,6 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags)
       break;
 
     case TRY_CATCH_EXPR:
-    case WITH_CLEANUP_EXPR:
     case CLEANUP_POINT_EXPR:
       dump_expr (pp, TREE_OPERAND (t, 0), flags);
       break;
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index a52a9e8..c037b2c 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -90,7 +90,6 @@ lvalue_kind (const_tree ref)
     case PREINCREMENT_EXPR:
     case PREDECREMENT_EXPR:
     case TRY_CATCH_EXPR:
-    case WITH_CLEANUP_EXPR:
     case REALPART_EXPR:
     case IMAGPART_EXPR:
       return lvalue_kind (TREE_OPERAND (ref, 0));
@@ -3584,11 +3583,6 @@ cp_tree_equal (tree t1, tree t2)
 	return cp_tree_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t2, 1));
       }
 
-    case WITH_CLEANUP_EXPR:
-      if (!cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0)))
-	return false;
-      return cp_tree_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t1, 1));
-
     case PARM_DECL:
       /* For comparing uses of parameters in late-specified return types
 	 with an out-of-class definition of the function, but can also come

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: C++ PATCH to remove WITH_CLEANUP_EXPR handling
  2017-06-29 21:44 C++ PATCH to remove WITH_CLEANUP_EXPR handling Jason Merrill
@ 2017-06-30 12:39 ` Nathan Sidwell
  2017-07-03  9:35 ` Marek Polacek
  1 sibling, 0 replies; 4+ messages in thread
From: Nathan Sidwell @ 2017-06-30 12:39 UTC (permalink / raw)
  To: Jason Merrill, gcc-patches List

On 06/29/2017 05:44 PM, Jason Merrill wrote:
> The C++ front end hasn't generated WITH_CLEANUP_EXPR in a very long
> time (20+ years?), so there's no need to handle it.

I see dead code

nathan

-- 
Nathan Sidwell

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: C++ PATCH to remove WITH_CLEANUP_EXPR handling
  2017-06-29 21:44 C++ PATCH to remove WITH_CLEANUP_EXPR handling Jason Merrill
  2017-06-30 12:39 ` Nathan Sidwell
@ 2017-07-03  9:35 ` Marek Polacek
  2017-07-04  2:03   ` Jason Merrill
  1 sibling, 1 reply; 4+ messages in thread
From: Marek Polacek @ 2017-07-03  9:35 UTC (permalink / raw)
  To: Jason Merrill; +Cc: gcc-patches List

On Thu, Jun 29, 2017 at 05:44:25PM -0400, Jason Merrill wrote:
> The C++ front end hasn't generated WITH_CLEANUP_EXPR in a very long
> time (20+ years?), so there's no need to handle it.

Heh.  Found another one; is this patch ok if it passes testing?

2017-07-03  Marek Polacek  <polacek@redhat.com>

	* c-warn.c (warn_if_unused_value): Remove WITH_CLEANUP_EXPR handling.

diff --git gcc/c-family/c-warn.c gcc/c-family/c-warn.c
index 5d67395..b9378c2 100644
--- gcc/c-family/c-warn.c
+++ gcc/c-family/c-warn.c
@@ -465,7 +465,6 @@ warn_if_unused_value (const_tree exp, location_t locus)
     case TARGET_EXPR:
     case CALL_EXPR:
     case TRY_CATCH_EXPR:
-    case WITH_CLEANUP_EXPR:
     case EXIT_EXPR:
     case VA_ARG_EXPR:
       return false;

	Marek

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: C++ PATCH to remove WITH_CLEANUP_EXPR handling
  2017-07-03  9:35 ` Marek Polacek
@ 2017-07-04  2:03   ` Jason Merrill
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Merrill @ 2017-07-04  2:03 UTC (permalink / raw)
  To: Marek Polacek; +Cc: gcc-patches List

Absolutely.

On Mon, Jul 3, 2017 at 5:35 AM, Marek Polacek <polacek@redhat.com> wrote:
> On Thu, Jun 29, 2017 at 05:44:25PM -0400, Jason Merrill wrote:
>> The C++ front end hasn't generated WITH_CLEANUP_EXPR in a very long
>> time (20+ years?), so there's no need to handle it.
>
> Heh.  Found another one; is this patch ok if it passes testing?
>
> 2017-07-03  Marek Polacek  <polacek@redhat.com>
>
>         * c-warn.c (warn_if_unused_value): Remove WITH_CLEANUP_EXPR handling.
>
> diff --git gcc/c-family/c-warn.c gcc/c-family/c-warn.c
> index 5d67395..b9378c2 100644
> --- gcc/c-family/c-warn.c
> +++ gcc/c-family/c-warn.c
> @@ -465,7 +465,6 @@ warn_if_unused_value (const_tree exp, location_t locus)
>      case TARGET_EXPR:
>      case CALL_EXPR:
>      case TRY_CATCH_EXPR:
> -    case WITH_CLEANUP_EXPR:
>      case EXIT_EXPR:
>      case VA_ARG_EXPR:
>        return false;
>
>         Marek

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-04  2:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29 21:44 C++ PATCH to remove WITH_CLEANUP_EXPR handling Jason Merrill
2017-06-30 12:39 ` Nathan Sidwell
2017-07-03  9:35 ` Marek Polacek
2017-07-04  2:03   ` Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).