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/110702] [12/13/14 Regression] Wrong code at -O1 on x86_64-linux-gnu (regression since GCC-12.2)
Date: Thu, 03 Aug 2023 10:59:02 +0000	[thread overview]
Message-ID: <bug-110702-4-rPRHqQoN3f@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110702-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110702

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue for this seems to be that create_mem_ref gets

  type = unsigned long
  offset = 0
  elements = {
    [0] = &e *
0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd, 
    [1] = (sizetype) a.9_30 * 232, 
    [2] = ivtmp.28_44 * 4
  }

via get_computation_aff and addr_to_parts fills out no suitable symbol/base

$113 = {symbol = <tree 0x0>, base = <plus_expr 0x7ffff73b30f0>, 
  index = <nop_expr 0x7ffff73af9a0>, step = <integer_cst 0x7ffff71e4000>, 
  offset = <tree 0x0>}

so we hit

  else /* !POINTER_TYPE_P */
    {
      base = build_int_cst (build_pointer_type (type), 0);
      index2 = addr->base;

in create_mem_ref_raw.

But get_address_cost sees the address split as aff_inv

  type = unsigned long
  offset = 0
  elements = {
    [0] = &e *
0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd, 
    [1] = (sizetype) a.9_30 * 232
  }

and aff_var

  type = unsigned long
  offset = 0
  elements = {
    [0] = ivtmp.28 * 4
  }

and eventually ends up with parts

$108 = {symbol = <tree 0x0>, base = <integer_cst 0x7ffff71e4150>, 
  index = <integer_cst 0x7ffff71e4150>, step = <integer_cst 0x7ffff73b05e8>, 
  offset = <tree 0x0>}

so the address we cost is different from the address we eventually generate
(the address we cost doesn't contain all parts - we ignore aff_var).

  parent reply	other threads:[~2023-08-03 10:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 13:26 [Bug c/110702] New: " shaohua.li at inf dot ethz.ch
2023-07-17 18:39 ` [Bug c/110702] [12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-07-17 18:45 ` [Bug middle-end/110702] " pinskia at gcc dot gnu.org
2023-07-18 14:09 ` mikpelinux at gmail dot com
2023-07-30 14:57 ` shaohua.li at inf dot ethz.ch
2023-08-03  9:32 ` [Bug tree-optimization/110702] " rguenth at gcc dot gnu.org
2023-08-03 10:59 ` rguenth at gcc dot gnu.org [this message]
2023-08-03 12:22 ` cvs-commit at gcc dot gnu.org
2023-08-03 12:23 ` [Bug tree-optimization/110702] [12/13 " rguenth at gcc dot gnu.org
2023-08-24 10:56 ` cvs-commit at gcc dot gnu.org
2023-09-22  5:46 ` [Bug tree-optimization/110702] [12 " rguenth at gcc dot gnu.org
2023-11-27 11:35 ` cvs-commit at gcc dot gnu.org
2023-11-27 11:37 ` rguenth 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-110702-4-rPRHqQoN3f@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: link
Be 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).