public inbox for gcc-rust@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rust: build failure after NON_DEPENDENT_EXPR removal [PR111899]
@ 2023-10-20 17:36 Patrick Palka
  2023-10-23  9:10 ` Thomas Schwinge
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Palka @ 2023-10-20 17:36 UTC (permalink / raw)
  To: gcc-patches; +Cc: jason, gcc-rust, Patrick Palka

Built on x86_64-pc-linux-gnu, pushed to trunk as obvious (hopefully).

-- >8 --

This patch removes stray NON_DEPENDENT_EXPR checks following the removal
of this tree code from the C++ FE.  (Since this restores the build I
supppose it means the Rust FE never creates NON_DEPENDENT_EXPR trees in
the first place, so no further analysis is needed.)

	PR rust/111899

gcc/rust/ChangeLog:

	* backend/rust-constexpr.cc (potential_constant_expression_1):
	Remove NON_DEPENDENT_EXPR handling.
	* backend/rust-tree.cc (mark_exp_read): Likewise.
	(mark_use): Likewise.
	(lvalue_kind): Likewise.
---
 gcc/rust/backend/rust-constexpr.cc | 1 -
 gcc/rust/backend/rust-tree.cc      | 3 ---
 2 files changed, 4 deletions(-)

diff --git a/gcc/rust/backend/rust-constexpr.cc b/gcc/rust/backend/rust-constexpr.cc
index b28fa27b2d0..a7ae4166ea0 100644
--- a/gcc/rust/backend/rust-constexpr.cc
+++ b/gcc/rust/backend/rust-constexpr.cc
@@ -6151,7 +6151,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
     case CLEANUP_POINT_EXPR:
     case EXPR_STMT:
     case PAREN_EXPR:
-    case NON_DEPENDENT_EXPR:
       /* For convenience.  */
     case LOOP_EXPR:
     case EXIT_EXPR:
diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc
index 66e859cd70c..7040c75f825 100644
--- a/gcc/rust/backend/rust-tree.cc
+++ b/gcc/rust/backend/rust-tree.cc
@@ -72,7 +72,6 @@ mark_exp_read (tree exp)
     case ADDR_EXPR:
     case INDIRECT_REF:
     case FLOAT_EXPR:
-    case NON_DEPENDENT_EXPR:
     case VIEW_CONVERT_EXPR:
       mark_exp_read (TREE_OPERAND (exp, 0));
       break;
@@ -128,7 +127,6 @@ mark_use (tree expr, bool rvalue_p, bool read_p,
   switch (TREE_CODE (expr))
     {
     case COMPONENT_REF:
-    case NON_DEPENDENT_EXPR:
       recurse_op[0] = true;
       break;
     case COMPOUND_EXPR:
@@ -4520,7 +4518,6 @@ lvalue_kind (const_tree ref)
 	 lvalues.  */
       return (DECL_NONSTATIC_MEMBER_FUNCTION_P (ref) ? clk_none : clk_ordinary);
 
-    case NON_DEPENDENT_EXPR:
     case PAREN_EXPR:
       return lvalue_kind (TREE_OPERAND (ref, 0));
 
-- 
2.42.0.411.g813d9a9188


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

* Re: [PATCH] rust: build failure after NON_DEPENDENT_EXPR removal [PR111899]
  2023-10-20 17:36 [PATCH] rust: build failure after NON_DEPENDENT_EXPR removal [PR111899] Patrick Palka
@ 2023-10-23  9:10 ` Thomas Schwinge
  2023-10-23 15:28   ` Jason Merrill
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Schwinge @ 2023-10-23  9:10 UTC (permalink / raw)
  To: Patrick Palka, gcc-patches; +Cc: jason, gcc-rust, Faisal Abbas

Hi Patrick!

On 2023-10-20T13:36:30-0400, Patrick Palka <ppalka@redhat.com> wrote:
> Built on x86_64-pc-linux-gnu, pushed to trunk as obvious (hopefully).
>
> -- >8 --
>
> This patch removes stray NON_DEPENDENT_EXPR checks following the removal
> of this tree code from the C++ FE.  (Since this restores the build I
> supppose it means the Rust FE never creates NON_DEPENDENT_EXPR trees in
> the first place, so no further analysis is needed.)

ACK, thanks!


For context: indeed, a non-trivial amount of C++ front end 'constexpr'
code was copied into the Rust front end, for implementing related Rust
functionality, mostly as part of the 2022 GSoC project
"Support for Constant Folding in Rust Frontend" (Faisal Abbas),
<https://gcc.gnu.org/wiki/SummerOfCode#A2022>.

Yes, this should eventually be cleaned up (and merged with the original
C++ front end code, as much as feasible -- which I don't know whether or
to which extent it is).


Grüße
 Thomas


>       PR rust/111899
>
> gcc/rust/ChangeLog:
>
>       * backend/rust-constexpr.cc (potential_constant_expression_1):
>       Remove NON_DEPENDENT_EXPR handling.
>       * backend/rust-tree.cc (mark_exp_read): Likewise.
>       (mark_use): Likewise.
>       (lvalue_kind): Likewise.
> ---
>  gcc/rust/backend/rust-constexpr.cc | 1 -
>  gcc/rust/backend/rust-tree.cc      | 3 ---
>  2 files changed, 4 deletions(-)
>
> diff --git a/gcc/rust/backend/rust-constexpr.cc b/gcc/rust/backend/rust-constexpr.cc
> index b28fa27b2d0..a7ae4166ea0 100644
> --- a/gcc/rust/backend/rust-constexpr.cc
> +++ b/gcc/rust/backend/rust-constexpr.cc
> @@ -6151,7 +6151,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
>      case CLEANUP_POINT_EXPR:
>      case EXPR_STMT:
>      case PAREN_EXPR:
> -    case NON_DEPENDENT_EXPR:
>        /* For convenience.  */
>      case LOOP_EXPR:
>      case EXIT_EXPR:
> diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc
> index 66e859cd70c..7040c75f825 100644
> --- a/gcc/rust/backend/rust-tree.cc
> +++ b/gcc/rust/backend/rust-tree.cc
> @@ -72,7 +72,6 @@ mark_exp_read (tree exp)
>      case ADDR_EXPR:
>      case INDIRECT_REF:
>      case FLOAT_EXPR:
> -    case NON_DEPENDENT_EXPR:
>      case VIEW_CONVERT_EXPR:
>        mark_exp_read (TREE_OPERAND (exp, 0));
>        break;
> @@ -128,7 +127,6 @@ mark_use (tree expr, bool rvalue_p, bool read_p,
>    switch (TREE_CODE (expr))
>      {
>      case COMPONENT_REF:
> -    case NON_DEPENDENT_EXPR:
>        recurse_op[0] = true;
>        break;
>      case COMPOUND_EXPR:
> @@ -4520,7 +4518,6 @@ lvalue_kind (const_tree ref)
>        lvalues.  */
>        return (DECL_NONSTATIC_MEMBER_FUNCTION_P (ref) ? clk_none : clk_ordinary);
>
> -    case NON_DEPENDENT_EXPR:
>      case PAREN_EXPR:
>        return lvalue_kind (TREE_OPERAND (ref, 0));
>
> --
> 2.42.0.411.g813d9a9188
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

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

* Re: [PATCH] rust: build failure after NON_DEPENDENT_EXPR removal [PR111899]
  2023-10-23  9:10 ` Thomas Schwinge
@ 2023-10-23 15:28   ` Jason Merrill
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Merrill @ 2023-10-23 15:28 UTC (permalink / raw)
  To: Thomas Schwinge, Patrick Palka, gcc-patches; +Cc: gcc-rust, Faisal Abbas

On 10/23/23 05:10, Thomas Schwinge wrote:
> Hi Patrick!
> 
> On 2023-10-20T13:36:30-0400, Patrick Palka <ppalka@redhat.com> wrote:
>> Built on x86_64-pc-linux-gnu, pushed to trunk as obvious (hopefully).
>>
>> -- >8 --
>>
>> This patch removes stray NON_DEPENDENT_EXPR checks following the removal
>> of this tree code from the C++ FE.  (Since this restores the build I
>> supppose it means the Rust FE never creates NON_DEPENDENT_EXPR trees in
>> the first place, so no further analysis is needed.)
> 
> ACK, thanks!
> 
> 
> For context: indeed, a non-trivial amount of C++ front end 'constexpr'
> code was copied into the Rust front end, for implementing related Rust
> functionality, mostly as part of the 2022 GSoC project
> "Support for Constant Folding in Rust Frontend" (Faisal Abbas),
> <https://gcc.gnu.org/wiki/SummerOfCode#A2022>.
> 
> Yes, this should eventually be cleaned up (and merged with the original
> C++ front end code, as much as feasible -- which I don't know whether or
> to which extent it is).

It would be nice to move a lot of the constexpr code into the 
middle-end, but I expect that would be a significant project.

Jason


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

end of thread, other threads:[~2023-10-23 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20 17:36 [PATCH] rust: build failure after NON_DEPENDENT_EXPR removal [PR111899] Patrick Palka
2023-10-23  9:10 ` Thomas Schwinge
2023-10-23 15:28   ` 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).