This is all about dead code.
To avoid this change 'if' to:
        if(p>=cmd_buf+1)
                ...
or just do not write dead code :)

I have no idea why gcc pukes this code instead of stripping it down.

~d


On Monday 02 June 2003 19:12, Steve Underwood wrote:
> Daniel Néri wrote:
> >       Hello,
> >
> >
> >I have some code (preprocessed source attached below), that gives me
> >an ICE when compiled with optimisations enabled (either -O or -O2):
> >
> >    $ msp430-gcc -save-temps -c -O2 cmd.c
> >    cmd.c: In function `cmd_read':
> >    cmd.c:50: Internal compiler error in redirect_edge_and_branch, at
> > cfgrtl.c:902 Please submit a full bug report,
> >    with preprocessed source if appropriate.
> >    See <URL:http://gcc.gnu.org/bugs.html> for instructions.
> >
> >
> >I use GCC 3.2.3 with mspgcc patches from less than an hour ago.
> >
> >
> >Best wishes,
> >   --Daniel
>
> If I strip your test case down to the following, it still gives the same
> error. I hope this makes a simpler test case for Dmitry.
>
> Regards,
> Steve
>
>
> enum cmd_status
> {
>     CMD_OK
> };
>
> struct cmd_cfg
> {
>         enum cmd_status (*eval)(const char *, unsigned int);
> };
>
>
> static char cmd_buf[32];
>
> unsigned int cmd_read(const struct cmd_cfg *cfg)
> {
>         char *p = cmd_buf;
>
>         switch (getc())
>         {
>         case '\b':
>             if (p > cmd_buf)
>                 --p;
>             break;
>         }
> }
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: eBay
> Get office equipment for less on eBay!
> http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users

-- 
/********************************************************************
     ("`-''-/").___..--''"`-._     (\   Dimmy the Wild      UA1ACZ
      `6_ 6  )   `-.  (     ).`-.__.`)  Enterprise Information Sys 
      (_Y_.)'  ._   )  `._ `. ``-..-'   Nevsky prospekt,   20 / 44
    _..`--'_..-_/  /--'_.' ,'           Saint Petersburg,   Russia
   (il),-''  (li),'  ((!.-'             +7 (812)  3468202, 5585314
 ********************************************************************/


Reply via email to