This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

middle-end/9759: Combine cannot do its job due to arithmetic expression evaluation order


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]