public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-9722] middle-end/110182 - TYPE_PRECISION on VECTOR_TYPE causes wrong-code Date: Fri, 23 Jun 2023 11:30:20 +0000 (GMT) [thread overview] Message-ID: <20230623113020.DE8DE3858D20@sourceware.org> (raw) https://gcc.gnu.org/g:f06f1b4102b1c6965ad6b1da0094d6de5c3a2940 commit r12-9722-gf06f1b4102b1c6965ad6b1da0094d6de5c3a2940 Author: Richard Biener <rguenther@suse.de> Date: Fri Jun 9 09:29:09 2023 +0200 middle-end/110182 - TYPE_PRECISION on VECTOR_TYPE causes wrong-code When folding two conversions in a row we use TYPE_PRECISION but that's invalid for VECTOR_TYPE. The following fixes this by using element_precision instead. PR middle-end/110182 * match.pd (two conversions in a row): Use element_precision to DTRT for VECTOR_TYPE. (cherry picked from commit 3e12669a0eb968cfcbe9242b382fd8020935edf8) Diff: --- gcc/match.pd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/match.pd b/gcc/match.pd index 70b85b965b9..f2828006fd6 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -3711,19 +3711,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) int inside_ptr = POINTER_TYPE_P (inside_type); int inside_float = FLOAT_TYPE_P (inside_type); int inside_vec = VECTOR_TYPE_P (inside_type); - unsigned int inside_prec = TYPE_PRECISION (inside_type); + unsigned int inside_prec = element_precision (inside_type); int inside_unsignedp = TYPE_UNSIGNED (inside_type); int inter_int = INTEGRAL_TYPE_P (inter_type); int inter_ptr = POINTER_TYPE_P (inter_type); int inter_float = FLOAT_TYPE_P (inter_type); int inter_vec = VECTOR_TYPE_P (inter_type); - unsigned int inter_prec = TYPE_PRECISION (inter_type); + unsigned int inter_prec = element_precision (inter_type); int inter_unsignedp = TYPE_UNSIGNED (inter_type); int final_int = INTEGRAL_TYPE_P (type); int final_ptr = POINTER_TYPE_P (type); int final_float = FLOAT_TYPE_P (type); int final_vec = VECTOR_TYPE_P (type); - unsigned int final_prec = TYPE_PRECISION (type); + unsigned int final_prec = element_precision (type); int final_unsignedp = TYPE_UNSIGNED (type); } (switch
reply other threads:[~2023-06-23 11:30 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230623113020.DE8DE3858D20@sourceware.org \ --to=rguenth@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).