This is the mail archive of the gcc@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]

Re: A bug in mark_constants () in varasm.c


> 
> Hi,
> 
> I really do appreciate all your efforts into making gcc such a lovely
> compiler, but I do think you need to follow some better programing 
> style guidelines.
> 
> Linus Torvalds requires that all code in the source is using a tab
> length of 8 spaces, and he also states that you are a bad programmer
> if you write code with more than 3 indentation levels.
> 
> This has caused the code to be fairly easy to read and maintainance is
> pretty straight forward.
> 
> When I see patches like this I frown. 
> 	
> 	DISABLE THE COPY & PASTE FUNCTIONS IN YOUR EDITOR!
> 
> Instead of making duplicate code in two places, make a function out of
> it. How hard is that?
> 
> static void 
> erase_reg_from_regstack(int regno, regstack_t regstack, int top)
> {
>     if (regstack->reg [top] != regno)
>       {
>          int i;
>          if (! have_cmove)
>            abort ();
>          for (i = regstack->top; i >= 0; i--)
>            if (regstack->reg [i] == regno)
>              {
>                int j;
>                for (j = i; j < top; j++)
>                  regstack->reg [j] = regstack->reg [j + 1];
>                break;
>              }
>       }
> }
> 
> I don't know what type regstack is, so please bear with me.
> 

Done by Stan.

-- 
H.J. Lu (hjl@gnu.org)


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