public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: lac@rgai.hu
To: gcc-gnats@gcc.gnu.org
Subject: middle-end/9759: Combine cannot do its job due to arithmetic expression evaluation order
Date: Wed, 19 Feb 2003 17:06:00 -0000	[thread overview]
Message-ID: <20030219165833.9825.qmail@sources.redhat.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2317 bytes --]


>Number:         9759
>Category:       middle-end
>Synopsis:       Combine cannot do its job due to arithmetic expression evaluation order
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          pessimizes-code
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 19 17:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     László Vidács
>Release:        gcc version 3.3 20030217 (prerelease)
>Organization:
>Environment:
BUILD & HOST: Linux 2.4.20 i686 unknown
TARGET: arm-unknown-elf
>Description:
Combine cannot combine a shift and arithmetic insn into one insn in ARM target, because there is a function call between them. Intelligent change in the evaluation order would enable Combine algorithm to produce better code.

In the example the ior expression has two operands (shift expr. and function call).
>How-To-Repeat:
gcc -Os -S 01.c

// 01.c

int func2(int d)
{
  return 12*d;
}
int func(int d)
{
  return 23*func2(d);
}
int main()
{
    int u;
        u = 0;
        u = (u << 8) | func(7);
        u = (u << 8) | func(8);
    return u;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-gzip; name="combine-shift.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="combine-shift.tar.gz"

H4sIAPy2Uz4AA+2WXWvbMBSGc+tA/sNZwiApqZFkNy5tNwa96F3vdl2UWA5itmwku6zr+t8n+bNp
sxbGkl3sPBAsHb2W5Nc5OibUl6MDQyghqxUZEUJodBa6K6Fhc3WE7GxEohULoyBgUeT0oZUBOfTG
HJUpuQYYbYUu8+z3Op6KzTH2c2RmQGFKqL+ZTsZ1+2pdybQ8lepzH9nkWcZVDKlUoo+290hVQlKp
DZu7VryYjB8nYwAtykoroOwkvpyMnwbdXhkLTpo54sWgzrhU804I4ELVZdN2VPAJyIv+vIKrKzhf
wM9mrWjxjuC8E7QbqZrl//VLOSL2NZrDr/Fm/jNCuvxnZyQgdf6HK8z/Y+D5iUyF16Wz55fie+mu
PJVb5THX3Kb5mqdenaK15KEQTW8JH921lLmajOvIhRV8Aa63xuXnEgqbWcKeHXUn0TwTrlmL6t6d
EiIW7XhlhLnjKlcPWV7ZVjtLrbaHzzebpltpSqHB8HsBIpWZVLwUsW8lPI49bSfpftykMKN2IMvv
vZ0gaybU0K6d5NruM0/zbSVafbFZWoF7WCN/9A/rn/Ye7Ldnx51X5vy5N/Qtb9x+ZbEEU9iOKbMk
9kzxYQmPiQ26gVTbtTZPbrRae110FtrAenittX/BHv+0WQ/GBu1AYAfSOBO8nq9eyhTdMoNpnWf7
LXNHfG+Z6+xY5gLHtkyHdtpXtnX/oFn0hoedLnROPb/p/PlI2PhXK4Ybc6374Z2bdbjrc7e/l143
5vmnnaMyFqr0pjfX1xcwv7n9uoDAD8CetAFhNIK59VGLVHAjFtP/qt4huxB6l+WxTKQ9RA/1IfBO
/adRRPr6TwNm9SxgFOv/McD6j/Uf6//B6/+eUk+Gr4HhEwFLPoIgCIIgCIIgCIIgCIIgCPJX+AXu
PFR5ACgAAA==


                 reply	other threads:[~2003-02-19 17:06 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=20030219165833.9825.qmail@sources.redhat.com \
    --to=lac@rgai.hu \
    --cc=gcc-gnats@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).