public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch,openacc] Fix infinite recursion in OMP clause pretty-printing, default label
@ 2018-09-20 17:10 Cesar Philippidis
  2018-11-29 21:20 ` Julian Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Cesar Philippidis @ 2018-09-20 17:10 UTC (permalink / raw)
  To: gcc-patches, Tom de Vries

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

Apparently, Tom ran into an ICE when we were adding support for new
clauses back in the gomp-4_0-branch days.  This patch shouldn't be
necessary because all of the clauses are fully implemented now, but
it may prevent similar bugs from occurring in the future at least
during development.

Is this patch OK for trunk? I bootstrapped and regtested it for x86_64
Linux with nvptx offloading.

Thanks,
Cesar

[-- Attachment #2: 0001-Fix-infinite-recursion-in-OMP-clause-pretty-printing-default-label.patch --]
[-- Type: text/x-patch, Size: 1146 bytes --]

Fix infinite recursion in OMP clause pretty-printing, default label

Apparently, Tom ran into an ICE when we were adding support for new
clauses back in the gomp-4_0-branch days.  This patch shouldn't be
necessary because all of the clauses are fully implemented now, but
it may prevent similar bugs from occuring in the future at least
during development.

2018-XX-YY  Tom de Vries  <tdevries@suse.de>
            Cesar Philippidis  <cesar@codesourcery.com>

	gcc/
	* tree-pretty-print.c (dump_omp_clause): Fix infinite recursion in
	default label.

(cherry picked from gomp-4_0-branch r228915, 2e4d930)
---
 gcc/tree-pretty-print.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 2c089b11751..031afbb49e4 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -1063,8 +1063,7 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
       break;
 
     default:
-      /* Should never happen.  */
-      dump_generic_node (pp, clause, spc, flags, false);
+      pp_string (pp, "unknown");
       break;
     }
 }
-- 
2.17.1


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

* Re: [patch,openacc] Fix infinite recursion in OMP clause pretty-printing, default label
  2018-09-20 17:10 [patch,openacc] Fix infinite recursion in OMP clause pretty-printing, default label Cesar Philippidis
@ 2018-11-29 21:20 ` Julian Brown
  2018-11-29 21:25   ` Joseph Myers
  0 siblings, 1 reply; 6+ messages in thread
From: Julian Brown @ 2018-11-29 21:20 UTC (permalink / raw)
  To: Cesar Philippidis; +Cc: gcc-patches, Tom de Vries, joseph

On Thu, 20 Sep 2018 10:08:51 -0700
Cesar Philippidis <cesar@codesourcery.com> wrote:

> Apparently, Tom ran into an ICE when we were adding support for new
> clauses back in the gomp-4_0-branch days.  This patch shouldn't be
> necessary because all of the clauses are fully implemented now, but
> it may prevent similar bugs from occurring in the future at least
> during development.
> 
> Is this patch OK for trunk? I bootstrapped and regtested it for x86_64
> Linux with nvptx offloading.

Joseph, could you take a look at this please?

Thanks,

Julian

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

* Re: [patch,openacc] Fix infinite recursion in OMP clause pretty-printing, default label
  2018-11-29 21:20 ` Julian Brown
@ 2018-11-29 21:25   ` Joseph Myers
  2018-11-30 21:35     ` Julian Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Joseph Myers @ 2018-11-29 21:25 UTC (permalink / raw)
  To: Julian Brown; +Cc: Cesar Philippidis, gcc-patches, Tom de Vries

On Thu, 29 Nov 2018, Julian Brown wrote:

> On Thu, 20 Sep 2018 10:08:51 -0700
> Cesar Philippidis <cesar@codesourcery.com> wrote:
> 
> > Apparently, Tom ran into an ICE when we were adding support for new
> > clauses back in the gomp-4_0-branch days.  This patch shouldn't be
> > necessary because all of the clauses are fully implemented now, but
> > it may prevent similar bugs from occurring in the future at least
> > during development.
> > 
> > Is this patch OK for trunk? I bootstrapped and regtested it for x86_64
> > Linux with nvptx offloading.
> 
> Joseph, could you take a look at this please?

Lots of other places in the same function use gcc_unreachable ().  I think 
using gcc_unreachable () here as well would be more appropriate than 
special-casing this one place in this function to use "unknown".

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [patch,openacc] Fix infinite recursion in OMP clause pretty-printing, default label
  2018-11-29 21:25   ` Joseph Myers
@ 2018-11-30 21:35     ` Julian Brown
  2018-11-30 21:40       ` Jakub Jelinek
  2018-11-30 21:56       ` Joseph Myers
  0 siblings, 2 replies; 6+ messages in thread
From: Julian Brown @ 2018-11-30 21:35 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Cesar Philippidis, gcc-patches, Tom de Vries

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

On Thu, 29 Nov 2018 21:25:33 +0000
Joseph Myers <joseph@codesourcery.com> wrote:

> On Thu, 29 Nov 2018, Julian Brown wrote:
> 
> > On Thu, 20 Sep 2018 10:08:51 -0700
> > Cesar Philippidis <cesar@codesourcery.com> wrote:
> >   
> > > Apparently, Tom ran into an ICE when we were adding support for
> > > new clauses back in the gomp-4_0-branch days.  This patch
> > > shouldn't be necessary because all of the clauses are fully
> > > implemented now, but it may prevent similar bugs from occurring
> > > in the future at least during development.
> > > 
> > > Is this patch OK for trunk? I bootstrapped and regtested it for
> > > x86_64 Linux with nvptx offloading.  
> > 
> > Joseph, could you take a look at this please?  
> 
> Lots of other places in the same function use gcc_unreachable ().  I
> think using gcc_unreachable () here as well would be more appropriate
> than special-casing this one place in this function to use "unknown".

How's this? (Obvious, but re-tested anyway.)

Thanks,

Julian

ChangeLog

    gcc/
    * tree-pretty-print.c (dump_omp_clause): Make default case
    gcc_unreachable.

[-- Attachment #2: dump-omp-clause-default-unreachable.diff --]
[-- Type: text/x-patch, Size: 430 bytes --]

diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 99eca4a..0861cc9 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -1180,9 +1180,7 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
       break;
 
     default:
-      /* Should never happen.  */
-      dump_generic_node (pp, clause, spc, flags, false);
-      break;
+      gcc_unreachable ();
     }
 }
 

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

* Re: [patch,openacc] Fix infinite recursion in OMP clause pretty-printing, default label
  2018-11-30 21:35     ` Julian Brown
@ 2018-11-30 21:40       ` Jakub Jelinek
  2018-11-30 21:56       ` Joseph Myers
  1 sibling, 0 replies; 6+ messages in thread
From: Jakub Jelinek @ 2018-11-30 21:40 UTC (permalink / raw)
  To: Julian Brown; +Cc: Joseph Myers, Cesar Philippidis, gcc-patches, Tom de Vries

On Fri, Nov 30, 2018 at 09:35:45PM +0000, Julian Brown wrote:
> How's this? (Obvious, but re-tested anyway.)
> 
> Thanks,
> 
> Julian
> 
> ChangeLog
> 
>     gcc/
>     * tree-pretty-print.c (dump_omp_clause): Make default case
>     gcc_unreachable.

Ok, thanks.

> diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
> index 99eca4a..0861cc9 100644
> --- a/gcc/tree-pretty-print.c
> +++ b/gcc/tree-pretty-print.c
> @@ -1180,9 +1180,7 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
>        break;
>  
>      default:
> -      /* Should never happen.  */
> -      dump_generic_node (pp, clause, spc, flags, false);
> -      break;
> +      gcc_unreachable ();
>      }
>  }
>  


	Jakub

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

* Re: [patch,openacc] Fix infinite recursion in OMP clause pretty-printing, default label
  2018-11-30 21:35     ` Julian Brown
  2018-11-30 21:40       ` Jakub Jelinek
@ 2018-11-30 21:56       ` Joseph Myers
  1 sibling, 0 replies; 6+ messages in thread
From: Joseph Myers @ 2018-11-30 21:56 UTC (permalink / raw)
  To: Julian Brown; +Cc: Cesar Philippidis, gcc-patches, Tom de Vries

On Fri, 30 Nov 2018, Julian Brown wrote:

> ChangeLog
> 
>     gcc/
>     * tree-pretty-print.c (dump_omp_clause): Make default case
>     gcc_unreachable.

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

end of thread, other threads:[~2018-11-30 21:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20 17:10 [patch,openacc] Fix infinite recursion in OMP clause pretty-printing, default label Cesar Philippidis
2018-11-29 21:20 ` Julian Brown
2018-11-29 21:25   ` Joseph Myers
2018-11-30 21:35     ` Julian Brown
2018-11-30 21:40       ` Jakub Jelinek
2018-11-30 21:56       ` Joseph Myers

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).