Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__builtin_apply does not pass args to called function correctly #98

Open
GoogleCodeExporter opened this issue May 5, 2016 · 4 comments

Comments

@GoogleCodeExporter
Copy link

probably need to do some magic to enforce SX calling convention.

affected testcases:

gcc.dg/builtin-apply2.c
gcc.dg/builtin-apply3.c
gcc.dg/builtin-apply4.c
gcc.dg/builtin-return-1.c

Original issue reported on code.google.com by [email protected] on 30 Jan 2009 at 10:04

@GoogleCodeExporter
Copy link
Author

also, this one is probably the root cause of failing 
gcc.dg/compat/struct-by-value-22
testcase.

Original comment by [email protected] on 5 Feb 2009 at 3:15

  • Added labels: Priority-Critical
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

struct-by-value-22 is a whole other problem.

Original comment by [email protected] on 6 Feb 2009 at 11:16

@GoogleCodeExporter
Copy link
Author

__builtin_apply() is seriously broken, and probably can not be fixed without 
patching
the the target-independent sources(gcc/builtins.c:expand_builtin_apply()).

perhaps wait for port to 4.4/4.5?

Original comment by [email protected] on 6 Feb 2009 at 4:24

  • Added labels: Priority-Low
  • Removed labels: Priority-Critical

@GoogleCodeExporter
Copy link
Author

the main problem with __builtin_apply() is that is subtracts the size of the
arguments passed to it from arg pointer:

#ifndef STACK_GROWS_DOWNWARD
  incoming_args = expand_simple_binop (Pmode, MINUS, incoming_args, argsize,
                       incoming_args, 0, OPTAB_LIB_WIDEN);
#endif

arg pointer, however, points to the bottom of the arguments already. similar 
occurs
when calculating dest address for outgoing arguments, a few lines onward.

Original comment by [email protected] on 9 Feb 2009 at 3:09

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant