public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/97960] [8/9/10/11 Regression] Wrong code at -O3 since r8-6511-g3ae129323d Date: Tue, 24 Nov 2020 15:12:31 +0000 [thread overview] Message-ID: <bug-97960-4-AK9RrT7gri@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-97960-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97960 --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- Creating dr for b[_7] base_address: &b offset from base address: (ssizetype) ((sizetype) (signed char) _5 * 4) constant offset from base address: -1012 step: 4 base alignment: 32 base misalignment: 0 offset alignment: 4 step alignment: 4 base_object: b Access function 0: {(int) h_20, +, 1}_2 looks like the wrong sign for the constant offset. #0 split_constant_offset_1 (type=<integer_type 0x7ffff68252a0 signed char>, op0=<ssa_name 0x7ffff6816f78 6>, code=NOP_EXPR, op1=<tree 0x0>, var=0x7fffffffba10, off=0x7fffffffba08, cache=..., limit=0x7fffffffc19c) now, var_min/max is UNSIGNED -3 / -1 (precision 8), woff is 3 we compute -3 + 3 == 0 and overflow to true (UNSIGNED arithmetic) _5 = (unsigned char) _35; _6 = _5 + 3; h_20 = (signed char) _6; but then we continue with /* Calculate (ssizetype) OP0 - (ssizetype) TMP_VAR. */ widest_int diff = (widest_int::from (op0_min, sgn) - widest_int::from (var_min, sgn)); getting -253. I remember this place has changed quite some times and wide (sign-extended) vs. widest (signed) ints do not make it easier to see what's correct ... I'm defering to Richard here. The C testcase trips at this point just twice (ldist and vectorizer) so it's easy enough to 'catch' in a debugger.
next prev parent reply other threads:[~2020-11-24 15:12 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-11-23 17:13 [Bug tree-optimization/97960] New: " acoplan at gcc dot gnu.org 2020-11-23 17:53 ` [Bug tree-optimization/97960] " acoplan at gcc dot gnu.org 2020-11-23 17:55 ` marxin at gcc dot gnu.org 2020-11-24 8:20 ` rguenth at gcc dot gnu.org 2020-11-24 15:12 ` rguenth at gcc dot gnu.org [this message] 2020-11-24 15:29 ` rsandifo at gcc dot gnu.org 2021-01-21 11:59 ` jakub at gcc dot gnu.org 2021-01-22 8:01 ` rguenth at gcc dot gnu.org 2021-01-22 9:27 ` acoplan at gcc dot gnu.org 2021-02-01 16:53 ` jakub at gcc dot gnu.org 2021-02-02 9:03 ` cvs-commit at gcc dot gnu.org 2021-02-02 9:35 ` [Bug tree-optimization/97960] [8/9/10 " jakub at gcc dot gnu.org 2021-04-22 13:27 ` rsandifo at gcc dot gnu.org 2021-04-23 9:21 ` rsandifo 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-97960-4-AK9RrT7gri@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).