tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

gcc 3.3.3 is doing stupid shit



Can anyone explain why gcc is doing what it is below?

If I look at the output from "gcc -E", the code is there,
so the lines are not disappearing in cpp...

Darren

Stepping in gdb:
Breakpoint 1, fr_cksum (m=0xbfbfc650, ip=0xbfbfc660, l4proto=17,
   l4hdr=0xbfbfc660, l3len=24) at ../../fil.c:3274
3274            csump = NULL;
(gdb) n
3275            sumsave = 0;
(gdb)
3277            sp = NULL;
(gdb)
3278            slen = 0;
(gdb)
68              __asm __volatile ("rorw $8, %w1" : "=r" (x) : "0" (x));
(gdb)
67      {
(gdb)
3287            if (IP_V(ip) == 4) {
(gdb)
3298            } else if (IP_V(ip) == 6) {
(gdb)
3299                    ip6 = (ip6_t *)ip;
(gdb)
3301                    slen = l3len - hlen;
(gdb) print hlen
$1 = 4448
Actual linese of code:
       } else if (IP_V(ip) == 6) {
               ip6 = (ip6_t *)ip;
               hlen = sizeof(ip6_t);
               slen = l3len - hlen;
fr_cksum(m, ip, l4proto, l4hdr, l3len)
       mb_t *m;
       ip_t *ip;
int l4proto, l3len; void *l4hdr;
{
       u_short *sp, slen, sumsave, l4hlen, *csump;
       u_int sum, sum2;
       int hlen;
#ifdef  USE_INET6
       ip6_t *ip6;
#endif

       csump = NULL;
       sumsave = 0;
       l4hlen = 0;
       sp = NULL;
       slen = 0;
       hlen = 0;
       sum = 0;

       sum = htons((u_short)l4proto);
/* * Add up IP Header portion
        */
#ifdef  USE_INET6
       if (IP_V(ip) == 4) {
#endif
               hlen = IP_HL(ip) << 2;
               slen = l3len - hlen;
               sum += htons(slen);
               sp = (u_short *)&ip->ip_src;
               sum += *sp++;   /* ip_src */
               sum += *sp++;
               sum += *sp++;   /* ip_dst */
               sum += *sp++;
#ifdef  USE_INET6
       } else if (IP_V(ip) == 6) {
               ip6 = (ip6_t *)ip;
               hlen = sizeof(ip6_t);
               slen = l3len - hlen;
               sum += htons(slen);




Home | Main Index | Thread Index | Old Index