This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug tree-optimization/71104] [7 Regression] ICE: verify_ssa failed (with vfork / error: definition in block 3 does not dominate use in block 7 )


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71104

--- Comment #16 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to rguenther@suse.de from comment #15)
> On Thu, 14 Jul 2016, bernd.edlinger at hotmail dot de wrote:
> 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71104
> > 
> > --- Comment #14 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
> > One question though...
> > 
> > This depends on a special knowledge about "vfork",
> > but it seems that gcc does not honor -ffreestanding
> > correctly in this case, because:
> > 
> > gcc -ffreestanding pr71104-1.c
> > 
> > should not have crashed (before your patch, but it did).
> 
> Even with -ffreestanding we handle some functions conservatively.
> See special_function_p.

Oh, I see.
Handling vfork that may be conservative, but longjmp is not conservative.


test.c:

void foo(void);
int longjmp(void);
int *p;

void bar(void)
{
  foo();
  *p = longjmp();
}

gcc -Wall -S -O3 -ffreestanding test.c
gives zero warning, and invalid code:

bar:
.LFB0:
        .cfi_startproc
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
        call    foo
        call    longjmp
        .cfi_endproc

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