[Bug target/111733] Emit inline SVE FSCALE instruction for ldexp

2024-11-12 Thread soumyaa at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111733

Soumya AR  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED
   Target Milestone|--- |15.0

--- Comment #5 from Soumya AR  ---
Fixed with https://gcc.gnu.org/g:9b2915d95d855333d4d8f66b71a75f653ee0d076

[Bug middle-end/118377] New: [15 Regression] ICE when using C division operator with svint8 and svint16

2025-01-08 Thread soumyaa at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118377

Bug ID: 118377
   Summary: [15 Regression] ICE when using C division operator
with svint8 and svint16
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: soumyaa at gcc dot gnu.org
  Target Milestone: ---

When using the C division operator with svint8 and svint16 SVE ACLE vectors,
the following ICE occurs:

during GIMPLE pass: veclower
test.c: In function ‘foo’:
test.c:4:1: internal compiler error: in to_constant, at poly-int.h:592
4 | foo (svint16_t x)
  | ^~~
0x2366fab internal_error(char const*, ...)
../../gcc_src/gcc/diagnostic-global-context.cc:517
0x81b1b3 fancy_abort(char const*, int, char const*)
../../gcc_src/gcc/diagnostic.cc:1722
0x80902f poly_int<2u, unsigned long>::to_constant() const
../../gcc_src/gcc/poly-int.h:592
0x130096b poly_int<2u, unsigned long>::to_constant() const
../../gcc_src/gcc/poly-int.h:590
0x130096b nunits_for_known_piecewise_op
../../gcc_src/gcc/tree-vect-generic.cc:92
0x130096b expand_vector_piecewise
../../gcc_src/gcc/tree-vect-generic.cc:294
0x130152b expand_vector_operation
../../gcc_src/gcc/tree-vect-generic.cc:1159
0x130400b expand_vector_operations_1
../../gcc_src/gcc/tree-vect-generic.cc:2243
0x1305e33 expand_vector_operations
../../gcc_src/gcc/tree-vect-generic.cc:2274
0x1305e33 execute
../../gcc_src/gcc/tree-vect-generic.cc:2326

Testcase (compiled with -mcpu=neoverse-v2):

#include 

svint16_t
foo (svint16_t x)
{
  return x / 4;
}

This most likely happens because SVE integer division using SDIV/UDIV is only
supported for 32-bit and 64-bit modes, and the middle-end does not have a
proper fallback if any other types are forced.

[Bug target/118377] ICE when using C division operator with svint8 and svint16

2025-01-13 Thread soumyaa at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118377

--- Comment #2 from Soumya AR  ---
Related: Using the C division operator with svfloat ICEs with g++ but not gcc.

Testcase:

#include 

svfloat16_t foo(svfloat16_t x) { return x / 4; }

Backtrace:

test2.cpp: In function ‘svfloat16_t foo(svfloat16_t)’:
test2.cpp:12:14: sorry, unimplemented: unexpected AST of kind
vec_duplicate_expr
   12 |   return x / 4;
  |  ^
test2.cpp:12:14: internal compiler error: in potential_constant_expression_1,
at cp/constexpr.cc:10763
0x2687e7b internal_error(char const*, ...)
../../gcc_src/gcc/diagnostic-global-context.cc:517
0x84b19f fancy_abort(char const*, int, char const*)
../../gcc_src/gcc/diagnostic.cc:1722
0x8db7bf potential_constant_expression_1
../../gcc_src/gcc/cp/constexpr.cc:10763
0x8dc10b potential_constant_expression_1(tree_node*, bool, bool, bool, bool,
int)
../../gcc_src/gcc/cp/constexpr.cc:10786
0x8dc10b is_constant_expression(tree_node*)
../../gcc_src/gcc/cp/constexpr.cc:10860
0x8dc10b is_nondependent_constant_expression(tree_node*)
../../gcc_src/gcc/cp/constexpr.cc:10904
0x8dd933 maybe_constant_value(tree_node*, tree_node*, mce_value)
../../gcc_src/gcc/cp/constexpr.cc:9243
0x9b59ab fold_for_warn(tree_node*)
../../gcc_src/gcc/cp/expr.cc:419
0xbf8f77 cp_build_binary_op(op_location_t const&, tree_code, tree_node*,
tree_node*, int)
../../gcc_src/gcc/cp/typeck.cc:5601
0x888deb build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
../../gcc_src/gcc/cp/call.cc:7568
0xbe3d13 build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node*, tree_node**, int)
../../gcc_src/gcc/cp/typeck.cc:4794
0xa86cff cp_parser_binary_expression
../../gcc_src/gcc/cp/parser.cc:10818
0xa87e53 cp_parser_assignment_expression
../../gcc_src/gcc/cp/parser.cc:10979
0xa883e3 cp_parser_expression
../../gcc_src/gcc/cp/parser.cc:11162
0xa9ad8f cp_parser_jump_statement
../../gcc_src/gcc/cp/parser.cc:15179
0xa9ad8f cp_parser_statement
../../gcc_src/gcc/cp/parser.cc:13000
0xa9df03 cp_parser_statement_seq_opt
../../gcc_src/gcc/cp/parser.cc:13697
0xa9e1c7 cp_parser_compound_statement
../../gcc_src/gcc/cp/parser.cc:13544
0xac96f3 cp_parser_function_body
../../gcc_src/gcc/cp/parser.cc:26495
0xac96f3 cp_parser_ctor_initializer_opt_and_function_body
../../gcc_src/gcc/cp/parser.cc:26546