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

            Bug ID: 119921
           Summary: [12/13/14/15/16 Regression] ICE building SVE ACLE in
                    varasm
           Product: gcc
           Version: 13.3.1
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tnfchris at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64*

Created attachment 61193
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61193&action=edit
sve-bug.ii

The attached testcase when compiled with -O2 -march=armv8-a+sve2 ICEs with:

sve-bug.ii:65:80: internal compiler error: in tree_to_uhwi, at tree.h:5020
   65 | void bo() { bi<1>(1, 0, 1, 0, 1, 1, 1, 1, 1, 1, bn, reinterpret_cast<y
*>(1)); }
      |                                                                        
       ^
0x2027bab internal_error(char const*, ...)
        ../../gcc/gcc/gcc/diagnostic-global-context.cc:517
0x7f6e6b fancy_abort(char const*, int, char const*)
        ../../gcc/gcc/gcc/diagnostic.cc:1749
0x1335073 tree_to_uhwi(tree_node const*)
        ../../gcc/gcc/gcc/tree.h:5020
0x1335073 assemble_variable_contents
        ../../gcc/gcc/gcc/varasm.cc:2425
0x133db7b assemble_variable(tree_node*, int, int, int)
        ../../gcc/gcc/gcc/varasm.cc:2619
0x13402a3 varpool_node::assemble_decl()
        ../../gcc/gcc/gcc/varpool.cc:596
0x13402a3 varpool_node::assemble_decl()
        ../../gcc/gcc/gcc/varpool.cc:564
0x1340d43 symbol_table::output_variables()
        ../../gcc/gcc/gcc/varpool.cc:764
0xb45f2f symbol_table::compile()
        ../../gcc/gcc/gcc/cgraphunit.cc:2421
0xb48647 symbol_table::compile()
        ../../gcc/gcc/gcc/cgraphunit.cc:2329
0xb48647 symbol_table::finalize_compilation_unit()
        ../../gcc/gcc/gcc/cgraphunit.cc:2607
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.

It seems like something is assuming that the value fits in an HWI without
checking first.

Reply via email to