public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101856] New: match_arith_overflow checks only mulv4_optab/umulv4_optab tables when smul_highpart_optab/umul_highpart_optab can produce decent code too Date: Wed, 11 Aug 2021 07:22:15 +0000 [thread overview] Message-ID: <bug-101856-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101856 Bug ID: 101856 Summary: match_arith_overflow checks only mulv4_optab/umulv4_optab tables when smul_highpart_optab/umul_highpart_optab can produce decent code too Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Target: aarch64-linux-gnu While looking at 30314, I Noticed aarch64 was not producing MUL_OVERFLOW for that test. I tested __builtin_umulll_overflow manually and got: umulh x8, x1, x0 cbz x8, Which is what I had expected. Original testcase: typedef __SIZE_TYPE__ size_t; extern void *malloc(size_t), abort(void); void *allocate(size_t num, size_t size) { size_t total = num * size; if (total / size != num) abort(); /* call malloc, whatever */ return 0; } The code does: || (code == MULT_EXPR && optab_handler (cast_stmt ? mulv4_optab : umulv4_optab, TYPE_MODE (type)) == CODE_FOR_nothing)) Oh it seems like there could be caching of reading optab_handler in match_arith_overflow too.
next reply other threads:[~2021-08-11 7:22 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-11 7:22 pinskia at gcc dot gnu.org [this message] 2022-12-25 5:19 ` [Bug tree-optimization/101856] " pinskia at gcc dot gnu.org 2023-05-18 10:10 ` jakub at gcc dot gnu.org 2023-05-19 10:59 ` cvs-commit at gcc dot gnu.org 2023-05-19 11:00 ` jakub at gcc dot gnu.org
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=bug-101856-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).