public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95087] New: [11 Regression] ICE in gimplify_expr, at gimplify.c:14382
@ 2020-05-12 15:02 asolokha at gmx dot com
  2020-05-12 19:55 ` [Bug c++/95087] " marxin at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: asolokha at gmx dot com @ 2020-05-12 15:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95087

            Bug ID: 95087
           Summary: [11 Regression] ICE in gimplify_expr, at
                    gimplify.c:14382
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-11.0.0-alpha20200510 snapshot (g:13a46321516e2efd3bbb1f1899c539c6724240a9)
ICEs when compiling
gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C w/
-fcoroutines:

% g++-11.0.0 -fcoroutines -c
gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C
gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C: In function
'Coro bar()':
gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C:37:1: error: a
'return' statement is not allowed in coroutine; did you mean 'co_return'?
   37 | bar () // { dg-error {a 'return' statement is not allowed} }
      | ^~~
gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C:42:5: internal
compiler error: in gimplify_expr, at gimplify.c:14382
   42 |     co_return;
      |     ^~~~~~~~~
0x700e91 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200510/work/gcc-11-20200510/gcc/gimplify.c:14382
0xd5871b gimplify_cleanup_point_expr
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200510/work/gcc-11-20200510/gcc/gimplify.c:6802
0xd3f9c5 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200510/work/gcc-11-20200510/gcc/gimplify.c:13977
0xd42c46 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200510/work/gcc-11-20200510/gcc/gimplify.c:6802
0xd5549a gimplify_cond_expr
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200510/work/gcc-11-20200510/gcc/gimplify.c:4256
0xd3f9e2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200510/work/gcc-11-20200510/gcc/gimplify.c:13542
0xd57c8b gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200510/work/gcc-11-20200510/gcc/gimplify.c:6802
0xd57c8b gimplify_body(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200510/work/gcc-11-20200510/gcc/gimplify.c:14834
0xd580fd gimplify_function_tree(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200510/work/gcc-11-20200510/gcc/gimplify.c:14988
0xb96967 cgraph_node::analyze()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200510/work/gcc-11-20200510/gcc/cgraphunit.c:670
0xb99587 analyze_functions
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200510/work/gcc-11-20200510/gcc/cgraphunit.c:1227
0xb9a152 symbol_table::finalize_compilation_unit()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200510/work/gcc-11-20200510/gcc/cgraphunit.c:2971

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

* [Bug c++/95087] [11 Regression] ICE in gimplify_expr, at gimplify.c:14382
  2020-05-12 15:02 [Bug c++/95087] New: [11 Regression] ICE in gimplify_expr, at gimplify.c:14382 asolokha at gmx dot com
@ 2020-05-12 19:55 ` marxin at gcc dot gnu.org
  2020-05-31 19:48 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-05-12 19:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95087

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |10.1.0
   Last reconfirmed|                            |2020-05-12
     Ever confirmed|0                           |1
   Target Milestone|---                         |11.0
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |11.0
                 CC|                            |iains at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started to fail with r11-178-gc7100843831147a0.

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

* [Bug c++/95087] [11 Regression] ICE in gimplify_expr, at gimplify.c:14382
  2020-05-12 15:02 [Bug c++/95087] New: [11 Regression] ICE in gimplify_expr, at gimplify.c:14382 asolokha at gmx dot com
  2020-05-12 19:55 ` [Bug c++/95087] " marxin at gcc dot gnu.org
@ 2020-05-31 19:48 ` cvs-commit at gcc dot gnu.org
  2020-06-06 16:51 ` cvs-commit at gcc dot gnu.org
  2020-06-06 18:41 ` iains at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-31 19:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95087

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:

https://gcc.gnu.org/g:1bb808504643e6c3c0df0fdd68a941ed2a64c7f0

commit r11-758-g1bb808504643e6c3c0df0fdd68a941ed2a64c7f0
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sun May 31 20:30:10 2020 +0100

    coroutines: Avoid functions with unlowered coroutine trees [PR95087].

    Diagnosing bad uses of 'return' in coroutines is somewhat
    tricky, since the user can use the keyword before we know
    that the function is a coroutine (where such returns are not
    permitted).  At present, we are just doing a check for any
    use of 'return' and erroring on that.  However, we can't then
    pass the function body on, since it will contain unlowered
    coroutine trees.

    This avoids the issue by dropping the entire function body
    under that circumstance.  We could do better (for 11) but
    this is intended to allow back-port of other fixes to 10.

    gcc/cp/ChangeLog:

            PR c++/95087
            * coroutines.cc (morph_fn_to_coro): If we see an
            early fatal error, drop the erroneous function body.

    gcc/testsuite/ChangeLog:

            PR c++/95087
            * g++.dg/coroutines/co-return-syntax-08-bad-return.C:
            Adjust the testcase to do the compile (rather than an
            -fsyntax-only parse).

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

* [Bug c++/95087] [11 Regression] ICE in gimplify_expr, at gimplify.c:14382
  2020-05-12 15:02 [Bug c++/95087] New: [11 Regression] ICE in gimplify_expr, at gimplify.c:14382 asolokha at gmx dot com
  2020-05-12 19:55 ` [Bug c++/95087] " marxin at gcc dot gnu.org
  2020-05-31 19:48 ` cvs-commit at gcc dot gnu.org
@ 2020-06-06 16:51 ` cvs-commit at gcc dot gnu.org
  2020-06-06 18:41 ` iains at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-06 16:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95087

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Iain D Sandoe
<iains@gcc.gnu.org>:

https://gcc.gnu.org/g:03da87235697eab344cde609d81d3f405f450c42

commit r10-8259-g03da87235697eab344cde609d81d3f405f450c42
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sat Jun 6 09:48:31 2020 +0100

    coroutines: Improve error recovery [PR94817, PR94829, PR95087].

    When we have completely missing key information (e.g. the
    coroutine_traits) or a partially transformed function body, we
    need to try and balance returning useful information about
    failures with the possibility that some part of the diagnostics
    machinery or following code will not be able to handle the
    state.

    The PRs (and revised testcase) point to cases where that processing
    has failed.

    This revises the process to avoid special handling for the
    ramp, and falls back on the same code used for regular function
    fails.

    There are test-cases (in addition to the ones for the PRs) that now
    cover all early exit points [where the transforms are considered
    to have failed in a manner that does not allow compilation to
    continue].

    Diagnosing bad uses of 'return' in coroutines is somewhat
    tricky, since the user can use the keyword before we know
    that the function is a coroutine (where such returns are not
    permitted).  At present, we are just doing a check for any
    use of 'return' and erroring on that.  However, we can't then
    pass the function body on, since it will contain unlowered
    coroutine trees.

    This avoids the issue by dropping the entire function body
    under that circumstance.

            Backport c7100843831147a034fe37d231c54ac53ceace45 and
a1bb808504643e6c3c0df0fdd68a941ed2a64c7f0

    gcc/cp/ChangeLog:

            PR c++/94817
            PR c++/94829
            PR c++/95087
            * coroutines.cc (morph_fn_to_coro): Set unformed outline
            functions to error_mark_node.  For early error returns suppress
            warnings about missing ramp return values.  Fix reinstatement
            of the function body on pre-existing initial error.  If we see
            an early fatal error, drop the erroneous function body.
            * decl.c (finish_function): Use the normal error path for fails
            in the ramp function, do not try to compile the helpers if the
            transform fails.

    gcc/testsuite/ChangeLog:

            PR c++/94817
            PR c++/94829
            PR c++/95087
            * g++.dg/coroutines/coro-missing-final-suspend.C: New test.
            * g++.dg/coroutines/coro-missing-initial-suspend.C: New test.
            * g++.dg/coroutines/coro-missing-promise-yield.C: Check for
            continuation of compilation.
            * g++.dg/coroutines/coro-missing-promise.C: Likewise.
            * g++.dg/coroutines/coro-missing-ret-value.C: Likewise
            * g++.dg/coroutines/coro-missing-ret-void.C: Likewise
            * g++.dg/coroutines/coro-missing-ueh-3.C: Likewise
            * g++.dg/coroutines/pr94817.C: New test.
            * g++.dg/coroutines/pr94829.C: New test.
            * g++.dg/coroutines/co-return-syntax-08-bad-return.C:
            Adjust the testcase to do the compile (rather than an
            -fsyntax-only parse).
            * g++.dg/coroutines/coro1-ret-int-yield-int.h
            (MISSING_INITIAL_SUSPEND, MISSING_FINAL_SUSPEND): New.

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

* [Bug c++/95087] [11 Regression] ICE in gimplify_expr, at gimplify.c:14382
  2020-05-12 15:02 [Bug c++/95087] New: [11 Regression] ICE in gimplify_expr, at gimplify.c:14382 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-06-06 16:51 ` cvs-commit at gcc dot gnu.org
@ 2020-06-06 18:41 ` iains at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: iains at gcc dot gnu.org @ 2020-06-06 18:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95087

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
fixed on master and for 10.2

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

end of thread, other threads:[~2020-06-06 18:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 15:02 [Bug c++/95087] New: [11 Regression] ICE in gimplify_expr, at gimplify.c:14382 asolokha at gmx dot com
2020-05-12 19:55 ` [Bug c++/95087] " marxin at gcc dot gnu.org
2020-05-31 19:48 ` cvs-commit at gcc dot gnu.org
2020-06-06 16:51 ` cvs-commit at gcc dot gnu.org
2020-06-06 18:41 ` iains at gcc dot gnu.org

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