Maciej W. Rozycki <[email protected]> 于2024年6月21日周五 20:02写道:
>
> On Fri, 21 Jun 2024, YunQiang Su wrote:
>
> > >  I haven't touched this stuff for ages, but AFAICT the code is already
> > > passed where applicable via the environment for `do_tr_or_bp' to handle,
> > > so I can't understand why your change is needed.
> > >
> >
> > The error_code in env is always zero, as we need to set it here.
>
>  There is code to set it there already, so when submitting a fix you need
> to investigate why it doesn't work and describe in the change description.
>
> > >  What problem are you trying to solve?
> > >
> >
> > See the talk in GCC mailing list about testsuite/ubsan/overflow-div-3.c
> > Qemu emits SIGTRAP instead of SIGFPE, due to it didn't initialize the
> > code of conditional trap to env.
>
>  Self-contained information about the reproducer needs to be included in
> the change description.  A general statement such as "this and that does
> not work" or referring to another mailing list is not sufficient.
>

I am trying to fix the problem like this
gcc/testsuite/gcc.c-torture/execute/20101011-1.c

void
sigfpe (int signum __attribute__ ((unused)))
{
  exit (0);
}

int
main ()
{
#if DO_TEST
  signal (SIGFPE, sigfpe);
  k = i / j;
  abort ();
#else
  exit (0);
#endif
}



>   Maciej

Reply via email to