public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/99136] New: ICE in gimplify_expr, at gimplify.c:14854
@ 2021-02-17 18:04 gscfq@t-online.de
  2021-02-17 18:21 ` [Bug c/99136] " jakub at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gscfq@t-online.de @ 2021-02-17 18:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99136
           Summary: ICE in gimplify_expr, at gimplify.c:14854
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Affects versions down to at least r5,
ICEs with -m16 and -m32, but not with -m64 :


$ cat z1.c
void f (double x)
{
  return 1.0/x;
}


$ gcc-11-20210214 -c z1.c -m32 -std=c11
z1.c: In function 'f':
z1.c:3:13: warning: 'return' with a value, in function returning void
    3 |   return 1.0/x;
      |          ~~~^~
z1.c:1:6: note: declared here
    1 | void f (double x)
      |      ^
z1.c:3:13: internal compiler error: in gimplify_expr, at gimplify.c:14854
    3 |   return 1.0/x;
      |          ~~~^~
0x8fe7b1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.c:14854
0x8fe8d8 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.c:6876
0x8fc1ad gimplify_and_add(tree_node*, gimple**)
        ../../gcc/gimplify.c:489
0x8fc1ad gimplify_return_expr
        ../../gcc/gimplify.c:1671
0x8fc1ad gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.c:14331
0x8fe8d8 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.c:6876
0x8fee31 gimplify_bind_expr
        ../../gcc/gimplify.c:1421
0x8fc9d2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.c:14271
0x8fe8d8 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.c:6876
0x8ff8fd gimplify_body(tree_node*, bool)
        ../../gcc/gimplify.c:15306
0x8ffd5f gimplify_function_tree(tree_node*)
        ../../gcc/gimplify.c:15460
0x79cb67 cgraph_node::analyze()
        ../../gcc/cgraphunit.c:670
0x79f4a7 analyze_functions
        ../../gcc/cgraphunit.c:1233
0x79fdfd symbol_table::finalize_compilation_unit()
        ../../gcc/cgraphunit.c:2511

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

* [Bug c/99136] ICE in gimplify_expr, at gimplify.c:14854
  2021-02-17 18:04 [Bug c/99136] New: ICE in gimplify_expr, at gimplify.c:14854 gscfq@t-online.de
@ 2021-02-17 18:21 ` jakub at gcc dot gnu.org
  2021-02-17 18:45 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-17 18:21 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
ICEs since -std=c11, resp. -std=c1x, resp. -fexcess-precision=standard (the
last one r0-92195-g8ce94e44465bcc958dc11270d9dee1775c7a4f43 ) options have been
introduced when using those options.

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

* [Bug c/99136] ICE in gimplify_expr, at gimplify.c:14854
  2021-02-17 18:04 [Bug c/99136] New: ICE in gimplify_expr, at gimplify.c:14854 gscfq@t-online.de
  2021-02-17 18:21 ` [Bug c/99136] " jakub at gcc dot gnu.org
@ 2021-02-17 18:45 ` jakub at gcc dot gnu.org
  2021-02-18 21:19 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-17 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2021-02-17
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 50213
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50213&action=edit
gcc11-pr99136.patch

Untested fix.

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

* [Bug c/99136] ICE in gimplify_expr, at gimplify.c:14854
  2021-02-17 18:04 [Bug c/99136] New: ICE in gimplify_expr, at gimplify.c:14854 gscfq@t-online.de
  2021-02-17 18:21 ` [Bug c/99136] " jakub at gcc dot gnu.org
  2021-02-17 18:45 ` jakub at gcc dot gnu.org
@ 2021-02-18 21:19 ` cvs-commit at gcc dot gnu.org
  2021-03-19 23:29 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-18 21:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:d82f829905cfe6cb47d073825f680900274ce764

commit r11-7282-gd82f829905cfe6cb47d073825f680900274ce764
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Feb 18 22:17:52 2021 +0100

    c: Fix ICE with -fexcess-precision=standard [PR99136]

    The following testcase ICEs on i686-linux, because c_finish_return wraps
    c_fully_folded retval back into EXCESS_PRECISION_EXPR, but when the
function
    return type is void, we don't call convert_for_assignment on it that would
    then be fully folded again, but just put the retval into RETURN_EXPR's
    operand, so nothing removes it anymore and during gimplification we
    ICE as EXCESS_PRECISION_EXPR is not handled.

    This patch fixes it by not adding that EXCESS_PRECISION_EXPR in functions
    returning void, the return value is ignored and all we need is evaluate any
    side-effects of the expression.

    2021-02-18  Jakub Jelinek  <jakub@redhat.com>

            PR c/99136
            * c-typeck.c (c_finish_return): Don't wrap retval into
            EXCESS_PRECISION_EXPR in functions that return void.

            * gcc.dg/pr99136.c: New test.

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

* [Bug c/99136] ICE in gimplify_expr, at gimplify.c:14854
  2021-02-17 18:04 [Bug c/99136] New: ICE in gimplify_expr, at gimplify.c:14854 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-02-18 21:19 ` cvs-commit at gcc dot gnu.org
@ 2021-03-19 23:29 ` cvs-commit at gcc dot gnu.org
  2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-19 23:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:3d7ce7ce6c03165ca1041b38e02428c925254968

commit r10-9472-g3d7ce7ce6c03165ca1041b38e02428c925254968
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Feb 18 22:17:52 2021 +0100

    c: Fix ICE with -fexcess-precision=standard [PR99136]

    The following testcase ICEs on i686-linux, because c_finish_return wraps
    c_fully_folded retval back into EXCESS_PRECISION_EXPR, but when the
function
    return type is void, we don't call convert_for_assignment on it that would
    then be fully folded again, but just put the retval into RETURN_EXPR's
    operand, so nothing removes it anymore and during gimplification we
    ICE as EXCESS_PRECISION_EXPR is not handled.

    This patch fixes it by not adding that EXCESS_PRECISION_EXPR in functions
    returning void, the return value is ignored and all we need is evaluate any
    side-effects of the expression.

    2021-02-18  Jakub Jelinek  <jakub@redhat.com>

            PR c/99136
            * c-typeck.c (c_finish_return): Don't wrap retval into
            EXCESS_PRECISION_EXPR in functions that return void.

            * gcc.dg/pr99136.c: New test.

    (cherry picked from commit d82f829905cfe6cb47d073825f680900274ce764)

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

* [Bug c/99136] ICE in gimplify_expr, at gimplify.c:14854
  2021-02-17 18:04 [Bug c/99136] New: ICE in gimplify_expr, at gimplify.c:14854 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-03-19 23:29 ` cvs-commit at gcc dot gnu.org
@ 2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org
  2021-04-22 16:51 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-20 23:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:884f790b8414e377665706f51254e8bd49a72f0b

commit r9-9422-g884f790b8414e377665706f51254e8bd49a72f0b
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Feb 18 22:17:52 2021 +0100

    c: Fix ICE with -fexcess-precision=standard [PR99136]

    The following testcase ICEs on i686-linux, because c_finish_return wraps
    c_fully_folded retval back into EXCESS_PRECISION_EXPR, but when the
function
    return type is void, we don't call convert_for_assignment on it that would
    then be fully folded again, but just put the retval into RETURN_EXPR's
    operand, so nothing removes it anymore and during gimplification we
    ICE as EXCESS_PRECISION_EXPR is not handled.

    This patch fixes it by not adding that EXCESS_PRECISION_EXPR in functions
    returning void, the return value is ignored and all we need is evaluate any
    side-effects of the expression.

    2021-02-18  Jakub Jelinek  <jakub@redhat.com>

            PR c/99136
            * c-typeck.c (c_finish_return): Don't wrap retval into
            EXCESS_PRECISION_EXPR in functions that return void.

            * gcc.dg/pr99136.c: New test.

    (cherry picked from commit 3d7ce7ce6c03165ca1041b38e02428c925254968)

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

* [Bug c/99136] ICE in gimplify_expr, at gimplify.c:14854
  2021-02-17 18:04 [Bug c/99136] New: ICE in gimplify_expr, at gimplify.c:14854 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org
@ 2021-04-22 16:51 ` cvs-commit at gcc dot gnu.org
  2021-04-22 17:11 ` jakub at gcc dot gnu.org
  2021-09-11 14:25 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-22 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:12fcc1d0934fa109bab00522e6aa250f5d478a15

commit r8-10887-g12fcc1d0934fa109bab00522e6aa250f5d478a15
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Feb 18 22:17:52 2021 +0100

    c: Fix ICE with -fexcess-precision=standard [PR99136]

    The following testcase ICEs on i686-linux, because c_finish_return wraps
    c_fully_folded retval back into EXCESS_PRECISION_EXPR, but when the
function
    return type is void, we don't call convert_for_assignment on it that would
    then be fully folded again, but just put the retval into RETURN_EXPR's
    operand, so nothing removes it anymore and during gimplification we
    ICE as EXCESS_PRECISION_EXPR is not handled.

    This patch fixes it by not adding that EXCESS_PRECISION_EXPR in functions
    returning void, the return value is ignored and all we need is evaluate any
    side-effects of the expression.

    2021-02-18  Jakub Jelinek  <jakub@redhat.com>

            PR c/99136
            * c-typeck.c (c_finish_return): Don't wrap retval into
            EXCESS_PRECISION_EXPR in functions that return void.

            * gcc.dg/pr99136.c: New test.

    (cherry picked from commit 3d7ce7ce6c03165ca1041b38e02428c925254968)

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

* [Bug c/99136] ICE in gimplify_expr, at gimplify.c:14854
  2021-02-17 18:04 [Bug c/99136] New: ICE in gimplify_expr, at gimplify.c:14854 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-04-22 16:51 ` cvs-commit at gcc dot gnu.org
@ 2021-04-22 17:11 ` jakub at gcc dot gnu.org
  2021-09-11 14:25 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-22 17:11 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

* [Bug c/99136] ICE in gimplify_expr, at gimplify.c:14854
  2021-02-17 18:04 [Bug c/99136] New: ICE in gimplify_expr, at gimplify.c:14854 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2021-04-22 17:11 ` jakub at gcc dot gnu.org
@ 2021-09-11 14:25 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-11 14:25 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |8.5

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

end of thread, other threads:[~2021-09-11 14:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-17 18:04 [Bug c/99136] New: ICE in gimplify_expr, at gimplify.c:14854 gscfq@t-online.de
2021-02-17 18:21 ` [Bug c/99136] " jakub at gcc dot gnu.org
2021-02-17 18:45 ` jakub at gcc dot gnu.org
2021-02-18 21:19 ` cvs-commit at gcc dot gnu.org
2021-03-19 23:29 ` cvs-commit at gcc dot gnu.org
2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org
2021-04-22 16:51 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:11 ` jakub at gcc dot gnu.org
2021-09-11 14:25 ` pinskia 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).