public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/103132] New: ice: Segmentation fault
@ 2021-11-08 11:35 dcb314 at hotmail dot com
  2021-11-08 11:46 ` [Bug c/103132] " marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dcb314 at hotmail dot com @ 2021-11-08 11:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103132
           Summary: ice: Segmentation fault
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this C code:

int globus_i_GLOBUS_GRIDFTP_SERVER_debug_handle_1;
int globus_l_gfs_ipc_unpack_data__sz;
static void globus_l_gfs_ipc_unpack_cred(len) {
  if (globus_i_GLOBUS_GRIDFTP_SERVER_debug_handle_1)
    globus_i_GLOBUS_GRIDFTP_SERVER_debug_printf("", __func__);
}
static void globus_l_gfs_ipc_unpack_data(len) {
  for (; globus_l_gfs_ipc_unpack_data__sz;)
    len--;
  len -= 4;
  len -= 4;
  globus_l_gfs_ipc_unpack_cred(len);
}
void globus_l_gfs_ipc_reply_read_body_cb() { globus_l_gfs_ipc_unpack_data(); }

compiled by recent gcc, does this:

$ /home/dcb/gcc/results.20211105/bin/gcc -g -O2 -c bug770.c
In function ‘globus_l_gfs_ipc_unpack_data.isra’:
cc1: internal compiler error: Segmentation fault
0xd987a9 crash_signal(int)
        ../../trunk.git/gcc/toplev.c:322
0x10b9b2a contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        ../../trunk.git/gcc/tree.h:3546
0x10b9b2a walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ../../trunk.git/gcc/tree.c:11030

The fault first seems to occur sometime between git hash d3f7a2fa64f8777c
and bcf4065c909bd101, a distance of 25 commits.

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

* [Bug c/103132] ice: Segmentation fault
  2021-11-08 11:35 [Bug c/103132] New: ice: Segmentation fault dcb314 at hotmail dot com
@ 2021-11-08 11:46 ` marxin at gcc dot gnu.org
  2021-11-08 11:48 ` [Bug c/103132] [12 Regression] ICE in remap_gimple_stmt at tree-inline.c:1828 since r12-4920-g1ece90ffa9ce63b4 marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-08 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-11-08
     Ever confirmed|0                           |1
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |mjambor at suse dot cz
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=101636
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Also started with r12-4920-g1ece90ffa9ce63b4.

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

* [Bug c/103132] [12 Regression] ICE in remap_gimple_stmt at tree-inline.c:1828 since r12-4920-g1ece90ffa9ce63b4
  2021-11-08 11:35 [Bug c/103132] New: ice: Segmentation fault dcb314 at hotmail dot com
  2021-11-08 11:46 ` [Bug c/103132] " marxin at gcc dot gnu.org
@ 2021-11-08 11:48 ` marxin at gcc dot gnu.org
  2021-11-08 17:05 ` [Bug ipa/103132] " jamborm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-08 11:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
   Target Milestone|---                         |12.0
            Summary|ice: Segmentation fault     |[12 Regression] ICE in
                   |                            |remap_gimple_stmt at
                   |                            |tree-inline.c:1828 since
                   |                            |r12-4920-g1ece90ffa9ce63b4

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

* [Bug ipa/103132] [12 Regression] ICE in remap_gimple_stmt at tree-inline.c:1828 since r12-4920-g1ece90ffa9ce63b4
  2021-11-08 11:35 [Bug c/103132] New: ice: Segmentation fault dcb314 at hotmail dot com
  2021-11-08 11:46 ` [Bug c/103132] " marxin at gcc dot gnu.org
  2021-11-08 11:48 ` [Bug c/103132] [12 Regression] ICE in remap_gimple_stmt at tree-inline.c:1828 since r12-4920-g1ece90ffa9ce63b4 marxin at gcc dot gnu.org
@ 2021-11-08 17:05 ` jamborm at gcc dot gnu.org
  2021-11-09 10:37 ` cvs-commit at gcc dot gnu.org
  2021-11-09 10:39 ` jamborm at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jamborm at gcc dot gnu.org @ 2021-11-08 17:05 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

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

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
I have proposed a fix on the mailing list:
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583693.html

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

* [Bug ipa/103132] [12 Regression] ICE in remap_gimple_stmt at tree-inline.c:1828 since r12-4920-g1ece90ffa9ce63b4
  2021-11-08 11:35 [Bug c/103132] New: ice: Segmentation fault dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2021-11-08 17:05 ` [Bug ipa/103132] " jamborm at gcc dot gnu.org
@ 2021-11-09 10:37 ` cvs-commit at gcc dot gnu.org
  2021-11-09 10:39 ` jamborm at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-09 10:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r12-5045-gdf8690f28379795a44aa4b6c737df08828168b6a
Author: Martin Jambor <mjambor@suse.cz>
Date:   Tue Nov 9 11:32:20 2021 +0100

    ipa: Fix segfault when remapping debug_binds with expressions (PR 103132)

    My initial implementation of the method
    ipa_param_body_adjustments::remap_with_debug_expressions was based on
    the assumption that if it was asked to remap an expression (as opposed
    to a simple SSA_NAME), the expression would not contain an SSA_NAME
    operand which is to be debug-reset.  While that is true for when
    called from ipa_param_body_adjustments::prepare_debug_expressions, it
    turns out it is not true when invoked from remap_gimple_stmt in
    tree-inline.c.  This patch adds a simple logic to handle such cases
    and simply map the entire value to NULL_TREE in those cases.

    gcc/ChangeLog:

    2021-11-08  Martin Jambor  <mjambor@suse.cz>

            PR ipa/103132
            * ipa-param-manipulation.c (replace_with_mapped_expr): Early
            return with error_mark_mode when part of expression is mapped to
            NULL.
            (ipa_param_body_adjustments::remap_with_debug_expressions): Set
            mapped value to NULL if walk_tree returns error_mark_mode.

    gcc/testsuite/ChangeLog:

    2021-11-08  Martin Jambor  <mjambor@suse.cz>

            PR ipa/103132
            * gcc.dg/ipa/pr103132.c: New test.

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

* [Bug ipa/103132] [12 Regression] ICE in remap_gimple_stmt at tree-inline.c:1828 since r12-4920-g1ece90ffa9ce63b4
  2021-11-08 11:35 [Bug c/103132] New: ice: Segmentation fault dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2021-11-09 10:37 ` cvs-commit at gcc dot gnu.org
@ 2021-11-09 10:39 ` jamborm at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jamborm at gcc dot gnu.org @ 2021-11-09 10:39 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

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

--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Fixed.  Thanks for testing and sorry for the breakage.

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 11:35 [Bug c/103132] New: ice: Segmentation fault dcb314 at hotmail dot com
2021-11-08 11:46 ` [Bug c/103132] " marxin at gcc dot gnu.org
2021-11-08 11:48 ` [Bug c/103132] [12 Regression] ICE in remap_gimple_stmt at tree-inline.c:1828 since r12-4920-g1ece90ffa9ce63b4 marxin at gcc dot gnu.org
2021-11-08 17:05 ` [Bug ipa/103132] " jamborm at gcc dot gnu.org
2021-11-09 10:37 ` cvs-commit at gcc dot gnu.org
2021-11-09 10:39 ` jamborm 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).