This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes.
- From: "hubicka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 9 Jan 2011 18:22:04 +0000
- Subject: [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes.
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237
Summary: builtin_apply_args broken WRT local API changes.
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: hubicka@gcc.gnu.org
#define INTEGER_ARG 5
extern void abort(void);
static void foo(int arg)
{
if (arg != INTEGER_ARG)
abort();
}
static void bar(int arg)
{
foo(arg);
__builtin_apply(foo, __builtin_apply_args(), 16);
}
int main(void)
{
bar(INTEGER_ARG);
return 0;
}
fails at 32bit. The problem is that we call bar with register calling
conventions, while foo's calling conventions are default.
We must prevent any call conventions changes on functions calling
builtlin_apply.
This is not only case where builtin_apply_args breaks, since we will happily
clone the functions, too.
I guess in addition to inlinable and cloning flag, we need flag whether
function calling convention can change. In what conditions this is false in
addition to apply_args?
This bug probably exists since GCC 3.4. I tested 4.3 and 4.5 to fail.