[arm, patch] Remove redundant promotion of function arguments
Mark Mitchell
mark@codesourcery.com
Thu Apr 8 16:44:00 GMT 2004
Paul Brook wrote:
>Tested on sparc-sun-solaris2.8/-m64 and cross-compiler to arm-none-elf, and by
>manually inspecting the generated assembly for the examples given previously
>in this thread.
>
>Ok?
>
>
This is OK for the mainline, modulo Eric's comments about ChangeLog typos.
This hunk:
> enum machine_mode
> promote_mode (tree type, enum machine_mode mode, int *punsignedp,
> int for_call ATTRIBUTE_UNUSED)
>@@ -806,17 +810,28 @@ promote_mode (tree type, enum machine_mo
> enum tree_code code = TREE_CODE (type);
> int unsignedp = *punsignedp;
>
>-#ifdef PROMOTE_FOR_CALL_ONLY
>+#ifndef PROMOTE_MODE
> if (! for_call)
> return mode;
> #endif
>
> switch (code)
> {
>-#ifdef PROMOTE_MODE
>+#ifdef PROMOTE_FUNCTION_MODE
> case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE:
> case CHAR_TYPE: case REAL_TYPE: case OFFSET_TYPE:
>- PROMOTE_MODE (mode, unsignedp, type);
>+#ifdef PROMOTE_MODE
>+ if (for_call)
>+ {
>+#endif
>+ PROMOTE_FUNCTION_MODE (mode, unsignedp, type);
>+#ifdef PROMOTE_MODE
>+ }
>+ else
>+ {
>+ PROMOTE_MODE (mode, unsignedp, type);
>+ }
>+#endif
> break;
> #endif
>
>
made my brain hurt a little. I was wondering if the first "#ifndef
PROMOTE_MODE" should be "if !defined(PROMOTE_MODE) &&
!defined(PROMOTE_FUNCTION_MODE)" -- but I guess it's correct the way it is.
Thanks,
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com
More information about the Gcc-patches
mailing list