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]

Re: [arm, patch] Remove redundant promotion of function arguments


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


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