This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Committed, MMIX: Fix target/18321. Suggest cfun->outgoing_args_sizebe HOST_WIDE_INT.


Looking in the vicinity of this bug, it seems GCC doesn't currently handle
functions with outgoing arguments (calls) that are larger than what fits
in an int on the host: typeof (cfun->outgoing_args_size) is int.  IIRC
that's the size for the actual ABI (i.e. after by-reference
adjustment), so likely not a problem for targets with remotely sane ABI's
and when a sane number of parameters is used.  A test-case would then have
to use more parameters than likely compilable with 32-bit hosts or less than
N*4GiB swap, where N is in the order of sizeof (tree)!

That's also not the problem in this PR, but that "int offset" was updated
with "HOST_WIDE_INT locals_size", next to the removed empty line.  As
noted in the PR, gcc-3.2 gave an error rather than an ICE, so I can call
this a regression (whew! ;-) With this patch, no regressions cross from
i686-pc-linux-gnu (FC2) to mmix-knuth-mmixware.

	PR target/18321
	* config/mmix/mmix.c (mmix_expand_epilogue): Change type of
	variable offset to HOST_WIDE_INT.  Remove obsolete comment.  Fix
	spacing.

Index: mmix.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.c,v
retrieving revision 1.72
diff -p -c -r1.72 mmix.c
*** mmix.c	13 Nov 2004 19:52:55 -0000	1.72
--- mmix.c	28 Dec 2004 18:56:45 -0000
*************** mmix_expand_epilogue (void)
*** 2093,2103 ****
         + current_function_pretend_args_size
         + locals_size + 7) & ~7;

-   /* The assumption that locals_size fits in an int is asserted in
-      mmix_expand_prologue.  */
-
    /* The first address to access is beyond the outgoing_args area.  */
!   int offset = current_function_outgoing_args_size;

    /* Add the space for global non-register-stack registers.
       It is assumed that the frame-pointer register can be one of these
--- 2093,2100 ----
         + current_function_pretend_args_size
         + locals_size + 7) & ~7;

    /* The first address to access is beyond the outgoing_args area.  */
!   HOST_WIDE_INT offset = current_function_outgoing_args_size;

    /* Add the space for global non-register-stack registers.
       It is assumed that the frame-pointer register can be one of these
*************** mmix_expand_epilogue (void)
*** 2156,2162 ****
       might be of an unaligned size.  */
    offset += (locals_size + 7) & ~7;

-
    /* The saved register stack pointer is just below the frame-pointer
       register.  We don't need to restore it "manually"; the POP
       instruction does that.  */
--- 2153,2158 ----

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]