public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* middle-end/9759: Combine cannot do its job due to arithmetic expression evaluation order
@ 2003-02-19 17:06 lac
  0 siblings, 0 replies; only message in thread
From: lac @ 2003-02-19 17:06 UTC (permalink / raw)
  To: gcc-gnats

[-- 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==


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-19 17:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-19 17:06 middle-end/9759: Combine cannot do its job due to arithmetic expression evaluation order lac

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).