This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix hangs with BLOCK_ABSTRACT_ORIGIN (PR debug/37156)


On Tue, Aug 19, 2008 at 10:03 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> This is similar to PR34850 and PR36811, but fixes up all the remaining
> spots we look through BLOCK_ABSTRACT_ORIGIN links until reaching non-BLOCK.
> BLOCKs with self-pointing BLOCK_ABSTRACT_ORIGIN are set up by
> integrate.c (set_block_origin_self).
>
> Ok for trunk/4.3?

And I thought I had grepped for all ... ;)  Ok for both.

Thanks,
Richard.

> 2008-08-19  Jakub Jelinek  <jakub@redhat.com>
>
>        PR debug/37156
>        * pretty-print.c (pp_base_format): Deal with recursive BLOCK trees.
>        * tree.c (block_nonartificial_location): Likewise.
>
>        * error.c (cp_print_error_function): Deal with recursive BLOCK trees.
>
>        * gcc.dg/pr37156.c: New test.
>
> --- gcc/pretty-print.c.jj       2008-02-18 23:46:08.000000000 +0100
> +++ gcc/pretty-print.c  2008-08-19 09:33:04.000000000 +0200
> @@ -501,7 +501,9 @@ pp_base_format (pretty_printer *pp, text
>              {
>                tree ao = BLOCK_ABSTRACT_ORIGIN (block);
>
> -               while (TREE_CODE (ao) == BLOCK && BLOCK_ABSTRACT_ORIGIN (ao))
> +               while (TREE_CODE (ao) == BLOCK
> +                      && BLOCK_ABSTRACT_ORIGIN (ao)
> +                      && BLOCK_ABSTRACT_ORIGIN (ao) != ao)
>                  ao = BLOCK_ABSTRACT_ORIGIN (ao);
>
>                if (TREE_CODE (ao) == FUNCTION_DECL)
> --- gcc/tree.c.jj       2008-07-19 21:01:18.000000000 +0200
> +++ gcc/tree.c  2008-08-19 09:33:46.000000000 +0200
> @@ -8818,7 +8818,9 @@ block_nonartificial_location (tree block
>     {
>       tree ao = BLOCK_ABSTRACT_ORIGIN (block);
>
> -      while (TREE_CODE (ao) == BLOCK && BLOCK_ABSTRACT_ORIGIN (ao))
> +      while (TREE_CODE (ao) == BLOCK
> +            && BLOCK_ABSTRACT_ORIGIN (ao)
> +            && BLOCK_ABSTRACT_ORIGIN (ao) != ao)
>        ao = BLOCK_ABSTRACT_ORIGIN (ao);
>
>       if (TREE_CODE (ao) == FUNCTION_DECL)
> --- gcc/cp/error.c.jj   2008-03-26 08:28:39.000000000 +0100
> +++ gcc/cp/error.c      2008-08-19 09:36:11.000000000 +0200
> @@ -2421,7 +2421,9 @@ cp_print_error_function (diagnostic_cont
>          if (abstract_origin)
>            {
>              ao = BLOCK_ABSTRACT_ORIGIN (abstract_origin);
> -             while (TREE_CODE (ao) == BLOCK && BLOCK_ABSTRACT_ORIGIN (ao))
> +             while (TREE_CODE (ao) == BLOCK
> +                    && BLOCK_ABSTRACT_ORIGIN (ao)
> +                    && BLOCK_ABSTRACT_ORIGIN (ao) != ao)
>                ao = BLOCK_ABSTRACT_ORIGIN (ao);
>              gcc_assert (TREE_CODE (ao) == FUNCTION_DECL);
>              fndecl = ao;
> --- gcc/testsuite/gcc.dg/pr37156.c.jj   2008-08-19 09:44:45.000000000 +0200
> +++ gcc/testsuite/gcc.dg/pr37156.c      2008-08-19 09:44:13.000000000 +0200
> @@ -0,0 +1,21 @@
> +/* PR debug/37156 */
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -g" } */
> +
> +__attribute__ ((warning ("is experimental"))) int bar (int, int *, int *, int);
> +
> +long long foo (void)
> +{
> +  int n, m;
> +  long long r;
> +  bar (0, &n, &m, 0);  /* { dg-warning "is experimental" } */
> +  r = (long long) n;
> +  return r;
> +}
> +
> +void
> +baz (int n)
> +{
> +  int o;
> +  o = foo () - n;
> +}
>
>        Jakub
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]