public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283
@ 2023-04-26 23:15 sjames at gcc dot gnu.org
  2023-04-27  0:34 ` [Bug tree-optimization/109639] " sjames at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-04-26 23:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109639
           Summary: [14 regression] Internal compiler error: tree check:
                    expected integer_cst, have addr_expr in to_wide, at
                    tree.h:6283
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---
              Host: aarch64-unknown-linux-gnu

Created attachment 54928
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54928&action=edit
ccwjJian.i.xz

Hit this w/ binutils-2.40 (and 2.39) with gcc ...:
```
libtool: compile:  aarch64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I.
-I/var/tmp/portage/sys-devel/binutils-2.40-r4/work/binutils-2.40/bfd
-DBINDIR=\"/usr/aarch64-unknown-linux-gnu/binutils-bin/2.40\"
-DLIBDIR=\"/usr/lib64/binutils/aarch64-unknown-linux-gnu/2.40\" -I.
-I/var/tmp/portage/sys-devel/binutils-2.40-r4/work/binutils-2.40/bfd
-I/var/tmp/portage/sys-devel/binutils-2.40-r4/work/binutils-2.40/bfd/../include
-DHAVE_aarch64_elf64_le_vec -DHAVE_aarch64_elf64_be_vec
-DHAVE_aarch64_elf32_le_vec -DHAVE_aarch64_elf32_be_vec -DHAVE_arm_elf32_le_vec
-DHAVE_arm_elf32_be_vec -DHAVE_aarch64_pei_le_vec -DHAVE_aarch64_pe_le_vec
-DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec
-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144
-O2 -pipe -mcpu=native -MT elf32-aarch64.lo -MD -MP -MF .deps/elf32-aarch64.Tpo
-c elf32-aarch64.c  -fPIC -DPIC -o .libs/elf32-aarch64.o
during IPA pass: inline
elfnn-aarch64.c:10242: internal compiler error: tree check: expected
integer_cst, have addr_expr in to_wide, at tree.h:6283
0x6c91af tree_check_failed(tree_node const*, char const*, int, char const*,
...)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/tree.cc:8869
0x6aec5b tree_int_cst_elt_check(tree_node const*, int, char const*, int, char
const*)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/tree.h:3728
0x83cf9b tree_int_cst_elt_check(tree_node const*, int, char const*, int, char
const*)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/tree.h:6285
0x83cf9b wi::to_wide(tree_node const*)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/tree.h:6283
0x1223b7f irange::varying_compatible_p() const
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/value-range.h:739
0x12170e7 irange::normalize_kind()
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/value-range.h:1009
0x12170e7 irange::irange_set(tree_node*, tree_node*)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/value-range.cc:966
0xb90b77 int_range<2u>::int_range(tree_node*, tree_node*, value_range_kind)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/value-range.h:863
0xb90b77 evaluate_conditions_for_known_args
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/ipa-fnsummary.cc:503
0xbaa59b do_estimate_edge_size(cgraph_edge*)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/ipa-inline-analysis.cc:335
0xbad283 estimate_edge_size(cgraph_edge*)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/ipa-inline.h:79
0xbad283 estimate_edge_growth(cgraph_edge*)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/ipa-inline.h:100
0xbaba6f do_estimate_growth_1
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/ipa-inline-analysis.cc:434
0xbabbb3 cgraph_node::call_for_symbol_and_aliases(bool (*)(cgraph_node*,
void*), void*, bool)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/cgraph.h:3412
0xbabbb3 estimate_growth(cgraph_node*)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/ipa-inline-analysis.cc:472
0x1e72b47 inline_small_functions
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/ipa-inline.cc:2042
0x1e72b47 ipa_inline
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/ipa-inline.cc:2811
0x1e72b47 execute
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/ipa-inline.cc:3210
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
make[4]: *** [Makefile:1776: elf32-aarch64.lo] Error 1
```

----

```
$ gcc -O2 -c ccwjJian.i
during IPA pass: inline
elfnn-aarch64.c:10242: internal compiler error: tree check: expected
integer_cst, have addr_expr in to_wide, at tree.h:6283
0x6c91af tree_check_failed(tree_node const*, char const*, int, char const*,
...)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/tree.cc:8869
0x6aec5b tree_int_cst_elt_check(tree_node const*, int, char const*, int, char
const*)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/tree.h:3728
0x83cf9b tree_int_cst_elt_check(tree_node const*, int, char const*, int, char
const*)
       
/usr/src/debug/sys-devel/gcc-14.0.0.9999/gcc-14.0.0.9999/gcc/tree.h:6285
[...]
```

```
gcc (Gentoo 14.0.0.9999 p, commit 7546d8be5a8ae93e81535644c2578807db276ab6)
14.0.0 20230426 (experimental)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

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

* [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
@ 2023-04-27  0:34 ` sjames at gcc dot gnu.org
  2023-04-27  2:56 ` sjames at gcc dot gnu.org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-04-27  0:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Sam James from comment #0)
> gcc (Gentoo 14.0.0.9999 p, commit 7546d8be5a8ae93e81535644c2578807db276ab6)
> 14.0.0 20230426 (experimental)

This commit is wrong (recorded incorrectly). I'm changing something in our
packaging to record the upstream commit correctly vs the commit after any
patches.

Anyway, reducing.

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

* [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
  2023-04-27  0:34 ` [Bug tree-optimization/109639] " sjames at gcc dot gnu.org
@ 2023-04-27  2:56 ` sjames at gcc dot gnu.org
  2023-04-27  3:00 ` pinskia at gcc dot gnu.org
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-04-27  2:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Sam James from comment #1)
> (In reply to Sam James from comment #0)
> > gcc (Gentoo 14.0.0.9999 p, commit 7546d8be5a8ae93e81535644c2578807db276ab6)
> > 14.0.0 20230426 (experimental)
> 
> This commit is wrong (recorded incorrectly). I'm changing something in our
> packaging to record the upstream commit correctly vs the commit after any
> patches.
> 
> Anyway, reducing.

It's actually built at b4c69e6b663753f41259e2e19ad03cfc11457534
(r14-267-gb4c69e6b663753).

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

* [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
  2023-04-27  0:34 ` [Bug tree-optimization/109639] " sjames at gcc dot gnu.org
  2023-04-27  2:56 ` sjames at gcc dot gnu.org
@ 2023-04-27  3:00 ` pinskia at gcc dot gnu.org
  2023-04-27  3:01 ` pinskia at gcc dot gnu.org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-27  3:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
               Host|aarch64-unknown-linux-gnu   |
           Keywords|                            |ice-on-valid-code

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can reproduce on the trunk on x86_64, reducing.

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

* [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-04-27  3:00 ` pinskia at gcc dot gnu.org
@ 2023-04-27  3:01 ` pinskia at gcc dot gnu.org
  2023-04-27  4:22 ` pinskia at gcc dot gnu.org
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-27  3:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

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

* [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-04-27  3:01 ` pinskia at gcc dot gnu.org
@ 2023-04-27  4:22 ` pinskia at gcc dot gnu.org
  2023-04-27  4:22 ` pinskia at gcc dot gnu.org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-27  4:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 54931
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54931&action=edit
One version of the reduced testcase

I am not a fan of this reduced testcase so I am trying again.

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

* [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-04-27  4:22 ` pinskia at gcc dot gnu.org
@ 2023-04-27  4:22 ` pinskia at gcc dot gnu.org
  2023-04-27  5:13 ` sjames at gcc dot gnu.org
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-27  4:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needs-bisection,
                   |                            |needs-reduction
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-04-27
     Ever confirmed|0                           |1

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

* [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-04-27  4:22 ` pinskia at gcc dot gnu.org
@ 2023-04-27  5:13 ` sjames at gcc dot gnu.org
  2023-04-27  5:14 ` sjames at gcc dot gnu.org
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-04-27  5:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Sam James <sjames at gcc dot gnu.org> ---
Created attachment 54932
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54932&action=edit
sam-reduced.i

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

* [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-04-27  5:13 ` sjames at gcc dot gnu.org
@ 2023-04-27  5:14 ` sjames at gcc dot gnu.org
  2023-04-27  5:45 ` [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8 sjames at gcc dot gnu.org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-04-27  5:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Sam James <sjames at gcc dot gnu.org> ---
Created attachment 54933
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54933&action=edit
sam-reduced-clean.i

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

* [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-04-27  5:14 ` sjames at gcc dot gnu.org
@ 2023-04-27  5:45 ` sjames at gcc dot gnu.org
  2023-04-27  6:13 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-04-27  5:45 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[14 regression] Internal    |[14 regression] Internal
                   |compiler error: tree check: |compiler error: tree check:
                   |expected integer_cst, have  |expected integer_cst, have
                   |addr_expr in to_wide, at    |addr_expr in to_wide, at
                   |tree.h:6283                 |tree.h:6283 since
                   |                            |r14-249-g3c9372dfee0bb8
           Keywords|needs-bisection,            |
                   |needs-reduction             |
                 CC|                            |aldyh at gcc dot gnu.org

--- Comment #7 from Sam James <sjames at gcc dot gnu.org> ---
3c9372dfee0bb893b99dd28658c98d397cda5b49 is the first bad commit
commit 3c9372dfee0bb893b99dd28658c98d397cda5b49
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Mon Nov 21 00:54:21 2022 +0100

    Remove deprecated range_fold_{unary,binary}_expr uses from ipa-*.

    gcc/ChangeLog:

            * ipa-cp.cc (ipa_vr_operation_and_type_effects): Convert to ranger
API.
            (ipa_value_range_from_jfunc): Same.
            (propagate_vr_across_jump_function): Same.
            * ipa-fnsummary.cc (evaluate_conditions_for_known_args): Same.
            * ipa-prop.cc (ipa_compute_jump_functions_for_edge): Same.
            * vr-values.cc (bounds_of_var_in_loop): Same.

 gcc/ipa-cp.cc        | 28 ++++++++++++++++++++++------
 gcc/ipa-fnsummary.cc | 45 +++++++++++++++++++++++++++++----------------
 gcc/ipa-prop.cc      |  5 ++---
 gcc/vr-values.cc     |  6 ++++--
 4 files changed, 57 insertions(+), 27 deletions(-)
bisect found first bad commit

i.e. r14-249-g3c9372dfee0bb8

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

* [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-04-27  5:45 ` [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8 sjames at gcc dot gnu.org
@ 2023-04-27  6:13 ` pinskia at gcc dot gnu.org
  2023-04-27  6:14 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-27  6:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 54934
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54934&action=edit
Slightly more reduced from what Sam had

Removes the struct type and do some name shorting.

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

* [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2023-04-27  6:13 ` pinskia at gcc dot gnu.org
@ 2023-04-27  6:14 ` pinskia at gcc dot gnu.org
  2023-04-27  6:43 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-27  6:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #54934|0                           |1
        is obsolete|                            |

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 54935
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54935&action=edit
One that will ICEs even for ILP32 targets

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

* [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2023-04-27  6:14 ` pinskia at gcc dot gnu.org
@ 2023-04-27  6:43 ` rguenth at gcc dot gnu.org
  2023-04-27  9:01 ` [Bug ipa/109639] " aldyh at gcc dot gnu.org
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-27  6:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
IPA also propagates &x, aka IP invariant addresses.

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

* [Bug ipa/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2023-04-27  6:43 ` rguenth at gcc dot gnu.org
@ 2023-04-27  9:01 ` aldyh at gcc dot gnu.org
  2023-04-27  9:08 ` aldyh at gcc dot gnu.org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: aldyh at gcc dot gnu.org @ 2023-04-27  9:01 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

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

--- Comment #11 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
*** Bug 109643 has been marked as a duplicate of this bug. ***

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

* [Bug ipa/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2023-04-27  9:01 ` [Bug ipa/109639] " aldyh at gcc dot gnu.org
@ 2023-04-27  9:08 ` aldyh at gcc dot gnu.org
  2023-04-27  9:11 ` aldyh at gcc dot gnu.org
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: aldyh at gcc dot gnu.org @ 2023-04-27  9:08 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |aldyh at gcc dot gnu.org
                 CC|                            |amacleod at redhat dot com

--- Comment #12 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
We're trying to build a range of [&k, &k] and are failing because irange's no
longer support symbolics.  Truth be told, we haven't supported them in a while,
because ranger doesn't.  However, the setter was normalizing addresses to
non-zero, which it is no longer doing.

Mine.

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

* [Bug ipa/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2023-04-27  9:08 ` aldyh at gcc dot gnu.org
@ 2023-04-27  9:11 ` aldyh at gcc dot gnu.org
  2023-04-27 10:11 ` aldyh at gcc dot gnu.org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: aldyh at gcc dot gnu.org @ 2023-04-27  9:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Sorry, it wasn't the setter doing the normalization, but the
range_fold_{unary,binary}_expr helpers.  Since IPA was the only user of these
deprecated functions, this should be relatively easy to contain.

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

* [Bug ipa/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2023-04-27  9:11 ` aldyh at gcc dot gnu.org
@ 2023-04-27 10:11 ` aldyh at gcc dot gnu.org
  2023-04-27 11:59 ` cvs-commit at gcc dot gnu.org
  2023-04-27 12:00 ` aldyh at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: aldyh at gcc dot gnu.org @ 2023-04-27 10:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Created attachment 54939
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54939&action=edit
proposed patch in testing

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

* [Bug ipa/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2023-04-27 10:11 ` aldyh at gcc dot gnu.org
@ 2023-04-27 11:59 ` cvs-commit at gcc dot gnu.org
  2023-04-27 12:00 ` aldyh at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-27 11:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Aldy Hernandez <aldyh@gcc.gnu.org>:

https://gcc.gnu.org/g:2b8ac1df6493eb1789c7c4d9f3df280ef9cf0ac4

commit r14-298-g2b8ac1df6493eb1789c7c4d9f3df280ef9cf0ac4
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Thu Apr 27 12:05:36 2023 +0200

    Normalize addresses in IPA before calling range_op_handler [PR109639]

    The old legacy code would allow building ranges containing symbolics,
    even though the entire ranger ecosystem does not handle them.  These
    were normalized into non-zero ranges by helper functions in VRP
    (range_fold_*_expr) before calling the ranger.  The only users of
    these functions should have been legacy VRP, which is no more.
    However, a handful of users crept into IPA, even though these
    functions shouldn't never been called outside of VRP or vr-values.

    The issue here is that IPA is building a range of [&foo, &foo] and
    expecting range_fold_binary to normalize it to non-zero.  Fixed by
    adding a helper function before calling the range_op handler.

    I think these covers the problematic ranges.  If not, I'll come up
    with something more generalized that does not involve polluting
    irange::set with the normalization code.  After all, this only
    involves a handful of IPA places.

    I've also added an assert in irange::set() making it easier to detect
    any possible fallout without having to drill deep into the setter.

    gcc/ChangeLog:

            PR tree-optimization/109639
            * ipa-cp.cc (ipa_value_range_from_jfunc): Normalize range.
            (propagate_vr_across_jump_function): Same.
            * ipa-fnsummary.cc (evaluate_conditions_for_known_args): Same.
            * ipa-prop.h (ipa_range_set_and_normalize): New.
            * value-range.cc (irange::set): Assert min and max are INTEGER_CST.

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

* [Bug ipa/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8
  2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2023-04-27 11:59 ` cvs-commit at gcc dot gnu.org
@ 2023-04-27 12:00 ` aldyh at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: aldyh at gcc dot gnu.org @ 2023-04-27 12:00 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

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

--- Comment #16 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
fixed

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

end of thread, other threads:[~2023-04-27 12:00 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-26 23:15 [Bug tree-optimization/109639] New: [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 sjames at gcc dot gnu.org
2023-04-27  0:34 ` [Bug tree-optimization/109639] " sjames at gcc dot gnu.org
2023-04-27  2:56 ` sjames at gcc dot gnu.org
2023-04-27  3:00 ` pinskia at gcc dot gnu.org
2023-04-27  3:01 ` pinskia at gcc dot gnu.org
2023-04-27  4:22 ` pinskia at gcc dot gnu.org
2023-04-27  4:22 ` pinskia at gcc dot gnu.org
2023-04-27  5:13 ` sjames at gcc dot gnu.org
2023-04-27  5:14 ` sjames at gcc dot gnu.org
2023-04-27  5:45 ` [Bug tree-optimization/109639] [14 regression] Internal compiler error: tree check: expected integer_cst, have addr_expr in to_wide, at tree.h:6283 since r14-249-g3c9372dfee0bb8 sjames at gcc dot gnu.org
2023-04-27  6:13 ` pinskia at gcc dot gnu.org
2023-04-27  6:14 ` pinskia at gcc dot gnu.org
2023-04-27  6:43 ` rguenth at gcc dot gnu.org
2023-04-27  9:01 ` [Bug ipa/109639] " aldyh at gcc dot gnu.org
2023-04-27  9:08 ` aldyh at gcc dot gnu.org
2023-04-27  9:11 ` aldyh at gcc dot gnu.org
2023-04-27 10:11 ` aldyh at gcc dot gnu.org
2023-04-27 11:59 ` cvs-commit at gcc dot gnu.org
2023-04-27 12:00 ` aldyh 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).