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: Fix stupid error in my last change to highest_pow2_factor


Richard Kenner wrote:
> I'm quite amazed something like this didn't cause any problems in the
> testsuite ...

According to http://gcc.gnu.org/codingconventions.html,
   "Every bug fixed should have a testcase to detect if the bug recurs."

Why not add a testcase that would have caught whatever this wasn't doing
right (which you didn't describe according to gcc.gnu.org/contribute.html)
or how you tested it (also a requirement in that same document)?

RJL




> 
> Sun Dec 16 13:13:01 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
> 
> 	* expr.c (highest_pow2_factor, case INTEGER_CST): Fix error in
> 	last change.
> 
> *** expr.c	2001/12/15 13:37:16	1.400
> --- expr.c	2001/12/16 18:18:04
> *************** highest_pow2_factor (exp)
> *** 5805,5809 ****
>   	{
>   	  c0 = tree_low_cst (exp, 0);
> ! 	  return c0 < 0 ? - c0 : c0;
>   	}
>         break;
> --- 5805,5810 ----
>   	{
>   	  c0 = tree_low_cst (exp, 0);
> ! 	  c0 = c0 < 0 ? - c0 : c0;
> ! 	  return c0 & -c0;
>   	}
>         break;


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