diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-12-10 12:20:20 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-12-10 12:20:20 +0000 |
commit | b78d005e8fa47fd698f103ee62d145c01f05de38 (patch) | |
tree | 3879ac00fe2d6d250b7ad1fd0747b798bc8b8195 /gcc | |
parent | b78500ecb86ef800509270d2d2f161e4eb9aadd0 (diff) | |
download | gcc-b78d005e8fa47fd698f103ee62d145c01f05de38.zip gcc-b78d005e8fa47fd698f103ee62d145c01f05de38.tar.gz gcc-b78d005e8fa47fd698f103ee62d145c01f05de38.tar.bz2 |
Make dwarf2out punt for MODE_VECTOR_BOOL
The dwarf2 handling of vector constants currently divides the vector
into a length (number of elements) and byte element size. This doesn't
work well for MODE_VECTOR_BOOL, where several elements are packed into
the same byte.
We should probably add a way of encoding this in future, but for now
the safest thing is to punt, like we already do for variable-length
vectors.
2019-12-10 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* dwarf2out.c (loc_descriptor): Punt for MODE_VECTOR_BOOL.
(add_const_value_attribute): Likewise.
gcc/testsuite/
* gcc.target/aarch64/sve/acle/general/debug_4.c: New test.
From-SVN: r279165
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/aarch64/sve/acle/general/debug_4.c | 16 |
4 files changed, 37 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ffc2d26..ed569e4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2019-12-10 Richard Sandiford <richard.sandiford@arm.com> + * dwarf2out.c (loc_descriptor): Punt for MODE_VECTOR_BOOL. + (add_const_value_attribute): Likewise. + +2019-12-10 Richard Sandiford <richard.sandiford@arm.com> + * tree-vect-loop.c (vect_create_epilog_for_reduction): When handling direct_slp_reduc, allow the PHI arguments to have a different type from the vector elements. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 6fb345b..ff55e39 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -16763,7 +16763,12 @@ loc_descriptor (rtx rtl, machine_mode mode, if (mode == VOIDmode) mode = GET_MODE (rtl); - if (mode != VOIDmode && (dwarf_version >= 4 || !dwarf_strict)) + if (mode != VOIDmode + /* The combination of a length and byte elt_size doesn't extend + naturally to boolean vectors, where several elements are packed + into the same byte. */ + && GET_MODE_CLASS (mode) != MODE_VECTOR_BOOL + && (dwarf_version >= 4 || !dwarf_strict)) { unsigned int length; if (!CONST_VECTOR_NUNITS (rtl).is_constant (&length)) @@ -19622,6 +19627,12 @@ add_const_value_attribute (dw_die_ref die, rtx rtl) return false; machine_mode mode = GET_MODE (rtl); + /* The combination of a length and byte elt_size doesn't extend + naturally to boolean vectors, where several elements are packed + into the same byte. */ + if (GET_MODE_CLASS (mode) == MODE_VECTOR_BOOL) + return false; + unsigned int elt_size = GET_MODE_UNIT_SIZE (mode); unsigned char *array = ggc_vec_alloc<unsigned char> (length * elt_size); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5020620..389fb25 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2019-12-10 Richard Sandiford <richard.sandiford@arm.com> + * gcc.target/aarch64/sve/acle/general/debug_4.c: New test. + +2019-12-10 Richard Sandiford <richard.sandiford@arm.com> + * gcc.target/aarch64/sve/clastb_9.c: New test. 2019-12-10 Tobias Burnus <tobias@codesourcery.com> diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/debug_4.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/debug_4.c new file mode 100644 index 0000000..5707cc2 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/debug_4.c @@ -0,0 +1,16 @@ +/* { dg-options "-O -g -msve-vector-bits=512" } */ + +#include <arm_sve.h> + +void __attribute__((noipa)) +g (volatile int *x, svbool_t pg) +{ + *x = 1; +} + +void +f (volatile int *x) +{ + svbool_t pg = svorr_z (svpfalse (), svpfalse (), svpfalse ()); + g (x, pg); +} |