http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Bernd Edlinger from comment #7)
> (In reply to Jakub Jelinek from comment #6)
> > That doesn't look safe, negative rbitpos is not necessarily undefined
> > behavior.
> > Can't you get the same with say
> > struct S { unsigned char s : 1; };
> > 
> > ...
> > void function(struct S *p)
> > {
> >   p[-1].s = 0;
> > }
> 
> no. I checked that. This is folded quite differently:
> 
>   MEM[(struct S *)p_1(D) + -1B].s = 0;
> 
> and there is no ICE in this case.

But this is really nothing the expansion code should rely on to detect if the
code is undefined behavior or not.

Reply via email to