Open th-otto opened 5 months ago
Oh. Would it be possible to have a simplified testcase to produce such thing? That would help, i.e. to open a bug on GCC Bugzilla, if relevant.
I already tried to produce a small testcase, without luck. Maybe i should try with cvise again, but that is slow.
But its not a bug, the __builtin_trap function is defined that way. We just need to know which circumstances cause it to be used, and then maybe replace the trap by something different.
The usual case for this is when code paths are elided due to UB detection.
In some larger projects, i noticed that especially the c++ compiler still produces
trap #7
instructions. That is maybe a relict from the linux version, and comes from the expansion of __builtin_trap https://github.com/freemint/m68k-atari-mint-gcc/blob/4598322acf7f9abe94721449c100f782185f05df/gcc/config/m68k/m68k.md#L7574I don't know yet however what is actually causing this. I thought it might have something to do with
__builtin_unreachable
or functions being declared asnoreturn
, but i was not yet able to reproduce this with a simple testcase.Do you think we should fix this, maybe by changing that to
abort()
instead?