2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-04-18 05:40:23 +08:00

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
This commit is contained in:
Geoffrey Keating 2003-09-23 21:37:32 +00:00 committed by Geoffrey Keating
parent e5f1132858
commit fff2cb99c9
4 changed files with 24 additions and 2 deletions
gcc
ChangeLog
config/rs6000
testsuite

@ -1,3 +1,9 @@
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>
* config.gcc: Set use_fixproto=no in each specific *-gnu*

@ -3977,7 +3977,7 @@ function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
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
@ -4206,7 +4206,7 @@ rs6000_va_arg (tree valist, tree type)
if (DEFAULT_ABI != ABI_V4)
{
/* 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);

@ -1,3 +1,7 @@
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>
PR target/12281

@ -0,0 +1,12 @@
/* { 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);
}