Commit fff2cb99 by Geoffrey Keating Committed by Geoffrey Keating

rs6000.c (function_arg_pass_by_reference): Don't pass zero-size arrays by reference.

2003-09-23  Geoffrey Keating  <geoffk@apple.com>

	* config/rs6000/rs6000.c (function_arg_pass_by_reference): Don't
	pass zero-size arrays by reference.
	(rs6000_va_arg): Likewise.

2003-09-23  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/darwin-abi-1.c: New file.

From-SVN: r71698
parent e5f11328
2003-09-23 Geoffrey Keating <geoffk@apple.com>
* config/rs6000/rs6000.c (function_arg_pass_by_reference): Don't
pass zero-size arrays by reference.
(rs6000_va_arg): Likewise.
2003-09-23 Nathanael Nerode <neroden@gcc.gnu.org> 2003-09-23 Nathanael Nerode <neroden@gcc.gnu.org>
* config.gcc: Set use_fixproto=no in each specific *-gnu* * config.gcc: Set use_fixproto=no in each specific *-gnu*
......
...@@ -3977,7 +3977,7 @@ function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, ...@@ -3977,7 +3977,7 @@ function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
return 1; return 1;
} }
return type && int_size_in_bytes (type) <= 0; return type && int_size_in_bytes (type) < 0;
} }
/* Perform any needed actions needed for a function that is receiving a /* Perform any needed actions needed for a function that is receiving a
...@@ -4206,7 +4206,7 @@ rs6000_va_arg (tree valist, tree type) ...@@ -4206,7 +4206,7 @@ rs6000_va_arg (tree valist, tree type)
if (DEFAULT_ABI != ABI_V4) if (DEFAULT_ABI != ABI_V4)
{ {
/* Variable sized types are passed by reference. */ /* Variable sized types are passed by reference. */
if (int_size_in_bytes (type) <= 0) if (int_size_in_bytes (type) < 0)
{ {
u = build_pointer_type (type); u = build_pointer_type (type);
......
2003-09-23 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/darwin-abi-1.c: New file.
2003-09-21 Andrew Pinski <pinskia@physics.uc.edu> 2003-09-21 Andrew Pinski <pinskia@physics.uc.edu>
PR target/12281 PR target/12281
......
/* { dg-do compile { target powerpc*-*-darwin* } } */
/* { dg-options "-O" } */
/* { dg-final { scan-assembler "li r3,12345\n\tbl " } } */
/* Check that zero-size structures don't affect parameter passing. */
struct empty { };
extern void foo (struct empty e, int a);
void bar (void) {
struct empty e;
foo (e, 12345);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment