Bug 14816 - -fno-crossjumping not working for large code?
Summary: -fno-crossjumping not working for large code?
Status: RESOLVED DUPLICATE of bug 8092
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.4.0
: P2 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-02 00:25 UTC by Michal Janeczek
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Janeczek 2004-04-02 00:25:27 UTC
I'm not sure if it really belongs here, but I hope it won't hurt..

I am working on kind-of interpreter, which consists of series of indirect branches:

label1:
    ...
    goto *ip;
    ...
labelN:
    ...
    goto *ip;

After optimization it is translated to more-or-less assembly equivalent of:

label0:
    goto *ip;
label1:
    ...
    goto label0;
    ...
labelN:
    ...
    goto label0;

That layout is hurting branch prediction, so I tried to disable it with
-fno-crossjumping, which I believe is responsible for this optimization.

For small code [tens of cases] it worked, but for larger one [hundreds] the
compiler still performed that optimization.

For comparison I ran GCC 3.3 with:
--param max-crossjump-edges=400 -fno-crossjumping
and it worked as expected.
[with default values it didn't link indirect branches in the larger case anyway]
Comment 1 Andrew Pinski 2004-04-02 00:36:15 UTC
Not a bug, see PR8092.

*** This bug has been marked as a duplicate of 8092 ***