* [PATCH] c-family, c++: Handle EXCESS_PRECISION_EXPR in pretty printers
@ 2024-03-22 9:11 Jakub Jelinek
2024-03-22 9:15 ` Rainer Orth
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jakub Jelinek @ 2024-03-22 9:11 UTC (permalink / raw)
To: Joseph S. Myers, Jason Merrill; +Cc: gcc-patches
Hi!
I've noticed that the c-c++-common/gomp/depobj-3.c test FAILs on i686-linux:
PASS: c-c++-common/gomp/depobj-3.c -std=c++17 at line 17 (test for warnings, line 15)
FAIL: c-c++-common/gomp/depobj-3.c -std=c++17 at line 39 (test for warnings, line 37)
PASS: c-c++-common/gomp/depobj-3.c -std=c++17 at line 43 (test for errors, line 41)
PASS: c-c++-common/gomp/depobj-3.c -std=c++17 (test for warnings, line 45)
FAIL: c-c++-common/gomp/depobj-3.c -std=c++17 (test for excess errors)
Excess errors:
/home/jakub/src/gcc/gcc/testsuite/c-c++-common/gomp/depobj-3.c:37:38: warning: the 'destroy' expression ''excess_precision_expr' not supported by dump_expr<expression error>' should be the same as the 'depobj' argument 'obj' [-Wopenmp]
The following patch replaces that 'excess_precision_expr' not supported by dump_expr<expression error>
with (float)(((long double)a) + (long double)5)
Still ugly and doesn't actually fix the FAIL (will deal with that
incrementally), but at least valid C/C++ and shows the excess precision
handling in action.
Ok for trunk if this passes bootstrap/regtest?
2024-03-22 Jakub Jelinek <jakub@redhat.com>
gcc/c/
* c-pretty-print.cc (pp_c_cast_expression,
c_pretty_printer::expression): Handle EXCESS_PRECISION_EXPR like
NOP_EXPR.
gcc/cp/
* error.cc (dump_expr): Handle EXCESS_PRECISION_EXPR like NOP_EXPR.
--- gcc/c-family/c-pretty-print.cc.jj 2024-01-12 10:07:57.744858004 +0100
+++ gcc/c-family/c-pretty-print.cc 2024-03-22 09:58:56.640001991 +0100
@@ -2327,6 +2327,7 @@ pp_c_cast_expression (c_pretty_printer *
case FIX_TRUNC_EXPR:
CASE_CONVERT:
case VIEW_CONVERT_EXPR:
+ case EXCESS_PRECISION_EXPR:
if (!location_wrapper_p (e))
pp_c_type_cast (pp, TREE_TYPE (e));
pp_c_cast_expression (pp, TREE_OPERAND (e, 0));
@@ -2753,6 +2754,7 @@ c_pretty_printer::expression (tree e)
case FIX_TRUNC_EXPR:
CASE_CONVERT:
case VIEW_CONVERT_EXPR:
+ case EXCESS_PRECISION_EXPR:
pp_c_cast_expression (this, e);
break;
--- gcc/cp/error.cc.jj 2024-01-20 12:32:34.157939870 +0100
+++ gcc/cp/error.cc 2024-03-22 10:00:38.259610171 +0100
@@ -2662,6 +2662,7 @@ dump_expr (cxx_pretty_printer *pp, tree
CASE_CONVERT:
case IMPLICIT_CONV_EXPR:
case VIEW_CONVERT_EXPR:
+ case EXCESS_PRECISION_EXPR:
{
tree op = TREE_OPERAND (t, 0);
Jakub
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] c-family, c++: Handle EXCESS_PRECISION_EXPR in pretty printers
2024-03-22 9:11 [PATCH] c-family, c++: Handle EXCESS_PRECISION_EXPR in pretty printers Jakub Jelinek
@ 2024-03-22 9:15 ` Rainer Orth
2024-03-22 14:12 ` Joseph Myers
2024-03-25 19:40 ` Jason Merrill
2 siblings, 0 replies; 4+ messages in thread
From: Rainer Orth @ 2024-03-22 9:15 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Joseph S. Myers, Jason Merrill, gcc-patches
Hi Jakub,
> I've noticed that the c-c++-common/gomp/depobj-3.c test FAILs on i686-linux:
> PASS: c-c++-common/gomp/depobj-3.c -std=c++17 at line 17 (test for warnings, line 15)
> FAIL: c-c++-common/gomp/depobj-3.c -std=c++17 at line 39 (test for warnings, line 37)
> PASS: c-c++-common/gomp/depobj-3.c -std=c++17 at line 43 (test for errors, line 41)
> PASS: c-c++-common/gomp/depobj-3.c -std=c++17 (test for warnings, line 45)
> FAIL: c-c++-common/gomp/depobj-3.c -std=c++17 (test for excess errors)
> Excess errors:
> /home/jakub/src/gcc/gcc/testsuite/c-c++-common/gomp/depobj-3.c:37:38: warning: the 'destroy' expression ''excess_precision_expr' not supported by dump_expr<expression error>' should be the same as the 'depobj' argument 'obj' [-Wopenmp]
> The following patch replaces that 'excess_precision_expr' not supported by dump_expr<expression error>
> with (float)(((long double)a) + (long double)5)
this is PR c++/112724.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] c-family, c++: Handle EXCESS_PRECISION_EXPR in pretty printers
2024-03-22 9:11 [PATCH] c-family, c++: Handle EXCESS_PRECISION_EXPR in pretty printers Jakub Jelinek
2024-03-22 9:15 ` Rainer Orth
@ 2024-03-22 14:12 ` Joseph Myers
2024-03-25 19:40 ` Jason Merrill
2 siblings, 0 replies; 4+ messages in thread
From: Joseph Myers @ 2024-03-22 14:12 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Jason Merrill, gcc-patches
On Fri, 22 Mar 2024, Jakub Jelinek wrote:
> Hi!
>
> I've noticed that the c-c++-common/gomp/depobj-3.c test FAILs on i686-linux:
> PASS: c-c++-common/gomp/depobj-3.c -std=c++17 at line 17 (test for warnings, line 15)
> FAIL: c-c++-common/gomp/depobj-3.c -std=c++17 at line 39 (test for warnings, line 37)
> PASS: c-c++-common/gomp/depobj-3.c -std=c++17 at line 43 (test for errors, line 41)
> PASS: c-c++-common/gomp/depobj-3.c -std=c++17 (test for warnings, line 45)
> FAIL: c-c++-common/gomp/depobj-3.c -std=c++17 (test for excess errors)
> Excess errors:
> /home/jakub/src/gcc/gcc/testsuite/c-c++-common/gomp/depobj-3.c:37:38: warning: the 'destroy' expression ''excess_precision_expr' not supported by dump_expr<expression error>' should be the same as the 'depobj' argument 'obj' [-Wopenmp]
> The following patch replaces that 'excess_precision_expr' not supported by dump_expr<expression error>
> with (float)(((long double)a) + (long double)5)
> Still ugly and doesn't actually fix the FAIL (will deal with that
> incrementally), but at least valid C/C++ and shows the excess precision
> handling in action.
>
> Ok for trunk if this passes bootstrap/regtest?
>
> 2024-03-22 Jakub Jelinek <jakub@redhat.com>
>
> gcc/c/
> * c-pretty-print.cc (pp_c_cast_expression,
> c_pretty_printer::expression): Handle EXCESS_PRECISION_EXPR like
> NOP_EXPR.
The c-pretty-print.cc changes are OK.
--
Joseph S. Myers
josmyers@redhat.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] c-family, c++: Handle EXCESS_PRECISION_EXPR in pretty printers
2024-03-22 9:11 [PATCH] c-family, c++: Handle EXCESS_PRECISION_EXPR in pretty printers Jakub Jelinek
2024-03-22 9:15 ` Rainer Orth
2024-03-22 14:12 ` Joseph Myers
@ 2024-03-25 19:40 ` Jason Merrill
2 siblings, 0 replies; 4+ messages in thread
From: Jason Merrill @ 2024-03-25 19:40 UTC (permalink / raw)
To: Jakub Jelinek, Joseph S. Myers; +Cc: gcc-patches
On 3/22/24 05:11, Jakub Jelinek wrote:
> Hi!
>
> I've noticed that the c-c++-common/gomp/depobj-3.c test FAILs on i686-linux:
> PASS: c-c++-common/gomp/depobj-3.c -std=c++17 at line 17 (test for warnings, line 15)
> FAIL: c-c++-common/gomp/depobj-3.c -std=c++17 at line 39 (test for warnings, line 37)
> PASS: c-c++-common/gomp/depobj-3.c -std=c++17 at line 43 (test for errors, line 41)
> PASS: c-c++-common/gomp/depobj-3.c -std=c++17 (test for warnings, line 45)
> FAIL: c-c++-common/gomp/depobj-3.c -std=c++17 (test for excess errors)
> Excess errors:
> /home/jakub/src/gcc/gcc/testsuite/c-c++-common/gomp/depobj-3.c:37:38: warning: the 'destroy' expression ''excess_precision_expr' not supported by dump_expr<expression error>' should be the same as the 'depobj' argument 'obj' [-Wopenmp]
> The following patch replaces that 'excess_precision_expr' not supported by dump_expr<expression error>
> with (float)(((long double)a) + (long double)5)
> Still ugly and doesn't actually fix the FAIL (will deal with that
> incrementally), but at least valid C/C++ and shows the excess precision
> handling in action.
>
> Ok for trunk if this passes bootstrap/regtest?
OK.
> 2024-03-22 Jakub Jelinek <jakub@redhat.com>
>
> gcc/c/
> * c-pretty-print.cc (pp_c_cast_expression,
> c_pretty_printer::expression): Handle EXCESS_PRECISION_EXPR like
> NOP_EXPR.
> gcc/cp/
> * error.cc (dump_expr): Handle EXCESS_PRECISION_EXPR like NOP_EXPR.
>
> --- gcc/c-family/c-pretty-print.cc.jj 2024-01-12 10:07:57.744858004 +0100
> +++ gcc/c-family/c-pretty-print.cc 2024-03-22 09:58:56.640001991 +0100
> @@ -2327,6 +2327,7 @@ pp_c_cast_expression (c_pretty_printer *
> case FIX_TRUNC_EXPR:
> CASE_CONVERT:
> case VIEW_CONVERT_EXPR:
> + case EXCESS_PRECISION_EXPR:
> if (!location_wrapper_p (e))
> pp_c_type_cast (pp, TREE_TYPE (e));
> pp_c_cast_expression (pp, TREE_OPERAND (e, 0));
> @@ -2753,6 +2754,7 @@ c_pretty_printer::expression (tree e)
> case FIX_TRUNC_EXPR:
> CASE_CONVERT:
> case VIEW_CONVERT_EXPR:
> + case EXCESS_PRECISION_EXPR:
> pp_c_cast_expression (this, e);
> break;
>
> --- gcc/cp/error.cc.jj 2024-01-20 12:32:34.157939870 +0100
> +++ gcc/cp/error.cc 2024-03-22 10:00:38.259610171 +0100
> @@ -2662,6 +2662,7 @@ dump_expr (cxx_pretty_printer *pp, tree
> CASE_CONVERT:
> case IMPLICIT_CONV_EXPR:
> case VIEW_CONVERT_EXPR:
> + case EXCESS_PRECISION_EXPR:
> {
> tree op = TREE_OPERAND (t, 0);
>
>
> Jakub
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-25 19:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-22 9:11 [PATCH] c-family, c++: Handle EXCESS_PRECISION_EXPR in pretty printers Jakub Jelinek
2024-03-22 9:15 ` Rainer Orth
2024-03-22 14:12 ` Joseph Myers
2024-03-25 19:40 ` 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).