#if HAVE_cmpstrnsi usage in builtins.c

Mike Stump mrs@apple.com
Thu Apr 6 20:02:00 GMT 2006


I encountered a bug in the compiler that caused a bootstrap failure  
for me due to a member reference in the expansion of optimize in some  
apple local code:

gcc/builtins.c:3679:5: error: token "." is not valid in preprocessor  
expressions

so, I checked the sources, and these can be complex, so they should  
do an #ifdef, not an #if, also this makes gcc consistent in how it  
checks these two, as there are other places that use #ifdef for them  
both.

I checked this in as obvious, let me know if you think you're  
reasonable and a maintainer and disagree.  :-)


2006-04-06  Mike Stump  <mrs@apple.com>

         * builtins.c (expand_builtin_longjmp):Use #ifdef instead of #if
         for HAVE_nonlocal_goto to be consistent.
         (expand_builtin_nonlocal_goto): Likewise.
         (expand_builtin_strcmp): Use #ifdef instead of #if
         for HAVE_cmpstrnsi to be consistent.

Doing diffs in .:
--- ./builtins.c.~1~    2006-04-04 13:45:16.000000000 -0700
+++ ./builtins.c        2006-04-06 12:29:58.000000000 -0700
@@ -793,7 +793,7 @@ expand_builtin_longjmp (rtx buf_addr, rt

        /* Pick up FP, label, and SP from the block and jump.  This  
code is
          from expand_goto in stmt.c; see there for detailed  
comments.  */
-#if HAVE_nonlocal_goto
+#ifdef HAVE_nonlocal_goto
        if (HAVE_nonlocal_goto)
         /* We have to pass a value to the nonlocal_goto pattern that  
will
            get copied into the static_chain pointer, but it does not  
matter
@@ -866,7 +866,7 @@ expand_builtin_nonlocal_goto (tree argli

    current_function_has_nonlocal_goto = 1;

-#if HAVE_nonlocal_goto
+#ifdef HAVE_nonlocal_goto
    /* ??? We no longer need to pass the static chain value, afaik.  */
    if (HAVE_nonlocal_goto)
      emit_insn (gen_nonlocal_goto (const0_rtx, r_label, r_sp, r_fp));
@@ -3676,7 +3676,7 @@ expand_builtin_strcmp (tree exp, rtx tar
                                GEN_INT (MIN (arg1_align, arg2_align)));
         }
#endif
-#if HAVE_cmpstrnsi
+#ifdef HAVE_cmpstrnsi
        /* Try to determine at least one length and call cmpstrnsi.  */
        if (!insn && HAVE_cmpstrnsi)
         {
--------------



More information about the Gcc-patches mailing list