Hi,
the following testcase illustrate problem with the offset.  Sadly it ICEs even 
w/o
LTO:
evans:/abuild/jh/trunk-3/build-inst12/gcc/:[1]# ./xgcc -B ./ -O2 ~/tt.c      
/root/tt.c: In function 'main':
/root/tt.c:24:11: warning: overflow in implicit constant conversion [-Woverflow]
           b.b=0xdead;
           ^
/root/tt.c:25:12: internal compiler error: in assign_stack_temp_for_type, at 
function.c:762
           a=retframe_block ();
            ^
0x7ae808 assign_stack_temp_for_type(machine_mode, long, tree_node*)
        ../../gcc/function.c:762


        /* { dg-do run } */

        extern void abort (void);
        int
        main (int argc, char **argv)
        { 
          int size = 10;
          typedef struct
            { 
              char val[size];
              char b;
            }
          block;
          block a, b;
          block __attribute__((noinline))
          retframe_block ()
            { 
            if (b.b != 0xdead)
                abort ();
              return *(block *) &b;
            }
          b.val[0] = 1;
          b.val[9] = 2;
          b.b=0xdead;
          a=retframe_block ();
          if (a.val[0] != 1
              || a.val[9] != 2)
            abort ();
          return 0;
        }
Honza

Reply via email to