]> gcc.gnu.org Git - gcc.git/commit
d: Fix ICE: verify_gimple_failed (conversion of register to a different size in ...
authorIain Buclaw <ibuclaw@gdcproject.org>
Sun, 29 Oct 2023 19:13:14 +0000 (20:13 +0100)
committerIain Buclaw <ibuclaw@gdcproject.org>
Sun, 29 Oct 2023 19:22:45 +0000 (20:22 +0100)
commit46024d05a2cbbc1c2397e5728a98f90449b20ca4
treefb89403282f09485cb07d2e3e2dac939e0fadddd
parentfe1dcd6da5c9259be889354fc69121ba5aaa374c
d: Fix ICE: verify_gimple_failed (conversion of register to a different size in 'view_convert_expr')

Static arrays in D are passed around by value, rather than decaying to a
pointer.  On x86_64 __builtin_va_list is an exception to this rule, but
semantically it's still treated as a static array.

This makes certain assignment operations fail due a mismatch in types.
As all examples in the test program are rejected by C/C++ front-ends,
these are now errors in D too to be consistent.

PR d/110712

gcc/d/ChangeLog:

* d-codegen.cc (d_build_call): Update call to convert_for_argument.
* d-convert.cc (is_valist_parameter_type): New function.
(check_valist_conversion): New function.
(convert_for_assignment): Update signature.  Add check whether
assigning va_list is permissible.
(convert_for_argument): Likewise.
* d-tree.h (convert_for_assignment): Update signature.
(convert_for_argument): Likewise.
* expr.cc (ExprVisitor::visit (AssignExp *)): Update call to
convert_for_assignment.

gcc/testsuite/ChangeLog:

* gdc.dg/pr110712.d: New test.

(cherry picked from commit ea8ffdcadb388b531adf4772287e7987a82a84b7)
gcc/d/d-codegen.cc
gcc/d/d-convert.cc
gcc/d/d-tree.h
gcc/d/expr.cc
gcc/testsuite/gdc.dg/pr110712.d [new file with mode: 0644]
This page took 0.0676870000000001 seconds and 6 git commands to generate.