public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt
@ 2023-03-03 11:51 simon at pushface dot org
  2023-03-03 11:53 ` [Bug ada/109005] " simon at pushface dot org
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: simon at pushface dot org @ 2023-03-03 11:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109005
           Summary: [13 Regression] ICE during GIMPLE pass: ifcvt
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simon at pushface dot org
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

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

* [Bug ada/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
@ 2023-03-03 11:53 ` simon at pushface dot org
  2023-03-03 11:59 ` simon at pushface dot org
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: simon at pushface dot org @ 2023-03-03 11:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from simon at pushface dot org ---
Created attachment 54576
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54576&action=edit
Reproducer

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

* [Bug ada/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
  2023-03-03 11:53 ` [Bug ada/109005] " simon at pushface dot org
@ 2023-03-03 11:59 ` simon at pushface dot org
  2023-03-03 12:30 ` rguenth at gcc dot gnu.org
                   ` (23 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: simon at pushface dot org @ 2023-03-03 11:59 UTC (permalink / raw)
  To: gcc-bugs

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

simon at pushface dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-apple-darwin
      Known to work|                            |12.2.0

--- Comment #2 from simon at pushface dot org ---
[So sorry not to have commented here before posting! The list of suggested PRs
covered the screen]

This occurs at -O2, not at -O1 or -O0.

$ gnatmake -c -u -f stm32-timers.adb -O2 -v

GNATMAKE 13.0.1 20230226 (experimental)
Copyright (C) 1992-2023, Free Software Foundation, Inc.
gcc -c -O2 stm32-timers.adb
during GIMPLE pass: ifcvt

raised CONSTRAINT_ERROR : erroneous memory access
End of compilation
gnatmake: "stm32-timers.adb" compilation error

I first found this exact problem when using an x86_64 x arm-eabi cross
compiler.

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

* [Bug ada/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
  2023-03-03 11:53 ` [Bug ada/109005] " simon at pushface dot org
  2023-03-03 11:59 ` simon at pushface dot org
@ 2023-03-03 12:30 ` rguenth at gcc dot gnu.org
  2023-03-03 12:53 ` simon at pushface dot org
                   ` (22 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-03 12:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
           Keywords|                            |ice-on-valid-code

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Eh, I'm hoping for a C testcase ... what's the actual ICE?

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

* [Bug ada/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (2 preceding siblings ...)
  2023-03-03 12:30 ` rguenth at gcc dot gnu.org
@ 2023-03-03 12:53 ` simon at pushface dot org
  2023-03-03 12:58 ` rguenth at gcc dot gnu.org
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: simon at pushface dot org @ 2023-03-03 12:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from simon at pushface dot org ---
(In reply to Richard Biener from comment #3)
> Eh, I'm hoping for a C testcase ... what's the actual ICE?

This is an LLDB session -- hope that helps

$ lldb /opt/gcc-13-20230226/libexec/gcc/x86_64-apple-darwin15/13.0.1/gnat1
(lldb) target create
"/opt/gcc-13-20230226/libexec/gcc/x86_64-apple-darwin15/13.0.1/gnat1"
Current executable set to
'/opt/gcc-13-20230226/libexec/gcc/x86_64-apple-darwin15/13.0.1/gnat1' (x86_64).
(lldb) run -quiet -O2 -dumpbase stm32-timers.adb -dumpbase-ext .adb -gnatez
-gnatea -gnatez -mmacosx-version-min=12.0.0 -mtune=core2 -fPIC stm32-timers.adb
-o /var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T//cc4fhSaX.s
Process 55466 launched:
'/opt/gcc-13-20230226/libexec/gcc/x86_64-apple-darwin15/13.0.1/gnat1' (x86_64)
during GIMPLE pass: ifcvt
Process 55466 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x0)
    frame #0: 0x00007ff80dd106b2 libsystem_platform.dylib`_platform_strlen + 18
libsystem_platform.dylib`:
->  0x7ff80dd106b2 <+18>: pcmpeqb (%rdi), %xmm0
    0x7ff80dd106b6 <+22>: pmovmskb %xmm0, %esi
    0x7ff80dd106ba <+26>: andq   $0xf, %rcx
    0x7ff80dd106be <+30>: orq    $-0x1, %rax
Target 0: (gnat1) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x0)
  * frame #0: 0x00007ff80dd106b2 libsystem_platform.dylib`_platform_strlen + 18
    frame #1: 0x0000000102a43f24 gnat1`libiberty_vprintf_buffer_size + 779
    frame #2: 0x0000000102a483f1 gnat1`xvasprintf + 35
    frame #3: 0x0000000102a48082 gnat1`xasprintf + 159
    frame #4: 0x000000010003e629
gnat1`internal_error_function(diagnostic_context*, char const*, __va_list_tag
(*) [1]) + 415
    frame #5: 0x000000010296caf1
gnat1`diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*) + 635
    frame #6: 0x000000010296d2c1 gnat1`diagnostic_impl(rich_location*,
diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1],
diagnostic_t) + 272
    frame #7: 0x000000010296ed3f gnat1`internal_error(char const*, ...) + 239
    frame #8: 0x000000010296f099 gnat1`fancy_abort(char const*, int, char
const*) + 293
    frame #9: 0x00000001024a1dae gnat1`make_ssa_name_fn(function*, tree_node*,
gimple*, unsigned int) + 141
    frame #10: 0x00000001024b2955 gnat1`make_temp_ssa_name(tree_node*, gimple*,
char const*) + 109
    frame #11: 0x000000010221a144 gnat1`ifc_temp_var(tree_node*, tree_node*,
gimple_stmt_iterator*) + 44
    frame #12: 0x00000001022238ea gnat1`lower_bitfield(gassign*, bool) + 415
    frame #13: 0x0000000102224670 gnat1`tree_if_conversion(loop*, vec<gimple*,
va_heap, vl_ptr>*) + 1337
    frame #14: 0x0000000102224b47 gnat1`(anonymous
namespace)::pass_if_conversion::execute(function*) + 275
    frame #15: 0x0000000101f7aac8 gnat1`execute_one_pass(opt_pass*) + 800
    frame #16: 0x0000000101f7af07 gnat1`execute_pass_list_1(opt_pass*) + 92
    frame #17: 0x0000000101f7af38 gnat1`execute_pass_list_1(opt_pass*) + 141
    frame #18: 0x0000000101f7af38 gnat1`execute_pass_list_1(opt_pass*) + 141
    frame #19: 0x0000000101f7af9e gnat1`execute_pass_list(function*, opt_pass*)
+ 74
    frame #20: 0x00000001017c53c0 gnat1`cgraph_node::expand() + 590
    frame #21: 0x00000001017c5c61 gnat1`expand_all_functions() + 778
    frame #22: 0x00000001017c6b0c gnat1`symbol_table::compile() + 962
    frame #23: 0x00000001017c700e
gnat1`symbol_table::finalize_compilation_unit() + 318
    frame #24: 0x000000010214fcf1 gnat1`compile_file() + 233
    frame #25: 0x00000001021535d0 gnat1`do_compile(bool) + 802
    frame #26: 0x0000000102153b0f gnat1`toplev::main(int, char**) + 721
    frame #27: 0x000000010293ad78 gnat1`main + 59
    frame #28: 0x000000010536052e dyld`start + 462
(lldb) q

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

* [Bug ada/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (3 preceding siblings ...)
  2023-03-03 12:53 ` simon at pushface dot org
@ 2023-03-03 12:58 ` rguenth at gcc dot gnu.org
  2023-03-06 10:56 ` [Bug tree-optimization/109005] " iains at gcc dot gnu.org
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-03 12:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
It helps pointing to the offender - we likely get a 'get_bitfield_rep' that's
not suitable for a register.

  /* Bail out if the representative is BLKmode as we will not be able to
     vectorize this.  */
  if (TYPE_MODE (TREE_TYPE (rep_decl)) == E_BLKmode) 
    return NULL_TREE;

should probably be !is_gimple_reg_type (TREE_TYPE (rep_decl)) but hard to
say without digging in.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (4 preceding siblings ...)
  2023-03-03 12:58 ` rguenth at gcc dot gnu.org
@ 2023-03-06 10:56 ` iains at gcc dot gnu.org
  2023-03-06 11:11 ` avieira at gcc dot gnu.org
                   ` (19 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: iains at gcc dot gnu.org @ 2023-03-06 10:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |iains at gcc dot gnu.org
   Last reconfirmed|                            |2023-03-06

--- Comment #6 from Iain Sandoe <iains at gcc dot gnu.org> ---
confirmed on x86_64-darwin19 and 21

trying to debug with GDB on darwin19...

frame #3: 0x0000000101f6ba08 gnat1`make_ssa_name_fn(function*, tree_node*,
gimple*, unsigned int) at tree-ssanames.cc:357:3
   354                    unsigned int version)
   355  {
   356    tree t;
-> 357    gcc_assert (VAR_P (var)
   358                || TREE_CODE (var) == PARM_DECL
   359                || TREE_CODE (var) == RESULT_DECL
   360                || (TYPE_P (var) && is_gimple_reg_type (var)));

(I'd need to do a debug build of gnat to get better info - but initial testing
says:

p debug_tree(var)
$5 = void
)

maybe, take that with a pinch of salt, GDB is not so reliable as lldb on
Darwin.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (5 preceding siblings ...)
  2023-03-06 10:56 ` [Bug tree-optimization/109005] " iains at gcc dot gnu.org
@ 2023-03-06 11:11 ` avieira at gcc dot gnu.org
  2023-03-06 11:12 ` avieira at gcc dot gnu.org
                   ` (18 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: avieira at gcc dot gnu.org @ 2023-03-06 11:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from avieira at gcc dot gnu.org ---
I'm still trying to build ADA to reproduce this.

Could you try 'p debug_tree (var)'

if var is a SSA_NAME debug won't print anything. If it comes back as not 0
could you also do p debug_tree (TREE_TYPE (var))

Thank you! I'll keep trying to build ADA locally to see if I can debug this
too.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (6 preceding siblings ...)
  2023-03-06 11:11 ` avieira at gcc dot gnu.org
@ 2023-03-06 11:12 ` avieira at gcc dot gnu.org
  2023-03-06 11:14 ` iains at gcc dot gnu.org
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: avieira at gcc dot gnu.org @ 2023-03-06 11:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from avieira at gcc dot gnu.org ---
Oh nvm... you did.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (7 preceding siblings ...)
  2023-03-06 11:12 ` avieira at gcc dot gnu.org
@ 2023-03-06 11:14 ` iains at gcc dot gnu.org
  2023-03-06 11:38 ` iains at gcc dot gnu.org
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: iains at gcc dot gnu.org @ 2023-03-06 11:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|x86_64-apple-darwin         |x86_64-apple-darwin,
                   |                            |x86_64-linux-gnu

--- Comment #9 from Iain Sandoe <iains at gcc dot gnu.org> ---
also on Linux.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (8 preceding siblings ...)
  2023-03-06 11:14 ` iains at gcc dot gnu.org
@ 2023-03-06 11:38 ` iains at gcc dot gnu.org
  2023-03-06 21:17 ` simon at pushface dot org
                   ` (15 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: iains at gcc dot gnu.org @ 2023-03-06 11:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Iain Sandoe <iains at gcc dot gnu.org> ---
with a debug build on darwin19:
#2  0x000000010249e5a5 in make_ssa_name_fn (fn=0x11104b170, var=0x10771d1f8,
stmt=0x0, version=0) at /src-local/gcc-master/gcc/tree-ssanames.cc:357
357       gcc_assert (VAR_P (var)
(gdb) p debug_tree(var)
 <array_type 0x10771d1f8
    type <integer_type 0x10711c348 character public unsigned QI
        size <integer_cst 0x107102d38 constant 8>
        unit-size <integer_cst 0x107102d50 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x10711c348 precision:8 min <integer_cst 0x107102d68 0> max <integer_cst
0x107102d08 255>
        pointer_to_this <pointer_type 0x107180c78>>
    QI size <integer_cst 0x107102d38 8> unit-size <integer_cst 0x107102d50 1>
    align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x10771d1f8
    domain <integer_type 0x107128b28
        type <integer_type 0x10711c000 sizetype public unsigned DI
            size <integer_cst 0x107102c48 constant 64>
            unit-size <integer_cst 0x107102c60 constant 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x10711c000 precision:64 min <integer_cst 0x107102c78 0> max <integer_cst
0x107103ee0 18446744073709551615>>
        DI size <integer_cst 0x107102c48 64> unit-size <integer_cst 0x107102c60
8>
        align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x107128b28 precision:64 min <integer_cst 0x107102c78 0> max <integer_cst
0x107102c78 0>>>


(gdb) p is_gimple_reg_type(var)
$3 = false

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (9 preceding siblings ...)
  2023-03-06 11:38 ` iains at gcc dot gnu.org
@ 2023-03-06 21:17 ` simon at pushface dot org
  2023-03-06 21:19 ` simon at pushface dot org
                   ` (14 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: simon at pushface dot org @ 2023-03-06 21:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from simon at pushface dot org ---
Created attachment 54597
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54597&action=edit
Minimal reproducer

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (10 preceding siblings ...)
  2023-03-06 21:17 ` simon at pushface dot org
@ 2023-03-06 21:19 ` simon at pushface dot org
  2023-03-06 21:19 ` simon at pushface dot org
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: simon at pushface dot org @ 2023-03-06 21:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from simon at pushface dot org ---
Not sure that it’ll make any difference, but I managed to slim the reproducer
down to a pure set of data declarations, no user code at all. It’s the very
last declaration (TIMx_CCMRx_Lower_Half) that triggers the problem. I think
it’s initialization code.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (11 preceding siblings ...)
  2023-03-06 21:19 ` simon at pushface dot org
@ 2023-03-06 21:19 ` simon at pushface dot org
  2023-03-07  7:25 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: simon at pushface dot org @ 2023-03-06 21:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from simon at pushface dot org ---
Not sure that it’ll make any difference, but I managed to slim the reproducer
down to a pure set of data declarations, no user code at all. It’s the very
last declaration (TIMx_CCMRx_Lower_Half) that triggers the problem. I think
it’s initialization code.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (12 preceding siblings ...)
  2023-03-06 21:19 ` simon at pushface dot org
@ 2023-03-07  7:25 ` rguenth at gcc dot gnu.org
  2023-03-07 10:10 ` avieira at gcc dot gnu.org
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-07  7:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #10)
> with a debug build on darwin19:
> #2  0x000000010249e5a5 in make_ssa_name_fn (fn=0x11104b170, var=0x10771d1f8,
> stmt=0x0, version=0) at /src-local/gcc-master/gcc/tree-ssanames.cc:357
> 357	  gcc_assert (VAR_P (var)
> (gdb) p debug_tree(var)
>  <array_type 0x10771d1f8
>     type <integer_type 0x10711c348 character public unsigned QI
>         size <integer_cst 0x107102d38 constant 8>
>         unit-size <integer_cst 0x107102d50 constant 1>
>         align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
> 0x10711c348 precision:8 min <integer_cst 0x107102d68 0> max <integer_cst
> 0x107102d08 255>
>         pointer_to_this <pointer_type 0x107180c78>>
>     QI size <integer_cst 0x107102d38 8> unit-size <integer_cst 0x107102d50 1>
      ^^

That proves my suspicion in comment#5 and the suggested fix should work fine.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (13 preceding siblings ...)
  2023-03-07  7:25 ` rguenth at gcc dot gnu.org
@ 2023-03-07 10:10 ` avieira at gcc dot gnu.org
  2023-03-07 10:44 ` dkm at gcc dot gnu.org
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: avieira at gcc dot gnu.org @ 2023-03-07 10:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from avieira at gcc dot gnu.org ---
@richi: Yeah and as I mentioned on IRC I can confirm it fixes the issue, I also
bootstrapped and regression tested the change on aarch64-unknown-linux-gnu.

Simon, I can't compile your minimal reproducer, first it complains about
missing the body keyword, so I added that, but then it complains about missing
a ifcvt_demo.ads, tried adding an empty one but that didn't work.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (14 preceding siblings ...)
  2023-03-07 10:10 ` avieira at gcc dot gnu.org
@ 2023-03-07 10:44 ` dkm at gcc dot gnu.org
  2023-03-07 10:48 ` dkm at gcc dot gnu.org
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: dkm at gcc dot gnu.org @ 2023-03-07 10:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
(In reply to avieira from comment #15)
> @richi: Yeah and as I mentioned on IRC I can confirm it fixes the issue, I
> also bootstrapped and regression tested the change on
> aarch64-unknown-linux-gnu.
> 
> Simon, I can't compile your minimal reproducer, first it complains about
> missing the body keyword, so I added that, but then it complains about
> missing a ifcvt_demo.ads, tried adding an empty one but that didn't work.

Try by using the small reproducer as the ads file instead:

gcc -c -O3 ifcvt_demo.ads      

during GIMPLE pass: ifcvt

raised STORAGE_ERROR : stack overflow or erroneous memory access

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (15 preceding siblings ...)
  2023-03-07 10:44 ` dkm at gcc dot gnu.org
@ 2023-03-07 10:48 ` dkm at gcc dot gnu.org
  2023-03-07 10:59 ` iains at gcc dot gnu.org
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: dkm at gcc dot gnu.org @ 2023-03-07 10:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
FWIW, can confirm the above fix works for the small reproducer (x86_64-linux)

   /* Bail out if the representative is BLKmode as we will not be able to
      vectorize this.  */
-  if (TYPE_MODE (TREE_TYPE (rep_decl)) == E_BLKmode)
+  if (!is_gimple_reg_type (TREE_TYPE (rep_decl)))
     return NULL_TREE;

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (16 preceding siblings ...)
  2023-03-07 10:48 ` dkm at gcc dot gnu.org
@ 2023-03-07 10:59 ` iains at gcc dot gnu.org
  2023-03-07 13:23 ` simon at pushface dot org
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: iains at gcc dot gnu.org @ 2023-03-07 10:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Marc Poulhiès from comment #17)
> FWIW, can confirm the above fix works for the small reproducer (x86_64-linux)
> 
>    /* Bail out if the representative is BLKmode as we will not be able to
>       vectorize this.  */
> -  if (TYPE_MODE (TREE_TYPE (rep_decl)) == E_BLKmode)
> +  if (!is_gimple_reg_type (TREE_TYPE (rep_decl)))
>      return NULL_TREE;

presumably, the final patch will also amend the comment?

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (17 preceding siblings ...)
  2023-03-07 10:59 ` iains at gcc dot gnu.org
@ 2023-03-07 13:23 ` simon at pushface dot org
  2023-03-07 14:09 ` avieira at gcc dot gnu.org
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: simon at pushface dot org @ 2023-03-07 13:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from simon at pushface dot org ---
(In reply to avieira from comment #15)

> Simon, I can't compile your minimal reproducer, first it complains about
> missing the body keyword, so I added that, but then it complains about
> missing a ifcvt_demo.ads, tried adding an empty one but that didn't work.

Sorry about that, next time I’ll post a zip archive so there’s no mistaking the
expected file name/type (it should have been .ads).

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (18 preceding siblings ...)
  2023-03-07 13:23 ` simon at pushface dot org
@ 2023-03-07 14:09 ` avieira at gcc dot gnu.org
  2023-03-07 14:22 ` avieira at gcc dot gnu.org
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: avieira at gcc dot gnu.org @ 2023-03-07 14:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #20 from avieira at gcc dot gnu.org ---
It's probably obvious to people that know Ada, so I just have to apologize for
my ignorance in that area :)

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (19 preceding siblings ...)
  2023-03-07 14:09 ` avieira at gcc dot gnu.org
@ 2023-03-07 14:22 ` avieira at gcc dot gnu.org
  2023-03-07 14:25 ` rguenther at suse dot de
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: avieira at gcc dot gnu.org @ 2023-03-07 14:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from avieira at gcc dot gnu.org ---
Something else that might be obvious, how do I create a minimal ifcvt_demo.adb
file that uses the .ads, so that I can add it as a testcase to gcc, as the
testsuite seems to pick up .adb files only.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (20 preceding siblings ...)
  2023-03-07 14:22 ` avieira at gcc dot gnu.org
@ 2023-03-07 14:25 ` rguenther at suse dot de
  2023-03-07 16:31 ` ebotcazou at gcc dot gnu.org
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenther at suse dot de @ 2023-03-07 14:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #22 from rguenther at suse dot de <rguenther at suse dot de> ---
On Tue, 7 Mar 2023, avieira at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109005
> 
> --- Comment #21 from avieira at gcc dot gnu.org ---
> Something else that might be obvious, how do I create a minimal ifcvt_demo.adb
> file that uses the .ads, so that I can add it as a testcase to gcc, as the
> testsuite seems to pick up .adb files only.

I'll leave adding a testcase to the Ada folks.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (21 preceding siblings ...)
  2023-03-07 14:25 ` rguenther at suse dot de
@ 2023-03-07 16:31 ` ebotcazou at gcc dot gnu.org
  2023-03-14  9:53 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-03-07 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

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

--- Comment #23 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> I'll leave adding a testcase to the Ada folks.

The spec can be added directly as gnat.dg/specs/opt6.ads to the testsuite.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (22 preceding siblings ...)
  2023-03-07 16:31 ` ebotcazou at gcc dot gnu.org
@ 2023-03-14  9:53 ` cvs-commit at gcc dot gnu.org
  2023-03-14 10:01 ` rguenth at gcc dot gnu.org
  2023-03-14 10:43 ` cvs-commit at gcc dot gnu.org
  25 siblings, 0 replies; 27+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-14  9:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #24 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andre Simoes Dias Vieira
<avieira@gcc.gnu.org>:

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

commit r13-6654-gb109964ddb421cf481828a2f3465751a2bd6a8f6
Author: Andre Vieira <andre.simoesdiasvieira@arm.com>
Date:   Tue Mar 14 09:51:38 2023 +0000

    ifcvt: Lower bitfields only if suitable for scalar register [PR 109005]

    This patch fixes the condition check for eligilibity of lowering bitfields,
    where before we would check for non-BLKmode types, in the hope of excluding
    unsuitable aggregate types, we now check directly the representative is not
an
    aggregate type, i.e. suitable for a scalar register.

    gcc/ChangeLog:

            PR tree-optimization/109005
            * tree-if-conv.cc (get_bitfield_rep): Replace BLKmode check with
            aggregate type check.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (23 preceding siblings ...)
  2023-03-14  9:53 ` cvs-commit at gcc dot gnu.org
@ 2023-03-14 10:01 ` rguenth at gcc dot gnu.org
  2023-03-14 10:43 ` cvs-commit at gcc dot gnu.org
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-14 10:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #25 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

* [Bug tree-optimization/109005] [13 Regression] ICE during GIMPLE pass: ifcvt
  2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
                   ` (24 preceding siblings ...)
  2023-03-14 10:01 ` rguenth at gcc dot gnu.org
@ 2023-03-14 10:43 ` cvs-commit at gcc dot gnu.org
  25 siblings, 0 replies; 27+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-14 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #26 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>:

https://gcc.gnu.org/g:67839c562779081936cb79ebca156ef43d70f65f

commit r13-6660-g67839c562779081936cb79ebca156ef43d70f65f
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Tue Mar 14 11:28:24 2023 +0100

    Add testcase for ifcvt fix

    gcc/testsuite/
            PR tree-optimization/109005
            * gnat.dg/specs/opt6.ads: New test.

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

end of thread, other threads:[~2023-03-14 10:43 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03 11:51 [Bug ada/109005] New: [13 Regression] ICE during GIMPLE pass: ifcvt simon at pushface dot org
2023-03-03 11:53 ` [Bug ada/109005] " simon at pushface dot org
2023-03-03 11:59 ` simon at pushface dot org
2023-03-03 12:30 ` rguenth at gcc dot gnu.org
2023-03-03 12:53 ` simon at pushface dot org
2023-03-03 12:58 ` rguenth at gcc dot gnu.org
2023-03-06 10:56 ` [Bug tree-optimization/109005] " iains at gcc dot gnu.org
2023-03-06 11:11 ` avieira at gcc dot gnu.org
2023-03-06 11:12 ` avieira at gcc dot gnu.org
2023-03-06 11:14 ` iains at gcc dot gnu.org
2023-03-06 11:38 ` iains at gcc dot gnu.org
2023-03-06 21:17 ` simon at pushface dot org
2023-03-06 21:19 ` simon at pushface dot org
2023-03-06 21:19 ` simon at pushface dot org
2023-03-07  7:25 ` rguenth at gcc dot gnu.org
2023-03-07 10:10 ` avieira at gcc dot gnu.org
2023-03-07 10:44 ` dkm at gcc dot gnu.org
2023-03-07 10:48 ` dkm at gcc dot gnu.org
2023-03-07 10:59 ` iains at gcc dot gnu.org
2023-03-07 13:23 ` simon at pushface dot org
2023-03-07 14:09 ` avieira at gcc dot gnu.org
2023-03-07 14:22 ` avieira at gcc dot gnu.org
2023-03-07 14:25 ` rguenther at suse dot de
2023-03-07 16:31 ` ebotcazou at gcc dot gnu.org
2023-03-14  9:53 ` cvs-commit at gcc dot gnu.org
2023-03-14 10:01 ` rguenth at gcc dot gnu.org
2023-03-14 10:43 ` 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).