https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78463
Bug ID: 78463 Summary: pure/const functions are assumed not to trap Product: gcc Version: 7.0 Status: UNCONFIRMED Keywords: missed-optimization, wrong-code Severity: enhancement Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org CC: hubicka at gcc dot gnu.org, jakub at gcc dot gnu.org Target Milestone: --- PR70586 shows that pure/const functions are assumed not to trap (EH / throw is captured separately already). This makes them fail the has-side-effects check which can lead to wrong-code issues (see that PR). We need a more fine-grained analysis (and IPA propagation) of what functions may do (trap, invoke undefined overflow, use FP math, etc.) to ask the right questions from optimizations (and enable more optimizations).