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: [Fixed-point] Bug in interpret_fixed ?


Hi sir,

  Thanks a lot!

2007-01-31  Chao-ying Fu  <fu@mips.com>

    * c-lex.c (interpret_fixed): Fix a bug of copylen for unsigned accum
    types.

Regards,
Chao-ying

Index: c-lex.c
===================================================================
--- c-lex.c     (revision 121327)
+++ c-lex.c     (working copy)
@@ -769,22 +769,22 @@
          if ((flags & CPP_N_WIDTH) == CPP_N_LARGE)
            {
              type = unsigned_long_long_accum_type_node;
-             copylen -= 3;
+             copylen -= 4;
            }
          else if ((flags & CPP_N_WIDTH) == CPP_N_MEDIUM)
            {
              type = unsigned_long_accum_type_node;
-             copylen -= 2;
+             copylen -= 3;
            }
          else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL)
            {
              type = unsigned_short_accum_type_node;
-             copylen -= 2;
+             copylen -= 3;
             }
          else
            {
              type = unsigned_accum_type_node;
-             copylen --;
+             copylen -= 2;
            }
        }
       else /* Signed _Accum.  */





----- Original Message ----- 
From: "Mohamed Shafi" <shafitvm@gmail.com>
To: <gcc-patches@gcc.gnu.org>
Cc: "Chao-ying Fu" <fu@mips.com>
Sent: Wednesday, January 31, 2007 5:48 AM
Subject: [Fixed-point] Bug in interpret_fixed ?


> Hello,
>
> Is the variable "copylen", in the function interpret_fixed in c-lex.c,
> updated properly for accum data types?
>
> Here is the relevant portion.of the file(for unsigned accum)
>
http://gcc.gnu.org/viewcvs/branches/fixed-point/gcc/c-lex.c?revision=118838&view=markup
>
>
>   if ((flags & CPP_N_WIDTH) == CPP_N_LARGE)
>     {
>       type = unsigned_long_long_accum_type_node;
>       copylen -= 3;
>     }
>   else if ((flags & CPP_N_WIDTH) == CPP_N_MEDIUM)
>     {
>       type = unsigned_long_accum_type_node;
>       copylen -= 2;
>     }
>   else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL)
>     {
>       type = unsigned_short_accum_type_node;
>       copylen -= 2;
>      }
>   else
>     {
>       type = unsigned_accum_type_node;
>       copylen --;
>     }
>
>
> Regards,
> Shafi
>


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