#pragma noinline not working as expected
|
|
Bugzilla Link |
1175 |
Created on |
Nov 23, 2015 23:54 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Extended Description
Given a function id():
int[*] id(int[*] a)
{ return a; }
#pragma noinline
Using `#pragma noinline' to prevent any inlining (via AINL) does not have the
intended effect - id() is selected for inlining.
Tracing though the compilations steps, the issue arises from libsac2c/scanparse/resolvepragma.c where the traversal (called RSP) does *not* traverse into ordinary N_fundef, only those linked to MODULE_FUNDECS, which means that the pragma is never resolved and the FUNDEF_NOINLINE flag is never set.
Looking through the RSP reversal, it becomes clear that it is only designed to handle external declarations, with asserts existing within RSPfundef() to ensure that only fundefs with ISEXTERN are traversed/modified.
My questions is, why are the pragmas of external declarations only 'resolved' and not all function declarations?