public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110705] New: ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x)
@ 2023-07-17 16:39 haoxintu at gmail dot com
  2023-07-17 19:19 ` [Bug ipa/110705] [11/12 Regression] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: haoxintu at gmail dot com @ 2023-07-17 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110705
           Summary: ICE at -O2 and above: in gimplify_modify_expr, at
                    gimplify.cc:6255 (on GCC-12.x)
           Product: gcc
           Version: 12.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

Hi,

GCC-12.0 to GCC-12.3 versions fail to compile the following code.

$cat small.c
struct a {
  long b;
};
union d {
  struct a b;
  int e;
}v;
long c;
int f;
static void g(union d h, long i) {
  while (1)
    switch (c)
    case 4:
      if (h.e)
        c = 4;
}
void j(union d *h) {
  if (f)
    g(*h, h->b.b);
}
void k() { union d *h = &v; j(h); }

$gcc-12 -w -O2 small.c
during IPA pass: inline
In function ‘j.part.0.isra’:
cc1: internal compiler error: in gimplify_modify_expr, at gimplify.cc:6255
0x664d30 gimplify_modify_expr
        ../../gcc/gimplify.cc:6255
0x97daf3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.cc:15098
0x982c3a gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.cc:7151
0x982c3a gimplify_and_add(tree_node*, gimple**)
        ../../gcc/gimplify.cc:496
0x982c3a internal_get_tmp_var
        ../../gcc/gimplify.cc:649
0x982ed1 get_initialized_tmp_var(tree_node*, gimple**, gimple**, bool)
        ../../gcc/gimplify.cc:681
0x982ed1 prepare_gimple_addressable
        ../../gcc/gimplify.cc:4580
0x983630 gimplify_addr_expr
        ../../gcc/gimplify.cc:6500
0x97dee8 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.cc:15145
0x9952bf force_gimple_operand_1(tree_node*, gimple**, bool (*)(tree_node*),
tree_node*)
        ../../gcc/gimplify-me.cc:78
0x9953ff force_gimple_operand_gsi_1(gimple_stmt_iterator*, tree_node*, bool
(*)(tree_node*), tree_node*, bool, gsi_iterator_update)
        ../../gcc/gimplify-me.cc:115
0x9953ff force_gimple_operand_gsi(gimple_stmt_iterator*, tree_node*, bool,
tree_node*, bool, gsi_iterator_update)
        ../../gcc/gimplify-me.cc:141
0xa31bf9 ipa_param_adjustments::modify_call(cgraph_edge*, bool)
        ../../gcc/ipa-param-manipulation.cc:827
0x806a13 cgraph_edge::redirect_call_stmt_to_callee(cgraph_edge*)
        ../../gcc/cgraph.cc:1531
0x9f5ad4 inline_transform(cgraph_node*)
        ../../gcc/ipa-inline-transform.cc:783
0xb4248b execute_one_ipa_transform_pass
        ../../gcc/passes.cc:2330
0xb4248b execute_all_ipa_transforms(bool)
        ../../gcc/passes.cc:2393
0x80ce5f cgraph_node::expand()
        ../../gcc/cgraphunit.cc:1828
0x80ce5f cgraph_node::expand()
        ../../gcc/cgraphunit.cc:1788
0x80e39e expand_all_functions
        ../../gcc/cgraphunit.cc:1999
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


$gcc-12 -v
Using built-in specs.
COLLECT_GCC=gcc-12
COLLECT_LTO_WRAPPER=/home/haoxin/haoxin-data/compilers/gcc-12.1-lastest/build/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure
--prefix=/home/haoxin/haoxin-data/compilers/gcc/build --enable-bootstrap
--enable-checking=release --enable-languages=c,c++ --enable-multilib
--program-suffix=-trunk : (reconfigured) ../configure
--prefix=/home/haoxin/haoxin-data/compilers/gcc/build --enable-bootstrap
--enable-checking=release --enable-languages=c,c++ --enable-multilib
--program-suffix=-trunk
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.1 20220424 (experimental) (GCC) 

GCC-12.3 on Godblot: https://godbolt.org/z/a3oxjdxeo

Thanks,
Haoxin

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

* [Bug ipa/110705] [11/12 Regression] ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x)
  2023-07-17 16:39 [Bug tree-optimization/110705] New: ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x) haoxintu at gmail dot com
@ 2023-07-17 19:19 ` pinskia at gcc dot gnu.org
  2023-07-18 11:48 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-17 19:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
            Summary|ICE at -O2 and above: in    |[11/12 Regression] ICE at
                   |gimplify_modify_expr, at    |-O2 and above: in
                   |gimplify.cc:6255 (on        |gimplify_modify_expr, at
                   |GCC-12.x)                   |gimplify.cc:6255 (on
                   |                            |GCC-12.x)
      Known to work|                            |13.1.0, 9.5.0
   Target Milestone|---                         |11.5
      Known to fail|                            |10.1.0, 10.5.0, 11.3.0,
                   |                            |11.4.0

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

* [Bug ipa/110705] [11/12 Regression] ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x)
  2023-07-17 16:39 [Bug tree-optimization/110705] New: ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x) haoxintu at gmail dot com
  2023-07-17 19:19 ` [Bug ipa/110705] [11/12 Regression] " pinskia at gcc dot gnu.org
@ 2023-07-18 11:48 ` rguenth at gcc dot gnu.org
  2023-07-18 11:48 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-18 11:48 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-07-18
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  Bisection of what fixed it would be useful.

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

* [Bug ipa/110705] [11/12 Regression] ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x)
  2023-07-17 16:39 [Bug tree-optimization/110705] New: ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x) haoxintu at gmail dot com
  2023-07-17 19:19 ` [Bug ipa/110705] [11/12 Regression] " pinskia at gcc dot gnu.org
  2023-07-18 11:48 ` rguenth at gcc dot gnu.org
@ 2023-07-18 11:48 ` rguenth at gcc dot gnu.org
  2024-01-10 14:59 ` jamborm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-18 11:48 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

* [Bug ipa/110705] [11/12 Regression] ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x)
  2023-07-17 16:39 [Bug tree-optimization/110705] New: ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x) haoxintu at gmail dot com
                   ` (2 preceding siblings ...)
  2023-07-18 11:48 ` rguenth at gcc dot gnu.org
@ 2024-01-10 14:59 ` jamborm at gcc dot gnu.org
  2024-01-11  1:03 ` pinskia at gcc dot gnu.org
  2024-01-20 19:44 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jamborm at gcc dot gnu.org @ 2024-01-10 14:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
This has been fixed with r13-1695-gb0f02eeb906b63 (Eric Botcazou: Fix ICE on
view conversion between struct and integer)

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

* [Bug ipa/110705] [11/12 Regression] ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x)
  2023-07-17 16:39 [Bug tree-optimization/110705] New: ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x) haoxintu at gmail dot com
                   ` (3 preceding siblings ...)
  2024-01-10 14:59 ` jamborm at gcc dot gnu.org
@ 2024-01-11  1:03 ` pinskia at gcc dot gnu.org
  2024-01-20 19:44 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-11  1:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598391.html

Will commit the testcase to the trunk so it does not regression.

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

* [Bug ipa/110705] [11/12 Regression] ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x)
  2023-07-17 16:39 [Bug tree-optimization/110705] New: ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x) haoxintu at gmail dot com
                   ` (4 preceding siblings ...)
  2024-01-11  1:03 ` pinskia at gcc dot gnu.org
@ 2024-01-20 19:44 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-20 19:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:

https://gcc.gnu.org/g:17473a93cff5340acfc293299a2f9a5857a50909

commit r14-8306-g17473a93cff5340acfc293299a2f9a5857a50909
Author: Andrew Pinski <quic_apinski@quicinc.com>
Date:   Sat Jan 20 11:39:11 2024 -0800

    ipa: Add testcase for already fixed case [PR110705]

    This testcase was fixed with r13-1695-gb0f02eeb906b63 which
    added an Ada testcase for the issue but adding a C testcase
    is a good idea and that is what this does.

    Committed after making sure it passes on  x86_64-linux-gnu.

            PR ipa/110705

    gcc/testsuite/ChangeLog:

            * gcc.c-torture/compile/pr110705-1.c: New test.

    Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>

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

end of thread, other threads:[~2024-01-20 19:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-17 16:39 [Bug tree-optimization/110705] New: ICE at -O2 and above: in gimplify_modify_expr, at gimplify.cc:6255 (on GCC-12.x) haoxintu at gmail dot com
2023-07-17 19:19 ` [Bug ipa/110705] [11/12 Regression] " pinskia at gcc dot gnu.org
2023-07-18 11:48 ` rguenth at gcc dot gnu.org
2023-07-18 11:48 ` rguenth at gcc dot gnu.org
2024-01-10 14:59 ` jamborm at gcc dot gnu.org
2024-01-11  1:03 ` pinskia at gcc dot gnu.org
2024-01-20 19:44 ` cvs-commit 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).