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 r13-7439] middle-end/110200 - genmatch force-leaf and convert interaction Date: Mon, 12 Jun 2023 09:02:51 +0000 (GMT) [thread overview] Message-ID: <20230612090251.764C0385841A@sourceware.org> (raw) https://gcc.gnu.org/g:73ae34bb693038829c05bed30d7ac623e67bde2e commit r13-7439-g73ae34bb693038829c05bed30d7ac623e67bde2e Author: Richard Biener <rguenther@suse.de> Date: Mon Jun 12 10:17:26 2023 +0200 middle-end/110200 - genmatch force-leaf and convert interaction The following fixes code GENERIC generation for (convert! ...) which currently generates if (TREE_TYPE (_o1[0]) != type) _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]); if (EXPR_P (_r1)) goto next_after_fail867; else _r1 = _o1[0]; where obviously braces are missing. PR middle-end/110200 * genmatch.cc (expr::gen_transform): Put braces around the if arm for the (convert ...) short-cut. (cherry picked from commit 820d1aec89c43dbbc70d3d0b888201878388454c) Diff: --- gcc/genmatch.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc index 4fab4135347..98b429a9d0b 100644 --- a/gcc/genmatch.cc +++ b/gcc/genmatch.cc @@ -2568,7 +2568,8 @@ expr::gen_transform (FILE *f, int indent, const char *dest, bool gimple, { fprintf_indent (f, indent, "if (TREE_TYPE (_o%d[0]) != %s)\n", depth, type); - indent += 2; + fprintf_indent (f, indent + 2, "{\n"); + indent += 4; } if (opr->kind == id_base::CODE) fprintf_indent (f, indent, "_r%d = fold_build%d_loc (loc, %s, %s", @@ -2591,7 +2592,8 @@ expr::gen_transform (FILE *f, int indent, const char *dest, bool gimple, } if (*opr == CONVERT_EXPR) { - indent -= 2; + fprintf_indent (f, indent - 2, "}\n"); + indent -= 4; fprintf_indent (f, indent, "else\n"); fprintf_indent (f, indent, " _r%d = _o%d[0];\n", depth, depth); }
reply other threads:[~2023-06-12 9:02 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=20230612090251.764C0385841A@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).